mapbox-gl-rails 0.51.0 → 0.52.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 69f885e74fcf239c674f0cabfdee2d09f90a847f
4
- data.tar.gz: 6870cef92eeb3251d7e9616d7f184614e8bb10a1
2
+ SHA256:
3
+ metadata.gz: bb2f107867c2885b4c9c9d6cf11876ef841ac4bbc665426cd93e8b4b822df320
4
+ data.tar.gz: dc86e1e4dbf11c98d6bba9af5ae68aa78d9a502723159aee9a0dc35a55f95889
5
5
  SHA512:
6
- metadata.gz: ac1a488595afa4283b5824232e34b142be911c7f2b68742ecf59d75981caf0eddb7ee986a598f4122a47559cb712af1d39b0fa7805dd9841cc584e5019f76df9
7
- data.tar.gz: 19cb0c06206ae41eaf8ad3098b168166007034d488d0c7295be6069238362137fffbbe2dd7a21aa838024ffffeba19e69d9e7d2e39f4e9dd09e3694ac026aa10
6
+ metadata.gz: 49bcbca94e60b4ca4f4786b2104145f08f6b9f302f849a04db551c37b73da6943bf1cb3b9bd3377cc05fefef526b6f442167933e1f0f5ac030aa8546ad8d9402
7
+ data.tar.gz: 49c9a80af16b3444050127edf33fe41eff069f2482b97e67221eb7dc707feb94716c7e9142d29db007ad1a4b46a61614c32e41cb74a8570c60b43d06abfec1c5
@@ -1,4 +1,74 @@
1
1
  (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.MapboxDirections = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
2
+ 'use strict';
3
+ var isObj = require('is-obj');
4
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
5
+ var propIsEnumerable = Object.prototype.propertyIsEnumerable;
6
+
7
+ function toObject(val) {
8
+ if (val === null || val === undefined) {
9
+ throw new TypeError('Sources cannot be null or undefined');
10
+ }
11
+
12
+ return Object(val);
13
+ }
14
+
15
+ function assignKey(to, from, key) {
16
+ var val = from[key];
17
+
18
+ if (val === undefined || val === null) {
19
+ return;
20
+ }
21
+
22
+ if (hasOwnProperty.call(to, key)) {
23
+ if (to[key] === undefined || to[key] === null) {
24
+ throw new TypeError('Cannot convert undefined or null to object (' + key + ')');
25
+ }
26
+ }
27
+
28
+ if (!hasOwnProperty.call(to, key) || !isObj(val)) {
29
+ to[key] = val;
30
+ } else {
31
+ to[key] = assign(Object(to[key]), from[key]);
32
+ }
33
+ }
34
+
35
+ function assign(to, from) {
36
+ if (to === from) {
37
+ return to;
38
+ }
39
+
40
+ from = Object(from);
41
+
42
+ for (var key in from) {
43
+ if (hasOwnProperty.call(from, key)) {
44
+ assignKey(to, from, key);
45
+ }
46
+ }
47
+
48
+ if (Object.getOwnPropertySymbols) {
49
+ var symbols = Object.getOwnPropertySymbols(from);
50
+
51
+ for (var i = 0; i < symbols.length; i++) {
52
+ if (propIsEnumerable.call(from, symbols[i])) {
53
+ assignKey(to, from, symbols[i]);
54
+ }
55
+ }
56
+ }
57
+
58
+ return to;
59
+ }
60
+
61
+ module.exports = function deepAssign(target) {
62
+ target = toObject(target);
63
+
64
+ for (var s = 1; s < arguments.length; s++) {
65
+ assign(target, arguments[s]);
66
+ }
67
+
68
+ return target;
69
+ };
70
+
71
+ },{"is-obj":4}],2:[function(require,module,exports){
2
72
  // Copyright Joyent, Inc. and other Node contributors.
3
73
  //
4
74
  // Permission is hereby granted, free of charge, to any person obtaining a
@@ -302,89 +372,180 @@ function isUndefined(arg) {
302
372
  return arg === void 0;
303
373
  }
304
374
 
305
- },{}],2:[function(require,module,exports){
306
- 'use strict';
307
- var isObj = require('is-obj');
308
- var hasOwnProperty = Object.prototype.hasOwnProperty;
309
- var propIsEnumerable = Object.prototype.propertyIsEnumerable;
375
+ },{}],3:[function(require,module,exports){
376
+ /*
377
+ * Fuzzy
378
+ * https://github.com/myork/fuzzy
379
+ *
380
+ * Copyright (c) 2012 Matt York
381
+ * Licensed under the MIT license.
382
+ */
310
383
 
311
- function toObject(val) {
312
- if (val === null || val === undefined) {
313
- throw new TypeError('Sources cannot be null or undefined');
314
- }
384
+ (function() {
315
385
 
316
- return Object(val);
386
+ var root = this;
387
+
388
+ var fuzzy = {};
389
+
390
+ // Use in node or in browser
391
+ if (typeof exports !== 'undefined') {
392
+ module.exports = fuzzy;
393
+ } else {
394
+ root.fuzzy = fuzzy;
317
395
  }
318
396
 
319
- function assignKey(to, from, key) {
320
- var val = from[key];
397
+ // Return all elements of `array` that have a fuzzy
398
+ // match against `pattern`.
399
+ fuzzy.simpleFilter = function(pattern, array) {
400
+ return array.filter(function(str) {
401
+ return fuzzy.test(pattern, str);
402
+ });
403
+ };
321
404
 
322
- if (val === undefined || val === null) {
323
- return;
324
- }
405
+ // Does `pattern` fuzzy match `str`?
406
+ fuzzy.test = function(pattern, str) {
407
+ return fuzzy.match(pattern, str) !== null;
408
+ };
325
409
 
326
- if (hasOwnProperty.call(to, key)) {
327
- if (to[key] === undefined || to[key] === null) {
328
- throw new TypeError('Cannot convert undefined or null to object (' + key + ')');
329
- }
330
- }
410
+ // If `pattern` matches `str`, wrap each matching character
411
+ // in `opts.pre` and `opts.post`. If no match, return null
412
+ fuzzy.match = function(pattern, str, opts) {
413
+ opts = opts || {};
414
+ var patternIdx = 0
415
+ , result = []
416
+ , len = str.length
417
+ , totalScore = 0
418
+ , currScore = 0
419
+ // prefix
420
+ , pre = opts.pre || ''
421
+ // suffix
422
+ , post = opts.post || ''
423
+ // String to compare against. This might be a lowercase version of the
424
+ // raw string
425
+ , compareString = opts.caseSensitive && str || str.toLowerCase()
426
+ , ch;
331
427
 
332
- if (!hasOwnProperty.call(to, key) || !isObj(val)) {
333
- to[key] = val;
334
- } else {
335
- to[key] = assign(Object(to[key]), from[key]);
336
- }
337
- }
428
+ pattern = opts.caseSensitive && pattern || pattern.toLowerCase();
338
429
 
339
- function assign(to, from) {
340
- if (to === from) {
341
- return to;
342
- }
430
+ // For each character in the string, either add it to the result
431
+ // or wrap in template if it's the next string in the pattern
432
+ for(var idx = 0; idx < len; idx++) {
433
+ ch = str[idx];
434
+ if(compareString[idx] === pattern[patternIdx]) {
435
+ ch = pre + ch + post;
436
+ patternIdx += 1;
343
437
 
344
- from = Object(from);
438
+ // consecutive characters should increase the score more than linearly
439
+ currScore += 1 + currScore;
440
+ } else {
441
+ currScore = 0;
442
+ }
443
+ totalScore += currScore;
444
+ result[result.length] = ch;
445
+ }
345
446
 
346
- for (var key in from) {
347
- if (hasOwnProperty.call(from, key)) {
348
- assignKey(to, from, key);
349
- }
350
- }
447
+ // return rendered string if we have a match for every char
448
+ if(patternIdx === pattern.length) {
449
+ // if the string is an exact match with pattern, totalScore should be maxed
450
+ totalScore = (compareString === pattern) ? Infinity : totalScore;
451
+ return {rendered: result.join(''), score: totalScore};
452
+ }
351
453
 
352
- if (Object.getOwnPropertySymbols) {
353
- var symbols = Object.getOwnPropertySymbols(from);
454
+ return null;
455
+ };
354
456
 
355
- for (var i = 0; i < symbols.length; i++) {
356
- if (propIsEnumerable.call(from, symbols[i])) {
357
- assignKey(to, from, symbols[i]);
358
- }
359
- }
360
- }
457
+ // The normal entry point. Filters `arr` for matches against `pattern`.
458
+ // It returns an array with matching values of the type:
459
+ //
460
+ // [{
461
+ // string: '<b>lah' // The rendered string
462
+ // , index: 2 // The index of the element in `arr`
463
+ // , original: 'blah' // The original element in `arr`
464
+ // }]
465
+ //
466
+ // `opts` is an optional argument bag. Details:
467
+ //
468
+ // opts = {
469
+ // // string to put before a matching character
470
+ // pre: '<b>'
471
+ //
472
+ // // string to put after matching character
473
+ // , post: '</b>'
474
+ //
475
+ // // Optional function. Input is an entry in the given arr`,
476
+ // // output should be the string to test `pattern` against.
477
+ // // In this example, if `arr = [{crying: 'koala'}]` we would return
478
+ // // 'koala'.
479
+ // , extract: function(arg) { return arg.crying; }
480
+ // }
481
+ fuzzy.filter = function(pattern, arr, opts) {
482
+ if(!arr || arr.length === 0) {
483
+ return [];
484
+ }
485
+ if (typeof pattern !== 'string') {
486
+ return arr;
487
+ }
488
+ opts = opts || {};
489
+ return arr
490
+ .reduce(function(prev, element, idx, arr) {
491
+ var str = element;
492
+ if(opts.extract) {
493
+ str = opts.extract(element);
494
+ }
495
+ var rendered = fuzzy.match(pattern, str, opts);
496
+ if(rendered != null) {
497
+ prev[prev.length] = {
498
+ string: rendered.rendered
499
+ , score: rendered.score
500
+ , index: idx
501
+ , original: element
502
+ };
503
+ }
504
+ return prev;
505
+ }, [])
361
506
 
362
- return to;
363
- }
507
+ // Sort by score. Browsers are inconsistent wrt stable/unstable
508
+ // sorting, so force stable by using the index in the case of tie.
509
+ // See http://ofb.net/~sethml/is-sort-stable.html
510
+ .sort(function(a,b) {
511
+ var compare = b.score - a.score;
512
+ if(compare) return compare;
513
+ return a.index - b.index;
514
+ });
515
+ };
364
516
 
365
- module.exports = function deepAssign(target) {
366
- target = toObject(target);
367
517
 
368
- for (var s = 1; s < arguments.length; s++) {
369
- assign(target, arguments[s]);
370
- }
518
+ }());
371
519
 
372
- return target;
373
- };
374
520
 
375
- },{"is-obj":3}],3:[function(require,module,exports){
521
+ },{}],4:[function(require,module,exports){
376
522
  'use strict';
377
523
  module.exports = function (x) {
378
524
  var type = typeof x;
379
525
  return x !== null && (type === 'object' || type === 'function');
380
526
  };
381
527
 
382
- },{}],4:[function(require,module,exports){
383
- (function (global){
528
+ },{}],5:[function(require,module,exports){
384
529
  /**
385
- * lodash (Custom Build) <https://lodash.com/>
386
- * Build: `lodash modularize exports="npm" -o ./`
387
- * Copyright jQuery Foundation and other contributors <https://jquery.org/>
530
+ * lodash 3.0.0 (Custom Build) <https://lodash.com/>
531
+ * Build: `lodash modern modularize exports="npm" -o ./`
532
+ * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
533
+ * Based on Underscore.js 1.7.0 <http://underscorejs.org/LICENSE>
534
+ * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
535
+ * Available under MIT license <https://lodash.com/license>
536
+ */
537
+
538
+ /** Used to match template delimiters. */
539
+ var reInterpolate = /<%=([\s\S]+?)%>/g;
540
+
541
+ module.exports = reInterpolate;
542
+
543
+ },{}],6:[function(require,module,exports){
544
+ (function (global){
545
+ /**
546
+ * lodash (Custom Build) <https://lodash.com/>
547
+ * Build: `lodash modularize exports="npm" -o ./`
548
+ * Copyright jQuery Foundation and other contributors <https://jquery.org/>
388
549
  * Released under MIT license <https://lodash.com/license>
389
550
  * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
390
551
  * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
@@ -760,7 +921,7 @@ function toNumber(value) {
760
921
  module.exports = debounce;
761
922
 
762
923
  }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
763
- },{}],5:[function(require,module,exports){
924
+ },{}],7:[function(require,module,exports){
764
925
  (function (global){
765
926
  /**
766
927
  * Lodash (Custom Build) <https://lodash.com/>
@@ -2612,7 +2773,7 @@ function stubFalse() {
2612
2773
  module.exports = isEqual;
2613
2774
 
2614
2775
  }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
2615
- },{}],6:[function(require,module,exports){
2776
+ },{}],8:[function(require,module,exports){
2616
2777
  (function (global){
2617
2778
  /**
2618
2779
  * lodash (Custom Build) <https://lodash.com/>
@@ -3748,22 +3909,7 @@ var attempt = baseRest(function(func, args) {
3748
3909
  module.exports = template;
3749
3910
 
3750
3911
  }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
3751
- },{"lodash._reinterpolate":7,"lodash.templatesettings":8}],7:[function(require,module,exports){
3752
- /**
3753
- * lodash 3.0.0 (Custom Build) <https://lodash.com/>
3754
- * Build: `lodash modern modularize exports="npm" -o ./`
3755
- * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
3756
- * Based on Underscore.js 1.7.0 <http://underscorejs.org/LICENSE>
3757
- * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
3758
- * Available under MIT license <https://lodash.com/license>
3759
- */
3760
-
3761
- /** Used to match template delimiters. */
3762
- var reInterpolate = /<%=([\s\S]+?)%>/g;
3763
-
3764
- module.exports = reInterpolate;
3765
-
3766
- },{}],8:[function(require,module,exports){
3912
+ },{"lodash._reinterpolate":5,"lodash.templatesettings":9}],9:[function(require,module,exports){
3767
3913
  (function (global){
3768
3914
  /**
3769
3915
  * lodash (Custom Build) <https://lodash.com/>
@@ -4047,497 +4193,934 @@ function escape(string) {
4047
4193
  module.exports = templateSettings;
4048
4194
 
4049
4195
  }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
4050
- },{"lodash._reinterpolate":7}],9:[function(require,module,exports){
4051
- 'use strict';
4196
+ },{"lodash._reinterpolate":5}],10:[function(require,module,exports){
4197
+ var root = require('./_root');
4052
4198
 
4053
- /**
4054
- * Based off of [the offical Google document](https://developers.google.com/maps/documentation/utilities/polylinealgorithm)
4055
- *
4056
- * Some parts from [this implementation](http://facstaff.unca.edu/mcmcclur/GoogleMaps/EncodePolyline/PolylineEncoder.js)
4057
- * by [Mark McClure](http://facstaff.unca.edu/mcmcclur/)
4058
- *
4059
- * @module polyline
4060
- */
4199
+ /** Built-in value references. */
4200
+ var Symbol = root.Symbol;
4061
4201
 
4062
- var polyline = {};
4202
+ module.exports = Symbol;
4063
4203
 
4064
- function encode(coordinate, factor) {
4065
- coordinate = Math.round(coordinate * factor);
4066
- coordinate <<= 1;
4067
- if (coordinate < 0) {
4068
- coordinate = ~coordinate;
4069
- }
4070
- var output = '';
4071
- while (coordinate >= 0x20) {
4072
- output += String.fromCharCode((0x20 | (coordinate & 0x1f)) + 63);
4073
- coordinate >>= 5;
4074
- }
4075
- output += String.fromCharCode(coordinate + 63);
4076
- return output;
4077
- }
4204
+ },{"./_root":17}],11:[function(require,module,exports){
4205
+ var Symbol = require('./_Symbol'),
4206
+ getRawTag = require('./_getRawTag'),
4207
+ objectToString = require('./_objectToString');
4208
+
4209
+ /** `Object#toString` result references. */
4210
+ var nullTag = '[object Null]',
4211
+ undefinedTag = '[object Undefined]';
4212
+
4213
+ /** Built-in value references. */
4214
+ var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
4078
4215
 
4079
4216
  /**
4080
- * Decodes to a [latitude, longitude] coordinates array.
4081
- *
4082
- * This is adapted from the implementation in Project-OSRM.
4083
- *
4084
- * @param {String} str
4085
- * @param {Number} precision
4086
- * @returns {Array}
4217
+ * The base implementation of `getTag` without fallbacks for buggy environments.
4087
4218
  *
4088
- * @see https://github.com/Project-OSRM/osrm-frontend/blob/master/WebContent/routing/OSRM.RoutingGeometry.js
4219
+ * @private
4220
+ * @param {*} value The value to query.
4221
+ * @returns {string} Returns the `toStringTag`.
4089
4222
  */
4090
- polyline.decode = function(str, precision) {
4091
- var index = 0,
4092
- lat = 0,
4093
- lng = 0,
4094
- coordinates = [],
4095
- shift = 0,
4096
- result = 0,
4097
- byte = null,
4098
- latitude_change,
4099
- longitude_change,
4100
- factor = Math.pow(10, precision || 5);
4223
+ function baseGetTag(value) {
4224
+ if (value == null) {
4225
+ return value === undefined ? undefinedTag : nullTag;
4226
+ }
4227
+ return (symToStringTag && symToStringTag in Object(value))
4228
+ ? getRawTag(value)
4229
+ : objectToString(value);
4230
+ }
4101
4231
 
4102
- // Coordinates have variable length when encoded, so just keep
4103
- // track of whether we've hit the end of the string. In each
4104
- // loop iteration, a single coordinate is decoded.
4105
- while (index < str.length) {
4232
+ module.exports = baseGetTag;
4106
4233
 
4107
- // Reset shift, result, and byte
4108
- byte = null;
4109
- shift = 0;
4110
- result = 0;
4234
+ },{"./_Symbol":10,"./_getRawTag":14,"./_objectToString":15}],12:[function(require,module,exports){
4235
+ (function (global){
4236
+ /** Detect free variable `global` from Node.js. */
4237
+ var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
4111
4238
 
4112
- do {
4113
- byte = str.charCodeAt(index++) - 63;
4114
- result |= (byte & 0x1f) << shift;
4115
- shift += 5;
4116
- } while (byte >= 0x20);
4239
+ module.exports = freeGlobal;
4117
4240
 
4118
- latitude_change = ((result & 1) ? ~(result >> 1) : (result >> 1));
4241
+ }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
4242
+ },{}],13:[function(require,module,exports){
4243
+ var overArg = require('./_overArg');
4119
4244
 
4120
- shift = result = 0;
4245
+ /** Built-in value references. */
4246
+ var getPrototype = overArg(Object.getPrototypeOf, Object);
4121
4247
 
4122
- do {
4123
- byte = str.charCodeAt(index++) - 63;
4124
- result |= (byte & 0x1f) << shift;
4125
- shift += 5;
4126
- } while (byte >= 0x20);
4248
+ module.exports = getPrototype;
4127
4249
 
4128
- longitude_change = ((result & 1) ? ~(result >> 1) : (result >> 1));
4250
+ },{"./_overArg":16}],14:[function(require,module,exports){
4251
+ var Symbol = require('./_Symbol');
4129
4252
 
4130
- lat += latitude_change;
4131
- lng += longitude_change;
4253
+ /** Used for built-in method references. */
4254
+ var objectProto = Object.prototype;
4132
4255
 
4133
- coordinates.push([lat / factor, lng / factor]);
4134
- }
4256
+ /** Used to check objects for own properties. */
4257
+ var hasOwnProperty = objectProto.hasOwnProperty;
4135
4258
 
4136
- return coordinates;
4137
- };
4259
+ /**
4260
+ * Used to resolve the
4261
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
4262
+ * of values.
4263
+ */
4264
+ var nativeObjectToString = objectProto.toString;
4265
+
4266
+ /** Built-in value references. */
4267
+ var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
4138
4268
 
4139
4269
  /**
4140
- * Encodes the given [latitude, longitude] coordinates array.
4270
+ * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
4141
4271
  *
4142
- * @param {Array.<Array.<Number>>} coordinates
4143
- * @param {Number} precision
4144
- * @returns {String}
4272
+ * @private
4273
+ * @param {*} value The value to query.
4274
+ * @returns {string} Returns the raw `toStringTag`.
4145
4275
  */
4146
- polyline.encode = function(coordinates, precision) {
4147
- if (!coordinates.length) { return ''; }
4276
+ function getRawTag(value) {
4277
+ var isOwn = hasOwnProperty.call(value, symToStringTag),
4278
+ tag = value[symToStringTag];
4148
4279
 
4149
- var factor = Math.pow(10, precision || 5),
4150
- output = encode(coordinates[0][0], factor) + encode(coordinates[0][1], factor);
4280
+ try {
4281
+ value[symToStringTag] = undefined;
4282
+ var unmasked = true;
4283
+ } catch (e) {}
4151
4284
 
4152
- for (var i = 1; i < coordinates.length; i++) {
4153
- var a = coordinates[i], b = coordinates[i - 1];
4154
- output += encode(a[0] - b[0], factor);
4155
- output += encode(a[1] - b[1], factor);
4285
+ var result = nativeObjectToString.call(value);
4286
+ if (unmasked) {
4287
+ if (isOwn) {
4288
+ value[symToStringTag] = tag;
4289
+ } else {
4290
+ delete value[symToStringTag];
4156
4291
  }
4292
+ }
4293
+ return result;
4294
+ }
4157
4295
 
4158
- return output;
4159
- };
4296
+ module.exports = getRawTag;
4160
4297
 
4161
- function flipped(coords) {
4162
- var flipped = [];
4163
- for (var i = 0; i < coords.length; i++) {
4164
- flipped.push(coords[i].slice().reverse());
4165
- }
4166
- return flipped;
4167
- }
4298
+ },{"./_Symbol":10}],15:[function(require,module,exports){
4299
+ /** Used for built-in method references. */
4300
+ var objectProto = Object.prototype;
4168
4301
 
4169
4302
  /**
4170
- * Encodes a GeoJSON LineString feature/geometry.
4171
- *
4172
- * @param {Object} geojson
4173
- * @param {Number} precision
4174
- * @returns {String}
4303
+ * Used to resolve the
4304
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
4305
+ * of values.
4175
4306
  */
4176
- polyline.fromGeoJSON = function(geojson, precision) {
4177
- if (geojson && geojson.type === 'Feature') {
4178
- geojson = geojson.geometry;
4179
- }
4180
- if (!geojson || geojson.type !== 'LineString') {
4181
- throw new Error('Input must be a GeoJSON LineString');
4182
- }
4183
- return polyline.encode(flipped(geojson.coordinates), precision);
4184
- };
4307
+ var nativeObjectToString = objectProto.toString;
4185
4308
 
4186
4309
  /**
4187
- * Decodes to a GeoJSON LineString geometry.
4310
+ * Converts `value` to a string using `Object.prototype.toString`.
4188
4311
  *
4189
- * @param {String} str
4190
- * @param {Number} precision
4191
- * @returns {Object}
4312
+ * @private
4313
+ * @param {*} value The value to convert.
4314
+ * @returns {string} Returns the converted string.
4192
4315
  */
4193
- polyline.toGeoJSON = function(str, precision) {
4194
- var coords = polyline.decode(str, precision);
4195
- return {
4196
- type: 'LineString',
4197
- coordinates: flipped(coords)
4198
- };
4199
- };
4316
+ function objectToString(value) {
4317
+ return nativeObjectToString.call(value);
4318
+ }
4200
4319
 
4201
- if (typeof module === 'object' && module.exports) {
4202
- module.exports = polyline;
4320
+ module.exports = objectToString;
4321
+
4322
+ },{}],16:[function(require,module,exports){
4323
+ /**
4324
+ * Creates a unary function that invokes `func` with its argument transformed.
4325
+ *
4326
+ * @private
4327
+ * @param {Function} func The function to wrap.
4328
+ * @param {Function} transform The argument transform.
4329
+ * @returns {Function} Returns the new function.
4330
+ */
4331
+ function overArg(func, transform) {
4332
+ return function(arg) {
4333
+ return func(transform(arg));
4334
+ };
4203
4335
  }
4204
4336
 
4205
- },{}],10:[function(require,module,exports){
4206
- 'use strict';
4337
+ module.exports = overArg;
4207
4338
 
4208
- exports.__esModule = true;
4209
- function createThunkMiddleware(extraArgument) {
4210
- return function (_ref) {
4211
- var dispatch = _ref.dispatch,
4212
- getState = _ref.getState;
4213
- return function (next) {
4214
- return function (action) {
4215
- if (typeof action === 'function') {
4216
- return action(dispatch, getState, extraArgument);
4217
- }
4339
+ },{}],17:[function(require,module,exports){
4340
+ var freeGlobal = require('./_freeGlobal');
4218
4341
 
4219
- return next(action);
4220
- };
4221
- };
4222
- };
4223
- }
4342
+ /** Detect free variable `self`. */
4343
+ var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
4224
4344
 
4225
- var thunk = createThunkMiddleware();
4226
- thunk.withExtraArgument = createThunkMiddleware;
4345
+ /** Used as a reference to the global object. */
4346
+ var root = freeGlobal || freeSelf || Function('return this')();
4227
4347
 
4228
- exports['default'] = thunk;
4229
- },{}],11:[function(require,module,exports){
4230
- 'use strict';
4348
+ module.exports = root;
4231
4349
 
4232
- exports.__esModule = true;
4350
+ },{"./_freeGlobal":12}],18:[function(require,module,exports){
4351
+ /**
4352
+ * Checks if `value` is object-like. A value is object-like if it's not `null`
4353
+ * and has a `typeof` result of "object".
4354
+ *
4355
+ * @static
4356
+ * @memberOf _
4357
+ * @since 4.0.0
4358
+ * @category Lang
4359
+ * @param {*} value The value to check.
4360
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
4361
+ * @example
4362
+ *
4363
+ * _.isObjectLike({});
4364
+ * // => true
4365
+ *
4366
+ * _.isObjectLike([1, 2, 3]);
4367
+ * // => true
4368
+ *
4369
+ * _.isObjectLike(_.noop);
4370
+ * // => false
4371
+ *
4372
+ * _.isObjectLike(null);
4373
+ * // => false
4374
+ */
4375
+ function isObjectLike(value) {
4376
+ return value != null && typeof value == 'object';
4377
+ }
4233
4378
 
4234
- var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
4379
+ module.exports = isObjectLike;
4235
4380
 
4236
- exports['default'] = applyMiddleware;
4381
+ },{}],19:[function(require,module,exports){
4382
+ var baseGetTag = require('./_baseGetTag'),
4383
+ getPrototype = require('./_getPrototype'),
4384
+ isObjectLike = require('./isObjectLike');
4237
4385
 
4238
- var _compose = require('./compose');
4386
+ /** `Object#toString` result references. */
4387
+ var objectTag = '[object Object]';
4239
4388
 
4240
- var _compose2 = _interopRequireDefault(_compose);
4389
+ /** Used for built-in method references. */
4390
+ var funcProto = Function.prototype,
4391
+ objectProto = Object.prototype;
4241
4392
 
4242
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
4393
+ /** Used to resolve the decompiled source of functions. */
4394
+ var funcToString = funcProto.toString;
4395
+
4396
+ /** Used to check objects for own properties. */
4397
+ var hasOwnProperty = objectProto.hasOwnProperty;
4398
+
4399
+ /** Used to infer the `Object` constructor. */
4400
+ var objectCtorString = funcToString.call(Object);
4243
4401
 
4244
4402
  /**
4245
- * Creates a store enhancer that applies middleware to the dispatch method
4246
- * of the Redux store. This is handy for a variety of tasks, such as expressing
4247
- * asynchronous actions in a concise manner, or logging every action payload.
4403
+ * Checks if `value` is a plain object, that is, an object created by the
4404
+ * `Object` constructor or one with a `[[Prototype]]` of `null`.
4248
4405
  *
4249
- * See `redux-thunk` package as an example of the Redux middleware.
4406
+ * @static
4407
+ * @memberOf _
4408
+ * @since 0.8.0
4409
+ * @category Lang
4410
+ * @param {*} value The value to check.
4411
+ * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
4412
+ * @example
4250
4413
  *
4251
- * Because middleware is potentially asynchronous, this should be the first
4252
- * store enhancer in the composition chain.
4414
+ * function Foo() {
4415
+ * this.a = 1;
4416
+ * }
4253
4417
  *
4254
- * Note that each middleware will be given the `dispatch` and `getState` functions
4255
- * as named arguments.
4418
+ * _.isPlainObject(new Foo);
4419
+ * // => false
4256
4420
  *
4257
- * @param {...Function} middlewares The middleware chain to be applied.
4258
- * @returns {Function} A store enhancer applying the middleware.
4421
+ * _.isPlainObject([1, 2, 3]);
4422
+ * // => false
4423
+ *
4424
+ * _.isPlainObject({ 'x': 0, 'y': 0 });
4425
+ * // => true
4426
+ *
4427
+ * _.isPlainObject(Object.create(null));
4428
+ * // => true
4259
4429
  */
4260
- function applyMiddleware() {
4261
- for (var _len = arguments.length, middlewares = Array(_len), _key = 0; _key < _len; _key++) {
4262
- middlewares[_key] = arguments[_key];
4430
+ function isPlainObject(value) {
4431
+ if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
4432
+ return false;
4263
4433
  }
4434
+ var proto = getPrototype(value);
4435
+ if (proto === null) {
4436
+ return true;
4437
+ }
4438
+ var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
4439
+ return typeof Ctor == 'function' && Ctor instanceof Ctor &&
4440
+ funcToString.call(Ctor) == objectCtorString;
4441
+ }
4264
4442
 
4265
- return function (createStore) {
4266
- return function (reducer, preloadedState, enhancer) {
4267
- var store = createStore(reducer, preloadedState, enhancer);
4268
- var _dispatch = store.dispatch;
4269
- var chain = [];
4270
-
4271
- var middlewareAPI = {
4272
- getState: store.getState,
4273
- dispatch: function dispatch(action) {
4274
- return _dispatch(action);
4275
- }
4276
- };
4277
- chain = middlewares.map(function (middleware) {
4278
- return middleware(middlewareAPI);
4279
- });
4280
- _dispatch = _compose2['default'].apply(undefined, chain)(store.dispatch);
4443
+ module.exports = isPlainObject;
4281
4444
 
4282
- return _extends({}, store, {
4283
- dispatch: _dispatch
4284
- });
4285
- };
4286
- };
4287
- }
4288
- },{"./compose":14}],12:[function(require,module,exports){
4445
+ },{"./_baseGetTag":11,"./_getPrototype":13,"./isObjectLike":18}],20:[function(require,module,exports){
4289
4446
  'use strict';
4290
4447
 
4291
- exports.__esModule = true;
4292
- exports['default'] = bindActionCreators;
4293
- function bindActionCreator(actionCreator, dispatch) {
4294
- return function () {
4295
- return dispatch(actionCreator.apply(undefined, arguments));
4296
- };
4297
- }
4298
-
4299
4448
  /**
4300
- * Turns an object whose values are action creators, into an object with the
4301
- * same keys, but with every function wrapped into a `dispatch` call so they
4302
- * may be invoked directly. This is just a convenience method, as you can call
4303
- * `store.dispatch(MyActionCreators.doSomething())` yourself just fine.
4304
- *
4305
- * For convenience, you can also pass a single function as the first argument,
4306
- * and get a function in return.
4307
- *
4308
- * @param {Function|Object} actionCreators An object whose values are action
4309
- * creator functions. One handy way to obtain it is to use ES6 `import * as`
4310
- * syntax. You may also pass a single function.
4449
+ * Based off of [the offical Google document](https://developers.google.com/maps/documentation/utilities/polylinealgorithm)
4311
4450
  *
4312
- * @param {Function} dispatch The `dispatch` function available on your Redux
4313
- * store.
4451
+ * Some parts from [this implementation](http://facstaff.unca.edu/mcmcclur/GoogleMaps/EncodePolyline/PolylineEncoder.js)
4452
+ * by [Mark McClure](http://facstaff.unca.edu/mcmcclur/)
4314
4453
  *
4315
- * @returns {Function|Object} The object mimicking the original object, but with
4316
- * every action creator wrapped into the `dispatch` call. If you passed a
4317
- * function as `actionCreators`, the return value will also be a single
4318
- * function.
4454
+ * @module polyline
4319
4455
  */
4320
- function bindActionCreators(actionCreators, dispatch) {
4321
- if (typeof actionCreators === 'function') {
4322
- return bindActionCreator(actionCreators, dispatch);
4323
- }
4324
4456
 
4325
- if (typeof actionCreators !== 'object' || actionCreators === null) {
4326
- throw new Error('bindActionCreators expected an object or a function, instead received ' + (actionCreators === null ? 'null' : typeof actionCreators) + '. ' + 'Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?');
4327
- }
4457
+ var polyline = {};
4328
4458
 
4329
- var keys = Object.keys(actionCreators);
4330
- var boundActionCreators = {};
4331
- for (var i = 0; i < keys.length; i++) {
4332
- var key = keys[i];
4333
- var actionCreator = actionCreators[key];
4334
- if (typeof actionCreator === 'function') {
4335
- boundActionCreators[key] = bindActionCreator(actionCreator, dispatch);
4459
+ function encode(coordinate, factor) {
4460
+ coordinate = Math.round(coordinate * factor);
4461
+ coordinate <<= 1;
4462
+ if (coordinate < 0) {
4463
+ coordinate = ~coordinate;
4336
4464
  }
4337
- }
4338
- return boundActionCreators;
4465
+ var output = '';
4466
+ while (coordinate >= 0x20) {
4467
+ output += String.fromCharCode((0x20 | (coordinate & 0x1f)) + 63);
4468
+ coordinate >>= 5;
4469
+ }
4470
+ output += String.fromCharCode(coordinate + 63);
4471
+ return output;
4339
4472
  }
4340
- },{}],13:[function(require,module,exports){
4341
- 'use strict';
4342
4473
 
4343
- exports.__esModule = true;
4344
- exports['default'] = combineReducers;
4474
+ /**
4475
+ * Decodes to a [latitude, longitude] coordinates array.
4476
+ *
4477
+ * This is adapted from the implementation in Project-OSRM.
4478
+ *
4479
+ * @param {String} str
4480
+ * @param {Number} precision
4481
+ * @returns {Array}
4482
+ *
4483
+ * @see https://github.com/Project-OSRM/osrm-frontend/blob/master/WebContent/routing/OSRM.RoutingGeometry.js
4484
+ */
4485
+ polyline.decode = function(str, precision) {
4486
+ var index = 0,
4487
+ lat = 0,
4488
+ lng = 0,
4489
+ coordinates = [],
4490
+ shift = 0,
4491
+ result = 0,
4492
+ byte = null,
4493
+ latitude_change,
4494
+ longitude_change,
4495
+ factor = Math.pow(10, precision || 5);
4345
4496
 
4346
- var _createStore = require('./createStore');
4497
+ // Coordinates have variable length when encoded, so just keep
4498
+ // track of whether we've hit the end of the string. In each
4499
+ // loop iteration, a single coordinate is decoded.
4500
+ while (index < str.length) {
4347
4501
 
4348
- var _isPlainObject = require('lodash/isPlainObject');
4502
+ // Reset shift, result, and byte
4503
+ byte = null;
4504
+ shift = 0;
4505
+ result = 0;
4349
4506
 
4350
- var _isPlainObject2 = _interopRequireDefault(_isPlainObject);
4507
+ do {
4508
+ byte = str.charCodeAt(index++) - 63;
4509
+ result |= (byte & 0x1f) << shift;
4510
+ shift += 5;
4511
+ } while (byte >= 0x20);
4351
4512
 
4352
- var _warning = require('./utils/warning');
4513
+ latitude_change = ((result & 1) ? ~(result >> 1) : (result >> 1));
4353
4514
 
4354
- var _warning2 = _interopRequireDefault(_warning);
4515
+ shift = result = 0;
4355
4516
 
4356
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
4517
+ do {
4518
+ byte = str.charCodeAt(index++) - 63;
4519
+ result |= (byte & 0x1f) << shift;
4520
+ shift += 5;
4521
+ } while (byte >= 0x20);
4357
4522
 
4358
- function getUndefinedStateErrorMessage(key, action) {
4359
- var actionType = action && action.type;
4360
- var actionName = actionType && '"' + actionType.toString() + '"' || 'an action';
4361
-
4362
- return 'Given action ' + actionName + ', reducer "' + key + '" returned undefined. ' + 'To ignore an action, you must explicitly return the previous state. ' + 'If you want this reducer to hold no value, you can return null instead of undefined.';
4363
- }
4364
-
4365
- function getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) {
4366
- var reducerKeys = Object.keys(reducers);
4367
- var argumentName = action && action.type === _createStore.ActionTypes.INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer';
4368
-
4369
- if (reducerKeys.length === 0) {
4370
- return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.';
4371
- }
4523
+ longitude_change = ((result & 1) ? ~(result >> 1) : (result >> 1));
4372
4524
 
4373
- if (!(0, _isPlainObject2['default'])(inputState)) {
4374
- return 'The ' + argumentName + ' has unexpected type of "' + {}.toString.call(inputState).match(/\s([a-z|A-Z]+)/)[1] + '". Expected argument to be an object with the following ' + ('keys: "' + reducerKeys.join('", "') + '"');
4375
- }
4525
+ lat += latitude_change;
4526
+ lng += longitude_change;
4376
4527
 
4377
- var unexpectedKeys = Object.keys(inputState).filter(function (key) {
4378
- return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key];
4379
- });
4528
+ coordinates.push([lat / factor, lng / factor]);
4529
+ }
4380
4530
 
4381
- unexpectedKeys.forEach(function (key) {
4382
- unexpectedKeyCache[key] = true;
4383
- });
4531
+ return coordinates;
4532
+ };
4384
4533
 
4385
- if (unexpectedKeys.length > 0) {
4386
- return 'Unexpected ' + (unexpectedKeys.length > 1 ? 'keys' : 'key') + ' ' + ('"' + unexpectedKeys.join('", "') + '" found in ' + argumentName + '. ') + 'Expected to find one of the known reducer keys instead: ' + ('"' + reducerKeys.join('", "') + '". Unexpected keys will be ignored.');
4387
- }
4388
- }
4534
+ /**
4535
+ * Encodes the given [latitude, longitude] coordinates array.
4536
+ *
4537
+ * @param {Array.<Array.<Number>>} coordinates
4538
+ * @param {Number} precision
4539
+ * @returns {String}
4540
+ */
4541
+ polyline.encode = function(coordinates, precision) {
4542
+ if (!coordinates.length) { return ''; }
4389
4543
 
4390
- function assertReducerShape(reducers) {
4391
- Object.keys(reducers).forEach(function (key) {
4392
- var reducer = reducers[key];
4393
- var initialState = reducer(undefined, { type: _createStore.ActionTypes.INIT });
4544
+ var factor = Math.pow(10, precision || 5),
4545
+ output = encode(coordinates[0][0], factor) + encode(coordinates[0][1], factor);
4394
4546
 
4395
- if (typeof initialState === 'undefined') {
4396
- throw new Error('Reducer "' + key + '" returned undefined during initialization. ' + 'If the state passed to the reducer is undefined, you must ' + 'explicitly return the initial state. The initial state may ' + 'not be undefined. If you don\'t want to set a value for this reducer, ' + 'you can use null instead of undefined.');
4547
+ for (var i = 1; i < coordinates.length; i++) {
4548
+ var a = coordinates[i], b = coordinates[i - 1];
4549
+ output += encode(a[0] - b[0], factor);
4550
+ output += encode(a[1] - b[1], factor);
4397
4551
  }
4398
4552
 
4399
- var type = '@@redux/PROBE_UNKNOWN_ACTION_' + Math.random().toString(36).substring(7).split('').join('.');
4400
- if (typeof reducer(undefined, { type: type }) === 'undefined') {
4401
- throw new Error('Reducer "' + key + '" returned undefined when probed with a random type. ' + ('Don\'t try to handle ' + _createStore.ActionTypes.INIT + ' or other actions in "redux/*" ') + 'namespace. They are considered private. Instead, you must return the ' + 'current state for any unknown actions, unless it is undefined, ' + 'in which case you must return the initial state, regardless of the ' + 'action type. The initial state may not be undefined, but can be null.');
4553
+ return output;
4554
+ };
4555
+
4556
+ function flipped(coords) {
4557
+ var flipped = [];
4558
+ for (var i = 0; i < coords.length; i++) {
4559
+ flipped.push(coords[i].slice().reverse());
4402
4560
  }
4403
- });
4561
+ return flipped;
4404
4562
  }
4405
4563
 
4406
4564
  /**
4407
- * Turns an object whose values are different reducer functions, into a single
4408
- * reducer function. It will call every child reducer, and gather their results
4409
- * into a single state object, whose keys correspond to the keys of the passed
4410
- * reducer functions.
4565
+ * Encodes a GeoJSON LineString feature/geometry.
4411
4566
  *
4412
- * @param {Object} reducers An object whose values correspond to different
4413
- * reducer functions that need to be combined into one. One handy way to obtain
4414
- * it is to use ES6 `import * as reducers` syntax. The reducers may never return
4415
- * undefined for any action. Instead, they should return their initial state
4416
- * if the state passed to them was undefined, and the current state for any
4417
- * unrecognized action.
4567
+ * @param {Object} geojson
4568
+ * @param {Number} precision
4569
+ * @returns {String}
4570
+ */
4571
+ polyline.fromGeoJSON = function(geojson, precision) {
4572
+ if (geojson && geojson.type === 'Feature') {
4573
+ geojson = geojson.geometry;
4574
+ }
4575
+ if (!geojson || geojson.type !== 'LineString') {
4576
+ throw new Error('Input must be a GeoJSON LineString');
4577
+ }
4578
+ return polyline.encode(flipped(geojson.coordinates), precision);
4579
+ };
4580
+
4581
+ /**
4582
+ * Decodes to a GeoJSON LineString geometry.
4418
4583
  *
4419
- * @returns {Function} A reducer function that invokes every reducer inside the
4420
- * passed object, and builds a state object with the same shape.
4584
+ * @param {String} str
4585
+ * @param {Number} precision
4586
+ * @returns {Object}
4421
4587
  */
4422
- function combineReducers(reducers) {
4423
- var reducerKeys = Object.keys(reducers);
4424
- var finalReducers = {};
4425
- for (var i = 0; i < reducerKeys.length; i++) {
4426
- var key = reducerKeys[i];
4588
+ polyline.toGeoJSON = function(str, precision) {
4589
+ var coords = polyline.decode(str, precision);
4590
+ return {
4591
+ type: 'LineString',
4592
+ coordinates: flipped(coords)
4593
+ };
4594
+ };
4427
4595
 
4428
- if ("test" !== 'production') {
4429
- if (typeof reducers[key] === 'undefined') {
4430
- (0, _warning2['default'])('No reducer provided for key "' + key + '"');
4431
- }
4596
+ if (typeof module === 'object' && module.exports) {
4597
+ module.exports = polyline;
4598
+ }
4599
+
4600
+ },{}],21:[function(require,module,exports){
4601
+ // shim for using process in browser
4602
+ var process = module.exports = {};
4603
+
4604
+ // cached from whatever global is present so that test runners that stub it
4605
+ // don't break things. But we need to wrap it in a try catch in case it is
4606
+ // wrapped in strict mode code which doesn't define any globals. It's inside a
4607
+ // function because try/catches deoptimize in certain engines.
4608
+
4609
+ var cachedSetTimeout;
4610
+ var cachedClearTimeout;
4611
+
4612
+ function defaultSetTimout() {
4613
+ throw new Error('setTimeout has not been defined');
4614
+ }
4615
+ function defaultClearTimeout () {
4616
+ throw new Error('clearTimeout has not been defined');
4617
+ }
4618
+ (function () {
4619
+ try {
4620
+ if (typeof setTimeout === 'function') {
4621
+ cachedSetTimeout = setTimeout;
4622
+ } else {
4623
+ cachedSetTimeout = defaultSetTimout;
4624
+ }
4625
+ } catch (e) {
4626
+ cachedSetTimeout = defaultSetTimout;
4627
+ }
4628
+ try {
4629
+ if (typeof clearTimeout === 'function') {
4630
+ cachedClearTimeout = clearTimeout;
4631
+ } else {
4632
+ cachedClearTimeout = defaultClearTimeout;
4633
+ }
4634
+ } catch (e) {
4635
+ cachedClearTimeout = defaultClearTimeout;
4636
+ }
4637
+ } ())
4638
+ function runTimeout(fun) {
4639
+ if (cachedSetTimeout === setTimeout) {
4640
+ //normal enviroments in sane situations
4641
+ return setTimeout(fun, 0);
4642
+ }
4643
+ // if setTimeout wasn't available but was latter defined
4644
+ if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
4645
+ cachedSetTimeout = setTimeout;
4646
+ return setTimeout(fun, 0);
4647
+ }
4648
+ try {
4649
+ // when when somebody has screwed with setTimeout but no I.E. maddness
4650
+ return cachedSetTimeout(fun, 0);
4651
+ } catch(e){
4652
+ try {
4653
+ // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
4654
+ return cachedSetTimeout.call(null, fun, 0);
4655
+ } catch(e){
4656
+ // 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
4657
+ return cachedSetTimeout.call(this, fun, 0);
4658
+ }
4432
4659
  }
4433
4660
 
4434
- if (typeof reducers[key] === 'function') {
4435
- finalReducers[key] = reducers[key];
4661
+
4662
+ }
4663
+ function runClearTimeout(marker) {
4664
+ if (cachedClearTimeout === clearTimeout) {
4665
+ //normal enviroments in sane situations
4666
+ return clearTimeout(marker);
4667
+ }
4668
+ // if clearTimeout wasn't available but was latter defined
4669
+ if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
4670
+ cachedClearTimeout = clearTimeout;
4671
+ return clearTimeout(marker);
4672
+ }
4673
+ try {
4674
+ // when when somebody has screwed with setTimeout but no I.E. maddness
4675
+ return cachedClearTimeout(marker);
4676
+ } catch (e){
4677
+ try {
4678
+ // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
4679
+ return cachedClearTimeout.call(null, marker);
4680
+ } catch (e){
4681
+ // 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.
4682
+ // Some versions of I.E. have different rules for clearTimeout vs setTimeout
4683
+ return cachedClearTimeout.call(this, marker);
4684
+ }
4436
4685
  }
4437
- }
4438
- var finalReducerKeys = Object.keys(finalReducers);
4439
4686
 
4440
- var unexpectedKeyCache = void 0;
4441
- if ("test" !== 'production') {
4442
- unexpectedKeyCache = {};
4443
- }
4444
4687
 
4445
- var shapeAssertionError = void 0;
4446
- try {
4447
- assertReducerShape(finalReducers);
4448
- } catch (e) {
4449
- shapeAssertionError = e;
4450
- }
4451
4688
 
4452
- return function combination() {
4453
- var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
4454
- var action = arguments[1];
4689
+ }
4690
+ var queue = [];
4691
+ var draining = false;
4692
+ var currentQueue;
4693
+ var queueIndex = -1;
4455
4694
 
4456
- if (shapeAssertionError) {
4457
- throw shapeAssertionError;
4695
+ function cleanUpNextTick() {
4696
+ if (!draining || !currentQueue) {
4697
+ return;
4458
4698
  }
4459
-
4460
- if ("test" !== 'production') {
4461
- var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache);
4462
- if (warningMessage) {
4463
- (0, _warning2['default'])(warningMessage);
4464
- }
4699
+ draining = false;
4700
+ if (currentQueue.length) {
4701
+ queue = currentQueue.concat(queue);
4702
+ } else {
4703
+ queueIndex = -1;
4465
4704
  }
4705
+ if (queue.length) {
4706
+ drainQueue();
4707
+ }
4708
+ }
4466
4709
 
4467
- var hasChanged = false;
4468
- var nextState = {};
4469
- for (var _i = 0; _i < finalReducerKeys.length; _i++) {
4470
- var _key = finalReducerKeys[_i];
4471
- var reducer = finalReducers[_key];
4472
- var previousStateForKey = state[_key];
4473
- var nextStateForKey = reducer(previousStateForKey, action);
4474
- if (typeof nextStateForKey === 'undefined') {
4475
- var errorMessage = getUndefinedStateErrorMessage(_key, action);
4476
- throw new Error(errorMessage);
4477
- }
4478
- nextState[_key] = nextStateForKey;
4479
- hasChanged = hasChanged || nextStateForKey !== previousStateForKey;
4710
+ function drainQueue() {
4711
+ if (draining) {
4712
+ return;
4480
4713
  }
4481
- return hasChanged ? nextState : state;
4482
- };
4714
+ var timeout = runTimeout(cleanUpNextTick);
4715
+ draining = true;
4716
+
4717
+ var len = queue.length;
4718
+ while(len) {
4719
+ currentQueue = queue;
4720
+ queue = [];
4721
+ while (++queueIndex < len) {
4722
+ if (currentQueue) {
4723
+ currentQueue[queueIndex].run();
4724
+ }
4725
+ }
4726
+ queueIndex = -1;
4727
+ len = queue.length;
4728
+ }
4729
+ currentQueue = null;
4730
+ draining = false;
4731
+ runClearTimeout(timeout);
4483
4732
  }
4484
- },{"./createStore":15,"./utils/warning":17,"lodash/isPlainObject":27}],14:[function(require,module,exports){
4485
- "use strict";
4486
4733
 
4487
- exports.__esModule = true;
4488
- exports["default"] = compose;
4489
- /**
4490
- * Composes single-argument functions from right to left. The rightmost
4491
- * function can take multiple arguments as it provides the signature for
4492
- * the resulting composite function.
4493
- *
4494
- * @param {...Function} funcs The functions to compose.
4495
- * @returns {Function} A function obtained by composing the argument functions
4496
- * from right to left. For example, compose(f, g, h) is identical to doing
4497
- * (...args) => f(g(h(...args))).
4498
- */
4734
+ process.nextTick = function (fun) {
4735
+ var args = new Array(arguments.length - 1);
4736
+ if (arguments.length > 1) {
4737
+ for (var i = 1; i < arguments.length; i++) {
4738
+ args[i - 1] = arguments[i];
4739
+ }
4740
+ }
4741
+ queue.push(new Item(fun, args));
4742
+ if (queue.length === 1 && !draining) {
4743
+ runTimeout(drainQueue);
4744
+ }
4745
+ };
4499
4746
 
4500
- function compose() {
4501
- for (var _len = arguments.length, funcs = Array(_len), _key = 0; _key < _len; _key++) {
4502
- funcs[_key] = arguments[_key];
4503
- }
4747
+ // v8 likes predictible objects
4748
+ function Item(fun, array) {
4749
+ this.fun = fun;
4750
+ this.array = array;
4751
+ }
4752
+ Item.prototype.run = function () {
4753
+ this.fun.apply(null, this.array);
4754
+ };
4755
+ process.title = 'browser';
4756
+ process.browser = true;
4757
+ process.env = {};
4758
+ process.argv = [];
4759
+ process.version = ''; // empty string to avoid regexp issues
4760
+ process.versions = {};
4761
+
4762
+ function noop() {}
4763
+
4764
+ process.on = noop;
4765
+ process.addListener = noop;
4766
+ process.once = noop;
4767
+ process.off = noop;
4768
+ process.removeListener = noop;
4769
+ process.removeAllListeners = noop;
4770
+ process.emit = noop;
4771
+ process.prependListener = noop;
4772
+ process.prependOnceListener = noop;
4773
+
4774
+ process.listeners = function (name) { return [] }
4775
+
4776
+ process.binding = function (name) {
4777
+ throw new Error('process.binding is not supported');
4778
+ };
4504
4779
 
4505
- if (funcs.length === 0) {
4506
- return function (arg) {
4507
- return arg;
4508
- };
4509
- }
4780
+ process.cwd = function () { return '/' };
4781
+ process.chdir = function (dir) {
4782
+ throw new Error('process.chdir is not supported');
4783
+ };
4784
+ process.umask = function() { return 0; };
4510
4785
 
4511
- if (funcs.length === 1) {
4512
- return funcs[0];
4513
- }
4786
+ },{}],22:[function(require,module,exports){
4787
+ 'use strict';
4514
4788
 
4515
- return funcs.reduce(function (a, b) {
4516
- return function () {
4517
- return a(b.apply(undefined, arguments));
4789
+ exports.__esModule = true;
4790
+ function createThunkMiddleware(extraArgument) {
4791
+ return function (_ref) {
4792
+ var dispatch = _ref.dispatch,
4793
+ getState = _ref.getState;
4794
+ return function (next) {
4795
+ return function (action) {
4796
+ if (typeof action === 'function') {
4797
+ return action(dispatch, getState, extraArgument);
4798
+ }
4799
+
4800
+ return next(action);
4801
+ };
4518
4802
  };
4519
- });
4803
+ };
4520
4804
  }
4521
- },{}],15:[function(require,module,exports){
4805
+
4806
+ var thunk = createThunkMiddleware();
4807
+ thunk.withExtraArgument = createThunkMiddleware;
4808
+
4809
+ exports['default'] = thunk;
4810
+ },{}],23:[function(require,module,exports){
4522
4811
  'use strict';
4523
4812
 
4524
4813
  exports.__esModule = true;
4525
- exports.ActionTypes = undefined;
4526
- exports['default'] = createStore;
4527
4814
 
4528
- var _isPlainObject = require('lodash/isPlainObject');
4815
+ var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
4529
4816
 
4530
- var _isPlainObject2 = _interopRequireDefault(_isPlainObject);
4817
+ exports['default'] = applyMiddleware;
4531
4818
 
4532
- var _symbolObservable = require('symbol-observable');
4819
+ var _compose = require('./compose');
4533
4820
 
4534
- var _symbolObservable2 = _interopRequireDefault(_symbolObservable);
4821
+ var _compose2 = _interopRequireDefault(_compose);
4535
4822
 
4536
4823
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
4537
4824
 
4538
4825
  /**
4539
- * These are private action types reserved by Redux.
4540
- * For any unknown actions, you must return the current state.
4826
+ * Creates a store enhancer that applies middleware to the dispatch method
4827
+ * of the Redux store. This is handy for a variety of tasks, such as expressing
4828
+ * asynchronous actions in a concise manner, or logging every action payload.
4829
+ *
4830
+ * See `redux-thunk` package as an example of the Redux middleware.
4831
+ *
4832
+ * Because middleware is potentially asynchronous, this should be the first
4833
+ * store enhancer in the composition chain.
4834
+ *
4835
+ * Note that each middleware will be given the `dispatch` and `getState` functions
4836
+ * as named arguments.
4837
+ *
4838
+ * @param {...Function} middlewares The middleware chain to be applied.
4839
+ * @returns {Function} A store enhancer applying the middleware.
4840
+ */
4841
+ function applyMiddleware() {
4842
+ for (var _len = arguments.length, middlewares = Array(_len), _key = 0; _key < _len; _key++) {
4843
+ middlewares[_key] = arguments[_key];
4844
+ }
4845
+
4846
+ return function (createStore) {
4847
+ return function (reducer, preloadedState, enhancer) {
4848
+ var store = createStore(reducer, preloadedState, enhancer);
4849
+ var _dispatch = store.dispatch;
4850
+ var chain = [];
4851
+
4852
+ var middlewareAPI = {
4853
+ getState: store.getState,
4854
+ dispatch: function dispatch(action) {
4855
+ return _dispatch(action);
4856
+ }
4857
+ };
4858
+ chain = middlewares.map(function (middleware) {
4859
+ return middleware(middlewareAPI);
4860
+ });
4861
+ _dispatch = _compose2['default'].apply(undefined, chain)(store.dispatch);
4862
+
4863
+ return _extends({}, store, {
4864
+ dispatch: _dispatch
4865
+ });
4866
+ };
4867
+ };
4868
+ }
4869
+ },{"./compose":26}],24:[function(require,module,exports){
4870
+ 'use strict';
4871
+
4872
+ exports.__esModule = true;
4873
+ exports['default'] = bindActionCreators;
4874
+ function bindActionCreator(actionCreator, dispatch) {
4875
+ return function () {
4876
+ return dispatch(actionCreator.apply(undefined, arguments));
4877
+ };
4878
+ }
4879
+
4880
+ /**
4881
+ * Turns an object whose values are action creators, into an object with the
4882
+ * same keys, but with every function wrapped into a `dispatch` call so they
4883
+ * may be invoked directly. This is just a convenience method, as you can call
4884
+ * `store.dispatch(MyActionCreators.doSomething())` yourself just fine.
4885
+ *
4886
+ * For convenience, you can also pass a single function as the first argument,
4887
+ * and get a function in return.
4888
+ *
4889
+ * @param {Function|Object} actionCreators An object whose values are action
4890
+ * creator functions. One handy way to obtain it is to use ES6 `import * as`
4891
+ * syntax. You may also pass a single function.
4892
+ *
4893
+ * @param {Function} dispatch The `dispatch` function available on your Redux
4894
+ * store.
4895
+ *
4896
+ * @returns {Function|Object} The object mimicking the original object, but with
4897
+ * every action creator wrapped into the `dispatch` call. If you passed a
4898
+ * function as `actionCreators`, the return value will also be a single
4899
+ * function.
4900
+ */
4901
+ function bindActionCreators(actionCreators, dispatch) {
4902
+ if (typeof actionCreators === 'function') {
4903
+ return bindActionCreator(actionCreators, dispatch);
4904
+ }
4905
+
4906
+ if (typeof actionCreators !== 'object' || actionCreators === null) {
4907
+ throw new Error('bindActionCreators expected an object or a function, instead received ' + (actionCreators === null ? 'null' : typeof actionCreators) + '. ' + 'Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?');
4908
+ }
4909
+
4910
+ var keys = Object.keys(actionCreators);
4911
+ var boundActionCreators = {};
4912
+ for (var i = 0; i < keys.length; i++) {
4913
+ var key = keys[i];
4914
+ var actionCreator = actionCreators[key];
4915
+ if (typeof actionCreator === 'function') {
4916
+ boundActionCreators[key] = bindActionCreator(actionCreator, dispatch);
4917
+ }
4918
+ }
4919
+ return boundActionCreators;
4920
+ }
4921
+ },{}],25:[function(require,module,exports){
4922
+ (function (process){
4923
+ 'use strict';
4924
+
4925
+ exports.__esModule = true;
4926
+ exports['default'] = combineReducers;
4927
+
4928
+ var _createStore = require('./createStore');
4929
+
4930
+ var _isPlainObject = require('lodash/isPlainObject');
4931
+
4932
+ var _isPlainObject2 = _interopRequireDefault(_isPlainObject);
4933
+
4934
+ var _warning = require('./utils/warning');
4935
+
4936
+ var _warning2 = _interopRequireDefault(_warning);
4937
+
4938
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
4939
+
4940
+ function getUndefinedStateErrorMessage(key, action) {
4941
+ var actionType = action && action.type;
4942
+ var actionName = actionType && '"' + actionType.toString() + '"' || 'an action';
4943
+
4944
+ return 'Given action ' + actionName + ', reducer "' + key + '" returned undefined. ' + 'To ignore an action, you must explicitly return the previous state. ' + 'If you want this reducer to hold no value, you can return null instead of undefined.';
4945
+ }
4946
+
4947
+ function getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) {
4948
+ var reducerKeys = Object.keys(reducers);
4949
+ var argumentName = action && action.type === _createStore.ActionTypes.INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer';
4950
+
4951
+ if (reducerKeys.length === 0) {
4952
+ return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.';
4953
+ }
4954
+
4955
+ if (!(0, _isPlainObject2['default'])(inputState)) {
4956
+ return 'The ' + argumentName + ' has unexpected type of "' + {}.toString.call(inputState).match(/\s([a-z|A-Z]+)/)[1] + '". Expected argument to be an object with the following ' + ('keys: "' + reducerKeys.join('", "') + '"');
4957
+ }
4958
+
4959
+ var unexpectedKeys = Object.keys(inputState).filter(function (key) {
4960
+ return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key];
4961
+ });
4962
+
4963
+ unexpectedKeys.forEach(function (key) {
4964
+ unexpectedKeyCache[key] = true;
4965
+ });
4966
+
4967
+ if (unexpectedKeys.length > 0) {
4968
+ return 'Unexpected ' + (unexpectedKeys.length > 1 ? 'keys' : 'key') + ' ' + ('"' + unexpectedKeys.join('", "') + '" found in ' + argumentName + '. ') + 'Expected to find one of the known reducer keys instead: ' + ('"' + reducerKeys.join('", "') + '". Unexpected keys will be ignored.');
4969
+ }
4970
+ }
4971
+
4972
+ function assertReducerShape(reducers) {
4973
+ Object.keys(reducers).forEach(function (key) {
4974
+ var reducer = reducers[key];
4975
+ var initialState = reducer(undefined, { type: _createStore.ActionTypes.INIT });
4976
+
4977
+ if (typeof initialState === 'undefined') {
4978
+ throw new Error('Reducer "' + key + '" returned undefined during initialization. ' + 'If the state passed to the reducer is undefined, you must ' + 'explicitly return the initial state. The initial state may ' + 'not be undefined. If you don\'t want to set a value for this reducer, ' + 'you can use null instead of undefined.');
4979
+ }
4980
+
4981
+ var type = '@@redux/PROBE_UNKNOWN_ACTION_' + Math.random().toString(36).substring(7).split('').join('.');
4982
+ if (typeof reducer(undefined, { type: type }) === 'undefined') {
4983
+ throw new Error('Reducer "' + key + '" returned undefined when probed with a random type. ' + ('Don\'t try to handle ' + _createStore.ActionTypes.INIT + ' or other actions in "redux/*" ') + 'namespace. They are considered private. Instead, you must return the ' + 'current state for any unknown actions, unless it is undefined, ' + 'in which case you must return the initial state, regardless of the ' + 'action type. The initial state may not be undefined, but can be null.');
4984
+ }
4985
+ });
4986
+ }
4987
+
4988
+ /**
4989
+ * Turns an object whose values are different reducer functions, into a single
4990
+ * reducer function. It will call every child reducer, and gather their results
4991
+ * into a single state object, whose keys correspond to the keys of the passed
4992
+ * reducer functions.
4993
+ *
4994
+ * @param {Object} reducers An object whose values correspond to different
4995
+ * reducer functions that need to be combined into one. One handy way to obtain
4996
+ * it is to use ES6 `import * as reducers` syntax. The reducers may never return
4997
+ * undefined for any action. Instead, they should return their initial state
4998
+ * if the state passed to them was undefined, and the current state for any
4999
+ * unrecognized action.
5000
+ *
5001
+ * @returns {Function} A reducer function that invokes every reducer inside the
5002
+ * passed object, and builds a state object with the same shape.
5003
+ */
5004
+ function combineReducers(reducers) {
5005
+ var reducerKeys = Object.keys(reducers);
5006
+ var finalReducers = {};
5007
+ for (var i = 0; i < reducerKeys.length; i++) {
5008
+ var key = reducerKeys[i];
5009
+
5010
+ if (process.env.NODE_ENV !== 'production') {
5011
+ if (typeof reducers[key] === 'undefined') {
5012
+ (0, _warning2['default'])('No reducer provided for key "' + key + '"');
5013
+ }
5014
+ }
5015
+
5016
+ if (typeof reducers[key] === 'function') {
5017
+ finalReducers[key] = reducers[key];
5018
+ }
5019
+ }
5020
+ var finalReducerKeys = Object.keys(finalReducers);
5021
+
5022
+ var unexpectedKeyCache = void 0;
5023
+ if (process.env.NODE_ENV !== 'production') {
5024
+ unexpectedKeyCache = {};
5025
+ }
5026
+
5027
+ var shapeAssertionError = void 0;
5028
+ try {
5029
+ assertReducerShape(finalReducers);
5030
+ } catch (e) {
5031
+ shapeAssertionError = e;
5032
+ }
5033
+
5034
+ return function combination() {
5035
+ var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
5036
+ var action = arguments[1];
5037
+
5038
+ if (shapeAssertionError) {
5039
+ throw shapeAssertionError;
5040
+ }
5041
+
5042
+ if (process.env.NODE_ENV !== 'production') {
5043
+ var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache);
5044
+ if (warningMessage) {
5045
+ (0, _warning2['default'])(warningMessage);
5046
+ }
5047
+ }
5048
+
5049
+ var hasChanged = false;
5050
+ var nextState = {};
5051
+ for (var _i = 0; _i < finalReducerKeys.length; _i++) {
5052
+ var _key = finalReducerKeys[_i];
5053
+ var reducer = finalReducers[_key];
5054
+ var previousStateForKey = state[_key];
5055
+ var nextStateForKey = reducer(previousStateForKey, action);
5056
+ if (typeof nextStateForKey === 'undefined') {
5057
+ var errorMessage = getUndefinedStateErrorMessage(_key, action);
5058
+ throw new Error(errorMessage);
5059
+ }
5060
+ nextState[_key] = nextStateForKey;
5061
+ hasChanged = hasChanged || nextStateForKey !== previousStateForKey;
5062
+ }
5063
+ return hasChanged ? nextState : state;
5064
+ };
5065
+ }
5066
+ }).call(this,require('_process'))
5067
+ },{"./createStore":27,"./utils/warning":29,"_process":21,"lodash/isPlainObject":19}],26:[function(require,module,exports){
5068
+ "use strict";
5069
+
5070
+ exports.__esModule = true;
5071
+ exports["default"] = compose;
5072
+ /**
5073
+ * Composes single-argument functions from right to left. The rightmost
5074
+ * function can take multiple arguments as it provides the signature for
5075
+ * the resulting composite function.
5076
+ *
5077
+ * @param {...Function} funcs The functions to compose.
5078
+ * @returns {Function} A function obtained by composing the argument functions
5079
+ * from right to left. For example, compose(f, g, h) is identical to doing
5080
+ * (...args) => f(g(h(...args))).
5081
+ */
5082
+
5083
+ function compose() {
5084
+ for (var _len = arguments.length, funcs = Array(_len), _key = 0; _key < _len; _key++) {
5085
+ funcs[_key] = arguments[_key];
5086
+ }
5087
+
5088
+ if (funcs.length === 0) {
5089
+ return function (arg) {
5090
+ return arg;
5091
+ };
5092
+ }
5093
+
5094
+ if (funcs.length === 1) {
5095
+ return funcs[0];
5096
+ }
5097
+
5098
+ return funcs.reduce(function (a, b) {
5099
+ return function () {
5100
+ return a(b.apply(undefined, arguments));
5101
+ };
5102
+ });
5103
+ }
5104
+ },{}],27:[function(require,module,exports){
5105
+ 'use strict';
5106
+
5107
+ exports.__esModule = true;
5108
+ exports.ActionTypes = undefined;
5109
+ exports['default'] = createStore;
5110
+
5111
+ var _isPlainObject = require('lodash/isPlainObject');
5112
+
5113
+ var _isPlainObject2 = _interopRequireDefault(_isPlainObject);
5114
+
5115
+ var _symbolObservable = require('symbol-observable');
5116
+
5117
+ var _symbolObservable2 = _interopRequireDefault(_symbolObservable);
5118
+
5119
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
5120
+
5121
+ /**
5122
+ * These are private action types reserved by Redux.
5123
+ * For any unknown actions, you must return the current state.
4541
5124
  * If the current state is undefined, you must return the initial state.
4542
5125
  * Do not reference these action types directly in your code.
4543
5126
  */
@@ -4687,477 +5270,174 @@ var ActionTypes = exports.ActionTypes = {
4687
5270
  }
4688
5271
 
4689
5272
  if (typeof action.type === 'undefined') {
4690
- throw new Error('Actions may not have an undefined "type" property. ' + 'Have you misspelled a constant?');
4691
- }
4692
-
4693
- if (isDispatching) {
4694
- throw new Error('Reducers may not dispatch actions.');
4695
- }
4696
-
4697
- try {
4698
- isDispatching = true;
4699
- currentState = currentReducer(currentState, action);
4700
- } finally {
4701
- isDispatching = false;
4702
- }
4703
-
4704
- var listeners = currentListeners = nextListeners;
4705
- for (var i = 0; i < listeners.length; i++) {
4706
- var listener = listeners[i];
4707
- listener();
4708
- }
4709
-
4710
- return action;
4711
- }
4712
-
4713
- /**
4714
- * Replaces the reducer currently used by the store to calculate the state.
4715
- *
4716
- * You might need this if your app implements code splitting and you want to
4717
- * load some of the reducers dynamically. You might also need this if you
4718
- * implement a hot reloading mechanism for Redux.
4719
- *
4720
- * @param {Function} nextReducer The reducer for the store to use instead.
4721
- * @returns {void}
4722
- */
4723
- function replaceReducer(nextReducer) {
4724
- if (typeof nextReducer !== 'function') {
4725
- throw new Error('Expected the nextReducer to be a function.');
4726
- }
4727
-
4728
- currentReducer = nextReducer;
4729
- dispatch({ type: ActionTypes.INIT });
4730
- }
4731
-
4732
- /**
4733
- * Interoperability point for observable/reactive libraries.
4734
- * @returns {observable} A minimal observable of state changes.
4735
- * For more information, see the observable proposal:
4736
- * https://github.com/tc39/proposal-observable
4737
- */
4738
- function observable() {
4739
- var _ref;
4740
-
4741
- var outerSubscribe = subscribe;
4742
- return _ref = {
4743
- /**
4744
- * The minimal observable subscription method.
4745
- * @param {Object} observer Any object that can be used as an observer.
4746
- * The observer object should have a `next` method.
4747
- * @returns {subscription} An object with an `unsubscribe` method that can
4748
- * be used to unsubscribe the observable from the store, and prevent further
4749
- * emission of values from the observable.
4750
- */
4751
- subscribe: function subscribe(observer) {
4752
- if (typeof observer !== 'object') {
4753
- throw new TypeError('Expected the observer to be an object.');
4754
- }
4755
-
4756
- function observeState() {
4757
- if (observer.next) {
4758
- observer.next(getState());
4759
- }
4760
- }
4761
-
4762
- observeState();
4763
- var unsubscribe = outerSubscribe(observeState);
4764
- return { unsubscribe: unsubscribe };
4765
- }
4766
- }, _ref[_symbolObservable2['default']] = function () {
4767
- return this;
4768
- }, _ref;
4769
- }
4770
-
4771
- // When a store is created, an "INIT" action is dispatched so that every
4772
- // reducer returns their initial state. This effectively populates
4773
- // the initial state tree.
4774
- dispatch({ type: ActionTypes.INIT });
4775
-
4776
- return _ref2 = {
4777
- dispatch: dispatch,
4778
- subscribe: subscribe,
4779
- getState: getState,
4780
- replaceReducer: replaceReducer
4781
- }, _ref2[_symbolObservable2['default']] = observable, _ref2;
4782
- }
4783
- },{"lodash/isPlainObject":27,"symbol-observable":28}],16:[function(require,module,exports){
4784
- 'use strict';
4785
-
4786
- exports.__esModule = true;
4787
- exports.compose = exports.applyMiddleware = exports.bindActionCreators = exports.combineReducers = exports.createStore = undefined;
4788
-
4789
- var _createStore = require('./createStore');
4790
-
4791
- var _createStore2 = _interopRequireDefault(_createStore);
4792
-
4793
- var _combineReducers = require('./combineReducers');
4794
-
4795
- var _combineReducers2 = _interopRequireDefault(_combineReducers);
4796
-
4797
- var _bindActionCreators = require('./bindActionCreators');
4798
-
4799
- var _bindActionCreators2 = _interopRequireDefault(_bindActionCreators);
4800
-
4801
- var _applyMiddleware = require('./applyMiddleware');
4802
-
4803
- var _applyMiddleware2 = _interopRequireDefault(_applyMiddleware);
4804
-
4805
- var _compose = require('./compose');
4806
-
4807
- var _compose2 = _interopRequireDefault(_compose);
4808
-
4809
- var _warning = require('./utils/warning');
4810
-
4811
- var _warning2 = _interopRequireDefault(_warning);
4812
-
4813
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
4814
-
4815
- /*
4816
- * This is a dummy function to check if the function name has been altered by minification.
4817
- * If the function has been minified and NODE_ENV !== 'production', warn the user.
4818
- */
4819
- function isCrushed() {}
4820
-
4821
- if ("test" !== 'production' && typeof isCrushed.name === 'string' && isCrushed.name !== 'isCrushed') {
4822
- (0, _warning2['default'])('You are currently using minified code outside of NODE_ENV === \'production\'. ' + 'This means that you are running a slower development build of Redux. ' + 'You can use loose-envify (https://github.com/zertosh/loose-envify) for browserify ' + 'or DefinePlugin for webpack (http://stackoverflow.com/questions/30030031) ' + 'to ensure you have the correct code for your production build.');
4823
- }
4824
-
4825
- exports.createStore = _createStore2['default'];
4826
- exports.combineReducers = _combineReducers2['default'];
4827
- exports.bindActionCreators = _bindActionCreators2['default'];
4828
- exports.applyMiddleware = _applyMiddleware2['default'];
4829
- exports.compose = _compose2['default'];
4830
- },{"./applyMiddleware":11,"./bindActionCreators":12,"./combineReducers":13,"./compose":14,"./createStore":15,"./utils/warning":17}],17:[function(require,module,exports){
4831
- 'use strict';
4832
-
4833
- exports.__esModule = true;
4834
- exports['default'] = warning;
4835
- /**
4836
- * Prints a warning in the console if it exists.
4837
- *
4838
- * @param {String} message The warning message.
4839
- * @returns {void}
4840
- */
4841
- function warning(message) {
4842
- /* eslint-disable no-console */
4843
- if (typeof console !== 'undefined' && typeof console.error === 'function') {
4844
- console.error(message);
4845
- }
4846
- /* eslint-enable no-console */
4847
- try {
4848
- // This error was thrown as a convenience so that if you enable
4849
- // "break on all exceptions" in your console,
4850
- // it would pause the execution at this line.
4851
- throw new Error(message);
4852
- /* eslint-disable no-empty */
4853
- } catch (e) {}
4854
- /* eslint-enable no-empty */
4855
- }
4856
- },{}],18:[function(require,module,exports){
4857
- var root = require('./_root');
4858
-
4859
- /** Built-in value references. */
4860
- var Symbol = root.Symbol;
4861
-
4862
- module.exports = Symbol;
4863
-
4864
- },{"./_root":25}],19:[function(require,module,exports){
4865
- var Symbol = require('./_Symbol'),
4866
- getRawTag = require('./_getRawTag'),
4867
- objectToString = require('./_objectToString');
4868
-
4869
- /** `Object#toString` result references. */
4870
- var nullTag = '[object Null]',
4871
- undefinedTag = '[object Undefined]';
4872
-
4873
- /** Built-in value references. */
4874
- var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
4875
-
4876
- /**
4877
- * The base implementation of `getTag` without fallbacks for buggy environments.
4878
- *
4879
- * @private
4880
- * @param {*} value The value to query.
4881
- * @returns {string} Returns the `toStringTag`.
4882
- */
4883
- function baseGetTag(value) {
4884
- if (value == null) {
4885
- return value === undefined ? undefinedTag : nullTag;
4886
- }
4887
- return (symToStringTag && symToStringTag in Object(value))
4888
- ? getRawTag(value)
4889
- : objectToString(value);
4890
- }
4891
-
4892
- module.exports = baseGetTag;
4893
-
4894
- },{"./_Symbol":18,"./_getRawTag":22,"./_objectToString":23}],20:[function(require,module,exports){
4895
- (function (global){
4896
- /** Detect free variable `global` from Node.js. */
4897
- var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
4898
-
4899
- module.exports = freeGlobal;
4900
-
4901
- }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
4902
- },{}],21:[function(require,module,exports){
4903
- var overArg = require('./_overArg');
4904
-
4905
- /** Built-in value references. */
4906
- var getPrototype = overArg(Object.getPrototypeOf, Object);
4907
-
4908
- module.exports = getPrototype;
4909
-
4910
- },{"./_overArg":24}],22:[function(require,module,exports){
4911
- var Symbol = require('./_Symbol');
4912
-
4913
- /** Used for built-in method references. */
4914
- var objectProto = Object.prototype;
4915
-
4916
- /** Used to check objects for own properties. */
4917
- var hasOwnProperty = objectProto.hasOwnProperty;
4918
-
4919
- /**
4920
- * Used to resolve the
4921
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
4922
- * of values.
4923
- */
4924
- var nativeObjectToString = objectProto.toString;
4925
-
4926
- /** Built-in value references. */
4927
- var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
4928
-
4929
- /**
4930
- * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
4931
- *
4932
- * @private
4933
- * @param {*} value The value to query.
4934
- * @returns {string} Returns the raw `toStringTag`.
4935
- */
4936
- function getRawTag(value) {
4937
- var isOwn = hasOwnProperty.call(value, symToStringTag),
4938
- tag = value[symToStringTag];
4939
-
4940
- try {
4941
- value[symToStringTag] = undefined;
4942
- var unmasked = true;
4943
- } catch (e) {}
4944
-
4945
- var result = nativeObjectToString.call(value);
4946
- if (unmasked) {
4947
- if (isOwn) {
4948
- value[symToStringTag] = tag;
4949
- } else {
4950
- delete value[symToStringTag];
5273
+ throw new Error('Actions may not have an undefined "type" property. ' + 'Have you misspelled a constant?');
4951
5274
  }
4952
- }
4953
- return result;
4954
- }
4955
5275
 
4956
- module.exports = getRawTag;
5276
+ if (isDispatching) {
5277
+ throw new Error('Reducers may not dispatch actions.');
5278
+ }
4957
5279
 
4958
- },{"./_Symbol":18}],23:[function(require,module,exports){
4959
- /** Used for built-in method references. */
4960
- var objectProto = Object.prototype;
5280
+ try {
5281
+ isDispatching = true;
5282
+ currentState = currentReducer(currentState, action);
5283
+ } finally {
5284
+ isDispatching = false;
5285
+ }
4961
5286
 
4962
- /**
4963
- * Used to resolve the
4964
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
4965
- * of values.
4966
- */
4967
- var nativeObjectToString = objectProto.toString;
5287
+ var listeners = currentListeners = nextListeners;
5288
+ for (var i = 0; i < listeners.length; i++) {
5289
+ var listener = listeners[i];
5290
+ listener();
5291
+ }
4968
5292
 
4969
- /**
4970
- * Converts `value` to a string using `Object.prototype.toString`.
4971
- *
4972
- * @private
4973
- * @param {*} value The value to convert.
4974
- * @returns {string} Returns the converted string.
4975
- */
4976
- function objectToString(value) {
4977
- return nativeObjectToString.call(value);
4978
- }
5293
+ return action;
5294
+ }
4979
5295
 
4980
- module.exports = objectToString;
5296
+ /**
5297
+ * Replaces the reducer currently used by the store to calculate the state.
5298
+ *
5299
+ * You might need this if your app implements code splitting and you want to
5300
+ * load some of the reducers dynamically. You might also need this if you
5301
+ * implement a hot reloading mechanism for Redux.
5302
+ *
5303
+ * @param {Function} nextReducer The reducer for the store to use instead.
5304
+ * @returns {void}
5305
+ */
5306
+ function replaceReducer(nextReducer) {
5307
+ if (typeof nextReducer !== 'function') {
5308
+ throw new Error('Expected the nextReducer to be a function.');
5309
+ }
4981
5310
 
4982
- },{}],24:[function(require,module,exports){
4983
- /**
4984
- * Creates a unary function that invokes `func` with its argument transformed.
4985
- *
4986
- * @private
4987
- * @param {Function} func The function to wrap.
4988
- * @param {Function} transform The argument transform.
4989
- * @returns {Function} Returns the new function.
4990
- */
4991
- function overArg(func, transform) {
4992
- return function(arg) {
4993
- return func(transform(arg));
4994
- };
4995
- }
5311
+ currentReducer = nextReducer;
5312
+ dispatch({ type: ActionTypes.INIT });
5313
+ }
4996
5314
 
4997
- module.exports = overArg;
5315
+ /**
5316
+ * Interoperability point for observable/reactive libraries.
5317
+ * @returns {observable} A minimal observable of state changes.
5318
+ * For more information, see the observable proposal:
5319
+ * https://github.com/tc39/proposal-observable
5320
+ */
5321
+ function observable() {
5322
+ var _ref;
4998
5323
 
4999
- },{}],25:[function(require,module,exports){
5000
- var freeGlobal = require('./_freeGlobal');
5324
+ var outerSubscribe = subscribe;
5325
+ return _ref = {
5326
+ /**
5327
+ * The minimal observable subscription method.
5328
+ * @param {Object} observer Any object that can be used as an observer.
5329
+ * The observer object should have a `next` method.
5330
+ * @returns {subscription} An object with an `unsubscribe` method that can
5331
+ * be used to unsubscribe the observable from the store, and prevent further
5332
+ * emission of values from the observable.
5333
+ */
5334
+ subscribe: function subscribe(observer) {
5335
+ if (typeof observer !== 'object') {
5336
+ throw new TypeError('Expected the observer to be an object.');
5337
+ }
5001
5338
 
5002
- /** Detect free variable `self`. */
5003
- var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
5339
+ function observeState() {
5340
+ if (observer.next) {
5341
+ observer.next(getState());
5342
+ }
5343
+ }
5004
5344
 
5005
- /** Used as a reference to the global object. */
5006
- var root = freeGlobal || freeSelf || Function('return this')();
5345
+ observeState();
5346
+ var unsubscribe = outerSubscribe(observeState);
5347
+ return { unsubscribe: unsubscribe };
5348
+ }
5349
+ }, _ref[_symbolObservable2['default']] = function () {
5350
+ return this;
5351
+ }, _ref;
5352
+ }
5007
5353
 
5008
- module.exports = root;
5354
+ // When a store is created, an "INIT" action is dispatched so that every
5355
+ // reducer returns their initial state. This effectively populates
5356
+ // the initial state tree.
5357
+ dispatch({ type: ActionTypes.INIT });
5009
5358
 
5010
- },{"./_freeGlobal":20}],26:[function(require,module,exports){
5011
- /**
5012
- * Checks if `value` is object-like. A value is object-like if it's not `null`
5013
- * and has a `typeof` result of "object".
5014
- *
5015
- * @static
5016
- * @memberOf _
5017
- * @since 4.0.0
5018
- * @category Lang
5019
- * @param {*} value The value to check.
5020
- * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
5021
- * @example
5022
- *
5023
- * _.isObjectLike({});
5024
- * // => true
5025
- *
5026
- * _.isObjectLike([1, 2, 3]);
5027
- * // => true
5028
- *
5029
- * _.isObjectLike(_.noop);
5030
- * // => false
5031
- *
5032
- * _.isObjectLike(null);
5033
- * // => false
5034
- */
5035
- function isObjectLike(value) {
5036
- return value != null && typeof value == 'object';
5359
+ return _ref2 = {
5360
+ dispatch: dispatch,
5361
+ subscribe: subscribe,
5362
+ getState: getState,
5363
+ replaceReducer: replaceReducer
5364
+ }, _ref2[_symbolObservable2['default']] = observable, _ref2;
5037
5365
  }
5366
+ },{"lodash/isPlainObject":19,"symbol-observable":33}],28:[function(require,module,exports){
5367
+ (function (process){
5368
+ 'use strict';
5038
5369
 
5039
- module.exports = isObjectLike;
5370
+ exports.__esModule = true;
5371
+ exports.compose = exports.applyMiddleware = exports.bindActionCreators = exports.combineReducers = exports.createStore = undefined;
5040
5372
 
5041
- },{}],27:[function(require,module,exports){
5042
- var baseGetTag = require('./_baseGetTag'),
5043
- getPrototype = require('./_getPrototype'),
5044
- isObjectLike = require('./isObjectLike');
5373
+ var _createStore = require('./createStore');
5045
5374
 
5046
- /** `Object#toString` result references. */
5047
- var objectTag = '[object Object]';
5375
+ var _createStore2 = _interopRequireDefault(_createStore);
5048
5376
 
5049
- /** Used for built-in method references. */
5050
- var funcProto = Function.prototype,
5051
- objectProto = Object.prototype;
5377
+ var _combineReducers = require('./combineReducers');
5052
5378
 
5053
- /** Used to resolve the decompiled source of functions. */
5054
- var funcToString = funcProto.toString;
5379
+ var _combineReducers2 = _interopRequireDefault(_combineReducers);
5055
5380
 
5056
- /** Used to check objects for own properties. */
5057
- var hasOwnProperty = objectProto.hasOwnProperty;
5381
+ var _bindActionCreators = require('./bindActionCreators');
5058
5382
 
5059
- /** Used to infer the `Object` constructor. */
5060
- var objectCtorString = funcToString.call(Object);
5383
+ var _bindActionCreators2 = _interopRequireDefault(_bindActionCreators);
5061
5384
 
5062
- /**
5063
- * Checks if `value` is a plain object, that is, an object created by the
5064
- * `Object` constructor or one with a `[[Prototype]]` of `null`.
5065
- *
5066
- * @static
5067
- * @memberOf _
5068
- * @since 0.8.0
5069
- * @category Lang
5070
- * @param {*} value The value to check.
5071
- * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
5072
- * @example
5073
- *
5074
- * function Foo() {
5075
- * this.a = 1;
5076
- * }
5077
- *
5078
- * _.isPlainObject(new Foo);
5079
- * // => false
5080
- *
5081
- * _.isPlainObject([1, 2, 3]);
5082
- * // => false
5083
- *
5084
- * _.isPlainObject({ 'x': 0, 'y': 0 });
5085
- * // => true
5086
- *
5087
- * _.isPlainObject(Object.create(null));
5088
- * // => true
5089
- */
5090
- function isPlainObject(value) {
5091
- if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
5092
- return false;
5093
- }
5094
- var proto = getPrototype(value);
5095
- if (proto === null) {
5096
- return true;
5097
- }
5098
- var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
5099
- return typeof Ctor == 'function' && Ctor instanceof Ctor &&
5100
- funcToString.call(Ctor) == objectCtorString;
5101
- }
5385
+ var _applyMiddleware = require('./applyMiddleware');
5102
5386
 
5103
- module.exports = isPlainObject;
5387
+ var _applyMiddleware2 = _interopRequireDefault(_applyMiddleware);
5104
5388
 
5105
- },{"./_baseGetTag":19,"./_getPrototype":21,"./isObjectLike":26}],28:[function(require,module,exports){
5106
- (function (global){
5107
- 'use strict';
5389
+ var _compose = require('./compose');
5108
5390
 
5109
- Object.defineProperty(exports, "__esModule", {
5110
- value: true
5111
- });
5391
+ var _compose2 = _interopRequireDefault(_compose);
5112
5392
 
5113
- var _ponyfill = require('./ponyfill.js');
5393
+ var _warning = require('./utils/warning');
5114
5394
 
5115
- var _ponyfill2 = _interopRequireDefault(_ponyfill);
5395
+ var _warning2 = _interopRequireDefault(_warning);
5116
5396
 
5117
5397
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
5118
5398
 
5119
- var root; /* global window */
5120
-
5121
-
5122
- if (typeof self !== 'undefined') {
5123
- root = self;
5124
- } else if (typeof window !== 'undefined') {
5125
- root = window;
5126
- } else if (typeof global !== 'undefined') {
5127
- root = global;
5128
- } else if (typeof module !== 'undefined') {
5129
- root = module;
5130
- } else {
5131
- root = Function('return this')();
5132
- }
5133
-
5134
- var result = (0, _ponyfill2['default'])(root);
5135
- exports['default'] = result;
5136
- }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
5137
- },{"./ponyfill.js":29}],29:[function(require,module,exports){
5138
- 'use strict';
5139
-
5140
- Object.defineProperty(exports, "__esModule", {
5141
- value: true
5142
- });
5143
- exports['default'] = symbolObservablePonyfill;
5144
- function symbolObservablePonyfill(root) {
5145
- var result;
5146
- var _Symbol = root.Symbol;
5399
+ /*
5400
+ * This is a dummy function to check if the function name has been altered by minification.
5401
+ * If the function has been minified and NODE_ENV !== 'production', warn the user.
5402
+ */
5403
+ function isCrushed() {}
5147
5404
 
5148
- if (typeof _Symbol === 'function') {
5149
- if (_Symbol.observable) {
5150
- result = _Symbol.observable;
5151
- } else {
5152
- result = _Symbol('observable');
5153
- _Symbol.observable = result;
5154
- }
5155
- } else {
5156
- result = '@@observable';
5157
- }
5405
+ if (process.env.NODE_ENV !== 'production' && typeof isCrushed.name === 'string' && isCrushed.name !== 'isCrushed') {
5406
+ (0, _warning2['default'])('You are currently using minified code outside of NODE_ENV === \'production\'. ' + 'This means that you are running a slower development build of Redux. ' + 'You can use loose-envify (https://github.com/zertosh/loose-envify) for browserify ' + 'or DefinePlugin for webpack (http://stackoverflow.com/questions/30030031) ' + 'to ensure you have the correct code for your production build.');
5407
+ }
5158
5408
 
5159
- return result;
5160
- };
5409
+ exports.createStore = _createStore2['default'];
5410
+ exports.combineReducers = _combineReducers2['default'];
5411
+ exports.bindActionCreators = _bindActionCreators2['default'];
5412
+ exports.applyMiddleware = _applyMiddleware2['default'];
5413
+ exports.compose = _compose2['default'];
5414
+ }).call(this,require('_process'))
5415
+ },{"./applyMiddleware":23,"./bindActionCreators":24,"./combineReducers":25,"./compose":26,"./createStore":27,"./utils/warning":29,"_process":21}],29:[function(require,module,exports){
5416
+ 'use strict';
5417
+
5418
+ exports.__esModule = true;
5419
+ exports['default'] = warning;
5420
+ /**
5421
+ * Prints a warning in the console if it exists.
5422
+ *
5423
+ * @param {String} message The warning message.
5424
+ * @returns {void}
5425
+ */
5426
+ function warning(message) {
5427
+ /* eslint-disable no-console */
5428
+ if (typeof console !== 'undefined' && typeof console.error === 'function') {
5429
+ console.error(message);
5430
+ }
5431
+ /* eslint-enable no-console */
5432
+ try {
5433
+ // This error was thrown as a convenience so that if you enable
5434
+ // "break on all exceptions" in your console,
5435
+ // it would pause the execution at this line.
5436
+ throw new Error(message);
5437
+ /* eslint-disable no-empty */
5438
+ } catch (e) {}
5439
+ /* eslint-enable no-empty */
5440
+ }
5161
5441
  },{}],30:[function(require,module,exports){
5162
5442
  'use strict';
5163
5443
 
@@ -5217,153 +5497,7 @@ function symbolObservablePonyfill(root) {
5217
5497
  var Suggestions = require('./src/suggestions');
5218
5498
  window.Suggestions = module.exports = Suggestions;
5219
5499
 
5220
- },{"./src/suggestions":33}],31:[function(require,module,exports){
5221
- /*
5222
- * Fuzzy
5223
- * https://github.com/myork/fuzzy
5224
- *
5225
- * Copyright (c) 2012 Matt York
5226
- * Licensed under the MIT license.
5227
- */
5228
-
5229
- (function() {
5230
-
5231
- var root = this;
5232
-
5233
- var fuzzy = {};
5234
-
5235
- // Use in node or in browser
5236
- if (typeof exports !== 'undefined') {
5237
- module.exports = fuzzy;
5238
- } else {
5239
- root.fuzzy = fuzzy;
5240
- }
5241
-
5242
- // Return all elements of `array` that have a fuzzy
5243
- // match against `pattern`.
5244
- fuzzy.simpleFilter = function(pattern, array) {
5245
- return array.filter(function(str) {
5246
- return fuzzy.test(pattern, str);
5247
- });
5248
- };
5249
-
5250
- // Does `pattern` fuzzy match `str`?
5251
- fuzzy.test = function(pattern, str) {
5252
- return fuzzy.match(pattern, str) !== null;
5253
- };
5254
-
5255
- // If `pattern` matches `str`, wrap each matching character
5256
- // in `opts.pre` and `opts.post`. If no match, return null
5257
- fuzzy.match = function(pattern, str, opts) {
5258
- opts = opts || {};
5259
- var patternIdx = 0
5260
- , result = []
5261
- , len = str.length
5262
- , totalScore = 0
5263
- , currScore = 0
5264
- // prefix
5265
- , pre = opts.pre || ''
5266
- // suffix
5267
- , post = opts.post || ''
5268
- // String to compare against. This might be a lowercase version of the
5269
- // raw string
5270
- , compareString = opts.caseSensitive && str || str.toLowerCase()
5271
- , ch;
5272
-
5273
- pattern = opts.caseSensitive && pattern || pattern.toLowerCase();
5274
-
5275
- // For each character in the string, either add it to the result
5276
- // or wrap in template if it's the next string in the pattern
5277
- for(var idx = 0; idx < len; idx++) {
5278
- ch = str[idx];
5279
- if(compareString[idx] === pattern[patternIdx]) {
5280
- ch = pre + ch + post;
5281
- patternIdx += 1;
5282
-
5283
- // consecutive characters should increase the score more than linearly
5284
- currScore += 1 + currScore;
5285
- } else {
5286
- currScore = 0;
5287
- }
5288
- totalScore += currScore;
5289
- result[result.length] = ch;
5290
- }
5291
-
5292
- // return rendered string if we have a match for every char
5293
- if(patternIdx === pattern.length) {
5294
- // if the string is an exact match with pattern, totalScore should be maxed
5295
- totalScore = (compareString === pattern) ? Infinity : totalScore;
5296
- return {rendered: result.join(''), score: totalScore};
5297
- }
5298
-
5299
- return null;
5300
- };
5301
-
5302
- // The normal entry point. Filters `arr` for matches against `pattern`.
5303
- // It returns an array with matching values of the type:
5304
- //
5305
- // [{
5306
- // string: '<b>lah' // The rendered string
5307
- // , index: 2 // The index of the element in `arr`
5308
- // , original: 'blah' // The original element in `arr`
5309
- // }]
5310
- //
5311
- // `opts` is an optional argument bag. Details:
5312
- //
5313
- // opts = {
5314
- // // string to put before a matching character
5315
- // pre: '<b>'
5316
- //
5317
- // // string to put after matching character
5318
- // , post: '</b>'
5319
- //
5320
- // // Optional function. Input is an entry in the given arr`,
5321
- // // output should be the string to test `pattern` against.
5322
- // // In this example, if `arr = [{crying: 'koala'}]` we would return
5323
- // // 'koala'.
5324
- // , extract: function(arg) { return arg.crying; }
5325
- // }
5326
- fuzzy.filter = function(pattern, arr, opts) {
5327
- if(!arr || arr.length === 0) {
5328
- return [];
5329
- }
5330
- if (typeof pattern !== 'string') {
5331
- return arr;
5332
- }
5333
- opts = opts || {};
5334
- return arr
5335
- .reduce(function(prev, element, idx, arr) {
5336
- var str = element;
5337
- if(opts.extract) {
5338
- str = opts.extract(element);
5339
- }
5340
- var rendered = fuzzy.match(pattern, str, opts);
5341
- if(rendered != null) {
5342
- prev[prev.length] = {
5343
- string: rendered.rendered
5344
- , score: rendered.score
5345
- , index: idx
5346
- , original: element
5347
- };
5348
- }
5349
- return prev;
5350
- }, [])
5351
-
5352
- // Sort by score. Browsers are inconsistent wrt stable/unstable
5353
- // sorting, so force stable by using the index in the case of tie.
5354
- // See http://ofb.net/~sethml/is-sort-stable.html
5355
- .sort(function(a,b) {
5356
- var compare = b.score - a.score;
5357
- if(compare) return compare;
5358
- return a.index - b.index;
5359
- });
5360
- };
5361
-
5362
-
5363
- }());
5364
-
5365
-
5366
- },{}],32:[function(require,module,exports){
5500
+ },{"./src/suggestions":32}],31:[function(require,module,exports){
5367
5501
  'Use strict';
5368
5502
 
5369
5503
  var List = function(component) {
@@ -5460,7 +5594,7 @@ List.prototype.next = function() {
5460
5594
 
5461
5595
  module.exports = List;
5462
5596
 
5463
- },{}],33:[function(require,module,exports){
5597
+ },{}],32:[function(require,module,exports){
5464
5598
  'use strict';
5465
5599
 
5466
5600
  var extend = require('xtend');
@@ -5679,7 +5813,63 @@ Suggestions.prototype.getItemValue = function(item) {
5679
5813
 
5680
5814
  module.exports = Suggestions;
5681
5815
 
5682
- },{"./list":32,"fuzzy":31,"xtend":36}],34:[function(require,module,exports){
5816
+ },{"./list":31,"fuzzy":3,"xtend":37}],33:[function(require,module,exports){
5817
+ (function (global){
5818
+ 'use strict';
5819
+
5820
+ Object.defineProperty(exports, "__esModule", {
5821
+ value: true
5822
+ });
5823
+
5824
+ var _ponyfill = require('./ponyfill.js');
5825
+
5826
+ var _ponyfill2 = _interopRequireDefault(_ponyfill);
5827
+
5828
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
5829
+
5830
+ var root; /* global window */
5831
+
5832
+
5833
+ if (typeof self !== 'undefined') {
5834
+ root = self;
5835
+ } else if (typeof window !== 'undefined') {
5836
+ root = window;
5837
+ } else if (typeof global !== 'undefined') {
5838
+ root = global;
5839
+ } else if (typeof module !== 'undefined') {
5840
+ root = module;
5841
+ } else {
5842
+ root = Function('return this')();
5843
+ }
5844
+
5845
+ var result = (0, _ponyfill2['default'])(root);
5846
+ exports['default'] = result;
5847
+ }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
5848
+ },{"./ponyfill.js":34}],34:[function(require,module,exports){
5849
+ 'use strict';
5850
+
5851
+ Object.defineProperty(exports, "__esModule", {
5852
+ value: true
5853
+ });
5854
+ exports['default'] = symbolObservablePonyfill;
5855
+ function symbolObservablePonyfill(root) {
5856
+ var result;
5857
+ var _Symbol = root.Symbol;
5858
+
5859
+ if (typeof _Symbol === 'function') {
5860
+ if (_Symbol.observable) {
5861
+ result = _Symbol.observable;
5862
+ } else {
5863
+ result = _Symbol('observable');
5864
+ _Symbol.observable = result;
5865
+ }
5866
+ } else {
5867
+ result = '@@observable';
5868
+ }
5869
+
5870
+ return result;
5871
+ };
5872
+ },{}],35:[function(require,module,exports){
5683
5873
  var each = require('turf-meta').coordEach;
5684
5874
 
5685
5875
  /**
@@ -5749,7 +5939,7 @@ module.exports = function(layer) {
5749
5939
  return extent;
5750
5940
  };
5751
5941
 
5752
- },{"turf-meta":35}],35:[function(require,module,exports){
5942
+ },{"turf-meta":36}],36:[function(require,module,exports){
5753
5943
  /**
5754
5944
  * Lazily iterate over coordinates in any GeoJSON object, similar to
5755
5945
  * Array.forEach.
@@ -5889,7 +6079,7 @@ function propReduce(layer, callback, memo) {
5889
6079
  }
5890
6080
  module.exports.propReduce = propReduce;
5891
6081
 
5892
- },{}],36:[function(require,module,exports){
6082
+ },{}],37:[function(require,module,exports){
5893
6083
  module.exports = extend
5894
6084
 
5895
6085
  var hasOwnProperty = Object.prototype.hasOwnProperty;
@@ -5910,7 +6100,7 @@ function extend() {
5910
6100
  return target
5911
6101
  }
5912
6102
 
5913
- },{}],37:[function(require,module,exports){
6103
+ },{}],38:[function(require,module,exports){
5914
6104
  'use strict';
5915
6105
 
5916
6106
  Object.defineProperty(exports, "__esModule", {
@@ -6314,7 +6504,7 @@ function eventEmit(type, data) {
6314
6504
  };
6315
6505
  }
6316
6506
 
6317
- },{"../constants/action_types":38,"../utils":46}],38:[function(require,module,exports){
6507
+ },{"../constants/action_types":39,"../utils":47}],39:[function(require,module,exports){
6318
6508
  'use strict';
6319
6509
 
6320
6510
  Object.defineProperty(exports, "__esModule", {
@@ -6337,7 +6527,7 @@ var ROUTE_INDEX = exports.ROUTE_INDEX = 'ROUTE_INDEX';
6337
6527
  var SET_OPTIONS = exports.SET_OPTIONS = 'SET_OPTIONS';
6338
6528
  var WAYPOINTS = exports.WAYPOINTS = 'WAYPOINTS';
6339
6529
 
6340
- },{}],39:[function(require,module,exports){
6530
+ },{}],40:[function(require,module,exports){
6341
6531
  'use strict';
6342
6532
 
6343
6533
  Object.defineProperty(exports, "__esModule", {
@@ -6356,10 +6546,6 @@ var _lodash = require('lodash.debounce');
6356
6546
 
6357
6547
  var _lodash2 = _interopRequireDefault(_lodash);
6358
6548
 
6359
- var _xtend = require('xtend');
6360
-
6361
- var _xtend2 = _interopRequireDefault(_xtend);
6362
-
6363
6549
  var _events = require('events');
6364
6550
 
6365
6551
  var _utils = require('../utils');
@@ -6378,14 +6564,8 @@ var Geocoder = function () {
6378
6564
  function Geocoder(options) {
6379
6565
  _classCallCheck(this, Geocoder);
6380
6566
 
6381
- var defaultOptions = {
6382
- placeholder: 'Search',
6383
- zoom: 16,
6384
- flyTo: true
6385
- };
6386
-
6387
6567
  this._ev = new _events.EventEmitter();
6388
- this.options = (0, _xtend2.default)({}, defaultOptions, options);
6568
+ this.options = options;
6389
6569
  this.api = options && options.api || 'https://api.mapbox.com/geocoding/v5/mapbox.places/';
6390
6570
  }
6391
6571
 
@@ -6469,11 +6649,13 @@ var Geocoder = function () {
6469
6649
  this._loadingEl.classList.add('active');
6470
6650
  this.fire('loading');
6471
6651
 
6472
- var options = [];
6473
- if (this.options.proximity) options.push('proximity=' + this.options.proximity.join());
6474
- if (this.options.bbox) options.push('bbox=' + this.options.bbox.join());
6475
- if (this.options.country) options.push('country=' + this.options.country);
6476
- if (this.options.types) options.push('types=' + this.options.types);
6652
+ var geocodingOptions = this.options;
6653
+ var exclude = ['placeholder', 'zoom', 'flyTo', 'accessToken'];
6654
+ var options = Object.keys(this.options).filter(function (key) {
6655
+ return exclude.indexOf(key) === -1;
6656
+ }).map(function (key) {
6657
+ return key + '=' + geocodingOptions[key];
6658
+ });
6477
6659
 
6478
6660
  var accessToken = this.options.accessToken ? this.options.accessToken : mapboxgl.accessToken;
6479
6661
  options.push('access_token=' + accessToken);
@@ -6654,7 +6836,7 @@ var Geocoder = function () {
6654
6836
  exports.default = Geocoder;
6655
6837
  ;
6656
6838
 
6657
- },{"../utils":46,"events":1,"lodash.debounce":4,"suggestions":30,"xtend":36}],40:[function(require,module,exports){
6839
+ },{"../utils":47,"events":2,"lodash.debounce":6,"suggestions":30}],41:[function(require,module,exports){
6658
6840
  'use strict';
6659
6841
 
6660
6842
  Object.defineProperty(exports, "__esModule", {
@@ -6757,25 +6939,25 @@ var Inputs = function () {
6757
6939
 
6758
6940
  var _store$getState3 = this.store.getState(),
6759
6941
  geocoder = _store$getState3.geocoder,
6760
- accessToken = _store$getState3.accessToken;
6942
+ accessToken = _store$getState3.accessToken,
6943
+ flyTo = _store$getState3.flyTo,
6944
+ placeholderOrigin = _store$getState3.placeholderOrigin,
6945
+ placeholderDestination = _store$getState3.placeholderDestination,
6946
+ zoom = _store$getState3.zoom;
6761
6947
 
6762
6948
  this.originInput = new _geocoder2.default(Object.assign({}, {
6763
- flyTo: false,
6764
- placeholder: 'Choose a starting place',
6765
6949
  accessToken: accessToken
6766
- }, geocoder));
6950
+ }, geocoder, { flyTo: flyTo, placeholder: placeholderOrigin, zoom: zoom }));
6767
6951
 
6768
- var originEl = this.originInput.onAdd();
6952
+ var originEl = this.originInput.onAdd(this._map);
6769
6953
  var originContainerEl = this.container.querySelector('#mapbox-directions-origin-input');
6770
6954
  originContainerEl.appendChild(originEl);
6771
6955
 
6772
6956
  this.destinationInput = new _geocoder2.default(Object.assign({}, {
6773
- flyTo: false,
6774
- placeholder: 'Choose destination',
6775
6957
  accessToken: accessToken
6776
- }, geocoder));
6958
+ }, geocoder, { flyTo: flyTo, placeholder: placeholderDestination, zoom: zoom }));
6777
6959
 
6778
- var destinationEl = this.destinationInput.onAdd();
6960
+ var destinationEl = this.destinationInput.onAdd(this._map);
6779
6961
  this.container.querySelector('#mapbox-directions-destination-input').appendChild(destinationEl);
6780
6962
 
6781
6963
  this.originInput.on('result', function (e) {
@@ -6855,7 +7037,7 @@ var Inputs = function () {
6855
7037
 
6856
7038
  exports.default = Inputs;
6857
7039
 
6858
- },{"./geocoder":39,"lodash.isequal":5,"lodash.template":6,"turf-extent":34}],41:[function(require,module,exports){
7040
+ },{"./geocoder":40,"lodash.isequal":7,"lodash.template":8,"turf-extent":35}],42:[function(require,module,exports){
6859
7041
  'use strict';
6860
7042
 
6861
7043
  Object.defineProperty(exports, "__esModule", {
@@ -6990,7 +7172,7 @@ var Instructions = function () {
6990
7172
 
6991
7173
  exports.default = Instructions;
6992
7174
 
6993
- },{"../utils":46,"lodash.isequal":5,"lodash.template":6}],42:[function(require,module,exports){
7175
+ },{"../utils":47,"lodash.isequal":7,"lodash.template":8}],43:[function(require,module,exports){
6994
7176
  'use strict';
6995
7177
 
6996
7178
  Object.defineProperty(exports, "__esModule", {
@@ -7059,11 +7241,15 @@ var store = storeWithMiddleware(_reducers2.default);
7059
7241
  * @param {Boolean} [options.congestion=false] Whether to enable congestion along the route line.
7060
7242
  * @param {String} [options.unit="imperial"] Measurement system to be used in navigation instructions. Options: `imperial`, `metric`
7061
7243
  * @param {Function} [options.compile=null] Provide a custom function for generating instruction, compatible with osrm-text-instructions.
7062
- * @param {Object} [options.geocoder] Pass options available to mapbox-gl-geocoder as [documented here](https://github.com/mapbox/mapbox-gl-geocoder/blob/master/API.md#mapboxglgeocoder).
7244
+ * @param {Object} [options.geocoder] Accepts an object containing the query parameters as [documented here](https://www.mapbox.com/api-documentation/#search-for-places).
7063
7245
  * @param {Object} [options.controls]
7064
7246
  * @param {Boolean} [options.controls.inputs=true] Hide or display the inputs control.
7065
7247
  * @param {Boolean} [options.controls.instructions=true] Hide or display the instructions control.
7066
7248
  * @param {Boolean} [options.controls.profileSwitcher=true] Hide or display the default profile switch with options for traffic, driving, walking and cycling.
7249
+ * @param {Number} [options.zoom=16] If no bbox exists from the geocoder result, the zoom you set here will be used in the flyTo.
7250
+ * @param {String} [options.placeholderOrigin="Choose a starting place"] If set, this text will appear as the placeholder attribute for the origin input element.
7251
+ * @param {String} [options.placeholderDestination="Choose destination"] If set, this text will appear as the placeholder attribute for the destination input element.
7252
+ * @param {Boolean} [options.flyTo=true] If false, animating the map to a selected result is disabled.
7067
7253
  * @example
7068
7254
  * var MapboxDirections = require('../src/index');
7069
7255
  * var directions = new MapboxDirections({
@@ -7648,7 +7834,7 @@ var MapboxDirections = function () {
7648
7834
 
7649
7835
  exports.default = MapboxDirections;
7650
7836
 
7651
- },{"./actions":37,"./controls/inputs":40,"./controls/instructions":41,"./directions_style":43,"./reducers":45,"./utils":46,"polyline":9,"redux":16,"redux-thunk":10}],43:[function(require,module,exports){
7837
+ },{"./actions":38,"./controls/inputs":41,"./controls/instructions":42,"./directions_style":44,"./reducers":46,"./utils":47,"polyline":20,"redux":28,"redux-thunk":22}],44:[function(require,module,exports){
7652
7838
  'use strict';
7653
7839
 
7654
7840
  Object.defineProperty(exports, "__esModule", {
@@ -7782,7 +7968,7 @@ var style = [{
7782
7968
 
7783
7969
  exports.default = style;
7784
7970
 
7785
- },{}],44:[function(require,module,exports){
7971
+ },{}],45:[function(require,module,exports){
7786
7972
  'use strict';
7787
7973
 
7788
7974
  var _directions = require('./directions');
@@ -7793,7 +7979,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
7793
7979
 
7794
7980
  module.exports = _directions2.default;
7795
7981
 
7796
- },{"./directions":42}],45:[function(require,module,exports){
7982
+ },{"./directions":43}],46:[function(require,module,exports){
7797
7983
  'use strict';
7798
7984
 
7799
7985
  Object.defineProperty(exports, "__esModule", {
@@ -7819,6 +8005,10 @@ var initialState = {
7819
8005
  alternatives: false,
7820
8006
  congestion: false,
7821
8007
  unit: 'imperial',
8008
+ flyTo: true,
8009
+ placeholderOrigin: 'Choose a starting place',
8010
+ placeholderDestination: 'Choose destination',
8011
+ zoom: 16,
7822
8012
  compile: null,
7823
8013
  proximity: false,
7824
8014
  styles: [],
@@ -7948,7 +8138,7 @@ function data() {
7948
8138
 
7949
8139
  exports.default = data;
7950
8140
 
7951
- },{"../constants/action_types.js":38,"deep-assign":2}],46:[function(require,module,exports){
8141
+ },{"../constants/action_types.js":39,"deep-assign":1}],47:[function(require,module,exports){
7952
8142
  'use strict';
7953
8143
 
7954
8144
  Object.defineProperty(exports, "__esModule", {
@@ -8016,5 +8206,5 @@ var format = {
8016
8206
 
8017
8207
  exports.default = { format: format, coordinateMatch: coordinateMatch, createPoint: createPoint, validCoords: validCoords, wrap: wrap, roundWithOriginalPrecision: roundWithOriginalPrecision };
8018
8208
 
8019
- },{}]},{},[44])(44)
8209
+ },{}]},{},[45])(45)
8020
8210
  });