├── README.md ├── example ├── client.js └── server.js ├── index.js ├── leafletgeojsonstream.js ├── leafletgeojsonstream.min.js └── package.json /README.md: -------------------------------------------------------------------------------- 1 | # leaflet-geojson-stream 2 | 3 | ![](http://i.imgur.com/lVF6xZl.gif) 4 | 5 | Stream [GeoJSON](http://geojson.org/) features into a [Leaflet](http://leafletjs.com/) 6 | layer. 7 | 8 | ## usage 9 | 10 | With [browserify](https://github.com/substack/node-browserify) 11 | 12 | npm install --save leaflet-geojson-stream 13 | 14 | Otherwise 15 | 16 | curl https://raw.github.com/tmcw/leaflet-geojson-stream/master/leafletgeojsonstream.js > leafletgeojsonstream.js 17 | 18 | ## api 19 | 20 | ### `lgs.ajax(url: string, layer: L.geoJson instance)` 21 | 22 | Request all features from a given `url` with [hyperquest](https://github.com/substack/hyperquest) 23 | and add them incrementally to `layer`. Returns a stream of feature objects 24 | that also emits `end` on completion. 25 | 26 | ### `lgs.layerPipe(layer: L.geoJson instance)` 27 | 28 | Given a `L.geoJson` instance, return a writable stream that accepts GeoJSON Feature 29 | objects. 30 | 31 | ## example 32 | 33 | ```js 34 | var leafletStream = require('leaflet-geojson-stream'), 35 | map = L.map('map').setView([0, 0], 2), 36 | gj = L.geoJson().addTo(map); 37 | 38 | leafletStream.ajax('/points.geojson', gj) 39 | .on('end', function() { 40 | alert('all done!'); 41 | }); 42 | ``` 43 | 44 | To run the prepackaged example: 45 | 46 | npm install 47 | cd example 48 | node server.js 49 | 50 | And open http://localhost:3000/ 51 | 52 | ## build 53 | 54 | npm install 55 | npm run-script build 56 | 57 | ## How 58 | 59 | A simple abstraction on top of [geojson-stream](https://github.com/tmcw/geojson-stream), 60 | which is in turn just a bit of sugar on [JSONStream](https://github.com/dominictarr/JSONStream). Regular old 61 | [XMLHttpRequest](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest) allows for partial replies 62 | under the magical 'status code 3'. This doesn't use WebSockets or anything else fancy. 63 | 64 | ## Caveats 65 | 66 | * Some servers will send huge chunks in their responses. This depends on a 67 | keep-alive connection with reasonable bites. 68 | * The GeoJSON object returned by the server currently _must_ be a `FeatureCollection` 69 | at its root. 70 | -------------------------------------------------------------------------------- /example/client.js: -------------------------------------------------------------------------------- 1 | var L = require('leaflet'), 2 | leafletStream = require('../'); 3 | 4 | L.Icon.Default.imagePath = 'http://leafletjs.com/dist/images'; 5 | 6 | window.onload = function() { 7 | var div = document.body.appendChild(document.createElement('div')); 8 | div.style.cssText = 'height:500px;'; 9 | var map = L.map(div).setView([0, 0], 2); 10 | L.tileLayer('http://a.tile.openstreetmap.org/{z}/{x}/{y}.png').addTo(map); 11 | var gj = L.geoJson().addTo(map); 12 | leafletStream.ajax('http://localhost:3000/points.geojson', gj) 13 | .on('end', function() { 14 | }); 15 | }; 16 | -------------------------------------------------------------------------------- /example/server.js: -------------------------------------------------------------------------------- 1 | var express = require('express'), 2 | browserify = require('browserify'), 3 | app = express(); 4 | 5 | app.get('/', function(req, res) { 6 | res.send(''); 7 | }); 8 | 9 | app.get('/bundle.js', function(req, res) { 10 | var b = browserify(); 11 | b.add('./client.js'); 12 | b.bundle().pipe(res); 13 | }); 14 | 15 | app.get('/points.geojson', function(req, res) { 16 | res.write('{"type":"FeatureCollection","features":['); 17 | var i = 0, die = 0; 18 | function send() { 19 | if (++i > 20) { 20 | res.write(JSON.stringify(randomFeature()) + '\n,\n'); 21 | i = 0; 22 | } else { 23 | // it seems like writing newlines here causes the buffer to 24 | // flush 25 | res.write('\n'); 26 | } 27 | if (die++ > 1000) { 28 | res.write(JSON.stringify(randomFeature())); 29 | res.write(']'); 30 | res.end(); 31 | return; 32 | } 33 | setTimeout(send, 10); 34 | } 35 | send(); 36 | }); 37 | 38 | app.listen(3000); 39 | console.log('open http://localhost:3000'); 40 | 41 | function randomFeature() { 42 | return { 43 | type: 'Feature', 44 | geometry: { 45 | type: 'Point', 46 | coordinates: [ 47 | (Math.random() - 0.5) * 360, 48 | (Math.random() - 0.5) * 180 49 | ] 50 | }, 51 | properties: {} 52 | }; 53 | } 54 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | var hyperquest = require('hyperquest'), 2 | through = require('through'), 3 | geojsonStream = require('geojson-stream'); 4 | 5 | module.exports.ajax = ajax; 6 | module.exports.layerPipe = layerPipe; 7 | 8 | function ajax(url, layer) { 9 | return hyperquest(url) 10 | .pipe(geojsonStream.parse()) 11 | .pipe(layerPipe(layer)); 12 | } 13 | 14 | function layerPipe(layer) { 15 | return through(function(d) { 16 | if (layer.addData !== undefined) layer.addData(d); 17 | this.queue(d); 18 | }); 19 | } 20 | -------------------------------------------------------------------------------- /leafletgeojsonstream.min.js: -------------------------------------------------------------------------------- 1 | !function(t){if("object"==typeof exports)module.exports=t();else if("function"==typeof define&&define.amd)define(t);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.leafletGeojsonStream=t()}}(function(){var t;return function e(t,n,r){function i(s,a){if(!n[s]){if(!t[s]){var h="function"==typeof require&&require;if(!a&&h)return h(s,!0);if(o)return o(s,!0);throw new Error("Cannot find module '"+s+"'")}var u=n[s]={exports:{}};t[s][0].call(u.exports,function(e){var n=t[s][1][e];return i(n?n:e)},u,u.exports,e,t,n,r)}return n[s].exports}for(var o="function"==typeof require&&require,s=0;sa;a++)s[a]=r.isBuffer(t)?t.readUInt8(a):t[a];else if("string"===i)s.write(t,0,e);else if("number"===i&&!r._useTypedArrays&&!n)for(a=0;o>a;a++)s[a]=0;return s}function i(t,e,n,i){n=Number(n)||0;var o=t.length-n;i?(i=Number(i),i>o&&(i=o)):i=o;var s=e.length;z(s%2===0,"Invalid hex string"),i>s/2&&(i=s/2);for(var a=0;i>a;a++){var h=parseInt(e.substr(2*a,2),16);z(!isNaN(h),"Invalid hex string"),t[n+a]=h}return r._charsWritten=2*a,a}function o(t,e,n,i){var o=r._charsWritten=N(B(e),t,n,i);return o}function s(t,e,n,i){var o=r._charsWritten=N(M(e),t,n,i);return o}function a(t,e,n,r){return s(t,e,n,r)}function h(t,e,n,i){var o=r._charsWritten=N(q(e),t,n,i);return o}function u(t,e,n,i){var o=r._charsWritten=N(O(e),t,n,i);return o}function f(t,e,n){return W.fromByteArray(0===e&&n===t.length?t:t.slice(e,n))}function c(t,e,n){var r="",i="";n=Math.min(t.length,n);for(var o=e;n>o;o++)t[o]<=127?(r+=D(i)+String.fromCharCode(t[o]),i=""):i+="%"+t[o].toString(16);return r+D(i)}function l(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;n>i;i++)r+=String.fromCharCode(t[i]);return r}function d(t,e,n){return l(t,e,n)}function p(t,e,n){var r=t.length;(!e||0>e)&&(e=0),(!n||0>n||n>r)&&(n=r);for(var i="",o=e;n>o;o++)i+=R(t[o]);return i}function g(t,e,n){for(var r=t.slice(e,n),i="",o=0;o=i)){var o;return n?(o=t[e],i>e+1&&(o|=t[e+1]<<8)):(o=t[e]<<8,i>e+1&&(o|=t[e+1])),o}}function v(t,e,n,r){r||(z("boolean"==typeof n,"missing or invalid endian"),z(void 0!==e&&null!==e,"missing offset"),z(e+3=i)){var o;return n?(i>e+2&&(o=t[e+2]<<16),i>e+1&&(o|=t[e+1]<<8),o|=t[e],i>e+3&&(o+=t[e+3]<<24>>>0)):(i>e+1&&(o=t[e+1]<<16),i>e+2&&(o|=t[e+2]<<8),i>e+3&&(o|=t[e+3]),o+=t[e]<<24>>>0),o}}function y(t,e,n,r){r||(z("boolean"==typeof n,"missing or invalid endian"),z(void 0!==e&&null!==e,"missing offset"),z(e+1=i)){var o=m(t,e,n,!0),s=32768&o;return s?-1*(65535-o+1):o}}function b(t,e,n,r){r||(z("boolean"==typeof n,"missing or invalid endian"),z(void 0!==e&&null!==e,"missing offset"),z(e+3=i)){var o=v(t,e,n,!0),s=2147483648&o;return s?-1*(4294967295-o+1):o}}function w(t,e,n,r){return r||(z("boolean"==typeof n,"missing or invalid endian"),z(e+3=o))for(var s=0,a=Math.min(o-n,2);a>s;s++)t[n+s]=(e&255<<8*(r?s:1-s))>>>8*(r?s:1-s)}function S(t,e,n,r,i){i||(z(void 0!==e&&null!==e,"missing value"),z("boolean"==typeof r,"missing or invalid endian"),z(void 0!==n&&null!==n,"missing offset"),z(n+3=o))for(var s=0,a=Math.min(o-n,4);a>s;s++)t[n+s]=e>>>8*(r?s:3-s)&255}function x(t,e,n,r,i){i||(z(void 0!==e&&null!==e,"missing value"),z("boolean"==typeof r,"missing or invalid endian"),z(void 0!==n&&null!==n,"missing offset"),z(n+1=o||(e>=0?_(t,e,n,r,i):_(t,65535+e+1,n,r,i))}function L(t,e,n,r,i){i||(z(void 0!==e&&null!==e,"missing value"),z("boolean"==typeof r,"missing or invalid endian"),z(void 0!==n&&null!==n,"missing offset"),z(n+3=o||(e>=0?S(t,e,n,r,i):S(t,4294967295+e+1,n,r,i))}function j(t,e,n,r,i){i||(z(void 0!==e&&null!==e,"missing value"),z("boolean"==typeof r,"missing or invalid endian"),z(void 0!==n&&null!==n,"missing offset"),z(n+3=o||G.write(t,e,n,r,23,4)}function A(t,e,n,r,i){i||(z(void 0!==e&&null!==e,"missing value"),z("boolean"==typeof r,"missing or invalid endian"),z(void 0!==n&&null!==n,"missing offset"),z(n+7=o||G.write(t,e,n,r,52,8)}function k(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function C(t,e,n){return"number"!=typeof t?n:(t=~~t,t>=e?e:t>=0?t:(t+=e,t>=0?t:0))}function T(t){return t=~~Math.ceil(+t),0>t?0:t}function I(t){return(Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)})(t)}function U(t){return I(t)||r.isBuffer(t)||t&&"object"==typeof t&&"number"==typeof t.length}function R(t){return 16>t?"0"+t.toString(16):t.toString(16)}function B(t){for(var e=[],n=0;n=r)e.push(t.charCodeAt(n));else{var i=n;r>=55296&&57343>=r&&n++;for(var o=encodeURIComponent(t.slice(i,n+1)).substr(1).split("%"),s=0;s>8,r=e%256,i.push(r),i.push(n);return i}function q(t){return W.toByteArray(t)}function N(t,e,n,r){for(var i=0;r>i&&!(i+n>=e.length||i>=t.length);i++)e[i+n]=t[i];return i}function D(t){try{return decodeURIComponent(t)}catch(e){return String.fromCharCode(65533)}}function F(t,e){z("number"==typeof t,"cannot write a non-number as a number"),z(t>=0,"specified a negative value for writing an unsigned value"),z(e>=t,"value is larger than maximum value for type"),z(Math.floor(t)===t,"value has a fractional component")}function H(t,e,n){z("number"==typeof t,"cannot write a non-number as a number"),z(e>=t,"value larger than maximum allowed value"),z(t>=n,"value smaller than minimum allowed value"),z(Math.floor(t)===t,"value has a fractional component")}function P(t,e,n){z("number"==typeof t,"cannot write a non-number as a number"),z(e>=t,"value larger than maximum allowed value"),z(t>=n,"value smaller than minimum allowed value")}function z(t,e){if(!t)throw new Error(e||"Failed assertion")}var W=t("base64-js"),G=t("ieee754");n.Buffer=r,n.SlowBuffer=r,n.INSPECT_MAX_BYTES=50,r.poolSize=8192,r._useTypedArrays=function(){try{var t=new ArrayBuffer(0),e=new Uint8Array(t);return e.foo=function(){return 42},42===e.foo()&&"function"==typeof e.subarray}catch(n){return!1}}(),r.isEncoding=function(t){switch(String(t).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!0;default:return!1}},r.isBuffer=function(t){return!(null===t||void 0===t||!t._isBuffer)},r.byteLength=function(t,e){var n;switch(t+="",e||"utf8"){case"hex":n=t.length/2;break;case"utf8":case"utf-8":n=B(t).length;break;case"ascii":case"binary":case"raw":n=t.length;break;case"base64":n=q(t).length;break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":n=2*t.length;break;default:throw new Error("Unknown encoding")}return n},r.concat=function(t,e){if(z(I(t),"Usage: Buffer.concat(list, [totalLength])\nlist should be an Array."),0===t.length)return new r(0);if(1===t.length)return t[0];var n;if("number"!=typeof e)for(e=0,n=0;nc&&(n=c)):n=c,r=String(r||"utf8").toLowerCase();var l;switch(r){case"hex":l=i(this,t,e,n);break;case"utf8":case"utf-8":l=o(this,t,e,n);break;case"ascii":l=s(this,t,e,n);break;case"binary":l=a(this,t,e,n);break;case"base64":l=h(this,t,e,n);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":l=u(this,t,e,n);break;default:throw new Error("Unknown encoding")}return l},r.prototype.toString=function(t,e,n){var r=this;if(t=String(t||"utf8").toLowerCase(),e=Number(e)||0,n=void 0!==n?Number(n):n=r.length,n===e)return"";var i;switch(t){case"hex":i=p(r,e,n);break;case"utf8":case"utf-8":i=c(r,e,n);break;case"ascii":i=l(r,e,n);break;case"binary":i=d(r,e,n);break;case"base64":i=f(r,e,n);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":i=g(r,e,n);break;default:throw new Error("Unknown encoding")}return i},r.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},r.prototype.copy=function(t,e,n,i){var o=this;if(n||(n=0),i||0===i||(i=this.length),e||(e=0),i!==n&&0!==t.length&&0!==o.length){z(i>=n,"sourceEnd < sourceStart"),z(e>=0&&e=0&&n=0&&i<=o.length,"sourceEnd out of bounds"),i>this.length&&(i=this.length),t.length-es||!r._useTypedArrays)for(var a=0;s>a;a++)t[a+e]=this[a+n];else t._set(this.subarray(n,n+s),e)}},r.prototype.slice=function(t,e){var n=this.length;if(t=C(t,n,0),e=C(e,n,n),r._useTypedArrays)return r._augment(this.subarray(t,e));for(var i=e-t,o=new r(i,void 0,!0),s=0;i>s;s++)o[s]=this[s+t];return o},r.prototype.get=function(t){return console.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(t)},r.prototype.set=function(t,e){return console.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(t,e)},r.prototype.readUInt8=function(t,e){return e||(z(void 0!==t&&null!==t,"missing offset"),z(t=this.length?void 0:this[t]},r.prototype.readUInt16LE=function(t,e){return m(this,t,!0,e)},r.prototype.readUInt16BE=function(t,e){return m(this,t,!1,e)},r.prototype.readUInt32LE=function(t,e){return v(this,t,!0,e)},r.prototype.readUInt32BE=function(t,e){return v(this,t,!1,e)},r.prototype.readInt8=function(t,e){if(e||(z(void 0!==t&&null!==t,"missing offset"),z(t=this.length)){var n=128&this[t];return n?-1*(255-this[t]+1):this[t]}},r.prototype.readInt16LE=function(t,e){return y(this,t,!0,e)},r.prototype.readInt16BE=function(t,e){return y(this,t,!1,e)},r.prototype.readInt32LE=function(t,e){return b(this,t,!0,e)},r.prototype.readInt32BE=function(t,e){return b(this,t,!1,e)},r.prototype.readFloatLE=function(t,e){return w(this,t,!0,e)},r.prototype.readFloatBE=function(t,e){return w(this,t,!1,e)},r.prototype.readDoubleLE=function(t,e){return E(this,t,!0,e)},r.prototype.readDoubleBE=function(t,e){return E(this,t,!1,e)},r.prototype.writeUInt8=function(t,e,n){n||(z(void 0!==t&&null!==t,"missing value"),z(void 0!==e&&null!==e,"missing offset"),z(e=this.length||(this[e]=t)},r.prototype.writeUInt16LE=function(t,e,n){_(this,t,e,!0,n)},r.prototype.writeUInt16BE=function(t,e,n){_(this,t,e,!1,n)},r.prototype.writeUInt32LE=function(t,e,n){S(this,t,e,!0,n)},r.prototype.writeUInt32BE=function(t,e,n){S(this,t,e,!1,n)},r.prototype.writeInt8=function(t,e,n){n||(z(void 0!==t&&null!==t,"missing value"),z(void 0!==e&&null!==e,"missing offset"),z(e=this.length||(t>=0?this.writeUInt8(t,e,n):this.writeUInt8(255+t+1,e,n))},r.prototype.writeInt16LE=function(t,e,n){x(this,t,e,!0,n)},r.prototype.writeInt16BE=function(t,e,n){x(this,t,e,!1,n)},r.prototype.writeInt32LE=function(t,e,n){L(this,t,e,!0,n)},r.prototype.writeInt32BE=function(t,e,n){L(this,t,e,!1,n)},r.prototype.writeFloatLE=function(t,e,n){j(this,t,e,!0,n)},r.prototype.writeFloatBE=function(t,e,n){j(this,t,e,!1,n)},r.prototype.writeDoubleLE=function(t,e,n){A(this,t,e,!0,n)},r.prototype.writeDoubleBE=function(t,e,n){A(this,t,e,!1,n)},r.prototype.fill=function(t,e,n){if(t||(t=0),e||(e=0),n||(n=this.length),"string"==typeof t&&(t=t.charCodeAt(0)),z("number"==typeof t&&!isNaN(t),"value is not a number"),z(n>=e,"end < start"),n!==e&&0!==this.length){z(e>=0&&e=0&&n<=this.length,"end out of bounds");for(var r=e;n>r;r++)this[r]=t}},r.prototype.inspect=function(){for(var t=[],e=this.length,r=0;e>r;r++)if(t[r]=R(this[r]),r===n.INSPECT_MAX_BYTES){t[r+1]="...";break}return""},r.prototype.toArrayBuffer=function(){if("undefined"!=typeof Uint8Array){if(r._useTypedArrays)return new r(this).buffer;for(var t=new Uint8Array(this.length),e=0,n=t.length;n>e;e+=1)t[e]=this[e];return t.buffer}throw new Error("Buffer.toArrayBuffer not supported in this browser")};var J=r.prototype;r._augment=function(t){return t._isBuffer=!0,t._get=t.get,t._set=t.set,t.get=J.get,t.set=J.set,t.write=J.write,t.toString=J.toString,t.toLocaleString=J.toString,t.toJSON=J.toJSON,t.copy=J.copy,t.slice=J.slice,t.readUInt8=J.readUInt8,t.readUInt16LE=J.readUInt16LE,t.readUInt16BE=J.readUInt16BE,t.readUInt32LE=J.readUInt32LE,t.readUInt32BE=J.readUInt32BE,t.readInt8=J.readInt8,t.readInt16LE=J.readInt16LE,t.readInt16BE=J.readInt16BE,t.readInt32LE=J.readInt32LE,t.readInt32BE=J.readInt32BE,t.readFloatLE=J.readFloatLE,t.readFloatBE=J.readFloatBE,t.readDoubleLE=J.readDoubleLE,t.readDoubleBE=J.readDoubleBE,t.writeUInt8=J.writeUInt8,t.writeUInt16LE=J.writeUInt16LE,t.writeUInt16BE=J.writeUInt16BE,t.writeUInt32LE=J.writeUInt32LE,t.writeUInt32BE=J.writeUInt32BE,t.writeInt8=J.writeInt8,t.writeInt16LE=J.writeInt16LE,t.writeInt16BE=J.writeInt16BE,t.writeInt32LE=J.writeInt32LE,t.writeInt32BE=J.writeInt32BE,t.writeFloatLE=J.writeFloatLE,t.writeFloatBE=J.writeFloatBE,t.writeDoubleLE=J.writeDoubleLE,t.writeDoubleBE=J.writeDoubleBE,t.fill=J.fill,t.inspect=J.inspect,t.toArrayBuffer=J.toArrayBuffer,t}},{"base64-js":3,ieee754:4}],3:[function(t,e){var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";!function(){"use strict";function t(t){var e=t.charCodeAt(0);return e===s?62:e===a?63:h>e?-1:h+10>e?e-h+26+26:f+26>e?e-f:u+26>e?e-u+26:void 0}function r(e){function n(t){u[c++]=t}var r,i,s,a,h,u;if(e.length%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var f=e.length;h="="===e.charAt(f-2)?2:"="===e.charAt(f-1)?1:0,u=new o(3*e.length/4-h),s=h>0?e.length-4:e.length;var c=0;for(r=0,i=0;s>r;r+=4,i+=3)a=t(e.charAt(r))<<18|t(e.charAt(r+1))<<12|t(e.charAt(r+2))<<6|t(e.charAt(r+3)),n((16711680&a)>>16),n((65280&a)>>8),n(255&a);return 2===h?(a=t(e.charAt(r))<<2|t(e.charAt(r+1))>>4,n(255&a)):1===h&&(a=t(e.charAt(r))<<10|t(e.charAt(r+1))<<4|t(e.charAt(r+2))>>2,n(a>>8&255),n(255&a)),u}function i(t){function e(t){return n.charAt(t)}function r(t){return e(t>>18&63)+e(t>>12&63)+e(t>>6&63)+e(63&t)}var i,o,s,a=t.length%3,h="";for(i=0,s=t.length-a;s>i;i+=3)o=(t[i]<<16)+(t[i+1]<<8)+t[i+2],h+=r(o);switch(a){case 1:o=t[t.length-1],h+=e(o>>2),h+=e(o<<4&63),h+="==";break;case 2:o=(t[t.length-2]<<8)+t[t.length-1],h+=e(o>>10),h+=e(o>>4&63),h+=e(o<<2&63),h+="="}return h}var o="undefined"!=typeof Uint8Array?Uint8Array:Array,s=("0".charCodeAt(0),"+".charCodeAt(0)),a="/".charCodeAt(0),h="0".charCodeAt(0),u="a".charCodeAt(0),f="A".charCodeAt(0);e.exports.toByteArray=r,e.exports.fromByteArray=i}()},{}],4:[function(t,e,n){n.read=function(t,e,n,r,i){var o,s,a=8*i-r-1,h=(1<>1,f=-7,c=n?i-1:0,l=n?-1:1,d=t[e+c];for(c+=l,o=d&(1<<-f)-1,d>>=-f,f+=a;f>0;o=256*o+t[e+c],c+=l,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=r;f>0;s=256*s+t[e+c],c+=l,f-=8);if(0===o)o=1-u;else{if(o===h)return s?0/0:1/0*(d?-1:1);s+=Math.pow(2,r),o-=u}return(d?-1:1)*s*Math.pow(2,o-r)},n.write=function(t,e,n,r,i,o){var s,a,h,u=8*o-i-1,f=(1<>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:o-1,p=r?1:-1,g=0>e||0===e&&0>1/e?1:0;for(e=Math.abs(e),isNaN(e)||1/0===e?(a=isNaN(e)?1:0,s=f):(s=Math.floor(Math.log(e)/Math.LN2),e*(h=Math.pow(2,-s))<1&&(s--,h*=2),e+=s+c>=1?l/h:l*Math.pow(2,1-c),e*h>=2&&(s++,h/=2),s+c>=f?(a=0,s=f):s+c>=1?(a=(e*h-1)*Math.pow(2,i),s+=c):(a=e*Math.pow(2,c-1)*Math.pow(2,i),s=0));i>=8;t[n+d]=255&a,d+=p,a/=256,i-=8);for(s=s<0;t[n+d]=255&s,d+=p,s/=256,u-=8);t[n+d-p]|=128*g}},{}],5:[function(t,e){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function r(t){return"function"==typeof t}function i(t){return"number"==typeof t}function o(t){return"object"==typeof t&&null!==t}function s(t){return void 0===t}e.exports=n,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(t){if(!i(t)||0>t||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},n.prototype.emit=function(t){var e,n,i,a,h,u;if(this._events||(this._events={}),"error"===t&&(!this._events.error||o(this._events.error)&&!this._events.error.length))throw e=arguments[1],e instanceof Error?e:TypeError('Uncaught, unspecified "error" event.');if(n=this._events[t],s(n))return!1;if(r(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:for(i=arguments.length,a=new Array(i-1),h=1;i>h;h++)a[h-1]=arguments[h];n.apply(this,a)}else if(o(n)){for(i=arguments.length,a=new Array(i-1),h=1;i>h;h++)a[h-1]=arguments[h];for(u=n.slice(),i=u.length,h=0;i>h;h++)u[h].apply(this,a)}return!0},n.prototype.addListener=function(t,e){var i;if(!r(e))throw TypeError("listener must be a function");if(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",t,r(e.listener)?e.listener:e),this._events[t]?o(this._events[t])?this._events[t].push(e):this._events[t]=[this._events[t],e]:this._events[t]=e,o(this._events[t])&&!this._events[t].warned){var i;i=s(this._maxListeners)?n.defaultMaxListeners:this._maxListeners,i&&i>0&&this._events[t].length>i&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),console.trace())}return this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(t,e){function n(){this.removeListener(t,n),i||(i=!0,e.apply(this,arguments))}if(!r(e))throw TypeError("listener must be a function");var i=!1;return n.listener=e,this.on(t,n),this},n.prototype.removeListener=function(t,e){var n,i,s,a;if(!r(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(n=this._events[t],s=n.length,i=-1,n===e||r(n.listener)&&n.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(o(n)){for(a=s;a-->0;)if(n[a]===e||n[a].listener&&n[a].listener===e){i=a;break}if(0>i)return this;1===n.length?(n.length=0,delete this._events[t]):n.splice(i,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},n.prototype.removeAllListeners=function(t){var e,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[t],r(n))this.removeListener(t,n);else for(;n.length;)this.removeListener(t,n[n.length-1]);return delete this._events[t],this},n.prototype.listeners=function(t){var e;return e=this._events&&this._events[t]?r(this._events[t])?[this._events[t]]:this._events[t].slice():[]},n.listenerCount=function(t,e){var n;return n=t._events&&t._events[e]?r(t._events[e])?1:t._events[e].length:0}},{}],6:[function(t,e){var n=e.exports,r=(t("events").EventEmitter,t("./lib/request")),i=t("url");n.request=function(t,e){"string"==typeof t&&(t=i.parse(t)),t||(t={}),t.host||t.port||(t.port=parseInt(window.location.port,10)),!t.host&&t.hostname&&(t.host=t.hostname),t.scheme||(t.scheme=window.location.protocol.split(":")[0]),t.host||(t.host=window.location.hostname||window.location.host),/:/.test(t.host)&&(t.port||(t.port=t.host.split(":")[1]),t.host=t.host.split(":")[0]),t.port||(t.port="https"==t.scheme?443:80);var n=new r(new o,t);return e&&n.on("response",e),n},n.get=function(t,e){t.method="GET";var r=n.request(t,e);return r.end(),r},n.Agent=function(){},n.Agent.defaultMaxSockets=4;var o=function(){if("undefined"==typeof window)throw new Error("no window object present");if(window.XMLHttpRequest)return window.XMLHttpRequest;if(window.ActiveXObject){for(var t=["Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP.3.0","Microsoft.XMLHTTP"],e=0;ethis.offset&&(this.emit("data",e.slice(this.offset)),this.offset=e.length))};var a=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},{stream:18,util:27}],9:[function(t,e,n){!function(){function t(t){this.message=t}var e="undefined"!=typeof n?n:this,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";t.prototype=new Error,t.prototype.name="InvalidCharacterError",e.btoa||(e.btoa=function(e){for(var n,i,o=0,s=r,a="";e.charAt(0|o)||(s="=",o%1);a+=s.charAt(63&n>>8-o%1*8)){if(i=e.charCodeAt(o+=.75),i>255)throw new t("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");n=n<<8|i}return a}),e.atob||(e.atob=function(e){if(e=e.replace(/=+$/,""),e.length%4==1)throw new t("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,i,o=0,s=0,a="";i=e.charAt(s++);~i&&(n=o%4?64*n+i:i,o++%4)?a+=String.fromCharCode(255&n>>(-2*o&6)):0)i=r.indexOf(i);return a})}()},{}],10:[function(t,e){var n=t("http"),r=e.exports;for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i]);r.request=function(t,e){return t||(t={}),t.scheme="https",n.request.call(this,t,e)}},{http:6}],11:[function(t,e){e.exports="function"==typeof Object.create?function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:function(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}},{}],12:[function(t,e){function n(){}var r=e.exports={};r.nextTick=function(){var t="undefined"!=typeof window&&window.setImmediate,e="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(t)return function(t){return window.setImmediate(t)};if(e){var n=[];return window.addEventListener("message",function(t){var e=t.source;if((e===window||null===e)&&"process-tick"===t.data&&(t.stopPropagation(),n.length>0)){var r=n.shift();r()}},!0),function(t){n.push(t),window.postMessage("process-tick","*")}}return function(t){setTimeout(t,0)}}(),r.title="browser",r.browser=!0,r.env={},r.argv=[],r.on=n,r.once=n,r.off=n,r.emit=n,r.binding=function(){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(){throw new Error("process.chdir is not supported")}},{}],13:[function(e,n,r){(function(e){!function(i){function o(t){throw RangeError(B[t])}function s(t,e){for(var n=t.length;n--;)t[n]=e(t[n]);return t}function a(t,e){return s(t.split(R),e).join(".")}function h(t){for(var e,n,r=[],i=0,o=t.length;o>i;)e=t.charCodeAt(i++),e>=55296&&56319>=e&&o>i?(n=t.charCodeAt(i++),56320==(64512&n)?r.push(((1023&e)<<10)+(1023&n)+65536):(r.push(e),i--)):r.push(e);return r}function u(t){return s(t,function(t){var e="";return t>65535&&(t-=65536,e+=q(t>>>10&1023|55296),t=56320|1023&t),e+=q(t)}).join("")}function f(t){return 10>t-48?t-22:26>t-65?t-65:26>t-97?t-97:S}function c(t,e){return t+22+75*(26>t)-((0!=e)<<5)}function l(t,e,n){var r=0;for(t=n?O(t/A):t>>1,t+=O(t/e);t>M*L>>1;r+=S)t=O(t/M);return O(r+(M+1)*t/(t+j))}function d(t){var e,n,r,i,s,a,h,c,d,p,g=[],m=t.length,v=0,y=C,b=k;for(n=t.lastIndexOf(T),0>n&&(n=0),r=0;n>r;++r)t.charCodeAt(r)>=128&&o("not-basic"),g.push(t.charCodeAt(r));for(i=n>0?n+1:0;m>i;){for(s=v,a=1,h=S;i>=m&&o("invalid-input"),c=f(t.charCodeAt(i++)),(c>=S||c>O((_-v)/a))&&o("overflow"),v+=c*a,d=b>=h?x:h>=b+L?L:h-b,!(d>c);h+=S)p=S-d,a>O(_/p)&&o("overflow"),a*=p;e=g.length+1,b=l(v-s,e,0==s),O(v/e)>_-y&&o("overflow"),y+=O(v/e),v%=e,g.splice(v++,0,y)}return u(g)}function p(t){var e,n,r,i,s,a,u,f,d,p,g,m,v,y,b,w=[];for(t=h(t),m=t.length,e=C,n=0,s=k,a=0;m>a;++a)g=t[a],128>g&&w.push(q(g));for(r=i=w.length,i&&w.push(T);m>r;){for(u=_,a=0;m>a;++a)g=t[a],g>=e&&u>g&&(u=g);for(v=r+1,u-e>O((_-n)/v)&&o("overflow"),n+=(u-e)*v,e=u,a=0;m>a;++a)if(g=t[a],e>g&&++n>_&&o("overflow"),g==e){for(f=n,d=S;p=s>=d?x:d>=s+L?L:d-s,!(p>f);d+=S)b=f-p,y=S-p,w.push(q(c(p+b%y,0))),f=O(b/y);w.push(q(c(f,0))),s=l(n,v,r==i),n=0,++r}++n,++e}return w.join("")}function g(t){return a(t,function(t){return I.test(t)?d(t.slice(4).toLowerCase()):t 2 | })}function m(t){return a(t,function(t){return U.test(t)?"xn--"+p(t):t})}var v="object"==typeof r&&r,y="object"==typeof n&&n&&n.exports==v&&n,b="object"==typeof e&&e;(b.global===b||b.window===b)&&(i=b);var w,E,_=2147483647,S=36,x=1,L=26,j=38,A=700,k=72,C=128,T="-",I=/^xn--/,U=/[^ -~]/,R=/\x2E|\u3002|\uFF0E|\uFF61/g,B={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},M=S-x,O=Math.floor,q=String.fromCharCode;if(w={version:"1.2.4",ucs2:{decode:h,encode:u},decode:d,encode:p,toASCII:m,toUnicode:g},"function"==typeof t&&"object"==typeof t.amd&&t.amd)t("punycode",function(){return w});else if(v&&!v.nodeType)if(y)y.exports=w;else for(E in w)w.hasOwnProperty(E)&&(v[E]=w[E]);else i.punycode=w}(this)}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],14:[function(t,e){"use strict";function n(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.exports=function(t,e,i,o){e=e||"&",i=i||"=";var s={};if("string"!=typeof t||0===t.length)return s;var a=/\+/g;t=t.split(e);var h=1e3;o&&"number"==typeof o.maxKeys&&(h=o.maxKeys);var u=t.length;h>0&&u>h&&(u=h);for(var f=0;u>f;++f){var c,l,d,p,g=t[f].replace(a,"%20"),m=g.indexOf(i);m>=0?(c=g.substr(0,m),l=g.substr(m+1)):(c=g,l=""),d=decodeURIComponent(c),p=decodeURIComponent(l),n(s,d)?r(s[d])?s[d].push(p):s[d]=[s[d],p]:s[d]=p}return s};var r=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},{}],15:[function(t,e){"use strict";function n(t,e){if(t.map)return t.map(e);for(var n=[],r=0;r0)){var r=n.shift();r()}},!0),function(t){n.push(t),window.postMessage("process-tick","*")}}return function(t){setTimeout(t,0)}}(),n.title="browser",n.browser=!0,n.env={},n.argv=[],n.binding=function(){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(){throw new Error("process.chdir is not supported")}},{}],20:[function(t,e){function n(t){return this instanceof n?void r.call(this,t):new n(t)}e.exports=n;var r=t("./transform.js"),i=t("inherits");i(n,r),n.prototype._transform=function(t,e,n){n(null,t)}},{"./transform.js":22,inherits:11}],21:[function(t,e){(function(n){function r(e){e=e||{};var n=e.highWaterMark;this.highWaterMark=n||0===n?n:16384,this.highWaterMark=~~this.highWaterMark,this.buffer=[],this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=!1,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.calledRead=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.objectMode=!!e.objectMode,this.defaultEncoding=e.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(S||(S=t("string_decoder").StringDecoder),this.decoder=new S(e.encoding),this.encoding=e.encoding)}function i(t){return this instanceof i?(this._readableState=new r(t,this),this.readable=!0,void L.call(this)):new i(t)}function o(t,e,n,r,i){var o=u(e,n);if(o)t.emit("error",o);else if(null===n||void 0===n)e.reading=!1,e.ended||f(t,e);else if(e.objectMode||n&&n.length>0)if(e.ended&&!i){var a=new Error("stream.push() after EOF");t.emit("error",a)}else if(e.endEmitted&&i){var a=new Error("stream.unshift() after end event");t.emit("error",a)}else!e.decoder||i||r||(n=e.decoder.write(n)),e.length+=e.objectMode?1:n.length,i?e.buffer.unshift(n):(e.reading=!1,e.buffer.push(n)),e.needReadable&&c(t),d(t,e);else i||(e.reading=!1);return s(e)}function s(t){return!t.ended&&(t.needReadable||t.length=C)t=C;else{t--;for(var e=1;32>e;e<<=1)t|=t>>e;t++}return t}function h(t,e){return 0===e.length&&e.ended?0:e.objectMode?0===t?0:1:isNaN(t)||null===t?e.flowing&&e.buffer.length?e.buffer[0].length:e.length:0>=t?0:(t>e.highWaterMark&&(e.highWaterMark=a(t)),t>e.length?e.ended?e.length:(e.needReadable=!0,0):t)}function u(t,e){var n=null;return j.isBuffer(e)||"string"==typeof e||null===e||void 0===e||t.objectMode||n||(n=new TypeError("Invalid non-string/buffer chunk")),n}function f(t,e){if(e.decoder&&!e.ended){var n=e.decoder.end();n&&n.length&&(e.buffer.push(n),e.length+=e.objectMode?1:n.length)}e.ended=!0,e.length>0?c(t):w(t)}function c(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,e.sync?A(function(){l(t)}):l(t))}function l(t){t.emit("readable")}function d(t,e){e.readingMore||(e.readingMore=!0,A(function(){p(t,e)}))}function p(t,e){for(var n=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length0)return;return 0===r.pipesCount?(r.flowing=!1,void(x.listenerCount(t,"data")>0&&y(t))):void(r.ranOut=!0)}function v(){this._readableState.ranOut&&(this._readableState.ranOut=!1,m(this))}function y(t,e){var n=t._readableState;if(n.flowing)throw new Error("Cannot switch to old mode now.");var r=e||!1,i=!1;t.readable=!0,t.pipe=L.prototype.pipe,t.on=t.addListener=L.prototype.on,t.on("readable",function(){i=!0;for(var e;!r&&null!==(e=t.read());)t.emit("data",e);null===e&&(i=!1,t._readableState.needReadable=!0)}),t.pause=function(){r=!0,this.emit("pause")},t.resume=function(){r=!1,i?A(function(){t.emit("readable")}):this.read(0),this.emit("resume")},t.emit("readable")}function b(t,e){var n,r=e.buffer,i=e.length,o=!!e.decoder,s=!!e.objectMode;if(0===r.length)return null;if(0===i)n=null;else if(s)n=r.shift();else if(!t||t>=i)n=o?r.join(""):j.concat(r,i),r.length=0;else if(tu&&t>h;u++){var a=r[0],c=Math.min(t-h,a.length);o?n+=a.slice(0,c):a.copy(n,h,0,c),c0)throw new Error("endReadable called on non-empty stream");!e.endEmitted&&e.calledRead&&(e.ended=!0,A(function(){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}))}function E(t,e){for(var n=0,r=t.length;r>n;n++)e(t[n],n)}function _(t,e){for(var n=0,r=t.length;r>n;n++)if(t[n]===e)return n;return-1}e.exports=i,i.ReadableState=r;var S,x=t("events").EventEmitter,L=t("./index.js"),j=t("buffer").Buffer,A=t("process/browser.js").nextTick,k=t("inherits");k(i,L),i.prototype.push=function(t,e){var n=this._readableState;return"string"!=typeof t||n.objectMode||(e=e||n.defaultEncoding,e!==n.encoding&&(t=new j(t,e),e="")),o(this,n,t,e,!1)},i.prototype.unshift=function(t){var e=this._readableState;return o(this,e,t,"",!0)},i.prototype.setEncoding=function(e){S||(S=t("string_decoder").StringDecoder),this._readableState.decoder=new S(e),this._readableState.encoding=e};var C=8388608;i.prototype.read=function(t){var e=this._readableState;e.calledRead=!0;var n=t;if(("number"!=typeof t||t>0)&&(e.emittedReadable=!1),0===t&&e.needReadable&&(e.length>=e.highWaterMark||e.ended))return c(this),null;if(t=h(t,e),0===t&&e.ended)return 0===e.length&&w(this),null;var r=e.needReadable;e.length-t<=e.highWaterMark&&(r=!0),(e.ended||e.reading)&&(r=!1),r&&(e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1),r&&!e.reading&&(t=h(n,e));var i;return i=t>0?b(t,e):null,null===i&&(e.needReadable=!0,t=0),e.length-=t,0!==e.length||e.ended||(e.needReadable=!0),e.ended&&!e.endEmitted&&0===e.length&&w(this),i},i.prototype._read=function(){this.emit("error",new Error("not implemented"))},i.prototype.pipe=function(t,e){function r(t){t===f&&o()}function i(){t.end()}function o(){t.removeListener("close",a),t.removeListener("finish",h),t.removeListener("drain",p),t.removeListener("error",s),t.removeListener("unpipe",r),f.removeListener("end",i),f.removeListener("end",o),(!t._writableState||t._writableState.needDrain)&&p()}function s(e){u(),0===y&&0===x.listenerCount(t,"error")&&t.emit("error",e)}function a(){t.removeListener("finish",h),u()}function h(){t.removeListener("close",a),u()}function u(){f.unpipe(t)}var f=this,c=this._readableState;switch(c.pipesCount){case 0:c.pipes=t;break;case 1:c.pipes=[c.pipes,t];break;default:c.pipes.push(t)}c.pipesCount+=1;var l=(!e||e.end!==!1)&&t!==n.stdout&&t!==n.stderr,d=l?i:o;c.endEmitted?A(d):f.once("end",d),t.on("unpipe",r);var p=g(f);t.on("drain",p);var y=x.listenerCount(t,"error");return t.once("error",s),t.once("close",a),t.once("finish",h),t.emit("pipe",f),c.flowing||(this.on("readable",v),c.flowing=!0,A(function(){m(f)})),t},i.prototype.unpipe=function(t){var e=this._readableState;if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,this.removeListener("readable",v),e.flowing=!1,t&&t.emit("unpipe",this),this);if(!t){var n=e.pipes,r=e.pipesCount;e.pipes=null,e.pipesCount=0,this.removeListener("readable",v),e.flowing=!1;for(var i=0;r>i;i++)n[i].emit("unpipe",this);return this}var i=_(e.pipes,t);return-1===i?this:(e.pipes.splice(i,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this),this)},i.prototype.on=function(t,e){var n=L.prototype.on.call(this,t,e);if("data"!==t||this._readableState.flowing||y(this),"readable"===t&&this.readable){var r=this._readableState;r.readableListening||(r.readableListening=!0,r.emittedReadable=!1,r.needReadable=!0,r.reading?r.length&&c(this,r):this.read(0))}return n},i.prototype.addListener=i.prototype.on,i.prototype.resume=function(){y(this),this.read(0),this.emit("resume")},i.prototype.pause=function(){y(this,!0),this.emit("pause")},i.prototype.wrap=function(t){var e=this._readableState,n=!1,r=this;t.on("end",function(){if(e.decoder&&!e.ended){var t=e.decoder.end();t&&t.length&&r.push(t)}r.push(null)}),t.on("data",function(i){if(e.decoder&&(i=e.decoder.write(i)),i&&(e.objectMode||i.length)){var o=r.push(i);o||(n=!0,t.pause())}});for(var i in t)"function"==typeof t[i]&&"undefined"==typeof this[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));var o=["error","close","destroy","pause","resume"];return E(o,function(e){t.on(e,function(t){return r.emit.apply(r,e,t)})}),r._read=function(){n&&(n=!1,t.resume())},r},i._fromList=b}).call(this,t("/Users/tmcw/src/leaflet-geojson-stream/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js"))},{"./index.js":18,"/Users/tmcw/src/leaflet-geojson-stream/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":12,buffer:2,events:5,inherits:11,"process/browser.js":19,string_decoder:24}],22:[function(t,e){function n(t,e){this.afterTransform=function(t,n){return r(e,t,n)},this.needTransform=!1,this.transforming=!1,this.writecb=null,this.writechunk=null}function r(t,e,n){var r=t._transformState;r.transforming=!1;var i=r.writecb;if(!i)return t.emit("error",new Error("no writecb in Transform class"));r.writechunk=null,r.writecb=null,null!==n&&void 0!==n&&t.push(n),i&&i(e);var o=t._readableState;o.reading=!1,(o.needReadable||o.length=this.charLength-this.charReceived?this.charLength-this.charReceived:t.length;if(t.copy(this.charBuffer,this.charReceived,n,r),this.charReceived+=r-n,n=r,this.charReceived=55296&&56319>=i)){if(this.charReceived=this.charLength=0,r==t.length)return e;t=t.slice(r,t.length);break}this.charLength+=this.surrogateSize,e=""}var o=this.detectIncompleteChar(t),s=t.length;this.charLength&&(t.copy(this.charBuffer,0,t.length-o,s),this.charReceived=o,s-=o),e+=t.toString(this.encoding,0,s);var s=e.length-1,i=e.charCodeAt(s);if(i>=55296&&56319>=i){var a=this.surrogateSize;return this.charLength+=a,this.charReceived+=a,this.charBuffer.copy(this.charBuffer,a,0,a),this.charBuffer.write(e.charAt(e.length-1),this.encoding),e.substring(0,s)}return e},h.prototype.detectIncompleteChar=function(t){for(var e=t.length>=3?3:t.length;e>0;e--){var n=t[t.length-e];if(1==e&&n>>5==6){this.charLength=2;break}if(2>=e&&n>>4==14){this.charLength=3;break}if(3>=e&&n>>3==30){this.charLength=4;break}}return e},h.prototype.end=function(t){var e="";if(t&&t.length&&(e=this.write(t)),this.charReceived){var n=this.charReceived,r=this.charBuffer,i=this.encoding;e+=r.slice(0,n).toString(i)}return e}},{buffer:2}],25:[function(t,e,n){function r(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function i(t,e,n){if(t&&u(t)&&t instanceof r)return t;var i=new r;return i.parse(t,e,n),i}function o(t){return h(t)&&(t=i(t)),t instanceof r?t.format():r.prototype.format.call(t)}function s(t,e){return i(t,!1,!0).resolve(e)}function a(t,e){return t?i(t,!1,!0).resolveObject(e):e}function h(t){return"string"==typeof t}function u(t){return"object"==typeof t&&null!==t}function f(t){return null===t}function c(t){return null==t}var l=t("punycode");n.parse=i,n.resolve=s,n.resolveObject=a,n.format=o,n.Url=r;var d=/^([a-z0-9.+-]+:)/i,p=/:[0-9]*$/,g=["<",">",'"',"`"," ","\r","\n"," "],m=["{","}","|","\\","^","`"].concat(g),v=["'"].concat(m),y=["%","/","?",";","#"].concat(v),b=["/","?","#"],w=255,E=/^[a-z0-9A-Z_-]{0,63}$/,_=/^([a-z0-9A-Z_-]{0,63})(.*)$/,S={javascript:!0,"javascript:":!0},x={javascript:!0,"javascript:":!0},L={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},j=t("querystring");r.prototype.parse=function(t,e,n){if(!h(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var r=t;r=r.trim();var i=d.exec(r);if(i){i=i[0];var o=i.toLowerCase();this.protocol=o,r=r.substr(i.length)}if(n||i||r.match(/^\/\/[^@\/]+@[^@\/]+/)){var s="//"===r.substr(0,2);!s||i&&x[i]||(r=r.substr(2),this.slashes=!0)}if(!x[i]&&(s||i&&!L[i])){for(var a=-1,u=0;uf)&&(a=f)}var c,p;p=-1===a?r.lastIndexOf("@"):r.lastIndexOf("@",a),-1!==p&&(c=r.slice(0,p),r=r.slice(p+1),this.auth=decodeURIComponent(c)),a=-1;for(var u=0;uf)&&(a=f)}-1===a&&(a=r.length),this.host=r.slice(0,a),r=r.slice(a),this.parseHost(),this.hostname=this.hostname||"";var g="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!g)for(var m=this.hostname.split(/\./),u=0,A=m.length;A>u;u++){var k=m[u];if(k&&!k.match(E)){for(var C="",T=0,I=k.length;I>T;T++)C+=k.charCodeAt(T)>127?"x":k[T];if(!C.match(E)){var U=m.slice(0,u),R=m.slice(u+1),B=k.match(_);B&&(U.push(B[1]),R.unshift(B[2])),R.length&&(r="/"+R.join(".")+r),this.hostname=U.join(".");break}}}if(this.hostname=this.hostname.length>w?"":this.hostname.toLowerCase(),!g){for(var M=this.hostname.split("."),O=[],u=0;uu;u++){var F=v[u],H=encodeURIComponent(F);H===F&&(H=escape(F)),r=r.split(F).join(H)}var P=r.indexOf("#");-1!==P&&(this.hash=r.substr(P),r=r.slice(0,P));var z=r.indexOf("?");if(-1!==z?(this.search=r.substr(z),this.query=r.substr(z+1),e&&(this.query=j.parse(this.query)),r=r.slice(0,z)):e&&(this.search="",this.query={}),r&&(this.pathname=r),L[o]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var N=this.pathname||"",q=this.search||"";this.path=N+q}return this.href=this.format(),this},r.prototype.format=function(){var t=this.auth||"";t&&(t=encodeURIComponent(t),t=t.replace(/%3A/i,":"),t+="@");var e=this.protocol||"",n=this.pathname||"",r=this.hash||"",i=!1,o="";this.host?i=t+this.host:this.hostname&&(i=t+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(i+=":"+this.port)),this.query&&u(this.query)&&Object.keys(this.query).length&&(o=j.stringify(this.query));var s=this.search||o&&"?"+o||"";return e&&":"!==e.substr(-1)&&(e+=":"),this.slashes||(!e||L[e])&&i!==!1?(i="//"+(i||""),n&&"/"!==n.charAt(0)&&(n="/"+n)):i||(i=""),r&&"#"!==r.charAt(0)&&(r="#"+r),s&&"?"!==s.charAt(0)&&(s="?"+s),n=n.replace(/[?#]/g,function(t){return encodeURIComponent(t)}),s=s.replace("#","%23"),e+i+n+s+r},r.prototype.resolve=function(t){return this.resolveObject(i(t,!1,!0)).format()},r.prototype.resolveObject=function(t){if(h(t)){var e=new r;e.parse(t,!1,!0),t=e}var n=new r;if(Object.keys(this).forEach(function(t){n[t]=this[t]},this),n.hash=t.hash,""===t.href)return n.href=n.format(),n;if(t.slashes&&!t.protocol)return Object.keys(t).forEach(function(e){"protocol"!==e&&(n[e]=t[e])}),L[n.protocol]&&n.hostname&&!n.pathname&&(n.path=n.pathname="/"),n.href=n.format(),n;if(t.protocol&&t.protocol!==n.protocol){if(!L[t.protocol])return Object.keys(t).forEach(function(e){n[e]=t[e]}),n.href=n.format(),n;if(n.protocol=t.protocol,t.host||x[t.protocol])n.pathname=t.pathname;else{for(var i=(t.pathname||"").split("/");i.length&&!(t.host=i.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),""!==i[0]&&i.unshift(""),i.length<2&&i.unshift(""),n.pathname=i.join("/")}if(n.search=t.search,n.query=t.query,n.host=t.host||"",n.auth=t.auth,n.hostname=t.hostname||t.host,n.port=t.port,n.pathname||n.search){var o=n.pathname||"",s=n.search||"";n.path=o+s}return n.slashes=n.slashes||t.slashes,n.href=n.format(),n}var a=n.pathname&&"/"===n.pathname.charAt(0),u=t.host||t.pathname&&"/"===t.pathname.charAt(0),l=u||a||n.host&&t.pathname,d=l,p=n.pathname&&n.pathname.split("/")||[],i=t.pathname&&t.pathname.split("/")||[],g=n.protocol&&!L[n.protocol];if(g&&(n.hostname="",n.port=null,n.host&&(""===p[0]?p[0]=n.host:p.unshift(n.host)),n.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(""===i[0]?i[0]=t.host:i.unshift(t.host)),t.host=null),l=l&&(""===i[0]||""===p[0])),u)n.host=t.host||""===t.host?t.host:n.host,n.hostname=t.hostname||""===t.hostname?t.hostname:n.hostname,n.search=t.search,n.query=t.query,p=i;else if(i.length)p||(p=[]),p.pop(),p=p.concat(i),n.search=t.search,n.query=t.query;else if(!c(t.search)){if(g){n.hostname=n.host=p.shift();var m=n.host&&n.host.indexOf("@")>0?n.host.split("@"):!1;m&&(n.auth=m.shift(),n.host=n.hostname=m.shift())}return n.search=t.search,n.query=t.query,f(n.pathname)&&f(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!p.length)return n.pathname=null,n.path=n.search?"/"+n.search:null,n.href=n.format(),n;for(var v=p.slice(-1)[0],y=(n.host||t.host)&&("."===v||".."===v)||""===v,b=0,w=p.length;w>=0;w--)v=p[w],"."==v?p.splice(w,1):".."===v?(p.splice(w,1),b++):b&&(p.splice(w,1),b--);if(!l&&!d)for(;b--;b)p.unshift("..");!l||""===p[0]||p[0]&&"/"===p[0].charAt(0)||p.unshift(""),y&&"/"!==p.join("/").substr(-1)&&p.push("");var E=""===p[0]||p[0]&&"/"===p[0].charAt(0);if(g){n.hostname=n.host=E?"":p.length?p.shift():"";var m=n.host&&n.host.indexOf("@")>0?n.host.split("@"):!1;m&&(n.auth=m.shift(),n.host=n.hostname=m.shift())}return l=l||n.host&&p.length,l&&!E&&p.unshift(""),p.length?n.pathname=p.join("/"):(n.pathname=null,n.path=null),f(n.pathname)&&f(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=t.auth||n.auth,n.slashes=n.slashes||t.slashes,n.href=n.format(),n},r.prototype.parseHost=function(){var t=this.host,e=p.exec(t);e&&(e=e[0],":"!==e&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},{punycode:13,querystring:16}],26:[function(t,e){e.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},{}],27:[function(t,e,n){(function(e,r){function i(t,e){var r={seen:[],stylize:s};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),g(e)?r.showHidden=e:e&&n._extend(r,e),E(r.showHidden)&&(r.showHidden=!1),E(r.depth)&&(r.depth=2),E(r.colors)&&(r.colors=!1),E(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=o),h(r,t,r.depth)}function o(t,e){var n=i.styles[e];return n?"["+i.colors[n][0]+"m"+t+"["+i.colors[n][1]+"m":t}function s(t){return t}function a(t){var e={};return t.forEach(function(t){e[t]=!0}),e}function h(t,e,r){if(t.customInspect&&e&&j(e.inspect)&&e.inspect!==n.inspect&&(!e.constructor||e.constructor.prototype!==e)){var i=e.inspect(r,t);return b(i)||(i=h(t,i,r)),i}var o=u(t,e);if(o)return o;var s=Object.keys(e),g=a(s);if(t.showHidden&&(s=Object.getOwnPropertyNames(e)),L(e)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return f(e);if(0===s.length){if(j(e)){var m=e.name?": "+e.name:"";return t.stylize("[Function"+m+"]","special")}if(_(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(x(e))return t.stylize(Date.prototype.toString.call(e),"date");if(L(e))return f(e)}var v="",y=!1,w=["{","}"];if(p(e)&&(y=!0,w=["[","]"]),j(e)){var E=e.name?": "+e.name:"";v=" [Function"+E+"]"}if(_(e)&&(v=" "+RegExp.prototype.toString.call(e)),x(e)&&(v=" "+Date.prototype.toUTCString.call(e)),L(e)&&(v=" "+f(e)),0===s.length&&(!y||0==e.length))return w[0]+v+w[1];if(0>r)return _(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special");t.seen.push(e);var S;return S=y?c(t,e,r,g,s):s.map(function(n){return l(t,e,r,g,n,y)}),t.seen.pop(),d(S,v,w)}function u(t,e){if(E(e))return t.stylize("undefined","undefined");if(b(e)){var n="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(n,"string")}return y(e)?t.stylize(""+e,"number"):g(e)?t.stylize(""+e,"boolean"):m(e)?t.stylize("null","null"):void 0}function f(t){return"["+Error.prototype.toString.call(t)+"]"}function c(t,e,n,r,i){for(var o=[],s=0,a=e.length;a>s;++s)o.push(I(e,String(s))?l(t,e,n,r,String(s),!0):"");return i.forEach(function(i){i.match(/^\d+$/)||o.push(l(t,e,n,r,i,!0))}),o}function l(t,e,n,r,i,o){var s,a,u;if(u=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]},u.get?a=u.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):u.set&&(a=t.stylize("[Setter]","special")),I(r,i)||(s="["+i+"]"),a||(t.seen.indexOf(u.value)<0?(a=m(n)?h(t,u.value,null):h(t,u.value,n-1),a.indexOf("\n")>-1&&(a=o?a.split("\n").map(function(t){return" "+t}).join("\n").substr(2):"\n"+a.split("\n").map(function(t){return" "+t}).join("\n"))):a=t.stylize("[Circular]","special")),E(s)){if(o&&i.match(/^\d+$/))return a;s=JSON.stringify(""+i),s.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=t.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=t.stylize(s,"string"))}return s+": "+a}function d(t,e,n){var r=0,i=t.reduce(function(t,e){return r++,e.indexOf("\n")>=0&&r++,t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0);return i>60?n[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+n[1]:n[0]+e+" "+t.join(", ")+" "+n[1]}function p(t){return Array.isArray(t) 3 | }function g(t){return"boolean"==typeof t}function m(t){return null===t}function v(t){return null==t}function y(t){return"number"==typeof t}function b(t){return"string"==typeof t}function w(t){return"symbol"==typeof t}function E(t){return void 0===t}function _(t){return S(t)&&"[object RegExp]"===k(t)}function S(t){return"object"==typeof t&&null!==t}function x(t){return S(t)&&"[object Date]"===k(t)}function L(t){return S(t)&&("[object Error]"===k(t)||t instanceof Error)}function j(t){return"function"==typeof t}function A(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||"undefined"==typeof t}function k(t){return Object.prototype.toString.call(t)}function C(t){return 10>t?"0"+t.toString(10):t.toString(10)}function T(){var t=new Date,e=[C(t.getHours()),C(t.getMinutes()),C(t.getSeconds())].join(":");return[t.getDate(),M[t.getMonth()],e].join(" ")}function I(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var U=/%[sdj%]/g;n.format=function(t){if(!b(t)){for(var e=[],n=0;n=o)return t;switch(t){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(e){return"[Circular]"}default:return t}}),a=r[n];o>n;a=r[++n])s+=m(a)||!S(a)?" "+a:" "+i(a);return s},n.deprecate=function(t,i){function o(){if(!s){if(e.throwDeprecation)throw new Error(i);e.traceDeprecation?console.trace(i):console.error(i),s=!0}return t.apply(this,arguments)}if(E(r.process))return function(){return n.deprecate(t,i).apply(this,arguments)};if(e.noDeprecation===!0)return t;var s=!1;return o};var R,B={};n.debuglog=function(t){if(E(R)&&(R=e.env.NODE_DEBUG||""),t=t.toUpperCase(),!B[t])if(new RegExp("\\b"+t+"\\b","i").test(R)){var r=e.pid;B[t]=function(){var e=n.format.apply(n,arguments);console.error("%s %d: %s",t,r,e)}}else B[t]=function(){};return B[t]},n.inspect=i,i.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]},i.styles={special:"cyan",number:"yellow","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",regexp:"red"},n.isArray=p,n.isBoolean=g,n.isNull=m,n.isNullOrUndefined=v,n.isNumber=y,n.isString=b,n.isSymbol=w,n.isUndefined=E,n.isRegExp=_,n.isObject=S,n.isDate=x,n.isError=L,n.isFunction=j,n.isPrimitive=A,n.isBuffer=t("./support/isBuffer");var M=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];n.log=function(){console.log("%s - %s",T(),n.format.apply(n,arguments))},n.inherits=t("inherits"),n._extend=function(t,e){if(!e||!S(e))return t;for(var n=Object.keys(e),r=n.length;r--;)t[n[r]]=e[n[r]];return t}}).call(this,t("/Users/tmcw/src/leaflet-geojson-stream/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./support/isBuffer":26,"/Users/tmcw/src/leaflet-geojson-stream/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":12,inherits:11}],28:[function(t,e){var n=t("JSONStream"),r='{"type":"FeatureCollection","features":[',i="]}";e.exports.parse=function(){var t=n.parse("features.*");return t},e.exports.stringify=function(){var t=n.stringify(r,"\n,\n",i);return t}},{JSONStream:29}],29:[function(t,e,n){(function(e,r){function i(t,e){return"string"==typeof t?e==t:t&&"function"==typeof t.exec?t.exec(e):"boolean"==typeof t?t:"function"==typeof t?t(e):!1}var o=t("jsonparse"),s=t("stream").Stream,a=t("through");n.parse=function(t){var n=new o,s=a(function(t){if("string"==typeof t)if(e.browser){for(var i=new Array(t.length),o=0;on;n++){var o=e[n];if(i[o]===t)return o}return t&&"0x"+t.toString(16)}function r(){this.tState=m,this.value=void 0,this.string=void 0,this.unicode=void 0,this.negative=void 0,this.magnatude=void 0,this.position=void 0,this.exponent=void 0,this.negativeExponent=void 0,this.key=void 0,this.mode=void 0,this.stack=[],this.state=H,this.bytes_remaining=0,this.bytes_in_sequence=0,this.temp_buffs={2:new t(2),3:new t(3),4:new t(4)}}var i={},o=i.LEFT_BRACE=1,s=i.RIGHT_BRACE=2,a=i.LEFT_BRACKET=3,h=i.RIGHT_BRACKET=4,u=i.COLON=5,f=i.COMMA=6,c=i.TRUE=7,l=i.FALSE=8,d=i.NULL=9,p=i.STRING=10,g=i.NUMBER=11,m=i.START=17,v=i.TRUE1=33,y=i.TRUE2=34,b=i.TRUE3=35,w=i.FALSE1=49,E=i.FALSE2=50,_=i.FALSE3=51,S=i.FALSE4=52,x=i.NULL1=65,L=i.NULL3=66,j=i.NULL2=67,A=i.NUMBER1=81,k=i.NUMBER2=82,C=i.NUMBER3=83,T=i.NUMBER4=84,I=i.NUMBER5=85,U=i.NUMBER6=86,R=i.NUMBER7=87,B=i.NUMBER8=88,M=i.STRING1=97,O=i.STRING2=98,q=i.STRING3=99,N=i.STRING4=100,D=i.STRING5=101,F=i.STRING6=102,H=i.VALUE=113,P=i.KEY=114,z=i.OBJECT=129,W=i.ARRAY=130,G=r.prototype;G.charError=function(t,e){this.onError(new Error("Unexpected "+JSON.stringify(String.fromCharCode(t[e]))+" at position "+e+" in state "+n(this.tState)))},G.onError=function(t){throw t},G.write=function(e){"string"==typeof e&&(e=new t(e));for(var n,r=0,i=e.length;i>r;r++)if(this.tState===m)n=e[r],123===n?this.onToken(o,"{"):125===n?this.onToken(s,"}"):91===n?this.onToken(a,"["):93===n?this.onToken(h,"]"):58===n?this.onToken(u,":"):44===n?this.onToken(f,","):116===n?this.tState=v:102===n?this.tState=w:110===n?this.tState=x:34===n?(this.string="",this.tState=M):45===n?(this.negative=!0,this.tState=A):48===n?(this.magnatude=0,this.tState=k):n>48&&64>n?(this.magnatude=n-48,this.tState=C):32===n||9===n||10===n||13===n||this.charError(e,r);else if(this.tState===M)if(n=e[r],this.bytes_remaining>0){for(var H=0;H=128)if(n>=194&&223>=n&&(this.bytes_in_sequence=2),n>=224&&239>=n&&(this.bytes_in_sequence=3),n>=240&&244>=n&&(this.bytes_in_sequence=4),this.bytes_in_sequence+r>e.length){for(var P=0;P<=e.length-1-r;P++)this.temp_buffs[this.bytes_in_sequence][P]=e[r+P];this.bytes_remaining=r+this.bytes_in_sequence-e.length,r=e.length-1}else this.string+=e.slice(r,r+this.bytes_in_sequence).toString(),r=r+this.bytes_in_sequence-1;else 34===n?(this.tState=m,this.onToken(p,this.string),this.string=void 0):92===n?this.tState=O:n>=32?this.string+=String.fromCharCode(n):this.charError(e,r);else this.tState===O?(n=e[r],34===n?(this.string+='"',this.tState=M):92===n?(this.string+="\\",this.tState=M):47===n?(this.string+="/",this.tState=M):98===n?(this.string+="\b",this.tState=M):102===n?(this.string+="\f",this.tState=M):110===n?(this.string+="\n",this.tState=M):114===n?(this.string+="\r",this.tState=M):116===n?(this.string+=" ",this.tState=M):117===n?(this.unicode="",this.tState=q):this.charError(e,r)):this.tState===q||this.tState===N||this.tState===D||this.tState===F?(n=e[r],n>=48&&64>n||n>64&&70>=n||n>96&&102>=n?(this.unicode+=String.fromCharCode(n),this.tState++===F&&(this.string+=String.fromCharCode(parseInt(this.unicode,16)),this.unicode=void 0,this.tState=M)):this.charError(e,r)):this.tState===A?(n=e[r],48===n?(this.magnatude=0,this.tState=k):n>48&&64>n?(this.magnatude=n-48,this.tState=C):this.charError(e,r)):this.tState===k?(n=e[r],46===n?(this.position=.1,this.tState=T):101===n||69===n?(this.exponent=0,this.tState=U):(this.tState=m,this.onToken(g,0),this.magnatude=void 0,this.negative=void 0,r--)):this.tState===C?(n=e[r],46===n?(this.position=.1,this.tState=T):101===n||69===n?(this.exponent=0,this.tState=U):n>=48&&64>n?this.magnatude=10*this.magnatude+n-48:(this.tState=m,this.negative&&(this.magnatude=-this.magnatude,this.negative=void 0),this.onToken(g,this.magnatude),this.magnatude=void 0,r--)):this.tState===T?(n=e[r],n>=48&&64>n?(this.magnatude+=this.position*(n-48),this.position/=10,this.tState=I):this.charError(e,r)):this.tState===I?(n=e[r],n>=48&&64>n?(this.magnatude+=this.position*(n-48),this.position/=10):101===n||69===n?(this.exponent=0,this.tState=U):(this.tState=m,this.negative&&(this.magnatude=-this.magnatude,this.negative=void 0),this.onToken(g,this.negative?-this.magnatude:this.magnatude),this.magnatude=void 0,this.position=void 0,r--)):this.tState===U?(n=e[r],43===n||45===n?(45===n&&(this.negativeExponent=!0),this.tState=R):n>=48&&64>n?(this.exponent=10*this.exponent+(n-48),this.tState=B):this.charError(e,r)):this.tState===R?(n=e[r],n>=48&&64>n?(this.exponent=10*this.exponent+(n-48),this.tState=B):this.charError(e,r)):this.tState===B?(n=e[r],n>=48&&64>n?this.exponent=10*this.exponent+(n-48):(this.negativeExponent&&(this.exponent=-this.exponent,this.negativeExponent=void 0),this.magnatude*=Math.pow(10,this.exponent),this.exponent=void 0,this.negative&&(this.magnatude=-this.magnatude,this.negative=void 0),this.tState=m,this.onToken(g,this.magnatude),this.magnatude=void 0,r--)):this.tState===v?114===e[r]?this.tState=y:this.charError(e,r):this.tState===y?117===e[r]?this.tState=b:this.charError(e,r):this.tState===b?101===e[r]?(this.tState=m,this.onToken(c,!0)):this.charError(e,r):this.tState===w?97===e[r]?this.tState=E:this.charError(e,r):this.tState===E?108===e[r]?this.tState=_:this.charError(e,r):this.tState===_?115===e[r]?this.tState=S:this.charError(e,r):this.tState===S?101===e[r]?(this.tState=m,this.onToken(l,!1)):this.charError(e,r):this.tState===x?117===e[r]?this.tState=L:this.charError(e,r):this.tState===L?108===e[r]?this.tState=j:this.charError(e,r):this.tState===j&&(108===e[r]?(this.tState=m,this.onToken(d,null)):this.charError(e,r))},G.onToken=function(){},G.parseError=function(t,e){this.onError(new Error("Unexpected "+n(t)+(e?"("+JSON.stringify(e)+")":"")+" in state "+n(this.state)))},G.onError=function(t){throw t},G.push=function(){this.stack.push({value:this.value,key:this.key,mode:this.mode})},G.pop=function(){var t=this.value,e=this.stack.pop();this.value=e.value,this.key=e.key,this.mode=e.mode,this.emit(t),this.mode||(this.state=H)},G.emit=function(t){this.mode&&(this.state=f),this.onValue(t)},G.onValue=function(){},G.onToken=function(t,e){this.state===H?t===p||t===g||t===c||t===l||t===d?(this.value&&(this.value[this.key]=e),this.emit(e)):t===o?(this.push(),this.value=this.value?this.value[this.key]={}:{},this.key=void 0,this.state=P,this.mode=z):t===a?(this.push(),this.value=this.value?this.value[this.key]=[]:[],this.key=0,this.mode=W,this.state=H):t===s?this.mode===z?this.pop():this.parseError(t,e):t===h?this.mode===W?this.pop():this.parseError(t,e):this.parseError(t,e):this.state===P?t===p?(this.key=e,this.state=u):t===s?this.pop():this.parseError(t,e):this.state===u?t===u?this.state=H:this.parseError(t,e):this.state===f?t===f?this.mode===W?(this.key++,this.state=H):this.mode===z&&(this.state=P):t===h&&this.mode===W||t===s&&this.mode===z?this.pop():this.parseError(t,e):this.parseError(t,e)},e.exports=r}).call(this,t("buffer").Buffer)},{buffer:2}],31:[function(t,e){(function(n,r){function i(t,e){var n=Array.prototype.slice.call(arguments,2);return function(){var r=n.concat(Array.prototype.slice.call(arguments));return e.apply(t,r)}}function o(t,e,r,o){"object"==typeof t&&(r=e,e=t,t=void 0),"function"==typeof e&&(r=e,e=void 0),e||(e={}),void 0!==t&&(e.uri=t),o&&(e.method=o.method);var a=new s(e),h=a.duplex&&f();h&&h.pause();var u=f(),l=a.duplex?c(h,u):u;a.duplex||(u.writable=!1),l.request=a,l.setHeader=i(a,a.setHeader),l.setLocation=i(a,a.setLocation);var d=!1;return l.on("close",function(){d=!0}),n.nextTick(function(){if(!d){l.on("close",function(){t.destroy()});var t=a._send();t.on("error",i(l,l.emit,"error")),t.on("response",function(t){l.response=t,l.emit("response",t),a.duplex?t.pipe(u):(t.on("data",function(t){u.queue(t)}),t.on("end",function(){u.queue(null)}))}),a.duplex?(h.pipe(t),h.resume()):t.end()}}),r&&(l.on("error",r),l.on("response",i(l,r,null))),l}function s(t){this.headers=t.headers||{};var e=(t.method||"GET").toUpperCase();this.method=e,this.duplex=!("GET"===e||"DELETE"===e||"HEAD"===e),this.auth=t.auth,this.options=t,t.uri&&this.setLocation(t.uri)}var a=t("url"),h=t("http"),u=t("https"),f=t("through"),c=t("duplexer");e.exports=o,o.get=o,o.post=function(t,e,n){return o(t,e,n,{method:"POST"})},o.put=function(t,e,n){return o(t,e,n,{method:"PUT"})},o["delete"]=function(t,e,n){return o(t,e,n,{method:"DELETE"})},s.prototype._send=function(){this._sent=!0;var t=this.headers||{},e=a.parse(this.uri),n=e.auth||this.auth;n&&(t.authorization="Basic "+r(n).toString("base64"));var i=e.protocol||"",o="https:"===i?u:h,s={scheme:i.replace(/:$/,""),method:this.method,host:e.hostname,port:Number(e.port)||("https:"===i?443:80),path:e.path,agent:!1,headers:t,withCredentials:this.options.withCredentials};"https:"===i&&(s.pfx=this.options.pfx,s.key=this.options.key,s.cert=this.options.cert,s.ca=this.options.ca,s.ciphers=this.options.ciphers,s.rejectUnauthorized=this.options.rejectUnauthorized,s.secureProtocol=this.options.secureProtocol);var f=o.request(s);return f.setTimeout&&f.setTimeout(1e3*Math.pow(2,32)),f},s.prototype.setHeader=function(t,e){if(this._sent)throw new Error("request already sent");return this.headers[t]=e,this},s.prototype.setLocation=function(t){return this.uri=t,this}}).call(this,t("/Users/tmcw/src/leaflet-geojson-stream/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js"),t("buffer").Buffer)},{"/Users/tmcw/src/leaflet-geojson-stream/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":12,buffer:2,duplexer:32,http:6,https:10,through:33,url:25}],32:[function(t,e){function n(t,e){if(t.forEach)return t.forEach(e);for(var n=0;n leafletgeojsonstream.js && uglifyjs leafletgeojsonstream.js -c -m > leafletgeojsonstream.min.js" 9 | }, 10 | "repository": { 11 | "type": "git", 12 | "url": "git://github.com/tmcw/leaflet-geojson-stream.git" 13 | }, 14 | "keywords": [ 15 | "leaflet", 16 | "stream", 17 | "ajax", 18 | "geojson" 19 | ], 20 | "author": "Tom MacWright", 21 | "license": "BSD-2-Clause", 22 | "bugs": { 23 | "url": "https://github.com/tmcw/leaflet-geojson-stream/issues" 24 | }, 25 | "dependencies": { 26 | "hyperquest": "~0.3.0", 27 | "geojson-stream": "0.0.0", 28 | "through": "~2.3.4" 29 | }, 30 | "devDependencies": { 31 | "browserify": "~3.44.2", 32 | "express": "~3.4.1", 33 | "leaflet": "~0.7.2", 34 | "uglifyjs": "~2.3.6" 35 | } 36 | } 37 | --------------------------------------------------------------------------------