jonnybarnes.uk/public/assets/js/newnote.js

29 lines
476 KiB
JavaScript
Raw Normal View History

Updating codebase to use es6/7 Squashed commit of the following: commit 07b27d00f135a521143154a2e77abdc1680b7d5b Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Thu Jan 26 14:59:35 2017 +0000 Fix styleci.io issue commit 9e67f0a96484f8047f22d13abb4cd41c2e44b95d Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Thu Jan 26 08:28:22 2017 +0000 Remove some unused dependencies commit 3c65070f3ff2aec10d821ae9f12821bc08e37d0a Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Wed Jan 25 18:00:10 2017 +0000 Compressed webpack/babel output commit 694c43d1a9a6c8cb84d4cc789a6643b8d2863cec Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Wed Jan 25 17:59:27 2017 +0000 Let’s compress the es5 output commit debffc0e41760fcc87e6d3768163e6ed8ea5d98c Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Wed Jan 25 17:45:05 2017 +0000 webpack/babel generated es5 assets commit 1e978d6c5795f230ab320f94ad2fb98871bb6fa5 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Wed Jan 25 17:36:52 2017 +0000 Allow content of micropub form page to be persisted commit 44fb8026962ef574700f07ef93d18bdb38cdedb2 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Wed Jan 25 17:35:58 2017 +0000 Name the micropub form commit 732abaf561bf9d6392fe506d30d320e9c17b8226 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Wed Jan 25 17:34:39 2017 +0000 Add webStorage dependency commit a4520085dfc673c5c3d940150358b8ecc3cdf022 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Jan 16 12:32:33 2017 +0000 No need for a form id on the micropub form untill form autosave is added commit a182be46a616d8e4085be5e24cbd3623f13cc28d Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Sat Jan 14 20:37:31 2017 +0000 Polyfill fetch and promise only in older browsers using unpkg.com commit fdc044150dc8e2b755f93119b196ba0455bbbb83 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 13 15:46:05 2017 +0000 Generated js from webpack/babel commit d24e6aa9fff38823a0c667e6f9e43dcb2ca179c4 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 13 15:45:32 2017 +0000 Lots of es6 to generate and add map, particularly the new note form commit e7004a9fe475e07d43de905fb00d51c659878474 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 13 15:44:54 2017 +0000 Don’t link to commons.js, it aint being made at the moment commit d4a2e4e143b644287f9da109eb2850c2361b2f20 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 13 15:43:27 2017 +0000 Temporarily don’t optimize JS commit 05623de122da7d88642af60f85e5320a3ff651fc Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Wed Jan 11 14:24:15 2017 +0000 Add places to geojson data commit 3eb1a4f29bb4263b9998a6f3f53abb7d1eeff520 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Wed Jan 11 14:22:53 2017 +0000 Use alertify.js to give relevant feedback to user commit 6f123fa178d6cd19528130ebd78157c37eaab1a1 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Wed Jan 11 14:21:24 2017 +0000 Add alertify.css back commit 89fca3b3aeb23ef97fb767514e0502298d1b83fd Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Wed Jan 11 14:19:56 2017 +0000 Webpack’d javascript commit 94ab60f34079238ed6228bf6e789f14d7a09823b Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Jan 9 09:10:17 2017 +0000 Webpack’d javascript commit 1ca3a55a27c20ea08633b589023fe5ad1acb2b68 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Mon Jan 9 09:09:06 2017 +0000 Define const functions in order of usage commit dc5535b32a357611860e0e98fcdc7d9c12c5d383 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Sun Jan 8 18:50:55 2017 +0000 Link to correct js files with defer option commit 42f0e5b85825943ed148736e8e0fe22f5654ae90 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Sun Jan 8 18:50:18 2017 +0000 New webpacked es6 code commit 300443bb0ce7b65bda1cf550fe5c7173a89edaf3 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Sun Jan 8 18:49:44 2017 +0000 Moving towards consolidated es6 map code commit b1001760e03dd358f896feb90dd3acc0bc6728fc Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Sun Jan 8 18:44:40 2017 +0000 Don’t mangle the fetch function commit 289e59025634b6d2569b73ae87e3ea4942034e33 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Sun Jan 8 18:43:47 2017 +0000 Updated yarn/npm dependencies commit 3439b008e6bd96d8c45591c2a945c4ac246440ec Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Thu Dec 29 11:58:50 2016 +0000 Link to the correct assets on the new note page commit 81dc83e362266028f8336ae5a27e92c8c8a2b6dc Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Thu Dec 29 11:57:46 2016 +0000 Add a map to the new note page commit 5101ecd3dd60cd78e9a4bce81a5e60a2f575bc57 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Thu Dec 29 11:56:54 2016 +0000 Bundle common JS between entry points commit 1f916adcfd1b07df388417b6bd800e109cec543c Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Thu Dec 29 11:55:31 2016 +0000 Add geojson to individual notes commit 7a6ae8ca49b4ca49413ddb977f7b534f62b41c20 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Wed Dec 28 19:53:30 2016 +0000 Link to self-hosted mapbox-gl.css commit 8be006ec2b738cbcebd06283e18c292b3efd7d16 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Wed Dec 28 19:52:41 2016 +0000 Use self-hosted mapbox-gl css, and a better default geojson title value commit 5ec480842a2194a071b6a23ae181a8de5b8d47cd Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Wed Dec 28 17:09:46 2016 +0000 Access geojson data to markup map correctly commit f2f1d7563f7b0cb7cc62658cc2817e56d2b47c31 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Wed Dec 28 17:09:07 2016 +0000 Generate geojson data for places commit 9f8c9ba02f7ac37b4ab81aad2fb0cd2c077c45cd Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Dec 23 11:55:10 2016 +0000 Use geojson to add a default you location point commit 3da499d3ea6a214f8008d1b98f9b0c2f31ecba0c Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Thu Dec 22 22:29:18 2016 +0000 Some code cleaning commit 39376097eda82491df272cc214d70ff3095d4873 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Thu Dec 22 22:21:29 2016 +0000 Use satellite streets view commit f3db8f43fc403bc180e24d63e21c8311441cb2b0 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Thu Dec 22 16:46:03 2016 +0000 Semi working map state, still need to add own css, and add marker commit 5f398a642b9db67f4b0733988c20138b37d2141d Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Thu Dec 22 13:17:04 2016 +0000 Reference new maps.js with bundled mapbox commit bad97649a623c5552e6b607a1975aa2de8131191 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Thu Dec 22 13:16:25 2016 +0000 Add mapbox-gl again commit 47484962e7620aa7a9a5153cfc03e2ba4030dd5c Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Wed Dec 21 00:03:23 2016 +0000 Early working version of maps.js commit e53e0f39952a65996c09b06fd35918ffabed0de2 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Dec 20 17:14:17 2016 +0000 Setup webpack commit f930a1e2bd7d18809bd40d0cc22f9c3af75f1984 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Dec 20 15:00:42 2016 +0000 Add webpack v2 commit b16e8d62db071155a8b5fb216d3d60ebf6fa9468 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Dec 20 14:53:47 2016 +0000 Define default settings for babel commit 97c13cb753e08d25aa48ecff579efa05173a2c81 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Dec 20 14:53:31 2016 +0000 Add babeljs commit dd9efc3b056cf96323d7f11acff0fb1ab137caef Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Dec 20 14:49:23 2016 +0000 Remove old javascript commit ab99c251ad5847b48d347e2c9426077b3ba8e0f5 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Dec 16 13:26:10 2016 +0000 update readme to reflect changes to how syndication targets need to be set
2017-01-26 15:21:21 +00:00
!function(t){function e(n){if(r[n])return r[n].exports;var i=r[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var r={};return e.m=t,e.c=r,e.i=function(t){return t},e.d=function(t,r,n){e.o(t,r)||Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=19)}([function(t,e){var r;r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){"use strict";function n(t){var e=/POINT\((.*)\)/.exec(t),r=e[1].split(" ")[0],n=e[1].split(" ")[1];return{latitude:n,longitude:r}}e.a=n},function(t,e,r){"use strict";function n(t){return Array.isArray(t)?t:Array.from(t)}function i(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=document.querySelectorAll(".map"),i=!0,o=!1,c=void 0;try{for(var p,f=function(){var n=p.value,i=n.dataset.latitude,o=n.dataset.longitude,l=n.dataset.id,c=window["geojson"+l];if(null==c&&(c={type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Point",coordinates:[o,i]},properties:{title:"Current Location",icon:"circle-stroked",uri:"current-location"}}]}),null!=e){var f=!0,d=!1,m=void 0;try{for(var y,v=e[Symbol.iterator]();!(f=(y=v.next()).done);f=!0){var g=y.value,_=r.i(s.a)(g.location).longitude,x=r.i(s.a)(g.location).latitude;c.features.push({type:"Feature",geometry:{type:"Point",coordinates:[_,x]},properties:{title:g.name,icon:"circle",uri:g.slug}})}}catch(t){d=!0,m=t}finally{try{!f&&v.return&&v.return()}finally{if(d)throw m}}}if(!o){t.coords.longitude}if(!i){t.coords.latitude}var map=new a.a.Map({container:n,style:"mapbox://styles/mapbox/streets-v9",center:[o,i],zoom:15});if(null==t&&map.scrollZoom.disable(),map.addControl(new a.a.NavigationControl),n.appendChild(h(map)),map.on("load",function(){map.addSource("points",{type:"geojson",data:c}),map.addLayer({id:"points",interactive:!0,type:"symbol",source:"points",layout:{"icon-image":"{icon}-15","text-field":"{title}","text-offset":[0,1]}})}),map.on("click",function(t){var e=map.queryRenderedFeatures(t.point,{layer:["points"]});e.length&&(map.flyTo({center:e[0].geometry.coordinates}),r.i(u.a)(e[0].properties.uri))}),c.features&&c.features.length>1){var b=new a.a.LngLatBounds,w=!0,E=!1,T=void 0;try{for(var S,z=c.features[Symbol.iterator]();!(w=(S=z.next()).done);w=!0){var A=S.value;b.extend(A.geometry.coordinates)}}catch(t){E=!0,T=t}finally{try{!w&&z.return&&z.return()}finally{if(E)throw T}}map.fitBounds(b,{padding:65})}return{v:map}},d=n[Symbol.iterator]();!(i=(p=d.next()).done);i=!0){var m=f();if("object"===("undefined"==typeof m?"undefined":l(m)))return m.v}}catch(t){o=!0,c=t}finally{try{!i&&d.return&&d.return()}finally{if(o)throw c}}}var o=r(9),a=r.n(o),s=r(1),u=r(4);e.a=i;var l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};a.a.accessToken="pk.eyJ1Ijoiam9ubnliYXJuZXMiLCJhIjoiY2l2cDhjYW04MDAwcjJ0cG1uZnhqcm82ayJ9.qA2zeVA-nsoMh9IFrd5KQw";var c=function(t){return t.split("-").map(function(t){var e=n(t),r=e[0],i=e.slice(1);return r.toUpperCase()+i.join("").toLowerCase()}).join(" ")},p=function(map,t,e){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],n=document.createElement("input");n.setAttribute("id",e),n.setAttribute("type","radio"),n.setAttribute("name","toggle"),n.setAttribute("value",e),1==r&&n.setAttribute("checked","checked"),n.addEventListener("click",function(){map.setStyle("mapbox://styles/mapbox/"+e+"-v9")});var i=document.createElement("label");i.setAttribute("for",e),i.appendChild(document.createTextNode(c(e))),t.appendChild(n),t.appendChild(i)},h=function(map){var t=document.createElement("div");return t.classList.add("map-menu"),p(map,t,"streets",!0),p(map,t,"s
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
* @license MIT
*/
var K=r(5),Q=r(7),$=r(8);e.Buffer=a,e.SlowBuffer=y,e.INSPECT_MAX_BYTES=50,a.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:n(),e.kMaxLength=i(),a.poolSize=8192,a._augment=function(t){return t.__proto__=a.prototype,t},a.from=function(t,e,r){return s(null,t,e,r)},a.TYPED_ARRAY_SUPPORT&&(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&a[Symbol.species]===a&&Object.defineProperty(a,Symbol.species,{value:null,configurable:!0})),a.alloc=function(t,e,r){return l(null,t,e,r)},a.allocUnsafe=function(t){return c(null,t)},a.allocUnsafeSlow=function(t){return c(null,t)},a.isBuffer=function(t){return!(null==t||!t._isBuffer)},a.compare=function(t,e){if(!a.isBuffer(t)||!a.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},a.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(t,e){if(!$(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return a.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=a.allocUnsafe(e),i=0;for(r=0;r<t.length;++r){var o=t[r];if(!a.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,i),i+=o.length}return n},a.byteLength=v,a.prototype._isBuffer=!0,a.prototype.swap16=function(){var t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)_(this,e,e+1);return this},a.prototype.swap32=function(){var t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)_(this,e,e+3),_(this,e+1,e+2);return this},a.prototype.swap64=function(){var t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)_(this,e,e+7),_(this,e+1,e+6),_(this,e+2,e+5),_(this,e+3,e+4);return this},a.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?P(this,0,t):g.apply(this,arguments)},a.prototype.equals=function(t){if(!a.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===a.compare(this,t)},a.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},a.prototype.compare=function(t,e,r,n,i){if(!a.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,i>>>=0,this===t)return 0;for(var o=i-n,s=r-e,u=Math.min(o,s),l=this.slice(n,i),c=t.slice(e,r),p=0;p<u;++p)if(l[p]!==c[p]){o=l[p],s=c[p];break}return o<s?-1:s<o?1:0},a.prototype.includes=function(t,e,r){return this.indexOf(t,e,r)!==-1},a.prototype.indexOf=function(t,e,r){return x(this,t,e,r,!0)},a.prototype.lastIndexOf=function(t,e,r){return x(this,t,e,r,!1)},a.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return w(this,t,e,r);case"utf8":case"utf-8":return E(this,t,e,r);case"ascii":return T(this,t,e,r);case"latin1":case"binary":return S(this,t,e,r);case"base64":return z(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(thi
var H=Y[W];A([H],new p(H.x,H.y,0))}},R.prototype.anchorIsTooClose=function(t,e,r){var n=this.compareText;if(t in n){for(var i=n[t],o=i.length-1;o>=0;o--)if(r.dist(i[o])<e)return!0}else n[t]=[];return n[t].push(r),!1},R.prototype.place=function(t,e){var r=this;this.createArrays();var n=this.layers[0].layout,i=t.maxScale,o="map"===n["text-rotation-alignment"]&&"line"===n["symbol-placement"],a="map"===n["icon-rotation-alignment"]&&"line"===n["symbol-placement"],s=n["text-allow-overlap"]||n["icon-allow-overlap"]||n["text-ignore-placement"]||n["icon-ignore-placement"];if(s){var u=this.symbolInstancesArray.toArray(this.symbolInstancesStartIndex,this.symbolInstancesEndIndex),l=t.angle,c=Math.sin(l),p=Math.cos(l);this.sortedSymbolInstances=u.sort(function(t,e){var r=c*t.anchorPointX+p*t.anchorPointY|0,n=c*e.anchorPointX+p*e.anchorPointY|0;return r-n||e.index-t.index})}for(var h=this.symbolInstancesStartIndex;h<this.symbolInstancesEndIndex;h++){var f=r.sortedSymbolInstances?r.sortedSymbolInstances[h-r.symbolInstancesStartIndex]:r.symbolInstancesArray.get(h),d={boxStartIndex:f.textBoxStartIndex,boxEndIndex:f.textBoxEndIndex},m={boxStartIndex:f.iconBoxStartIndex,boxEndIndex:f.iconBoxEndIndex},y=!(f.textBoxStartIndex===f.textBoxEndIndex),v=!(f.iconBoxStartIndex===f.iconBoxEndIndex),g=n["text-optional"]||!y,_=n["icon-optional"]||!v,x=y?t.placeCollisionFeature(d,n["text-allow-overlap"],n["symbol-avoid-edges"]):t.minScale,b=v?t.placeCollisionFeature(m,n["icon-allow-overlap"],n["symbol-avoid-edges"]):t.minScale;g||_?!_&&x?x=Math.max(b,x):!g&&b&&(b=Math.max(b,x)):b=x=Math.max(b,x),y&&(t.insertCollisionFeature(d,x,n["text-ignore-placement"]),x<=i&&r.addSymbols(r.arrays.glyph,f.glyphQuadStartIndex,f.glyphQuadEndIndex,x,n["text-keep-upright"],o,t.angle,f.writingModes)),v&&(t.insertCollisionFeature(m,b,n["icon-ignore-placement"]),b<=i&&r.addSymbols(r.arrays.icon,f.iconQuadStartIndex,f.iconQuadEndIndex,b,n["icon-keep-upright"],a,t.angle))}e&&this.addToDebugBuffers(t)},R.prototype.addSymbols=function(t,e,r,i,o,a,s,u){for(var l=this,c=t.elementArray,p=t.layoutVertexArray,h=this.zoom,f=Math.max(Math.log(i)/Math.LN2+h,0),d=e;d<r;d++){var m=l.symbolQuadsArray.get(d).SymbolQuad,y=(m.anchorAngle+s+Math.PI)%(2*Math.PI);if(u&M.vertical){if(a&&m.writingMode===M.vertical){if(o&&a&&y<=5*Math.PI/4||y>7*Math.PI/4)continue}else if(o&&a&&y<=3*Math.PI/4||y>5*Math.PI/4)continue}else if(o&&a&&(y<=Math.PI/2||y>3*Math.PI/2))continue;var v=m.tl,g=m.tr,_=m.bl,x=m.br,b=m.tex,w=m.anchorPoint,E=Math.max(h+Math.log(m.minScale)/Math.LN2,f),T=Math.min(h+Math.log(m.maxScale)/Math.LN2,25);if(!(T<=E)){E===f&&(E=0);var S=Math.round(m.glyphAngle/(2*Math.PI)*256),z=t.prepareSegment(4),A=z.vertexLength;n(p,w.x,w.y,v.x,v.y,b.x,b.y,E,T,f,S),n(p,w.x,w.y,g.x,g.y,b.x+b.w,b.y,E,T,f,S),n(p,w.x,w.y,_.x,_.y,b.x,b.y+b.h,E,T,f,S),n(p,w.x,w.y,x.x,x.y,b.x+b.w,b.y+b.h,E,T,f,S),c.emplaceBack(A,A+1,A+2),c.emplaceBack(A+1,A+2,A+3),z.vertexLength+=4,z.primitiveLength+=2}}},R.prototype.addToDebugBuffers=function(t){for(var e=this,r=this.arrays.collisionBox,n=r.layoutVertexArray,a=r.elementArray,s=-t.angle,u=t.yStretch,l=this.symbolInstancesStartIndex;l<this.symbolInstancesEndIndex;l++){var c=e.symbolInstancesArray.get(l);c.textCollisionFeature={boxStartIndex:c.textBoxStartIndex,boxEndIndex:c.textBoxEndIndex},c.iconCollisionFeature={boxStartIndex:c.iconBoxStartIndex,boxEndIndex:c.iconBoxEndIndex};for(var p=0;p<2;p++){var h=c[0===p?"textCollisionFeature":"iconCollisionFeature"];if(h)for(var f=h.boxStartIndex;f<h.boxEndIndex;f++){var d=e.collisionBoxArray.get(f),m=d.anchorPoint,y=new o(d.x1,d.y1*u)._rotate(s),v=new o(d.x2,d.y1*u)._rotate(s),g=new o(d.x1,d.y2*u)._rotate(s),_=new o(d.x2,d.y2*u)._rotate(s),x=Math.max(0,Math.min(25,e.zoom+Math.log(d.maxScale)/Math.LN2)),b=Math.max(0,Math.min(25,e.zoom+Math.log(d.placementScale)/Math.LN2)),w=r.prepareSegment(4),E=w.vertexLength;i(n,m,y,x,b),i(n,m,v,x,b),i(n,m,_,x,b),i(n,m,g,x,b),a.emplaceBack(E,E+1),a.emplaceBack(E+1,E+2),a.emplaceBack(E+2,E+3),a.emplaceBack(E+3,E),w.vertexLength+=4,w.primitiveLength+=4}}}},R.prototype.addSymbolInstance=function(t,e,r,n
F:[18,[4,21,4,0,-1,-1,4,21,17,21,-1,-1,4,11,12,11]],G:[21,[18,16,17,18,15,20,13,21,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,18,8,-1,-1,13,8,18,8]],H:[22,[4,21,4,0,-1,-1,18,21,18,0,-1,-1,4,11,18,11]],I:[8,[4,21,4,0]],J:[16,[12,21,12,5,11,2,10,1,8,0,6,0,4,1,3,2,2,5,2,7]],K:[21,[4,21,4,0,-1,-1,18,21,4,7,-1,-1,9,12,18,0]],L:[17,[4,21,4,0,-1,-1,4,0,16,0]],M:[24,[4,21,4,0,-1,-1,4,21,12,0,-1,-1,20,21,12,0,-1,-1,20,21,20,0]],N:[22,[4,21,4,0,-1,-1,4,21,18,0,-1,-1,18,21,18,0]],O:[22,[9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21]],P:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,14,17,12,16,11,13,10,4,10]],Q:[22,[9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21,-1,-1,12,4,18,-2]],R:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13,11,4,11,-1,-1,11,11,18,0]],S:[20,[17,18,15,20,12,21,8,21,5,20,3,18,3,16,4,14,5,13,7,12,13,10,15,9,16,8,17,6,17,3,15,1,12,0,8,0,5,1,3,3]],T:[16,[8,21,8,0,-1,-1,1,21,15,21]],U:[22,[4,21,4,6,5,3,7,1,10,0,12,0,15,1,17,3,18,6,18,21]],V:[18,[1,21,9,0,-1,-1,17,21,9,0]],W:[24,[2,21,7,0,-1,-1,12,21,7,0,-1,-1,12,21,17,0,-1,-1,22,21,17,0]],X:[20,[3,21,17,0,-1,-1,17,21,3,0]],Y:[18,[1,21,9,11,9,0,-1,-1,17,21,9,11]],Z:[20,[17,21,3,0,-1,-1,3,21,17,21,-1,-1,3,0,17,0]],"[":[14,[4,25,4,-7,-1,-1,5,25,5,-7,-1,-1,4,25,11,25,-1,-1,4,-7,11,-7]],"\\":[14,[0,21,14,-3]],"]":[14,[9,25,9,-7,-1,-1,10,25,10,-7,-1,-1,3,25,10,25,-1,-1,3,-7,10,-7]],"^":[16,[6,15,8,18,10,15,-1,-1,3,12,8,17,13,12,-1,-1,8,17,8,0]],_:[16,[0,-2,16,-2]],"`":[10,[6,21,5,20,4,18,4,16,5,15,6,16,5,17]],a:[19,[15,14,15,0,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],b:[19,[4,21,4,0,-1,-1,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3]],c:[18,[15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],d:[19,[15,21,15,0,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],e:[18,[3,8,15,8,15,10,14,12,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],f:[12,[10,21,8,21,6,20,5,17,5,0,-1,-1,2,14,9,14]],g:[19,[15,14,15,-2,14,-5,13,-6,11,-7,8,-7,6,-6,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],h:[19,[4,21,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0]],i:[8,[3,21,4,20,5,21,4,22,3,21,-1,-1,4,14,4,0]],j:[10,[5,21,6,20,7,21,6,22,5,21,-1,-1,6,14,6,-3,5,-6,3,-7,1,-7]],k:[17,[4,21,4,0,-1,-1,14,14,4,4,-1,-1,8,8,15,0]],l:[8,[4,21,4,0]],m:[30,[4,14,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0,-1,-1,15,10,18,13,20,14,23,14,25,13,26,10,26,0]],n:[19,[4,14,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0]],o:[19,[8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3,16,6,16,8,15,11,13,13,11,14,8,14]],p:[19,[4,14,4,-7,-1,-1,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3]],q:[19,[15,14,15,-7,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],r:[13,[4,14,4,0,-1,-1,4,8,5,11,7,13,9,14,12,14]],s:[17,[14,11,13,13,10,14,7,14,4,13,3,11,4,9,6,8,11,7,13,6,14,4,14,3,13,1,10,0,7,0,4,1,3,3]],t:[12,[5,21,5,4,6,1,8,0,10,0,-1,-1,2,14,9,14]],u:[19,[4,14,4,4,5,1,7,0,10,0,12,1,15,4,-1,-1,15,14,15,0]],v:[16,[2,14,8,0,-1,-1,14,14,8,0]],w:[22,[3,14,7,0,-1,-1,11,14,7,0,-1,-1,11,14,15,0,-1,-1,19,14,15,0]],x:[17,[3,14,14,0,-1,-1,14,14,3,0]],y:[16,[2,14,8,0,-1,-1,14,14,8,0,6,-4,4,-6,2,-7,1,-7]],z:[17,[14,14,3,0,-1,-1,3,14,14,14,-1,-1,3,0,14,0]],"{":[14,[9,25,7,24,6,23,5,21,5,19,6,17,7,16,8,14,8,12,6,10,-1,-1,7,24,6,22,6,20,7,18,8,17,9,15,9,13,8,11,4,9,8,7,9,5,9,3,8,1,7,0,6,-2,6,-4,7,-6,-1,-1,6,8,8,6,8,4,7,2,6,1,5,-1,5,-3,6,-5,7,-6,9,-7]],"|":[8,[4,25,4,-7]],"}":[14,[5,25,7,24,8,23,9,21,9,19,8,17,7,16,6,14,6,12,8,10,-1,-1,7,24,8,22,8,20,7,18,6,17,5,15,5,13,6,11,10,9,6,7,5,5,5,3,6,1,7,0,8,-2,8,-4,7,-6,-1,-1,8,8,6,6,6,4,7,2,8,1,9,-1,9,-3,8,-5,7,-6,5,-7]],"~":[24,[3,6,3,8,4,11,6,12,8,12,10,11,14,8,16,7,18,7,20,8,21,10,-1,-1,3,8,4,10,6,11,8,11,10,10,14,7,16,6,18,6,20,7,21,10,21,12]]};e.exports=function(t,e,r,i){i=i||1;var o,a,s,u,l,c,p,h,f=[];for(o=0,a=t.length;o<a;o++)if(l=n[t
this.gl.depthRange(r,e)},v.prototype.translatePosMatrix=function(t,e,r,n){if(!r[0]&&!r[1])return t;if("viewport"===n){var o=Math.sin(-this.transform.angle),a=Math.cos(-this.transform.angle);r=[r[0]*a-r[1]*o,r[0]*o+r[1]*a]}var s=[u(e,r[0],this.transform.zoom),u(e,r[1],this.transform.zoom),0],l=new Float32Array(16);return i.translate(l,t,s),l},v.prototype.saveTileTexture=function(t){var e=this.reusableTextures[t.size];e?e.push(t):this.reusableTextures[t.size]=[t]},v.prototype.saveViewportTexture=function(t){this.reusableTextures.viewport||(this.reusableTextures.viewport={}),this.reusableTextures.viewport.texture=t},v.prototype.getTileTexture=function(t,e){var r=this.reusableTextures[t];if(r){var n=r[e||t];return n&&n.length>0?n.pop():null}},v.prototype.getViewportTexture=function(t,e){if(this.reusableTextures.viewport){var r=this.reusableTextures.viewport.texture;return r.width===t&&r.height===e?r:(this.gl.deleteTexture(r),void(this.reusableTextures.viewport.texture=null))}},v.prototype.lineWidth=function(t){this.gl.lineWidth(l.clamp(t,this.lineWidthRange[0],this.lineWidthRange[1]))},v.prototype.showOverdrawInspector=function(t){if(t||this._showOverdrawInspector){this._showOverdrawInspector=t;var e=this.gl;if(t){e.blendFunc(e.CONSTANT_COLOR,e.ONE);var r=8,n=1/r;e.blendColor(n,n,n,0),e.clearColor(0,0,0,1),e.clear(e.COLOR_BUFFER_BIT)}else e.blendFunc(e.ONE,e.ONE_MINUS_SRC_ALPHA)}},v.prototype.createProgram=function(t,e){var r=this.gl,i=r.createProgram(),o=m[t],a="#define MAPBOX_GL_JS\n#define DEVICE_PIXEL_RATIO "+n.devicePixelRatio.toFixed(1)+"\n";this._showOverdrawInspector&&(a+="#define OVERDRAW_INSPECTOR;\n");var s=r.createShader(r.FRAGMENT_SHADER);r.shaderSource(s,e.applyPragmas(a+m.prelude.fragmentSource+o.fragmentSource,"fragment")),r.compileShader(s),r.attachShader(i,s);var u=r.createShader(r.VERTEX_SHADER);r.shaderSource(u,e.applyPragmas(a+m.prelude.vertexSource+o.vertexSource,"vertex")),r.compileShader(u),r.attachShader(i,u),r.linkProgram(i);for(var l=r.getProgramParameter(i,r.ACTIVE_ATTRIBUTES),c={program:i,numAttributes:l},p=0;p<l;p++){var h=r.getActiveAttrib(i,p);c[h.name]=r.getAttribLocation(i,h.name)}for(var f=r.getProgramParameter(i,r.ACTIVE_UNIFORMS),d=0;d<f;d++){var y=r.getActiveUniform(i,d);c[y.name]=r.getUniformLocation(i,y.name)}return c},v.prototype._createProgramCached=function(t,e){this.cache=this.cache||{};var r=""+t+(e.cacheKey||"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[r]||(this.cache[r]=this.createProgram(t,e)),this.cache[r]},v.prototype.useProgram=function(t,e){var r=this.gl,n=this._createProgramCached(t,e||this.emptyProgramConfiguration);return this.currentProgram!==n&&(r.useProgram(n.program),this.currentProgram=n),n},e.exports=v},{"../data/buffer":8,"../data/extent":11,"../data/pos_array":14,"../data/program_configuration":15,"../data/raster_bounds_array":16,"../source/pixels_to_tile_units":45,"../source/source_cache":49,"../util/browser":108,"../util/util":127,"./draw_background":25,"./draw_circle":26,"./draw_debug":28,"./draw_fill":29,"./draw_fill_extrusion":30,"./draw_line":31,"./draw_raster":32,"./draw_symbol":33,"./frame_history":34,"./shaders":38,"./vertex_array_object":39,"@mapbox/gl-matrix":131}],37:[function(t,e,r){"use strict";var n=t("../source/pixels_to_tile_units");r.prepare=function(t,e,r){var n=e.gl,i=e.spriteAtlas.getPosition(t.from,!0),o=e.spriteAtlas.getPosition(t.to,!0);i&&o&&(n.uniform1i(r.u_image,0),n.uniform2fv(r.u_pattern_tl_a,i.tl),n.uniform2fv(r.u_pattern_br_a,i.br),n.uniform2fv(r.u_pattern_tl_b,o.tl),n.uniform2fv(r.u_pattern_br_b,o.br),n.uniform1f(r.u_mix,t.t),n.uniform2fv(r.u_pattern_size_a,i.size),n.uniform2fv(r.u_pattern_size_b,o.size),n.uniform1f(r.u_scale_a,t.fromScale),n.uniform1f(r.u_scale_b,t.toScale),n.activeTexture(n.TEXTURE0),e.spriteAtlas.bind(n,!0))},r.setTile=function(t,e,r){var i=e.gl;i.uniform1f(r.u_tile_units_to_pixels,1/n(t,1,e.transform.tileZoom));var o=Math.pow(2,t.coord.z),a=t.tileSize*Math.pow(2,e.transform.tileZoom)/o,s=a*(t.coord.x+t.coord.w*o),u=a*t.coord.y;i.uniform2f(r.u_pixel_coord_upper,s>>16,u>>16),i.uniform2f(r.u
vertexSource:"// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\n// We scale the distance before adding it to the buffers so that we can store\n// long distances for long segments. Use this value to unscale the distance.\n#define LINE_DISTANCE_SCALE 2.0\n\n// the distance over which the line edge fades out.\n// Retina devices need a smaller distance to avoid aliasing.\n#define ANTIALIASING 1.0 / DEVICE_PIXEL_RATIO / 2.0\n\nattribute vec2 a_pos;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform vec2 u_patternscale_a;\nuniform float u_tex_y_a;\nuniform vec2 u_patternscale_b;\nuniform float u_tex_y_b;\nuniform vec2 u_gl_units_to_pixels;\nuniform mediump float u_width;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying vec2 v_tex_a;\nvarying vec2 v_tex_b;\nvarying float v_gamma_scale;\n\n#pragma mapbox: define lowp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n\nvoid main() {\n #pragma mapbox: initialize lowp vec4 color\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize mediump float gapwidth\n #pragma mapbox: initialize lowp float offset\n\n vec2 a_extrude = a_data.xy - 128.0;\n float a_direction = mod(a_data.z, 4.0) - 1.0;\n float a_linesofar = (floor(a_data.z / 4.0) + a_data.w * 64.0) * LINE_DISTANCE_SCALE;\n\n // We store the texture normals in the most insignificant bit\n // transform y so that 0 => -1 and 1 => 1\n // In the texture normal, x is 0 if the normal points straight up/down and 1 if it's a round cap\n // y is 1 if the normal points up, and -1 if it points down\n mediump vec2 normal = mod(a_pos, 2.0);\n normal.y = sign(normal.y - 0.5);\n v_normal = normal;\n\n // these transformations used to be applied in the JS and native code bases. \n // moved them into the shader for clarity and simplicity. \n gapwidth = gapwidth / 2.0;\n float width = u_width / 2.0;\n offset = -1.0 * offset;\n \n float inset = gapwidth + (gapwidth > 0.0 ? ANTIALIASING : 0.0);\n float outset = gapwidth + width * (gapwidth > 0.0 ? 2.0 : 1.0) + ANTIALIASING;\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist =outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset2 = offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n // Remove the texture normal bit to get the position\n vec2 pos = floor(a_pos * 0.5);\n\n vec4 projected_extrude = u_matrix * vec4(dist / u_ratio, 0.0, 0.0);\n gl_Position = u_matrix * vec4(pos + offset2 / u_ratio, 0.0, 1.0) + projected_extrude;\n\n // calculate how much the perspective view squishes or stretches the extrude\n float extrude_length_without_perspective = length(dist);\n float extrude_length_with_perspective = length(projected_extrude.xy / gl_Position.w * u_gl_units_to_pixels);\n v_gamma_scale = extrude_length_without_perspective / extrude_length_with_perspective;\n\n v_tex_a = vec2(a_linesofar * u_patternscale_a.x, normal.y * u_patternscale_a.y + u_tex_y_a);\n v_tex_b = vec2(a_linesofar * u_patternscale_b.x, normal.y * u_patternscale_b.y + u_tex_y_b);\n\n v_width2 = vec2(outset, inset);\n}\n"},raster:{fragmentSou
queryGeometry:[],scale:Math.pow(2,e.transform.zoom-y.coord.z)}),b.queryGeometry.push(_)}}var w=[];for(var E in r)w.push(r[E]);return w},e.prototype.redoPlacement=function(){for(var t=this,e=this.getIds(),r=0;r<e.length;r++){var n=t.getTileByID(e[r]);n.redoPlacement(t._source)}},e.prototype.getVisibleCoordinates=function(){for(var t=this,e=this.getRenderableIds().map(u.fromID),r=0,n=e;r<n.length;r+=1){var i=n[r];i.posMatrix=t.transform.calculatePosMatrix(i,t._source.maxzoom)}return e},e}(s);f.maxOverzooming=10,f.maxUnderzooming=3,e.exports=f},{"../data/extent":11,"../geo/coordinate":18,"../util/evented":116,"../util/lru_cache":122,"../util/util":127,"./source":48,"./tile":50,"./tile_coord":51}],50:[function(t,e,r){"use strict";var n=t("../util/util"),i=t("../data/bucket"),o=t("../data/feature_index"),a=t("vector-tile"),s=t("pbf"),u=t("../util/vectortile_to_geojson"),l=t("feature-filter"),c=t("../symbol/collision_tile"),p=t("../symbol/collision_box"),h=t("../symbol/symbol_instances"),f=t("../symbol/symbol_quads"),d=function(t,e,r){this.coord=t,this.uid=n.uniqueId(),this.uses=0,this.tileSize=e,this.sourceMaxZoom=r,this.buckets={},this.state="loading"};d.prototype.registerFadeDuration=function(t,e){var r=e+this.timeAdded;r<Date.now()||this.fadeEndTime&&r<this.fadeEndTime||(this.fadeEndTime=r,t.set(this.fadeEndTime-Date.now()))},d.prototype.loadVectorData=function(t,e){this.hasData()&&this.unloadVectorData(e),this.state="loaded",t&&(t.rawTileData&&(this.rawTileData=t.rawTileData),this.collisionBoxArray=new p(t.collisionBoxArray),this.collisionTile=new c(t.collisionTile,this.collisionBoxArray),this.symbolInstancesArray=new h(t.symbolInstancesArray),this.symbolQuadsArray=new f(t.symbolQuadsArray),this.featureIndex=new o(t.featureIndex,this.rawTileData,this.collisionTile),this.buckets=i.deserialize(t.buckets,e.style))},d.prototype.reloadSymbolData=function(t,e){var r=this;if("unloaded"!==this.state){this.collisionTile=new c(t.collisionTile,this.collisionBoxArray),this.featureIndex.setCollisionTile(this.collisionTile);for(var o in this.buckets){var a=r.buckets[o];"symbol"===a.type&&(a.destroy(),delete r.buckets[o])}n.extend(this.buckets,i.deserialize(t.buckets,e))}},d.prototype.unloadVectorData=function(){var t=this;for(var e in this.buckets)t.buckets[e].destroy();this.buckets={},this.collisionBoxArray=null,this.symbolQuadsArray=null,this.symbolInstancesArray=null,this.collisionTile=null,this.featureIndex=null,this.state="unloaded"},d.prototype.redoPlacement=function(t){function e(e,r){this.reloadSymbolData(r,t.map.style),t.fire("data",{tile:this,coord:this.coord,dataType:"tile"}),t.map&&(t.map.painter.tileExtentVAO.vao=null),this.state="loaded",this.redoWhenDone&&(this.redoPlacement(t),this.redoWhenDone=!1)}if("vector"===t.type||"geojson"===t.type){if("loaded"!==this.state||"reloading"===this.state)return void(this.redoWhenDone=!0);this.state="reloading",t.dispatcher.send("redoPlacement",{type:t.type,uid:this.uid,source:t.id,angle:t.map.transform.angle,pitch:t.map.transform.pitch,showCollisionBoxes:t.map.showCollisionBoxes},e.bind(this),this.workerID)}},d.prototype.getBucket=function(t){return this.buckets[t.id]},d.prototype.querySourceFeatures=function(t,e){var r=this;if(this.rawTileData){this.vtLayers||(this.vtLayers=new a.VectorTile(new s(this.rawTileData)).layers);var n=this.vtLayers._geojsonTileLayer||this.vtLayers[e.sourceLayer];if(n)for(var i=l(e&&e.filter),o={z:this.coord.z,x:this.coord.x,y:this.coord.y},c=0;c<n.length;c++){var p=n.feature(c);if(i(p)){var h=new u(p,r.coord.z,r.coord.x,r.coord.y);h.tile=o,t.push(h)}}}},d.prototype.hasData=function(){return"loaded"===this.state||"reloading"===this.state},e.exports=d},{"../data/bucket":2,"../data/feature_index":12,"../symbol/collision_box":76,"../symbol/collision_tile":78,"../symbol/symbol_instances":87,"../symbol/symbol_quads":88,"../util/util":127,"../util/vectortile_to_geojson":128,"feature-filter":135,pbf:193,"vector-tile":204}],51:[function(t,e,r){"use strict";function n(t,e){if(t.row>e.row){var r=t;t=e,e=r}return{x0:t.column,y0:t.row,x1:e.column,y1:e.row,dx:e.column-
sources:c.mapObject(this.sourceCaches,function(t){return t.serialize()}),layers:this._order.map(function(e){return t._layers[e].serialize()})},function(t){return void 0!==t})},e.prototype._updateLayer=function(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&(this._updatedSources[t.source]="reload"),this._changed=!0},e.prototype._flattenRenderedFeatures=function(t){for(var e=this,r=[],n=this._order.length-1;n>=0;n--)for(var i=e._order[n],o=0,a=t;o<a.length;o+=1){var s=a[o],u=s[i];if(u)for(var l=0,c=u;l<c.length;l+=1){var p=c[l];r.push(p)}}return r},e.prototype.queryRenderedFeatures=function(t,e,r,n){var i=this;e&&e.filter&&this._validate(y.filter,"queryRenderedFeatures.filter",e.filter);var o={};if(e&&e.layers)for(var a=0,s=e.layers;a<s.length;a+=1){var u=s[a],l=i._layers[u];if(!l)return void i.fire("error",{error:"The layer '"+u+"' does not exist in the map's style and cannot be queried for features."});o[l.source]=!0}var c=[];for(var p in this.sourceCaches)if(!e.layers||o[p]){var h=g.rendered(i.sourceCaches[p],i._layers,t,e,r,n);c.push(h)}return this._flattenRenderedFeatures(c)},e.prototype.querySourceFeatures=function(t,e){e&&e.filter&&this._validate(y.filter,"querySourceFeatures.filter",e.filter);var r=this.sourceCaches[t];return r?g.source(r,e):[]},e.prototype.addSourceType=function(t,e,r){return v.getType(t)?r(new Error('A source type called "'+t+'" already exists.')):(v.setType(t,e),e.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:t,url:e.workerSourceURL},r):r(null,null))},e.prototype.getLight=function(){return this.light.getLight()},e.prototype.setLight=function(t,e){this._checkLoaded();var r=this.light.getLight(),n=!1;for(var i in t)if(!c.deepEqual(t[i],r[i])){n=!0;break}if(n){var o=this.stylesheet.transition||{};this.light.setLight(t),this.light.updateLightTransitions(e||{transition:!0},o,this.animationLoop)}},e.prototype._validate=function(t,e,r,n,i){return(!i||i.validate!==!1)&&y.emitErrors(this,t.call(y,c.extend({key:e,style:this.serialize(),value:r,styleSpec:x},n)))},e.prototype._remove=function(){var t=this;for(var e in this.sourceCaches)t.sourceCaches[e].clearTiles();this.dispatcher.remove()},e.prototype._clearSource=function(t){this.sourceCaches[t].clearTiles()},e.prototype._reloadSource=function(t){this.sourceCaches[t].reload()},e.prototype._updateSources=function(t){var e=this;for(var r in this.sourceCaches)e.sourceCaches[r].update(t)},e.prototype._redoPlacement=function(){var t=this;for(var e in this.sourceCaches)t.sourceCaches[e].redoPlacement()},e.prototype.getIcons=function(t,e,r){var n=this,i=function(){n.spriteAtlas.setSprite(n.sprite),n.spriteAtlas.addIcons(e.icons,r)};this.sprite.loaded()?i():this.sprite.on("data",i)},e.prototype.getGlyphs=function(t,e,r){function n(t,e,n){t&&console.error(t),s[n]=e,a--,0===a&&r(null,s)}var i=this,o=e.stacks,a=Object.keys(o).length,s={};for(var u in o)i.glyphSource.getSimpleGlyphs(u,o[u],e.uid,n)},e}(n);e.exports=A},{"../global_worker_pool":22,"../render/line_atlas":35,"../source/query_features":46,"../source/source":48,"../source/source_cache":49,"../symbol/glyph_source":81,"../symbol/sprite_atlas":86,"../util/ajax":107,"../util/browser":108,"../util/dispatcher":114,"../util/evented":116,"../util/mapbox":123,"../util/util":127,"./animation_loop":57,"./image_sprite":58,"./light":59,"./style_layer":63,"./style_spec":70,"./validate_style":72,"mapbox-gl-function":161,"mapbox-gl-style-spec/lib/deref":162,"mapbox-gl-style-spec/lib/diff":163}],62:[function(t,e,r){"use strict";var n=t("mapbox-gl-function"),i=t("./parse_color"),o=t("../util/util"),a=function(t,e){var r=this;this.value=o.clone(e),this.isFunction=n.isFunctionDefinition(e),this.json=JSON.stringify(this.value),this.minimum=t.minimum,this.isColor="color"===t.type;var a=this.isColor&&this.value?i(this.value):e,s=t.default;if(s&&"color"===t.type&&(s=i(s)),this.function=n[t.function||"piecewise-constant"](a,s),this.isFeatureConstant=this.function.isFeatureConstant,this.isZoomConstant=this.function.isZoomConstant,!this.isFeatureConstant&&!this.isZoomConstant){
h=h.matMult(G),f=f.matMult(G),m=m.matMult(G),d=d.matMult(G)}return[new n(new s(t.x,t.y),h,f,m,d,e.image.rect,0,0,u,1/0)]}function o(t,e,r,i,o,l){for(var c=o.layout["text-rotate"]*Math.PI/180,p=o.layout["text-keep-upright"],h=e.positionedGlyphs,f=[],d=0;d<h.length;d++){var m=h[d],y=m.glyph;if(y){var v=y.rect;if(v){var g,_=(m.x+y.advance/2)*r,x=u;l?(g=[],x=a(g,t,_,i,t.segment,!0),p&&(x=Math.min(x,a(g,t,_,i,t.segment,!1)))):g=[{anchorPoint:new s(t.x,t.y),offset:0,angle:0,maxScale:1/0,minScale:u}];var b=m.x+y.left,w=m.y-y.top,E=b+v.w,T=w+v.h,S=new s(m.x,y.advance/2),z=new s(b,w),A=new s(E,w),M=new s(b,T),P=new s(E,T);0!==m.angle&&(z._sub(S)._rotate(m.angle)._add(S),A._sub(S)._rotate(m.angle)._add(S),M._sub(S)._rotate(m.angle)._add(S),P._sub(S)._rotate(m.angle)._add(S));for(var L=0;L<g.length;L++){var k=g[L],C=z,I=A,R=M,D=P;if(c){var O=Math.sin(c),B=Math.cos(c),j=[B,-O,O,B];C=C.matMult(j),I=I.matMult(j),R=R.matMult(j),D=D.matMult(j)}var F=Math.max(k.minScale,x),U=(t.angle+k.offset+2*Math.PI)%(2*Math.PI),N=(k.angle+k.offset+2*Math.PI)%(2*Math.PI);f.push(new n(k.anchorPoint,C,I,R,D,v,U,N,F,k.maxScale,e.writingMode))}}}}return f}function a(t,e,r,n,i,o){var a=!o;r<0&&(o=!o),o&&i++;var l=new s(e.x,e.y),c=n[i],p=1/0;r=Math.abs(r);for(var h=u;;){var f=l.dist(c),d=r/f,m=Math.atan2(c.y-l.y,c.x-l.x);if(o||(m+=Math.PI),t.push({anchorPoint:l,offset:a?Math.PI:0,minScale:d,maxScale:p,angle:(m+2*Math.PI)%(2*Math.PI)}),d<=h)break;for(l=c;l.equals(c);)if(i+=o?1:-1,c=n[i],!c)return d;var y=c.sub(l)._unit();l=l.sub(y._mult(f)),p=d}return h}var s=t("point-geometry");e.exports={getIconQuads:i,getGlyphQuads:o,SymbolQuad:n};var u=.5},{"point-geometry":194}],84:[function(t,e,r){"use strict";var n=t("../util/token");e.exports=function(t,e){var r=n(t.properties,e["text-field"]);if(r){r=r.toString();var i=e["text-transform"];return"uppercase"===i?r=r.toLocaleUpperCase():"lowercase"===i&&(r=r.toLocaleLowerCase()),r}}},{"../util/token":126}],85:[function(t,e,r){"use strict";function n(t,e,r,n,i){this.codePoint=t,this.x=e,this.y=r,this.glyph=n||null,this.angle=i}function i(t,e,r,n,i,o,a){this.positionedGlyphs=t,this.text=e,this.top=r,this.bottom=n,this.left=i,this.right=o,this.writingMode=a}function o(t,e){for(var r=[],n=0,i=0,o=e;i<o.length;i+=1){var a=o[i];r.push(t.substring(n,a)),n=a}return n<t.length&&r.push(t.substring(n,t.length)),r}function a(t,e,r,n,a,s,u,l,c,p,d){t=t.trim(),d===x.vertical&&(t=_(t));var m=[],y=new i(m,t,c[1],c[1],c[0],c[0],d),v=d===x.horizontal&&r?o(t,h(t,l,r,e)):[t];return f(y,e,v,n,a,s,u,c,d,l,p),!!m.length&&y}function s(t,e,r,n){var i=0;for(var o in t){var a=n[t.charCodeAt(o)];a&&(i+=a.advance+e)}var s=Math.max(1,Math.ceil(i/r));return i/s}function u(t,e,r,n){var i=Math.pow(t-e,2);return n&&t<e?Math.max(0,i-150):i+Math.abs(r)*r}function l(t,e){var r=0;return 10===t&&(r-=1e4),!e||40!==e&&65288!==e||(r+=50),41!==t&&65289!==t||(r+=50),r}function c(t,e,r,n,i,o){for(var a=[],s=0,l=n;s<l.length;s+=1){var c=l[s],p=e-c.x;a.push({priorBreak:c,badness:u(p,r,i,o)+c.badness})}return a.push({priorBreak:null,badness:u(e,r,i,o)}),a.sort(function(t,e){return t.badness-e.badness}),{index:t,x:e,priorBreak:a[0].priorBreak,badness:a[0].badness}}function p(t){return t?p(t.priorBreak).concat(t.index):[]}function h(t,e,r,n){if(!r)return[];if(!t)return[];for(var i=[],o=s(t,e,r,n),a=0,u=0;u<t.length;u++){var h=t.charCodeAt(u),f=n[h];if(f||h===b){if(w[h]||g.charAllowsIdeographicBreaking(h)){var d=t.charCodeAt(u-1);i.unshift(c(u,a,o,i,l(h,d),!1))}f&&(a+=f.advance+e)}}return i.unshift(c(t.length,a,o,i,0,!0)),p(i.shift())}function f(t,e,r,i,o,a,s,u,l,c,p){var h=-17,f=0,y=h,v=0,_=t.positionedGlyphs;for(var b in r){var w=r[b].trim();if(w.length){for(var E=_.length,T=0;T<w.length;T++){var S=w.charCodeAt(T),z=e[S];z&&(g.charHasUprightVerticalOrientation(S)&&l!==x.horizontal?(_.push(new n(S,f,0,z,-Math.PI/2)),f+=p+c):(_.push(new n(S,f,y,z,0)),f+=z.advance+c))}if(_.length!==E){var A=f-c;v=Math.max(A,v),d(_,e,E,_.length-1,s)}f=0,y+=i}else y+=i}m(_,s,o,a,v,i,r.length,u);var M=r.length*i;t.top+=-a*M,t.bottom=t.top+M,t.left+=-o*v,t.right=t.left+v}function d(t,e,r,n
this._fireEvent("drag",t),this._fireEvent("move",t),this._pos=e,t.preventDefault()}},c.prototype._onUp=function(t){var e=this;if(this.isActive()){this._active=!1,this._fireEvent("dragend",t),this._drainInertiaBuffer();var r=function(){return e._fireEvent("moveend",t)},n=this._inertia;if(n.length<2)return void r();var i=n[n.length-1],o=n[0],c=i[1].sub(o[1]),p=(i[0]-o[0])/1e3;if(0===p||i[1].equals(o[1]))return void r();var h=c.mult(a/p),f=h.mag();f>u&&(f=u,h._unit()._mult(f));var d=f/(l*a),m=h.mult(-d/2);this._map.panBy(m,{duration:1e3*d,easing:s,noMoveStart:!0},{originalEvent:t})}},c.prototype._onMouseUp=function(t){this._ignoreEvent(t)||(this._onUp(t),o.document.removeEventListener("mousemove",this._onMove),o.document.removeEventListener("mouseup",this._onMouseUp))},c.prototype._onTouchEnd=function(t){this._ignoreEvent(t)||(this._onUp(t),o.document.removeEventListener("touchmove",this._onMove),o.document.removeEventListener("touchend",this._onTouchEnd))},c.prototype._fireEvent=function(t,e){return this._map.fire(t,{originalEvent:e})},c.prototype._ignoreEvent=function(t){var e=this._map;if(e.boxZoom&&e.boxZoom.isActive())return!0;if(e.dragRotate&&e.dragRotate.isActive())return!0;if(t.touches)return t.touches.length>1;if(t.ctrlKey)return!0;var r=1,n=0;return"mousemove"===t.type?t.buttons&0===r:t.button!==n},c.prototype._drainInertiaBuffer=function(){for(var t=this._inertia,e=Date.now(),r=160;t.length>0&&e-t[0][0]>r;)t.shift()},e.exports=c},{"../../util/dom":115,"../../util/util":127,"../../util/window":110}],98:[function(t,e,r){"use strict";var n=t("../../util/dom"),i=t("../../util/util"),o=t("../../util/window"),a=.25,s=i.bezier(0,0,a,1),u=180,l=720,c=function(t,e){this._map=t,this._el=t.getCanvasContainer(),this._bearingSnap=e.bearingSnap,this._pitchWithRotate=e.pitchWithRotate!==!1,i.bindAll(["_onDown","_onMove","_onUp"],this)};c.prototype.isEnabled=function(){return!!this._enabled},c.prototype.isActive=function(){return!!this._active},c.prototype.enable=function(){this.isEnabled()||(this._el.addEventListener("mousedown",this._onDown),this._enabled=!0)},c.prototype.disable=function(){this.isEnabled()&&(this._el.removeEventListener("mousedown",this._onDown),this._enabled=!1)},c.prototype._onDown=function(t){this._ignoreEvent(t)||this.isActive()||(o.document.addEventListener("mousemove",this._onMove),o.document.addEventListener("mouseup",this._onUp),this._active=!1,this._inertia=[[Date.now(),this._map.getBearing()]],this._startPos=this._pos=n.mousePos(this._el,t),this._center=this._map.transform.centerPoint,t.preventDefault())},c.prototype._onMove=function(t){if(!this._ignoreEvent(t)){this.isActive()||(this._active=!0,this._fireEvent("rotatestart",t),this._fireEvent("movestart",t));var e=this._map;e.stop();var r=this._pos,i=n.mousePos(this._el,t),o=.8*(r.x-i.x),a=(r.y-i.y)*-.5,s=e.getBearing()-o,u=e.getPitch()-a,l=this._inertia,c=l[l.length-1];this._drainInertiaBuffer(),l.push([Date.now(),e._normalizeBearing(s,c[1])]),e.transform.bearing=s,this._pitchWithRotate&&(e.transform.pitch=u),this._fireEvent("rotate",t),this._fireEvent("move",t),this._pos=i}},c.prototype._onUp=function(t){var e=this;if(!this._ignoreEvent(t)&&(o.document.removeEventListener("mousemove",this._onMove),o.document.removeEventListener("mouseup",this._onUp),this.isActive())){this._active=!1,this._fireEvent("rotateend",t),this._drainInertiaBuffer();var r=this._map,n=r.getBearing(),i=this._inertia,c=function(){Math.abs(n)<e._bearingSnap?r.resetNorth({noMoveStart:!0},{originalEvent:t}):e._fireEvent("moveend",t)};if(i.length<2)return void c();var p=i[0],h=i[i.length-1],f=i[i.length-2],d=r._normalizeBearing(n,f[1]),m=h[1]-p[1],y=m<0?-1:1,v=(h[0]-p[0])/1e3;if(0===m||0===v)return void c();var g=Math.abs(m*(a/v));g>u&&(g=u);var _=g/(l*a),x=y*g*(_/2);d+=x,Math.abs(r._normalizeBearing(d,0))<this._bearingSnap&&(d=r._normalizeBearing(0,d)),r.rotateTo(d,{duration:1e3*_,easing:s,noMoveStart:!0},{originalEvent:t})}},c.prototype._fireEvent=function(t,e){return this._map.fire(t,{originalEvent:e})},c.prototype._ignoreEvent=function(t){var e=this._map;if(e.boxZoom&&e.boxZ
this.target.removeEventListener("message",this.receive,!1)},e.exports=n},{}],107:[function(t,e,r){"use strict";function n(t){var e=i.document.createElement("a");return e.href=t,e.protocol===i.document.location.protocol&&e.host===i.document.location.host}var i=t("./window");r.getJSON=function(t,e){var r=new i.XMLHttpRequest;return r.open("GET",t,!0),r.setRequestHeader("Accept","application/json"),r.onerror=function(t){e(t)},r.onload=function(){if(r.status>=200&&r.status<300&&r.response){var t;try{t=JSON.parse(r.response)}catch(t){return e(t)}e(null,t)}else e(new Error(r.statusText))},r.send(),r},r.getArrayBuffer=function(t,e){var r=new i.XMLHttpRequest;return r.open("GET",t,!0),r.responseType="arraybuffer",r.onerror=function(t){e(t)},r.onload=function(){return 0===r.response.byteLength&&200===r.status?e(new Error("http status 200 returned without content.")):void(r.status>=200&&r.status<300&&r.response?e(null,r.response):e(new Error(r.statusText)))},r.send(),r};var o="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";r.getImage=function(t,e){return r.getArrayBuffer(t,function(t,r){if(t)return e(t);var n=new i.Image,a=i.URL||i.webkitURL;n.onload=function(){e(null,n),a.revokeObjectURL(n.src)};var s=new i.Blob([new Uint8Array(r)],{type:"image/png"});n.src=r.byteLength?a.createObjectURL(s):o})},r.getVideo=function(t,e){var r=i.document.createElement("video");r.onloadstart=function(){e(null,r)};for(var o=0;o<t.length;o++){var a=i.document.createElement("source");n(t[o])||(r.crossOrigin="Anonymous"),a.src=t[o],r.appendChild(a)}return r}},{"./window":110}],108:[function(t,e,r){"use strict";var n=t("./window");e.exports.now=function(){return n.performance&&n.performance.now?n.performance.now.bind(n.performance):Date.now.bind(Date)}();var i=n.requestAnimationFrame||n.mozRequestAnimationFrame||n.webkitRequestAnimationFrame||n.msRequestAnimationFrame;r.frame=function(t){return i(t)};var o=n.cancelAnimationFrame||n.mozCancelAnimationFrame||n.webkitCancelAnimationFrame||n.msCancelAnimationFrame;r.cancelFrame=function(t){o(t)},r.timed=function(t,n,i){function o(u){a||(u=e.exports.now(),u>=s+n?t.call(i,1):(t.call(i,(u-s)/n),r.frame(o)))}if(!n)return t.call(i,1),null;var a=!1,s=e.exports.now();return r.frame(o),function(){a=!0}},r.getImageData=function(t){var e=n.document.createElement("canvas"),r=e.getContext("2d");return e.width=t.width,e.height=t.height,r.drawImage(t,0,0),r.getImageData(0,0,t.width,t.height).data},r.supported=t("mapbox-gl-supported"),r.hardwareConcurrency=n.navigator.hardwareConcurrency||4,Object.defineProperty(r,"devicePixelRatio",{get:function(){return n.devicePixelRatio}}),r.supportsWebp=!1;var a=n.document.createElement("img");a.onload=function(){r.supportsWebp=!0},a.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="},{"./window":110,"mapbox-gl-supported":190}],109:[function(t,e,r){"use strict";var n=t("webworkify"),i=t("../window"),o=i.URL.createObjectURL(new n(t("../../source/worker"),{bare:!0}));e.exports=function(){return new i.Worker(o)}},{"../../source/worker":55,"../window":110,webworkify:211}],110:[function(t,e,r){"use strict";e.exports=self},{}],111:[function(t,e,r){"use strict";function n(t,e){return e.area-t.area}var i=t("quickselect"),o=t("./util").calculateSignedArea;e.exports=function(t,e){var r=t.length;if(r<=1)return[t];for(var a,s,u=[],l=0;l<r;l++){var c=o(t[l]);0!==c&&(t[l].area=Math.abs(c),void 0===s&&(s=c<0),s===c<0?(a&&u.push(a),a=[t[l]]):a.push(t[l]))}if(a&&u.push(a),e>1)for(var p=0;p<u.length;p++)u[p].length<=e||(i(u[p],e,1,u[p].length-1,n),u[p]=u[p].slice(0,e));return u}},{"./util":127,quickselect:196}],112:[function(t,e,r){"use strict";var n={API_URL:"https://api.mapbox.com",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null};e.exports=n},{}],113:[function(t,e,r){"use strict";var n=function(t){var e=this;this._stringToNumber={},this._numberToString=[];for(var r=0;r<t.length;r++){var n=t[r];e._stringToNumber[n]=r,e._numberToString[r]=n}};n.prototype.encode=function(t){return this._stringToNumber[t]},n.p
x=r[5],b=r[6],w=r[7],t[4]=_*n+x*s+b*p+w*m,t[5]=_*i+x*u+b*h+w*y,t[6]=_*o+x*l+b*f+w*v,t[7]=_*a+x*c+b*d+w*g,_=r[8],x=r[9],b=r[10],w=r[11],t[8]=_*n+x*s+b*p+w*m,t[9]=_*i+x*u+b*h+w*y,t[10]=_*o+x*l+b*f+w*v,t[11]=_*a+x*c+b*d+w*g,_=r[12],x=r[13],b=r[14],w=r[15],t[12]=_*n+x*s+b*p+w*m,t[13]=_*i+x*u+b*h+w*y,t[14]=_*o+x*l+b*f+w*v,t[15]=_*a+x*c+b*d+w*g,t}function f(t,e,r){var n,i,o,a,s,u,l,c,p,h,f,d,m=r[0],y=r[1],v=r[2];return e===t?(t[12]=e[0]*m+e[4]*y+e[8]*v+e[12],t[13]=e[1]*m+e[5]*y+e[9]*v+e[13],t[14]=e[2]*m+e[6]*y+e[10]*v+e[14],t[15]=e[3]*m+e[7]*y+e[11]*v+e[15]):(n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],l=e[6],c=e[7],p=e[8],h=e[9],f=e[10],d=e[11],t[0]=n,t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=u,t[6]=l,t[7]=c,t[8]=p,t[9]=h,t[10]=f,t[11]=d,t[12]=n*m+s*y+p*v+e[12],t[13]=i*m+u*y+h*v+e[13],t[14]=o*m+l*y+f*v+e[14],t[15]=a*m+c*y+d*v+e[15]),t}function d(t,e,r){var n=r[0],i=r[1],o=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function m(t,e,r){var n=Math.sin(r),i=Math.cos(r),o=e[4],a=e[5],s=e[6],u=e[7],l=e[8],c=e[9],p=e[10],h=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*i+l*n,t[5]=a*i+c*n,t[6]=s*i+p*n,t[7]=u*i+h*n,t[8]=l*i-o*n,t[9]=c*i-a*n,t[10]=p*i-s*n,t[11]=h*i-u*n,t}function y(t,e,r){var n=Math.sin(r),i=Math.cos(r),o=e[0],a=e[1],s=e[2],u=e[3],l=e[4],c=e[5],p=e[6],h=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i+l*n,t[1]=a*i+c*n,t[2]=s*i+p*n,t[3]=u*i+h*n,t[4]=l*i-o*n,t[5]=c*i-a*n,t[6]=p*i-s*n,t[7]=h*i-u*n,t}function v(t,e,r,n,i){var o=1/Math.tan(e/2),a=1/(n-i);return t[0]=o/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=(i+n)*a,t[11]=-1,t[12]=0,t[13]=0,t[14]=2*i*n*a,t[15]=0,t}function g(t,e,r,n,i,o,a){var s=1/(e-r),u=1/(n-i),l=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*l,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*u,t[14]=(a+o)*l,t[15]=1,t}var _=(t(),r(),{vec3:{transformMat3:e},vec4:{transformMat4:n},mat2:{create:i,rotate:o,scale:a},mat3:{create:s,fromRotation:u},mat4:{create:l,identity:c,translate:f,scale:d,multiply:h,perspective:v,rotateX:m,rotateZ:y,invert:p,ortho:g}});return _})},{}],132:[function(t,e,r){function n(t){return t=Math.round(t),t<0?0:t>255?255:t}function i(t){return t<0?0:t>1?1:t}function o(t){return n("%"===t[t.length-1]?parseFloat(t)/100*255:parseInt(t))}function a(t){return i("%"===t[t.length-1]?parseFloat(t)/100:parseFloat(t))}function s(t,e,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}function u(t){var e=t.replace(/ /g,"").toLowerCase();if(e in l)return l[e].slice();if("#"===e[0]){if(4===e.length){var r=parseInt(e.substr(1),16);return r>=0&&r<=4095?[(3840&r)>>4|(3840&r)>>8,240&r|(240&r)>>4,15&r|(15&r)<<4,1]:null}if(7===e.length){var r=parseInt(e.substr(1),16);return r>=0&&r<=16777215?[(16711680&r)>>16,(65280&r)>>8,255&r,1]:null}return null}var i=e.indexOf("("),u=e.indexOf(")");if(i!==-1&&u+1===e.length){var c=e.substr(0,i),p=e.substr(i+1,u-(i+1)).split(","),h=1;switch(c){case"rgba":if(4!==p.length)return null;h=a(p.pop());case"rgb":return 3!==p.length?null:[o(p[0]),o(p[1]),o(p[2]),h];case"hsla":if(4!==p.length)return null;h=a(p.pop());case"hsl":if(3!==p.length)return null;var f=(parseFloat(p[0])%360+360)%360/360,d=a(p[1]),m=a(p[2]),y=m<=.5?m*(d+1):m+d-m*d,v=2*m-y;return[n(255*s(v,y,f+1/3)),n(255*s(v,y,f)),n(255*s(v,y,f-1/3)),h];default:return null}}return null}var l={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1
if(w||E)return r(w?t.value():t,E?e.value():e,n,i,o,a)}if(!b)return!1;o||(o=[]),a||(a=[]);for(var z=o.length;z--;)if(o[z]==t)return a[z]==e;o.push(t),a.push(e);var A=(c?s:l)(t,e,r,n,i,o,a);return o.pop(),a.pop(),A}function s(t,e,r,n,o,a,s){var u=-1,l=t.length,c=e.length;if(l!=c&&!(o&&c>l))return!1;for(;++u<l;){var p=t[u],h=e[u],f=n?n(o?h:p,o?p:h,u):void 0;if(void 0!==f){if(f)continue;return!1}if(o){if(!i(e,function(t){return p===t||r(p,t,n,o,a,s)}))return!1}else if(p!==h&&!r(p,h,n,o,a,s))return!1}return!0}function u(t,e,r){switch(r){case y:case v:return+t==+e;case g:return t.name==e.name&&t.message==e.message;case _:return t!=+t?e!=+e:t==+e;case b:case w:return t==e+""}return!1}function l(t,e,r,n,i,o,a){var s=f(t),u=s.length,l=f(e),c=l.length;if(u!=c&&!i)return!1;for(var p=u;p--;){var h=s[p];if(!(i?h in e:T.call(e,h)))return!1}for(var d=i;++p<u;){h=s[p];var m=t[h],y=e[h],v=n?n(i?y:m,i?m:y,h):void 0;if(!(void 0===v?r(m,y,n,i,o,a):v))return!1;d||(d="constructor"==h)}if(!d){var g=t.constructor,_=e.constructor;if(g!=_&&"constructor"in t&&"constructor"in e&&!("function"==typeof g&&g instanceof g&&"function"==typeof _&&_ instanceof _))return!1}return!0}function c(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}var p=t("lodash.isarray"),h=t("lodash.istypedarray"),f=t("lodash.keys"),d="[object Arguments]",m="[object Array]",y="[object Boolean]",v="[object Date]",g="[object Error]",_="[object Number]",x="[object Object]",b="[object RegExp]",w="[object String]",E=Object.prototype,T=E.hasOwnProperty,S=E.toString;e.exports=o},{"lodash.isarray":156,"lodash.istypedarray":158,"lodash.keys":159}],153:[function(t,e,r){function n(t,e,r){if("function"!=typeof t)return i;if(void 0===e)return t;switch(r){case 1:return function(r){return t.call(e,r)};case 3:return function(r,n,i){return t.call(e,r,n,i)};case 4:return function(r,n,i,o){return t.call(e,r,n,i,o)};case 5:return function(r,n,i,o,a){return t.call(e,r,n,i,o,a)}}return function(){return t.apply(e,arguments)}}function i(t){return t}e.exports=n},{}],154:[function(t,e,r){function n(t){return!!t&&"object"==typeof t}function i(t,e){var r=null==t?void 0:t[e];return s(r)?r:void 0}function o(t){return a(t)&&f.call(t)==u}function a(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function s(t){return null!=t&&(o(t)?d.test(p.call(t)):n(t)&&l.test(t))}var u="[object Function]",l=/^\[object .+?Constructor\]$/,c=Object.prototype,p=Function.prototype.toString,h=c.hasOwnProperty,f=c.toString,d=RegExp("^"+p.call(h).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=i},{}],155:[function(t,e,r){function n(t){return o(t)&&m.call(t,"callee")&&(!v.call(t,"callee")||y.call(t)==p)}function i(t){return null!=t&&s(t.length)&&!a(t)}function o(t){return l(t)&&i(t)}function a(t){var e=u(t)?y.call(t):"";return e==h||e==f}function s(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=c}function u(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function l(t){return!!t&&"object"==typeof t}var c=9007199254740991,p="[object Arguments]",h="[object Function]",f="[object GeneratorFunction]",d=Object.prototype,m=d.hasOwnProperty,y=d.toString,v=d.propertyIsEnumerable;e.exports=n},{}],156:[function(t,e,r){function n(t){return!!t&&"object"==typeof t}function i(t,e){var r=null==t?void 0:t[e];return u(r)?r:void 0}function o(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=g}function a(t){return s(t)&&m.call(t)==c}function s(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function u(t){return null!=t&&(a(t)?y.test(f.call(t)):n(t)&&p.test(t))}var l="[object Array]",c="[object Function]",p=/^\[object .+?Constructor\]$/,h=Object.prototype,f=Function.prototype.toString,d=h.hasOwnProperty,m=h.toString,y=RegExp("^"+f.call(d).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),v=i(Array,"isArray"),g=9007199254740991,_=v||function(t){return n(t)&&o(t.length)&&m.call(t)==l};e.exports=_},{}],157:[function(t,e,r){function n(t,e,r,n){r="function"==typeof r?o(r,n,3):void
n.source=o(t("./validate/validate_source")),n.light=o(t("./validate/validate_light")),n.layer=o(t("./validate/validate_layer")),n.filter=o(t("./validate/validate_filter")),n.paintProperty=o(t("./validate/validate_paint_property")),n.layoutProperty=o(t("./validate/validate_layout_property")),e.exports=n},{"../reference/latest.min":188,"./validate/validate":170,"./validate/validate_constants":174,"./validate/validate_filter":176,"./validate/validate_glyphs_url":178,"./validate/validate_layer":179,"./validate/validate_layout_property":180,"./validate/validate_light":181,"./validate/validate_paint_property":184,"./validate/validate_source":185}],188:[function(t,e,r){e.exports=t("./v8.min.json")},{"./v8.min.json":189}],189:[function(t,e,r){e.exports={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_tile","source_geojson","source_video","source_image"],source_tile:{type:{required:!0,type:"enum",values:{vector:{},raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},buffer:{type:"number",default:128,maximum:512,minimum:0},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},"fill-extrusion":{},raster:{},background:{}}},metadata:{type:"*"},ref:{type:"string"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"},"paint.*":{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_fill-extrusion","layout_symbol","layout_raster","layout_background"],layout_background:{visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{visible:{},none:{}},default:"visible"}},layout_fill:{visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{visible:{},none:{}},default:"visible"}},layout_circle:{visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{visible:{},none:{}},default:"visible"}},"layout_fill-extrusion":{visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{visible:{},none:{}},default:"visible"}},layout_line:{"line-cap":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:{butt:{},round:{},square:{}},default:"butt"},"line-join":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:{bevel:{},round:{},miter:{}},default:"miter"},"line-miter-limit":{type:"number",default:2,function:"interpolated","zoom-function":!0,"property-function":!0,requires:[{"line-join":"miter"}]},"line-round-limit":{type:"number",default:1.05,function:"interpolated","zoom-function":!0,"property-function":!0,requires:[{"line-join":"round"}]},visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{v
this.realloc(4),this.buf.writeFloatLE(t,this.pos),this.pos+=4},writeDouble:function(t){this.realloc(8),this.buf.writeDoubleLE(t,this.pos),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r<e;r++)this.buf[this.pos++]=t[r]},writeRawMessage:function(t,e){this.pos++;var r=this.pos;t(e,this);var n=this.pos-r;n>=128&&a(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,n.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){this.writeMessage(t,s,e)},writePackedSVarint:function(t,e){this.writeMessage(t,u,e)},writePackedBoolean:function(t,e){this.writeMessage(t,p,e)},writePackedFloat:function(t,e){this.writeMessage(t,l,e)},writePackedDouble:function(t,e){this.writeMessage(t,c,e)},writePackedFixed32:function(t,e){this.writeMessage(t,h,e)},writePackedSFixed32:function(t,e){this.writeMessage(t,f,e)},writePackedFixed64:function(t,e){this.writeMessage(t,d,e)},writePackedSFixed64:function(t,e){this.writeMessage(t,m,e)},writeBytesField:function(t,e){this.writeTag(t,n.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,n.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,n.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,n.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,n.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,n.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,n.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,n.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,n.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,n.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}}}).call(this,"undefined"!=typeof r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./buffer":192}],194:[function(t,e,r){"use strict";function n(t,e){this.x=t,this.y=e}e.exports=n,n.prototype={clone:function(){return new n(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,r=t.y-this.y;return e*e+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[0]*this.x+t[1]*this.y,r=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=r,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),r=Math.sin(t),n=e*this.x-r*this.y,i=r*this.x+e*this.y;return this.x=n,this.y=i,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},n.convert=function(t){return t instanceof n?t:Array.isArray(t)?new n(t[0],t[1]):t}},{}],195:[function(t,e,r){function n(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function o(t){if(p===setTimeout)return setTimeout(t,0);if((p===n||!p)&&setTimeout)return p=setTimeout,setTimeout(t,0);try{return p(t,0)}catch(e){t
var h=c.value,f=r.i(s.a)(h.location),d=document.createElement("option");d.setAttribute("value",h.slug),d.dataset.latitude=f.latitude,d.dataset.longitude=f.longitude,d.appendChild(document.createTextNode(h.name)),n.appendChild(d)}}catch(t){u=!0,l=t}finally{try{!a&&p.return&&p.return()}finally{if(u)throw l}}}return n.addEventListener("change",function(){if("no-location"!==n.value){var t=n[n.selectedIndex].dataset.latitude,e=n[n.selectedIndex].dataset.longitude;map.flyTo({center:[e,t]})}}),n}},function(t,e,r){"use strict";function n(){var t=document.querySelector("fieldset"),e=document.createElement("div");e.classList.add("map"),t.appendChild(e),navigator.geolocation.getCurrentPosition(function(t){e.dataset.latitude=t.coords.latitude,e.dataset.longitude=t.coords.longitude,e.dataset.accuracy=t.coords.accuracy,r.i(i.a)(t)})}var i=r(12);e.a=n},function(t,e,r){"use strict";function n(map){var t=document.createElement("button");return t.setAttribute("type","button"),t.setAttribute("id","create-new-place"),t.appendChild(document.createTextNode("Create New Place?")),t.addEventListener("click",function(){var t=document.createElement("div"),e=document.createElement("label");e.setAttribute("for","place-name"),e.classList.add("place-label"),e.appendChild(document.createTextNode("Name:"));var n=document.createElement("input");n.setAttribute("placeholder","Name"),n.setAttribute("name","place-name"),n.setAttribute("id","place-name"),n.setAttribute("type","text"),t.appendChild(e),t.appendChild(n);var o=document.createElement("div"),a=document.createElement("label");a.setAttribute("for","place-description"),a.classList.add("place-label"),a.appendChild(document.createTextNode("Description:"));var s=document.createElement("input");s.setAttribute("placeholder","Description"),s.setAttribute("name","place-description"),s.setAttribute("id","place-description"),s.setAttribute("type","text"),o.appendChild(a),o.appendChild(s);var u=document.createElement("div"),l=document.createElement("label");l.setAttribute("for","place-latitude"),l.classList.add("place-label"),l.appendChild(document.createTextNode("Latitude:"));var c=document.createElement("input");c.setAttribute("name","place-latitude"),c.setAttribute("id","place-latitude"),c.setAttribute("type","text"),c.value=map.getCenter().lat,u.appendChild(l),u.appendChild(c);var p=document.createElement("div"),h=document.createElement("label");h.setAttribute("for","place-longitude"),h.classList.add("place-label"),h.appendChild(document.createTextNode("Longitude:"));var f=document.createElement("input");f.setAttribute("name","place-longitude"),f.setAttribute("id","place-longitude"),f.setAttribute("type","text"),f.value=map.getCenter().lng,p.appendChild(h),p.appendChild(f);var d=document.createElement("button");d.setAttribute("id","place-submit"),d.setAttribute("name","place-submit"),d.setAttribute("type","button"),d.appendChild(document.createTextNode("Submit New Place")),d.addEventListener("click",function(){r.i(i.a)(map)});var m=document.querySelector("fieldset");m.appendChild(t),m.appendChild(o),m.appendChild(u),m.appendChild(p),m.appendChild(d)}),t}var i=r(15);e.a=n},function(t,e,r){"use strict";function n(map){var t=new FormData;t.append("place-name",document.querySelector("#place-name").value),t.append("place-description",document.querySelector("#place-description").value),t.append("place-latitude",document.querySelector("#place-latitude").value),t.append("place-longitude",document.querySelector("#place-longitude").value),fetch("/places/new",{credentials:"same-origin",method:"post",body:t}).then(function(t){return t.json()}).then(function(t){if(t.error===!0)throw new Error(t.error_description);var e=document.querySelector("fieldset"),r=document.querySelectorAll(".place-label"),n=!0,i=!1,o=void 0;try{for(var a,s=r[Symbol.iterator]();!(n=(a=s.next()).done);n=!0){var u=a.value;e.removeChild(u.parentNode)}}catch(t){i=!0,o=t}finally{try{!n&&s.return&&s.return()}finally{if(i)throw o}}e.removeChild(document.querySelector("#place-submit"));var l=document.querySelector("#create-new-place");l.parentNode.remov
* webStorage - A minimal Javascript wrapper to work with localStorage and sessionStorage
*
* @version v1.2.1
* @author George Raptis <georapbox@gmail.com> (georapbox.github.io)
* @homepage https://github.com/georapbox/webStorage#readme
* @repository git+https://github.com/georapbox/webStorage.git
*/
!function(e,r){t.exports=r()}(this,function(){return function(t){function e(n){if(r[n])return r[n].exports;var i=r[n]={exports:{},id:n,loaded:!1};return t[n].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){"use strict";function n(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(e,"__esModule",{value:!0});var o=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),a=r(1),s=n(a),u=r(2),l=n(u),c=r(3),p=n(c),h=r(4),f=n(h),d=r(5),m=n(d),y=r(6),v=n(y),g=r(7),_=n(g),x={driver:localStorage,name:"webStorage"},b={set:"setItem",set_err:"setItemError",get:"getItem",get_err:"getItemError",remove:"removeItem",clear:"clear"},w=function(){function t(e){if(i(this,t),e=(0,f.default)({},x,e),null==e.name||""===(0,p.default)(e.name))throw"You must use a valid name for the database.";this.options=e,this.storeKeyPrefix=(0,v.default)(this),s.default.apply(Object.getPrototypeOf(this))}return o(t,[{key:"createInstance",value:function(e){return new t(e)}},{key:"config",value:function(t){if(t=(0,f.default)({},x,t),null==t.name||""===(0,p.default)(t.name))throw"You must use a valid name for the database.";this.options=t,this.storeKeyPrefix=(0,v.default)(this)}},{key:"getItem",value:function(t){var e=this.options.driver.getItem(this.storeKeyPrefix+t);try{var r=JSON.parse(e);return this.dispatchEvent({type:b.get,data:r}),r}catch(t){throw this.dispatchEvent({type:b.get_err,data:t}),t}}},{key:"setItem",value:function(t,e){try{return e=null==e?null:e,t=this.storeKeyPrefix+t,this.options.driver.setItem(t,JSON.stringify(e)),this.dispatchEvent({type:b.set,data:e}),e}catch(t){throw this.dispatchEvent({type:b.set_err,data:t}),t}}},{key:"removeItem",value:function(t){this.dispatchEvent({type:b.remove,data:t}),this.options.driver.removeItem(this.storeKeyPrefix+t)}},{key:"clear",value:function(t){var e=this.options.driver;t===!0?e.clear():(0,_.default)(this,function(t){e.removeItem(t)}),this.dispatchEvent({type:b.clear})}},{key:"keys",value:function(){var t=[],e=this.storeKeyPrefix;return(0,_.default)(this,function(r){t.push((0,l.default)(r,e))}),t}},{key:"length",value:function(){var t=0;return(0,_.default)(this,function(){t+=1}),t}},{key:"iterate",value:function(t){var e=this.storeKeyPrefix;(0,_.default)(this,function(r,n,i){var o=(0,l.default)(r,e),a=JSON.parse(n);if(t&&t(o,a,i)===!1)return!1})}},{key:"quota",value:function(){var t={},e=0;return(0,_.default)(this,function(r,n){var i=2*n.length/1024/1024;e+=i,t[r]=i}),{total:e,items:t}}},{key:"supported",value:function(){return(0,m.default)(this.options.driver)}}]),t}();e.default=new w,t.exports=e.default},function(t,e,r){var n,i;!function(o,a,s){"use strict";n=s,i="function"==typeof n?n.call(e,r,e,t):n,!(void 0!==i&&(t.exports=i))}("eventDispatcher",this,function(t){"use strict";var e={nonExtensible:'Cannot apply "'+t+'" on an non extensible object'},r={addEventListener:function(t,r){var n;if(!Object.isExtensible(this))throw new TypeError(e.nonExtensible);return"undefined"==typeof this._listeners&&(this._listeners={}),n=this._listeners,"undefined"==typeof n[t]&&(n[t]=[]),n[t].indexOf(r)===-1&&n[t].push(r),this},hasEventListener:function(t,e){var r;return"undefined"!=typeof this._listeners&&(r=this._listeners,"undefined"!=typeof r[t]&&r[t].indexOf(e)!==-1)},removeEventListener:function(t,e){var r,n,i;if("undefined"!=typeof this._listeners)return r=this._listeners,n=r[t],"undefined"!=typeof n&&(i=n.indexOf(e),i!==-1&&n.splice(i,1)),this},dispatchEvent:function(t){var e,r,n,i;if("undefined"!=typeof this._listeners){if(e=this._listeners,r=e[t.type],"undefined"!=typeof r)for(t.target=this,i=r.length,n=0;n<i;n+=1)r[n].call(this,t);return this}}},n=Object.create(r,{apply:{value:function(t){if(!Object.isExtensible(t))throw new TypeError(e.nonExtensible);return t.a