UNPKG

mapbox-gl

Version:
2 lines 71.2 kB
!function t(e,n,r){function i(s,a){if(!n[s]){if(!e[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(o)return o(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var l=n[s]={exports:{}};e[s][0].call(l.exports,function(t){var n=e[s][1][t];return i(n?n:t)},l,l.exports,t,e,n,r)}return n[s].exports}for(var o="function"==typeof require&&require,s=0;s<r.length;s++)i(r[s]);return i}({1:[function(t,e){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}var r=t("./src/directions"),i=n(r);window.mapboxgl?mapboxgl.Directions=i["default"]:"undefined"!=typeof e&&(e.exports=i["default"])},{"./src/directions":42}],2:[function(t,e){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function r(t){return"function"==typeof t}function i(t){return"number"==typeof t}function o(t){return"object"==typeof t&&null!==t}function s(t){return void 0===t}e.exports=n,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(t){if(!i(t)||0>t||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},n.prototype.emit=function(t){var e,n,i,a,u,c;if(this._events||(this._events={}),"error"===t&&(!this._events.error||o(this._events.error)&&!this._events.error.length)){if(e=arguments[1],e instanceof Error)throw e;var l=new Error('Uncaught, unspecified "error" event. ('+e+")");throw l.context=e,l}if(n=this._events[t],s(n))return!1;if(r(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:a=Array.prototype.slice.call(arguments,1),n.apply(this,a)}else if(o(n))for(a=Array.prototype.slice.call(arguments,1),c=n.slice(),i=c.length,u=0;i>u;u++)c[u].apply(this,a);return!0},n.prototype.addListener=function(t,e){var i;if(!r(e))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",t,r(e.listener)?e.listener:e),this._events[t]?o(this._events[t])?this._events[t].push(e):this._events[t]=[this._events[t],e]:this._events[t]=e,o(this._events[t])&&!this._events[t].warned&&(i=s(this._maxListeners)?n.defaultMaxListeners:this._maxListeners,i&&i>0&&this._events[t].length>i&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace())),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(t,e){function n(){this.removeListener(t,n),i||(i=!0,e.apply(this,arguments))}if(!r(e))throw TypeError("listener must be a function");var i=!1;return n.listener=e,this.on(t,n),this},n.prototype.removeListener=function(t,e){var n,i,s,a;if(!r(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(n=this._events[t],s=n.length,i=-1,n===e||r(n.listener)&&n.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(o(n)){for(a=s;a-->0;)if(n[a]===e||n[a].listener&&n[a].listener===e){i=a;break}if(0>i)return this;1===n.length?(n.length=0,delete this._events[t]):n.splice(i,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},n.prototype.removeAllListeners=function(t){var e,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[t],r(n))this.removeListener(t,n);else if(n)for(;n.length;)this.removeListener(t,n[n.length-1]);return delete this._events[t],this},n.prototype.listeners=function(t){var e;return e=this._events&&this._events[t]?r(this._events[t])?[this._events[t]]:this._events[t].slice():[]},n.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(r(e))return 1;if(e)return e.length}return 0},n.listenerCount=function(t,e){return t.listenerCount(e)}},{}],3:[function(t,e,n){!function(){var t=this,r={};"undefined"!=typeof n?e.exports=r:t.fuzzy=r,r.simpleFilter=function(t,e){return e.filter(function(e){return r.test(t,e)})},r.test=function(t,e){return null!==r.match(t,e)},r.match=function(t,e,n){n=n||{};var r,i=0,o=[],s=e.length,a=0,u=0,c=n.pre||"",l=n.post||"",f=n.caseSensitive&&e||e.toLowerCase();t=n.caseSensitive&&t||t.toLowerCase();for(var p=0;s>p;p++)r=e[p],f[p]===t[i]?(r=c+r+l,i+=1,u+=1+u):u=0,a+=u,o[o.length]=r;return i===t.length?{rendered:o.join(""),score:a}:null},r.filter=function(t,e,n){return n=n||{},e.reduce(function(e,i,o){var s=i;n.extract&&(s=n.extract(i));var a=r.match(t,s,n);return null!=a&&(e[e.length]={string:a.rendered,score:a.score,index:o,original:i}),e},[]).sort(function(t,e){var n=e.score-t.score;return n?n:t.index-e.index})}}()},{}],4:[function(t,e){var n=/<%=([\s\S]+?)%>/g;e.exports=n},{}],5:[function(t,e,n){(function(t){function r(t){return t&&t.Object===Object?t:null}var i={"function":!0,object:!0},o=i[typeof n]&&n&&!n.nodeType?n:void 0,s=i[typeof e]&&e&&!e.nodeType?e:void 0,a=r(o&&s&&"object"==typeof t&&t),u=r(i[typeof self]&&self),c=r(i[typeof window]&&window),l=r(i[typeof this]&&this),f=a||c!==(l&&l.window)&&c||u||l||Function("return this")();e.exports=f}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],6:[function(t,e){function n(t,e,n){var r=t[e];_.call(t,e)&&u(r,n)&&(void 0!==n||e in t)||(t[e]=n)}function r(t){return function(e){return null==e?void 0:e[t]}}function i(t,e,r,i){r||(r={});for(var o=-1,s=e.length;++o<s;){var a=e[o],u=i?i(r[a],t[a],a,r,t):t[a];n(r,a,u)}return r}function o(t){return h(function(e,n){var r=-1,i=n.length,o=i>1?n[i-1]:void 0,s=i>2?n[2]:void 0;for(o=t.length>3&&"function"==typeof o?(i--,o):void 0,s&&a(n[0],n[1],s)&&(o=3>i?void 0:o,i=1),e=Object(e);++r<i;){var u=n[r];u&&t(e,u,r,o)}return e})}function s(t,e){return e=null==e?y:e,!!e&&("number"==typeof t||m.test(t))&&t>-1&&t%1==0&&e>t}function a(t,e,n){if(!p(n))return!1;var r=typeof e;return("number"==r?c(n)&&s(e,n.length):"string"==r&&e in n)?u(n[e],t):!1}function u(t,e){return t===e||t!==t&&e!==e}function c(t){return null!=t&&f(O(t))&&!l(t)}function l(t){var e=p(t)?w.call(t):"";return e==v||e==g}function f(t){return"number"==typeof t&&t>-1&&t%1==0&&y>=t}function p(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}var d=t("lodash.keysin"),h=t("lodash.rest"),y=9007199254740991,v="[object Function]",g="[object GeneratorFunction]",m=/^(?:0|[1-9]\d*)$/,b=Object.prototype,_=b.hasOwnProperty,w=b.toString,O=r("length"),x=o(function(t,e,n,r){i(e,d(e),t,r)});e.exports=x},{"lodash.keysin":11,"lodash.rest":12}],7:[function(t,e){function n(t,e,n){function r(e){var n=y,r=v;return y=v=void 0,E=e,m=t.apply(r,n)}function o(t){return E=t,b=setTimeout(l,e),j?r(t):m}function s(t){var n=t-x,r=t-E,i=e-n;return I?w(i,g-r):i}function c(t){var n=t-x,r=t-E;return!x||n>=e||0>n||I&&r>=g}function l(){var t=O();return c(t)?f(t):void(b=setTimeout(l,s(t)))}function f(t){return clearTimeout(b),b=void 0,S&&y?r(t):(y=v=void 0,m)}function p(){void 0!==b&&clearTimeout(b),x=E=0,y=v=b=void 0}function d(){return void 0===b?m:f(O())}function h(){var t=O(),n=c(t);if(y=arguments,v=this,x=t,n){if(void 0===b)return o(x);if(I)return clearTimeout(b),b=setTimeout(l,e),r(x)}return void 0===b&&(b=setTimeout(l,e)),m}var y,v,g,m,b,x=0,E=0,j=!1,I=!1,S=!0;if("function"!=typeof t)throw new TypeError(u);return e=a(e)||0,i(n)&&(j=!!n.leading,I="maxWait"in n,g=I?_(a(n.maxWait)||0,e):g,S="trailing"in n?!!n.trailing:S),h.cancel=p,h.flush=d,h}function r(t){var e=i(t)?b.call(t):"";return e==l||e==f}function i(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function o(t){return!!t&&"object"==typeof t}function s(t){return"symbol"==typeof t||o(t)&&b.call(t)==p}function a(t){if("number"==typeof t)return t;if(s(t))return c;if(i(t)){var e=r(t.valueOf)?t.valueOf():t;t=i(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(d,"");var n=y.test(t);return n||v.test(t)?g(t.slice(2),n?2:8):h.test(t)?c:+t}var u="Expected a function",c=0/0,l="[object Function]",f="[object GeneratorFunction]",p="[object Symbol]",d=/^\s+|\s+$/g,h=/^[-+]0x[0-9a-f]+$/i,y=/^0b[01]+$/i,v=/^0o[0-7]+$/i,g=parseInt,m=Object.prototype,b=m.toString,_=Math.max,w=Math.min,O=Date.now;e.exports=n},{}],8:[function(t,e){function n(t){return a[t]}function r(t){return t=i(t),t&&s.test(t)?t.replace(o,n):t}var i=t("lodash.tostring"),o=/[&<>"'`]/g,s=RegExp(o.source),a={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","`":"&#96;"};e.exports=r},{"lodash.tostring":15}],9:[function(t,e){function n(t,e){for(var n=-1,r=t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}function r(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(n){}return e}function i(t){var e=-1,n=Array(t.size);return t.forEach(function(t,r){n[++e]=[r,t]}),n}function o(t){var e=-1,n=Array(t.size);return t.forEach(function(t){n[++e]=t}),n}function s(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function a(){this.__data__=Xe?Xe(null):{}}function u(t){return this.has(t)&&delete this.__data__[t]}function c(t){var e=this.__data__;if(Xe){var n=e[t];return n===re?void 0:n}return Ue.call(e,t)?e[t]:void 0}function l(t){var e=this.__data__;return Xe?void 0!==e[t]:Ue.call(e,t)}function f(t,e){var n=this.__data__;return n[t]=Xe&&void 0===e?re:e,this}function p(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function d(){this.__data__=[]}function h(t){var e=this.__data__,n=A(e,t);if(0>n)return!1;var r=e.length-1;return n==r?e.pop():ze.call(e,n,1),!0}function y(t){var e=this.__data__,n=A(e,t);return 0>n?void 0:e[n][1]}function v(t){return A(this.__data__,t)>-1}function g(t,e){var n=this.__data__,r=A(n,t);return 0>r?n.push([t,e]):n[r][1]=e,this}function m(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function b(){this.__data__={hash:new s,map:new(Ve||p),string:new s}}function _(t){return U(this,t)["delete"](t)}function w(t){return U(this,t).get(t)}function O(t){return U(this,t).has(t)}function x(t,e){return U(this,t).set(t,e),this}function E(t){var e=-1,n=t?t.length:0;for(this.__data__=new m;++e<n;)this.add(t[e])}function j(t){return this.__data__.set(t,re),this}function I(t){return this.__data__.has(t)}function S(t){this.__data__=new p(t)}function T(){this.__data__=new p}function C(t){return this.__data__["delete"](t)}function R(t){return this.__data__.get(t)}function k(t){return this.__data__.has(t)}function N(t,e){var n=this.__data__;return n instanceof p&&n.__data__.length==ne&&(n=this.__data__=new m(n.__data__)),n.set(t,e),this}function A(t,e){for(var n=t.length;n--;)if(B(t[n][0],e))return n;return-1}function M(t,e){return Ue.call(t,e)||"object"==typeof t&&e in t&&null===$(t)}function D(t,e,n,r,i){return t===e?!0:null==t||null==e||!J(t)&&!K(e)?t!==t&&e!==e:L(t,e,D,n,r,i)}function L(t,e,n,i,o,s){var a=an(t),u=an(e),c=ue,l=ue;a||(c=Q(t),c=c==ae?ve:c),u||(l=Q(e),l=l==ae?ve:l);var f=c==ve&&!r(t),p=l==ve&&!r(e),d=c==l;if(d&&!f)return s||(s=new S),a||Z(t)?P(t,e,n,i,o,s):F(t,e,c,n,i,o,s);if(!(o&oe)){var h=f&&Ue.call(t,"__wrapped__"),y=p&&Ue.call(e,"__wrapped__");if(h||y){var v=h?t.value():t,g=y?e.value():e;return s||(s=new S),n(v,g,i,o,s)}}return d?(s||(s=new S),q(t,e,n,i,o,s)):!1}function P(t,e,r,i,o,s){var a=o&oe,u=t.length,c=e.length;if(u!=c&&!(a&&c>u))return!1;var l=s.get(t);if(l)return l==e;var f=-1,p=!0,d=o&ie?new E:void 0;for(s.set(t,e);++f<u;){var h=t[f],y=e[f];if(i)var v=a?i(y,h,f,e,t,s):i(h,y,f,t,e,s);if(void 0!==v){if(v)continue;p=!1;break}if(d){if(!n(e,function(t,e){return d.has(e)||h!==t&&!r(h,t,i,o,s)?void 0:d.add(e)})){p=!1;break}}else if(h!==y&&!r(h,y,i,o,s)){p=!1;break}}return s["delete"](t),p}function F(t,e,n,r,s,a,u){switch(n){case Ee:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case xe:return t.byteLength==e.byteLength&&r(new We(t),new We(e))?!0:!1;case ce:case le:return+t==+e;case fe:return t.name==e.name&&t.message==e.message;case ye:return t!=+t?e!=+e:t==+e;case me:case _e:return t==e+"";case he:var c=i;case be:var l=a&oe;if(c||(c=o),t.size!=e.size&&!l)return!1;var f=u.get(t);return f?f==e:(a|=ie,u.set(t,e),P(c(t),c(e),r,s,a,u));case we:if(sn)return sn.call(t)==sn.call(e)}return!1}function q(t,e,n,r,i,o){var s=i&oe,a=te(t),u=a.length,c=te(e),l=c.length;if(u!=l&&!s)return!1;for(var f=u;f--;){var p=a[f];if(!(s?p in e:M(e,p)))return!1}var d=o.get(t);if(d)return d==e;var h=!0;o.set(t,e);for(var y=s;++f<u;){p=a[f];var v=t[p],g=e[p];if(r)var m=s?r(g,v,p,e,t,o):r(v,g,p,t,e,o);if(!(void 0===m?v===g||n(v,g,r,i,o):m)){h=!1;break}y||(y="constructor"==p)}if(h&&!y){var b=t.constructor,_=e.constructor;b!=_&&"constructor"in t&&"constructor"in e&&!("function"==typeof b&&b instanceof b&&"function"==typeof _&&_ instanceof _)&&(h=!1)}return o["delete"](t),h}function U(t,e){var n=t.__data__;return W(e)?n["string"==typeof e?"string":"hash"]:n.map}function G(t,e){var n=t[e];return X(n)?n:void 0}function $(t){return Be(Object(t))}function Q(t){return Ge.call(t)}function W(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}function z(t){if(null!=t){try{return qe.call(t)}catch(e){}try{return t+""}catch(e){}}return""}function B(t,e){return t===e||t!==t&&e!==e}function H(t,e){return D(t,e)}function V(t){var e=J(t)?Ge.call(t):"";return e==pe||e==de}function Y(t){return"number"==typeof t&&t>-1&&t%1==0&&se>=t}function J(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function K(t){return!!t&&"object"==typeof t}function X(t){if(!J(t))return!1;var e=V(t)||r(t)?$e:De;return e.test(z(t))}function Z(t){return K(t)&&Y(t.length)&&!!Le[Ge.call(t)]}var te=t("lodash.keys"),ee=t("lodash._root"),ne=200,re="__lodash_hash_undefined__",ie=1,oe=2,se=9007199254740991,ae="[object Arguments]",ue="[object Array]",ce="[object Boolean]",le="[object Date]",fe="[object Error]",pe="[object Function]",de="[object GeneratorFunction]",he="[object Map]",ye="[object Number]",ve="[object Object]",ge="[object Promise]",me="[object RegExp]",be="[object Set]",_e="[object String]",we="[object Symbol]",Oe="[object WeakMap]",xe="[object ArrayBuffer]",Ee="[object DataView]",je="[object Float32Array]",Ie="[object Float64Array]",Se="[object Int8Array]",Te="[object Int16Array]",Ce="[object Int32Array]",Re="[object Uint8Array]",ke="[object Uint8ClampedArray]",Ne="[object Uint16Array]",Ae="[object Uint32Array]",Me=/[\\^$.*+?()[\]{}|]/g,De=/^\[object .+?Constructor\]$/,Le={};Le[je]=Le[Ie]=Le[Se]=Le[Te]=Le[Ce]=Le[Re]=Le[ke]=Le[Ne]=Le[Ae]=!0,Le[ae]=Le[ue]=Le[xe]=Le[ce]=Le[Ee]=Le[le]=Le[fe]=Le[pe]=Le[he]=Le[ye]=Le[ve]=Le[me]=Le[be]=Le[_e]=Le[Oe]=!1;var Pe=Array.prototype,Fe=Object.prototype,qe=Function.prototype.toString,Ue=Fe.hasOwnProperty,Ge=Fe.toString,$e=RegExp("^"+qe.call(Ue).replace(Me,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Qe=ee.Symbol,We=ee.Uint8Array,ze=Pe.splice,Be=Object.getPrototypeOf,He=G(ee,"DataView"),Ve=G(ee,"Map"),Ye=G(ee,"Promise"),Je=G(ee,"Set"),Ke=G(ee,"WeakMap"),Xe=G(Object,"create"),Ze=z(He),tn=z(Ve),en=z(Ye),nn=z(Je),rn=z(Ke),on=Qe?Qe.prototype:void 0,sn=on?on.valueOf:void 0;s.prototype.clear=a,s.prototype["delete"]=u,s.prototype.get=c,s.prototype.has=l,s.prototype.set=f,p.prototype.clear=d,p.prototype["delete"]=h,p.prototype.get=y,p.prototype.has=v,p.prototype.set=g,m.prototype.clear=b,m.prototype["delete"]=_,m.prototype.get=w,m.prototype.has=O,m.prototype.set=x,E.prototype.add=E.prototype.push=j,E.prototype.has=I,S.prototype.clear=T,S.prototype["delete"]=C,S.prototype.get=R,S.prototype.has=k,S.prototype.set=N,(He&&Q(new He(new ArrayBuffer(1)))!=Ee||Ve&&Q(new Ve)!=he||Ye&&Q(Ye.resolve())!=ge||Je&&Q(new Je)!=be||Ke&&Q(new Ke)!=Oe)&&(Q=function(t){var e=Ge.call(t),n=e==ve?t.constructor:void 0,r=n?z(n):void 0;if(r)switch(r){case Ze:return Ee;case tn:return he;case en:return ge;case nn:return be;case rn:return Oe}return e});var an=Array.isArray;e.exports=H},{"lodash._root":5,"lodash.keys":10}],10:[function(t,e){function n(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function r(t,e){return I.call(t,e)||"object"==typeof t&&e in t&&null===s(t)}function i(t){return R(Object(t))}function o(t){return function(e){return null==e?void 0:e[t]}}function s(t){return C(Object(t))}function a(t){var e=t?t.length:void 0;return h(e)&&(N(t)||g(t)||l(t))?n(e,String):null}function u(t,e){return e=null==e?b:e,!!e&&("number"==typeof t||E.test(t))&&t>-1&&t%1==0&&e>t}function c(t){var e=t&&t.constructor,n="function"==typeof e&&e.prototype||j;return t===n}function l(t){return p(t)&&I.call(t,"callee")&&(!T.call(t,"callee")||S.call(t)==_)}function f(t){return null!=t&&h(k(t))&&!d(t)}function p(t){return v(t)&&f(t)}function d(t){var e=y(t)?S.call(t):"";return e==w||e==O}function h(t){return"number"==typeof t&&t>-1&&t%1==0&&b>=t}function y(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function v(t){return!!t&&"object"==typeof t}function g(t){return"string"==typeof t||!N(t)&&v(t)&&S.call(t)==x}function m(t){var e=c(t);if(!e&&!f(t))return i(t);var n=a(t),o=!!n,s=n||[],l=s.length;for(var p in t)!r(t,p)||o&&("length"==p||u(p,l))||e&&"constructor"==p||s.push(p);return s}var b=9007199254740991,_="[object Arguments]",w="[object Function]",O="[object GeneratorFunction]",x="[object String]",E=/^(?:0|[1-9]\d*)$/,j=Object.prototype,I=j.hasOwnProperty,S=j.toString,T=j.propertyIsEnumerable,C=Object.getPrototypeOf,R=Object.keys,k=o("length"),N=Array.isArray;e.exports=m},{}],11:[function(t,e,n){(function(t){function r(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function i(t){return t&&t.Object===Object?t:null}function o(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}function s(t){t=null==t?t:Object(t);var e=[];for(var n in t)e.push(n);return e}function a(t){return function(e){return null==e?void 0:e[t]}}function u(t){var e=t?t.length:void 0;return y(e)&&(G(t)||m(t)||f(t))?r(e,String):null}function c(t,e){return e=null==e?_:e,!!e&&("number"==typeof t||j.test(t))&&t>-1&&t%1==0&&e>t}function l(t){var e=t&&t.constructor,n="function"==typeof e&&e.prototype||M;return t===n}function f(t){return d(t)&&D.call(t,"callee")&&(!q.call(t,"callee")||L.call(t)==w)}function p(t){return null!=t&&y(U(t))&&!h(t)}function d(t){return g(t)&&p(t)}function h(t){var e=v(t)?L.call(t):"";return e==O||e==x}function y(t){return"number"==typeof t&&t>-1&&t%1==0&&_>=t}function v(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function g(t){return!!t&&"object"==typeof t}function m(t){return"string"==typeof t||!G(t)&&g(t)&&L.call(t)==E}function b(t){for(var e=-1,n=l(t),r=s(t),i=r.length,o=u(t),a=!!o,f=o||[],p=f.length;++e<i;){var d=r[e];a&&("length"==d||c(d,p))||"constructor"==d&&(n||!D.call(t,d))||f.push(d)}return f}var _=9007199254740991,w="[object Arguments]",O="[object Function]",x="[object GeneratorFunction]",E="[object String]",j=/^(?:0|[1-9]\d*)$/,I={"function":!0,object:!0},S=I[typeof n]&&n&&!n.nodeType?n:void 0,T=I[typeof e]&&e&&!e.nodeType?e:void 0,C=i(S&&T&&"object"==typeof t&&t),R=i(I[typeof self]&&self),k=i(I[typeof window]&&window),N=i(I[typeof this]&&this),A=C||k!==(N&&N.window)&&k||R||N||Function("return this")(),M=Object.prototype,D=M.hasOwnProperty,L=M.toString,P=A.Reflect,F=P?P.enumerate:void 0,q=M.propertyIsEnumerable;F&&!q.call({valueOf:1},"valueOf")&&(s=function(t){return o(F(t))});var U=a("length"),G=Array.isArray;e.exports=b}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],12:[function(t,e){function n(t,e,n){var r=n.length;switch(r){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function r(t,e){if("function"!=typeof t)throw new TypeError(f);return e=j(void 0===e?t.length-1:c(e),0),function(){for(var r=arguments,i=-1,o=j(r.length-e,0),s=Array(o);++i<o;)s[i]=r[e+i];switch(e){case 0:return t.call(this,s);case 1:return t.call(this,r[0],s);case 2:return t.call(this,r[0],r[1],s)}var a=Array(e+1);for(i=-1;++i<e;)a[i]=r[i];return a[e]=s,n(t,this,a)}}function i(t){var e=o(t)?E.call(t):"";return e==y||e==v}function o(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function s(t){return!!t&&"object"==typeof t}function a(t){return"symbol"==typeof t||s(t)&&E.call(t)==g}function u(t){if(!t)return 0===t?t:0;if(t=l(t),t===p||t===-p){var e=0>t?-1:1;return e*d}return t===t?t:0}function c(t){var e=u(t),n=e%1;return e===e?n?e-n:e:0}function l(t){if("number"==typeof t)return t;if(a(t))return h;if(o(t)){var e=i(t.valueOf)?t.valueOf():t;t=o(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(m,"");var n=_.test(t);return n||w.test(t)?O(t.slice(2),n?2:8):b.test(t)?h:+t}var f="Expected a function",p=1/0,d=1.7976931348623157e308,h=0/0,y="[object Function]",v="[object GeneratorFunction]",g="[object Symbol]",m=/^\s+|\s+$/g,b=/^[-+]0x[0-9a-f]+$/i,_=/^0b[01]+$/i,w=/^0o[0-7]+$/i,O=parseInt,x=Object.prototype,E=x.toString,j=Math.max;e.exports=r},{}],13:[function(t,e){function n(t,e,n){var r=n.length;switch(r){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function r(t,e){for(var n=-1,r=t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}function i(t,e){return r(e,function(e){return t[e]})}function o(t){return"\\"+D[t]}function s(t,e,n,r){return void 0===t||l(t,L[n])&&!P.call(r,n)?e:t}function a(t){return function(e){return null==e?void 0:e[t]}}function u(t,e){return e=null==e?E:e,!!e&&("number"==typeof t||N.test(t))&&t>-1&&t%1==0&&e>t}function c(t,e,n){if(!y(n))return!1;var r=typeof e;return("number"==r?f(n)&&u(e,n.length):"string"==r&&e in n)?l(n[e],t):!1}function l(t,e){return t===e||t!==t&&e!==e}function f(t){return null!=t&&h(q(t))&&!d(t)}function p(t){return v(t)?F.call(t)==j||"string"==typeof t.message&&"string"==typeof t.name:!1}function d(t){var e=y(t)?F.call(t):"";return e==I||e==S}function h(t){return"number"==typeof t&&t>-1&&t%1==0&&E>=t}function y(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function v(t){return!!t&&"object"==typeof t}function g(t,e,n){var r=O.imports._.templateSettings||O;n&&c(t,e,n)&&(e=void 0),t=x(t),e=m({},e,r,s);var a,u,l=m({},e.imports,r.imports,s),f=b(l),d=i(l,f),h=0,y=e.interpolate||A,v="__p += '",g=RegExp((e.escape||A).source+"|"+y.source+"|"+(y===_?k:A).source+"|"+(e.evaluate||A).source+"|$","g"),w="sourceURL"in e?"//# sourceURL="+e.sourceURL+"\n":"";t.replace(g,function(e,n,r,i,s,c){return r||(r=i),v+=t.slice(h,c).replace(M,o),n&&(a=!0,v+="' +\n__e("+n+") +\n'"),s&&(u=!0,v+="';\n"+s+";\n__p += '"),r&&(v+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),h=c+e.length,e}),v+="';\n";var E=e.variable;E||(v="with (obj) {\n"+v+"\n}\n"),v=(u?v.replace(T,""):v).replace(C,"$1").replace(R,"$1;"),v="function("+(E||"obj")+") {\n"+(E?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(a?", __e = _.escape":"")+(u?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+v+"return __p\n}";var j=U(function(){return Function(f,w+"return "+v).apply(void 0,d)});if(j.source=v,p(j))throw j;return j}var m=t("lodash.assigninwith"),b=t("lodash.keys"),_=t("lodash._reinterpolate"),w=t("lodash.rest"),O=t("lodash.templatesettings"),x=t("lodash.tostring"),E=9007199254740991,j="[object Error]",I="[object Function]",S="[object GeneratorFunction]",T=/\b__p \+= '';/g,C=/\b(__p \+=) '' \+/g,R=/(__e\(.*?\)|\b__t\)) \+\n'';/g,k=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,N=/^(?:0|[1-9]\d*)$/,A=/($^)/,M=/['\n\r\u2028\u2029\\]/g,D={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},L=Object.prototype,P=L.hasOwnProperty,F=L.toString,q=a("length"),U=w(function(t,e){try{return n(t,void 0,e)}catch(r){return p(r)?r:new Error(r)}});e.exports=g},{"lodash._reinterpolate":4,"lodash.assigninwith":6,"lodash.keys":10,"lodash.rest":12,"lodash.templatesettings":14,"lodash.tostring":15}],14:[function(t,e){var n=t("lodash.escape"),r=t("lodash._reinterpolate"),i=/<%-([\s\S]+?)%>/g,o=/<%([\s\S]+?)%>/g,s={escape:i,evaluate:o,interpolate:r,variable:"",imports:{_:{escape:n}}};e.exports=s},{"lodash._reinterpolate":4,"lodash.escape":8}],15:[function(t,e,n){(function(t){function r(t){return t&&t.Object===Object?t:null}function i(t){if("string"==typeof t)return t;if(s(t))return O?O.call(t):"";var e=t+"";return"0"==e&&1/t==-u?"-0":e}function o(t){return!!t&&"object"==typeof t}function s(t){return"symbol"==typeof t||o(t)&&b.call(t)==c}function a(t){return null==t?"":i(t)}var u=1/0,c="[object Symbol]",l={"function":!0,object:!0},f=l[typeof n]&&n&&!n.nodeType?n:void 0,p=l[typeof e]&&e&&!e.nodeType?e:void 0,d=r(f&&p&&"object"==typeof t&&t),h=r(l[typeof self]&&self),y=r(l[typeof window]&&window),v=r(l[typeof this]&&this),g=d||y!==(v&&v.window)&&y||h||v||Function("return this")(),m=Object.prototype,b=m.toString,_=g.Symbol,w=_?_.prototype:void 0,O=w?w.toString:void 0;e.exports=a}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],16:[function(t,e){function n(t){return r(Object(t))}var r=Object.getPrototypeOf;e.exports=n},{}],17:[function(t,e){function n(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(n){}return e}e.exports=n},{}],18:[function(t,e){function n(t){return!!t&&"object"==typeof t}e.exports=n},{}],19:[function(t,e){function n(t){if(!o(t)||f.call(t)!=s||i(t))return!1;var e=r(t);if(null===e)return!0;var n=c.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&u.call(n)==l}var r=t("./_getPrototype"),i=t("./_isHostObject"),o=t("./isObjectLike"),s="[object Object]",a=Object.prototype,u=Function.prototype.toString,c=a.hasOwnProperty,l=u.call(Object),f=a.toString;e.exports=n},{"./_getPrototype":16,"./_isHostObject":17,"./isObjectLike":18}],20:[function(t,e){"use strict";function n(t){this._ev=new s,this.options=o({},this.options,t)}if(!mapboxgl)throw new Error("include mapboxgl before mapbox-gl-geocoder.js");var r=t("suggestions"),i=t("lodash.debounce"),o=t("xtend"),s=t("events").EventEmitter,a="https://api.mapbox.com/geocoding/v5/mapbox.places/";n.prototype=mapboxgl.util.inherit(mapboxgl.Control,{options:{position:"top-left",placeholder:"Search",zoom:16,flyTo:!0},onAdd:function(t){this.request=new XMLHttpRequest,this.container=this.options.container?"string"==typeof this.options.container?document.getElementById(this.options.container):this.options.container:t.getContainer();var e=document.createElement("div");e.className="mapboxgl-ctrl-geocoder";var n=document.createElement("span");n.className="geocoder-icon geocoder-icon-search";var o=this._inputEl=document.createElement("input");o.type="text",o.placeholder=this.options.placeholder,o.addEventListener("keydown",i(function(t){return t.target.value?void(t.metaKey||-1!==[9,27,37,39,13,38,40].indexOf(t.keyCode)||this._queryFromInput(t.target.value)):this._clearEl.classList.remove("active")}.bind(this)),200),o.addEventListener("change",function(e){e.target.value&&this._clearEl.classList.add("active");var n=this._typeahead.selected;if(n){if(this.options.flyTo)if(n.bbox&&n.context&&n.context.length<=3||n.bbox&&!n.context){var r=n.bbox;t.fitBounds([[r[0],r[1]],[r[2],r[3]]])}else t.flyTo({center:n.center,zoom:this.options.zoom});this._input=n,this.fire("result",{result:n})}}.bind(this));var s=document.createElement("div");s.classList.add("geocoder-pin-right");var a=this._clearEl=document.createElement("button");a.className="geocoder-icon geocoder-icon-close",a.addEventListener("click",this._clear.bind(this));var u=this._loadingEl=document.createElement("span");return u.className="geocoder-icon geocoder-icon-loading",s.appendChild(a),s.appendChild(u),e.appendChild(n),e.appendChild(o),e.appendChild(s),this.container.appendChild(e),this.options.container&&(this.options.position=!1),this._typeahead=new r(o,[],{filter:!1}),this._typeahead.getItemValue=function(t){return t.place_name},e},_geocode:function(t,e){this._loadingEl.classList.add("active"),this.fire("loading");var n=[];this.options.proximity&&n.push("proximity="+this.options.proximity.join()),this.options.bbox&&n.push("bbox="+this.options.bbox.join()),this.options.country&&n.push("country="+this.options.country),this.options.types&&n.push("types="+this.options.types);var r=this.options.accessToken?this.options.accessToken:mapboxgl.accessToken;n.push("access_token="+r),this.request.abort(),this.request.open("GET",a+encodeURIComponent(t.trim())+".json?"+n.join("&"),!0),this.request.onload=function(){if(this._loadingEl.classList.remove("active"),this.request.status>=200&&this.request.status<400){var t=JSON.parse(this.request.responseText);return t.features.length?this._clearEl.classList.add("active"):(this._clearEl.classList.remove("active"),this._typeahead.selected=null),this.fire("results",{results:t.features}),this._typeahead.update(t.features),e(t.features)}this.fire("error",{error:JSON.parse(this.request.responseText).message})}.bind(this),this.request.onerror=function(){this._loadingEl.classList.remove("active"),this.fire("error",{error:JSON.parse(this.request.responseText).message})}.bind(this),this.request.send()},_queryFromInput:function(t){t=t.trim(),t||this._clear(),t.length>2&&this._geocode(t,function(t){this._results=t}.bind(this))},_change:function(){var t=document.createEvent("HTMLEvents");t.initEvent("change",!0,!1),this._inputEl.dispatchEvent(t)},_query:function(t){t&&("object"==typeof t&&t.length&&(t=[mapboxgl.util.wrap(t[0],-180,180),mapboxgl.util.wrap(t[1],-180,180)].join()),this._geocode(t,function(t){if(t.length){var e=t[0];this._results=t,this._typeahead.selected=e,this._inputEl.value=e.place_name,this._change()}}.bind(this)))},_setInput:function(t){t&&("object"==typeof t&&t.length&&(t=[mapboxgl.util.wrap(t[0],-180,180),mapboxgl.util.wrap(t[1],-180,180)].join()),this._inputEl.value=t,this._input=null,this._typeahead.selected=null,this._typeahead.clear(),this._change())},_clear:function(){this._input=null,this._inputEl.value="",this._typeahead.selected=null,this._typeahead.clear(),this._change(),this._inputEl.focus(),this._clearEl.classList.remove("active"),this.fire("clear")},getResult:function(){return this._input},query:function(t){return this._query(t),this},setInput:function(t){return this._setInput(t),this},on:function(t,e){return this._ev.on(t,e),this},fire:function(t,e){return this._ev.emit(t,e),this},off:function(t,e){return this._ev.removeListener(t,e),this}}),window.mapboxgl?mapboxgl.Geocoder=n:"undefined"!=typeof e&&(e.exports=n)},{events:2,"lodash.debounce":7,suggestions:30,xtend:37}],21:[function(t,e){"use strict";function n(t,e){t=Math.round(t*e),t<<=1,0>t&&(t=~t);for(var n="";t>=32;)n+=String.fromCharCode((32|31&t)+63),t>>=5;return n+=String.fromCharCode(t+63)}function r(t){for(var e=[],n=0;n<t.length;n++)e.push(t[n].slice().reverse());return e}var i={};i.decode=function(t,e){for(var n,r,i=0,o=0,s=0,a=[],u=0,c=0,l=null,f=Math.pow(10,e||5);i<t.length;){l=null,u=0,c=0;do l=t.charCodeAt(i++)-63,c|=(31&l)<<u,u+=5;while(l>=32);n=1&c?~(c>>1):c>>1,u=c=0;do l=t.charCodeAt(i++)-63,c|=(31&l)<<u,u+=5;while(l>=32);r=1&c?~(c>>1):c>>1,o+=n,s+=r,a.push([o/f,s/f])}return a},i.encode=function(t,e){if(!t.length)return"";for(var r=Math.pow(10,e||5),i=n(t[0][0],r)+n(t[0][1],r),o=1;o<t.length;o++){var s=t[o],a=t[o-1];i+=n(s[0]-a[0],r),i+=n(s[1]-a[1],r)}return i},i.fromGeoJSON=function(t,e){if(t&&"Feature"===t.type&&(t=t.geometry),!t||"LineString"!==t.type)throw new Error("Input must be a GeoJSON LineString");return i.encode(r(t.coordinates),e)},i.toGeoJSON=function(t,e){var n=i.decode(t,e);return{type:"LineString",coordinates:r(n)}},"object"==typeof e&&e.exports&&(e.exports=i) },{}],22:[function(t,e,n){"use strict";function r(t){return function(e){var n=e.dispatch,r=e.getState;return function(e){return function(i){return"function"==typeof i?i(n,r,t):e(i)}}}}n.__esModule=!0;var i=r();i.withExtraArgument=r,n["default"]=i},{}],23:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(){for(var t=arguments.length,e=Array(t),n=0;t>n;n++)e[n]=arguments[n];return function(t){return function(n,r,i){var s=t(n,r,i),u=s.dispatch,c=[],l={getState:s.getState,dispatch:function(t){return u(t)}};return c=e.map(function(t){return t(l)}),u=a["default"].apply(void 0,c)(s.dispatch),o({},s,{dispatch:u})}}}n.__esModule=!0;var o=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t};n["default"]=i;var s=t("./compose"),a=r(s)},{"./compose":26}],24:[function(t,e,n){"use strict";function r(t,e){return function(){return e(t.apply(void 0,arguments))}}function i(t,e){if("function"==typeof t)return r(t,e);if("object"!=typeof t||null===t)throw new Error("bindActionCreators expected an object or a function, instead received "+(null===t?"null":typeof t)+'. Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?');for(var n=Object.keys(t),i={},o=0;o<n.length;o++){var s=n[o],a=t[s];"function"==typeof a&&(i[s]=r(a,e))}return i}n.__esModule=!0,n["default"]=i},{}],25:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){var n=e&&e.type,r=n&&'"'+n.toString()+'"'||"an action";return"Given action "+r+', reducer "'+t+'" returned undefined. To ignore an action, you must explicitly return the previous state.'}function o(t){Object.keys(t).forEach(function(e){var n=t[e],r=n(void 0,{type:a.ActionTypes.INIT});if("undefined"==typeof r)throw new Error('Reducer "'+e+'" 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.');var i="@@redux/PROBE_UNKNOWN_ACTION_"+Math.random().toString(36).substring(7).split("").join(".");if("undefined"==typeof n(void 0,{type:i}))throw new Error('Reducer "'+e+'" returned undefined when probed with a random type. '+("Don't try to handle "+a.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.")})}function s(t){for(var e=Object.keys(t),n={},r=0;r<e.length;r++){var s=e[r];"function"==typeof t[s]&&(n[s]=t[s])}var a,u=Object.keys(n);try{o(n)}catch(c){a=c}return function(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],e=arguments[1];if(a)throw a;for(var r=!1,o={},s=0;s<u.length;s++){var c=u[s],l=n[c],f=t[c],p=l(f,e);if("undefined"==typeof p){var d=i(c,e);throw new Error(d)}o[c]=p,r=r||p!==f}return r?o:t}}n.__esModule=!0,n["default"]=s;{var a=t("./createStore"),u=t("lodash/isPlainObject"),c=(r(u),t("./utils/warning"));r(c)}},{"./createStore":27,"./utils/warning":29,"lodash/isPlainObject":19}],26:[function(t,e,n){"use strict";function r(){for(var t=arguments.length,e=Array(t),n=0;t>n;n++)e[n]=arguments[n];if(0===e.length)return function(t){return t};var r=function(){var t=e[e.length-1],n=e.slice(0,-1);return{v:function(){return n.reduceRight(function(t,e){return e(t)},t.apply(void 0,arguments))}}}();return"object"==typeof r?r.v:void 0}n.__esModule=!0,n["default"]=r},{}],27:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e,n){function r(){g===v&&(g=v.slice())}function o(){return y}function a(t){if("function"!=typeof t)throw new Error("Expected listener to be a function.");var e=!0;return r(),g.push(t),function(){if(e){e=!1,r();var n=g.indexOf(t);g.splice(n,1)}}}function l(t){if(!s["default"](t))throw new Error("Actions must be plain objects. Use custom middleware for async actions.");if("undefined"==typeof t.type)throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(m)throw new Error("Reducers may not dispatch actions.");try{m=!0,y=h(y,t)}finally{m=!1}for(var e=v=g,n=0;n<e.length;n++)e[n]();return t}function f(t){if("function"!=typeof t)throw new Error("Expected the nextReducer to be a function.");h=t,l({type:c.INIT})}function p(){var t,e=a;return t={subscribe:function(t){function n(){t.next&&t.next(o())}if("object"!=typeof t)throw new TypeError("Expected the observer to be an object.");n();var r=e(n);return{unsubscribe:r}}},t[u["default"]]=function(){return this},t}var d;if("function"==typeof e&&"undefined"==typeof n&&(n=e,e=void 0),"undefined"!=typeof n){if("function"!=typeof n)throw new Error("Expected the enhancer to be a function.");return n(i)(t,e)}if("function"!=typeof t)throw new Error("Expected the reducer to be a function.");var h=t,y=e,v=[],g=v,m=!1;return l({type:c.INIT}),d={dispatch:l,subscribe:a,getState:o,replaceReducer:f},d[u["default"]]=p,d}n.__esModule=!0,n.ActionTypes=void 0,n["default"]=i;var o=t("lodash/isPlainObject"),s=r(o),a=t("symbol-observable"),u=r(a),c=n.ActionTypes={INIT:"@@redux/INIT"}},{"lodash/isPlainObject":19,"symbol-observable":33}],28:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}n.__esModule=!0,n.compose=n.applyMiddleware=n.bindActionCreators=n.combineReducers=n.createStore=void 0;{var i=t("./createStore"),o=r(i),s=t("./combineReducers"),a=r(s),u=t("./bindActionCreators"),c=r(u),l=t("./applyMiddleware"),f=r(l),p=t("./compose"),d=r(p),h=t("./utils/warning");r(h)}n.createStore=o["default"],n.combineReducers=a["default"],n.bindActionCreators=c["default"],n.applyMiddleware=f["default"],n.compose=d["default"]},{"./applyMiddleware":23,"./bindActionCreators":24,"./combineReducers":25,"./compose":26,"./createStore":27,"./utils/warning":29}],29:[function(t,e,n){"use strict";function r(t){"undefined"!=typeof console&&"function"==typeof console.error&&console.error(t);try{throw new Error(t)}catch(e){}}n.__esModule=!0,n["default"]=r},{}],30:[function(t,e){"use strict";var n=t("./src/suggestions");window.Suggestions=e.exports=n},{"./src/suggestions":32}],31:[function(t,e){"Use strict";var n=function(t){return this.component=t,this.items=[],this.active=0,this.element=document.createElement("ul"),this.element.className="suggestions",t.el.parentNode.insertBefore(this.element,t.el.nextSibling),this};n.prototype.show=function(){this.element.style.display="block"},n.prototype.hide=function(){this.element.style.display="none"},n.prototype.add=function(t){this.items.push(t)},n.prototype.clear=function(){this.items=[],this.active=0},n.prototype.isEmpty=function(){return!this.items.length},n.prototype.draw=function(){if(this.element.innerHTML="",0===this.items.length)return void this.hide();for(var t=0;t<this.items.length;t++)this.drawItem(this.items[t],this.active===t);this.show()},n.prototype.drawItem=function(t,e){var n=document.createElement("li"),r=document.createElement("a");e&&(n.className+=" active"),r.innerHTML=t.string,n.appendChild(r),this.element.appendChild(n),n.addEventListener("mousedown",function(){this.handleMouseDown.call(this,t)}.bind(this))},n.prototype.handleMouseDown=function(t){this.component.value(t.original),this.clear(),this.draw()},n.prototype.move=function(t){this.active=t,this.draw()},n.prototype.previous=function(){this.move(0===this.active?this.items.length-1:this.active-1)},n.prototype.next=function(){this.move(this.active===this.items.length-1?0:this.active+1)},e.exports=n},{}],32:[function(t,e){"use strict";var n=t("xtend"),r=t("fuzzy"),i=t("./list"),o=function(t,e,r){return r=r||{},this.options=n({minLength:2,limit:5,filter:!0},r),this.el=t,this.data=e||[],this.list=new i(this),this.query="",this.selected=null,this.list.draw(),this.el.addEventListener("keyup",function(t){this.handleKeyUp(t.keyCode)}.bind(this),!1),this.el.addEventListener("keydown",function(t){this.handleKeyDown(t)}.bind(this)),this.el.addEventListener("focus",function(){this.handleFocus()}.bind(this)),this.el.addEventListener("blur",function(){this.handleBlur()}.bind(this)),this};o.prototype.handleKeyUp=function(t){return 40!==t&&38!==t&&27!==t&&13!==t&&9!==t?(this.query=this.normalize(this.el.value),this.list.clear(),this.query.length<this.options.minLength?void this.list.draw():void this.getCandidates(function(t){for(var e=0;e<t.length&&(this.list.add(t[e]),e!==this.options.limit-1);e++);this.list.draw()}.bind(this))):void 0},o.prototype.handleKeyDown=function(t){switch(t.keyCode){case 13:case 9:this.list.isEmpty()||(this.value(this.list.items[this.list.active].original),this.list.hide());break;case 27:this.list.isEmpty()||this.list.hide();break;case 38:this.list.previous();break;case 40:this.list.next()}},o.prototype.handleBlur=function(){this.list.hide()},o.prototype.handleFocus=function(){this.list.isEmpty()||this.list.show()},o.prototype.update=function(t){this.data=t,this.list.draw()},o.prototype.clear=function(){this.data=[],this.list.clear()},o.prototype.normalize=function(t){return t=t.toLowerCase()},o.prototype.match=function(t,e){return t.indexOf(e)>-1},o.prototype.value=function(t){if(this.selected=t,this.el.value=this.getItemValue(t),document.createEvent){var e=document.createEvent("HTMLEvents");e.initEvent("change",!0,!1),this.el.dispatchEvent(e)}else this.el.fireEvent("onchange")},o.prototype.getCandidates=function(t){var e={pre:"<strong>",post:"</strong>",extract:function(t){return this.getItemValue(t)}.bind(this)},n=this.options.filter?r.filter(this.query,this.data,e):this.data.map(function(t){return{original:t,string:this.getItemValue(t).replace(new RegExp("("+this.query+")","ig"),function(t,e){return"<strong>"+e+"</strong>"})}}.bind(this));t(n)},o.prototype.getItemValue=function(t){return t},e.exports=o},{"./list":31,fuzzy:3,xtend:37}],33:[function(t,e){(function(n){"use strict";e.exports=t("./ponyfill")(n||window||this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./ponyfill":34}],34:[function(t,e){"use strict";e.exports=function(t){var e,n=t.Symbol;return"function"==typeof n?n.observable?e=n.observable:(e=n("observable"),n.observable=e):e="@@observable",e}},{}],35:[function(t,e){var n=t("turf-meta").coordEach;e.exports=function(t){var e=[1/0,1/0,-1/0,-1/0];return n(t,function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]<t[0]&&(e[2]=t[0]),e[3]<t[1]&&(e[3]=t[1])}),e}},{"turf-meta":36}],36:[function(t,e){function n(t,e,n){var r,i,o,s,a,u,c,f,p,d=0,h="FeatureCollection"===t.type,y="Feature"===t.type,v=h?t.features.length:1;for(r=0;v>r;r++)for(f=h?t.features[r].geometry:y?t.geometry:t,p="GeometryCollection"===f.type,u=p?f.geometries.length:1,s=0;u>s;s++)if(a=p?f.geometries[s]:f,c=a.coordinates,d=!n||"Polygon"!==a.type&&"MultiPolygon"!==a.type?0:1,"Point"===a.type)e(c);else if("LineString"===a.type||"MultiPoint"===a.type)for(i=0;i<c.length;i++)e(c[i]);else if("Polygon"===a.type||"MultiLineString"===a.type)for(i=0;i<c.length;i++)for(o=0;o<c[i].length-d;o++)e(c[i][o]);else{if("MultiPolygon"!==a.type)throw new Error("Unknown Geometry Type");for(i=0;i<c.length;i++)for(o=0;o<c[i].length;o++)for(l=0;l<c[i][o].length-d;l++)e(c[i][o][l])}}function r(t,e,r,i){return n(t,function(t){r=e(r,t)},i),r}function i(t,e){var n;switch(t.type){case"FeatureCollection":for(features=t.features,n=0;n<t.features.length;n++)e(t.features[n].properties);break;case"Feature":e(t.properties)}}function o(t,e,n){return i(t,function(t){n=e(n,t)}),n}e.exports.coordEach=n,e.exports.coordReduce=r,e.exports.propEach=i,e.exports.propReduce=o},{}],37:[function(t,e){function n(){for(var t={},e=0;e<arguments.length;e++){var n=arguments[e];for(var i in n)r.call(n,i)&&(t[i]=n[i])}return t}e.exports=n;var r=Object.prototype.hasOwnProperty},{}],38:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e}function o(t){return function(e){var n=P["default"].createPoint(t,{id:"origin","marker-symbol":"A"});e({type:D.ORIGIN,origin:n}),e(A("origin",{feature:n}))}}function s(t){return function(e){var n=P["default"].createPoint(t,{id:"destination","marker-symbol":"B"});e({type:D.DESTINATION,destination:n}),e(A("destination",{feature:n}))}}function a(t){return function(e){e({type:D.DIRECTIONS,directions:t}),e(A("route",{route:t}))}}function u(t){return{type:D.WAYPOINTS,waypoints:t}}function c(t){return{type:D.HOVER_MARKER,hoverMarker:t}}function l(){return function(t,e){var n=e(),r=n.api,i=n.accessToken,u=n.routeIndex,c=n.profile,l=f(e),p=[];p.push("geometry=polyline"),p.push("instructions=text"),p.push("alternatives=true"),p.push("steps=true");var h=i?i:mapboxgl.accessToken;p.push("access_token="+h),F.abort(),F.open("GET",r+"mapbox."+c+"/"+l+".json?"+p.join("&"),!0),F.onload=function(){if(!(F.status>=200&&F.status<400))return t(a([])),t(d(JSON.parse(F.responseText).message));var e=JSON.parse(F.responseText);return e.error?(t(a([])),t(d(e.error))):(t(d(null)),e.routes[u]||t(O(0)),t(a(e.routes)),t(o(e.origin.geometry.coordinates)),void t(s(e.destination.geometry.coordinates)))},F.onerror=function(){return t(a([])),t(d(JSON.parse(F.responseText).message))},F.send()}}function f(t){var e=t(),n=e.origin,r=e.destination,i=e.waypoints,o=[];return o=o.concat(n.geometry.coordinates),o.push(";"),i.length&&i.forEach(function(t){o=o.concat(t.geometry.coordinates),o.push(";")}),o=o.concat(r.geometry.coordinates),encodeURIComponent(o.join())}function p(t){var e={id:"waypoint"};return Object.assign(t,{properties:t.properties?Object.assign(t.properties,e):e})}function d(t){return function(e){e({type:"ERROR",error:t}),t&&e(A("error",{error:t}))}}function h(t){return{type:D.ORIGIN_QUERY,query:t}}function y(t){return{type:D.DESTINATION_QUERY,query:t}}function v(t){return{type:D.ORIGIN_FROM_COORDINATES,coordinates:t}}function g(t){return{type:D.DESTINATION_FROM_COORDINATES,coordinates:t}}function m(){return function(t){t({type:D.ORIGIN_CLEAR}),t(A("clear",{type:"origin"})),t(d(null))}}function b(){return function(t){t({type:D.DESTINATION_CLEAR}),t(A("clear",{type:"destination"})),t(d(null))}}function _(t){return{type:D.SET_OPTIONS,options:t}}function w(t){return function(e){var n=t?P["default"].createPoint(t,{id:"hover"}):{};e(c(n))}}function O(t){return{type:D.ROUTE_INDEX,routeIndex:t}}function x(t){return function(e,n){var r=n(),i=r.destination;e(o(t)),i.geometry&&e(l())}}function E(t){return function(e,n){var r=n(),i=r.origin;e(s(t)),i.geometry&&e(l())}}function j(t){return function(e,n){var r=n(),i=r.origin,o=r.destination;e({type:D.DIRECTIONS_PROFILE,profile:t}),e(A("profile",{profile:t})),i.geometry&&o.geometry&&e(l())}}function I(){return function(t,e){var n=e();n.destination.geometry&&t(o(n.destination.geometry.coordinates)),n.origin.geometry&&t(s(n.origin.geometry.coordinates)),n.origin.geometry&&n.destination.geometry&&t(l())}}function S(t){return function(e){return P["default"].validCoords(t)||(t=[P["default"].wrap(t[0]),P["default"].wrap(t[1])]),isNaN(t[0])&&isNaN(t[1])?e(d(new Error("Coordinates are not valid"))):(e(v(t)),void e(x(t)))}}function T(t){return function(e){return P["default"].validCoords(t)||(t=[P["default"].wrap(t[0]),P["default"].wrap(t[1])]),isNaN(t[0])&&isNaN(t[1])?e(d(new Error("Coordinates are not valid"))):(e(E(t)),void e(g(t)))}}function C(t,e){return function(n,r){var i=r(),o=i.destination,s=i.waypoints;s.splice(t,0,p(e)),n(u(s)),o.geometry&&n(l())}}function R(t,e){return function(n,r){var i=r(),o=i.destination,s=i.waypoints;s[t]=p(e),n(u(s)),o.geometry&&n(l())}}function k(t){return function(e,n){var r=n(),i=r.destination,o=r.waypoints;o=o.filter(function(e){return!P["default"].coordinateMatch(e,t)}),e(u(o)),i.geometry&&e(l())}}function N(t,e){return function(n,r){var i=r(),o=i.events;return o[t]=o[t]||[],o[t].push(e),{type:D.EVENTS,events:o}}}function A(t,e){var n=this;return function(r,i){var o=i(),s=o.events;if(!s[t])return{type:D.EVENTS,events:s};for(var a=s[t].slice(),u=0;u<a.length;u++)a[u].call(n,e)}}Object.defineProperty(n,"__esModule",{value:!0}),n.queryOrigin=h,n.queryDestination=y,n.queryOriginCoordinates=v,n.queryDestinationCoordinates=g,n.clearOrigin=m,n.clearDestination=b,n.setOptions=_,n.hoverMarker=w,n.setRouteIndex=O,n.createOrigin=x,n.createDestination=E,n.setProfile=j,n.reverse=I,n.setOriginFromCoordinates=S,n.setDestinationFromCoordinates=T,n.addWaypoint=C,n.setWaypoint=R,n.removeWaypoint=k,n.eventSubscribe=N,n.eventEmit=A;var M=t("../constants/action_types"),D=i(M),L=t("../utils"),P=r(L),F=new XMLHttpRequest},{"../constants/action_types":39,"../utils":45}],39:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});n.DESTINATION="DESTINATION",n.DESTINATION_CLEAR="DESTINATION_CLEAR",n.DESTINATION_QUERY="DESTINATION_QUERY",n.DESTINATION_FROM_COORDINATES="DESTINATION_FROM_COORDINATES",n.DIRECTIONS="DIRECTIONS",n.DIRECTIONS_PROFILE="DIRECTIONS_PROFILE",n.EVENTS="EVENTS",n.ERROR="ERROR",n.HOVER_MARKER="HOVER_MARKER",n.ORIGIN="ORIGIN",n.ORIGIN_CLEAR="ORIGIN_CLEAR",n.ORIGIN_QUERY="ORIGIN_QUERY",n.ORIGIN_FROM_COORDINATES="ORIGIN_FROM_COORDINATES",n.ROUTE_INDEX="ROUTE_INDEX",n.SET_OPTIONS="SET_OPTIONS",n.WAYPOINTS="WAYPOINTS"},{}],40:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var o=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();t("mapbo