StackGenVis: Alignment of Data, Algorithms, and Models for Stacking Ensemble Learning Using Performance Metrics https://doi.org/10.1109/TVCG.2020.3030352
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
StackGenVis/frontend/node_modules/plotly.js/dist/plotly-mapbox.min.js

7 lines
1.5 MiB

/**
* plotly.js (mapbox - minified) v1.52.2
* Copyright 2012-2020, Plotly, Inc.
* All rights reserved.
* Licensed under the MIT license
*/
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Plotly=t()}}(function(){return function(){return function t(e,r,n){function i(o,s){if(!r[o]){if(!e[o]){var l="function"==typeof require&&require;if(!s&&l)return l(o,!0);if(a)return a(o,!0);var u=new Error("Cannot find module '"+o+"'");throw u.code="MODULE_NOT_FOUND",u}var c=r[o]={exports:{}};e[o][0].call(c.exports,function(t){return i(e[o][1][t]||t)},c,c.exports,t,e,r,n)}return r[o].exports}for(var a="function"==typeof require&&require,o=0;o<n.length;o++)i(n[o]);return i}}()({1:[function(t,e,r){"use strict";var n=t("../src/lib"),i={"X,X div":"direction:ltr;font-family:'Open Sans', verdana, arial, sans-serif;margin:0;padding:0;","X input,X button":"font-family:'Open Sans', verdana, arial, sans-serif;","X input:focus,X button:focus":"outline:none;","X a":"text-decoration:none;","X a:hover":"text-decoration:none;","X .crisp":"shape-rendering:crispEdges;","X .user-select-none":"-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;","X svg":"overflow:hidden;","X svg a":"fill:#447adb;","X svg a:hover":"fill:#3c6dc5;","X .main-svg":"position:absolute;top:0;left:0;pointer-events:none;","X .main-svg .draglayer":"pointer-events:all;","X .cursor-default":"cursor:default;","X .cursor-pointer":"cursor:pointer;","X .cursor-crosshair":"cursor:crosshair;","X .cursor-move":"cursor:move;","X .cursor-col-resize":"cursor:col-resize;","X .cursor-row-resize":"cursor:row-resize;","X .cursor-ns-resize":"cursor:ns-resize;","X .cursor-ew-resize":"cursor:ew-resize;","X .cursor-sw-resize":"cursor:sw-resize;","X .cursor-s-resize":"cursor:s-resize;","X .cursor-se-resize":"cursor:se-resize;","X .cursor-w-resize":"cursor:w-resize;","X .cursor-e-resize":"cursor:e-resize;","X .cursor-nw-resize":"cursor:nw-resize;","X .cursor-n-resize":"cursor:n-resize;","X .cursor-ne-resize":"cursor:ne-resize;","X .cursor-grab":"cursor:-webkit-grab;cursor:grab;","X .modebar":"position:absolute;top:2px;right:2px;","X .ease-bg":"-webkit-transition:background-color 0.3s ease 0s;-moz-transition:background-color 0.3s ease 0s;-ms-transition:background-color 0.3s ease 0s;-o-transition:background-color 0.3s ease 0s;transition:background-color 0.3s ease 0s;","X .modebar--hover>:not(.watermark)":"opacity:0;-webkit-transition:opacity 0.3s ease 0s;-moz-transition:opacity 0.3s ease 0s;-ms-transition:opacity 0.3s ease 0s;-o-transition:opacity 0.3s ease 0s;transition:opacity 0.3s ease 0s;","X:hover .modebar--hover .modebar-group":"opacity:1;","X .modebar-group":"float:left;display:inline-block;box-sizing:border-box;padding-left:8px;position:relative;vertical-align:middle;white-space:nowrap;","X .modebar-btn":"position:relative;font-size:16px;padding:3px 4px;height:22px;cursor:pointer;line-height:normal;box-sizing:border-box;","X .modebar-btn svg":"position:relative;top:2px;","X .modebar.vertical":"display:flex;flex-direction:column;flex-wrap:wrap;align-content:flex-end;max-height:100%;","X .modebar.vertical svg":"top:-1px;","X .modebar.vertical .modebar-group":"display:block;float:none;padding-left:0px;padding-bottom:8px;","X .modebar.vertical .modebar-group .modebar-btn":"display:block;text-align:center;","X [data-title]:before,X [data-title]:after":"position:absolute;-webkit-transform:translate3d(0, 0, 0);-moz-transform:translate3d(0, 0, 0);-ms-transform:translate3d(0, 0, 0);-o-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);display:none;opacity:0;z-index:1001;pointer-events:none;top:110%;right:50%;","X [data-title]:hover:before,X [data-title]:hover:after":"display:block;opacity:1;","X [data-title]:before":"content:'';position:absolute;background:transparent;border:6px solid transparent;z-index:1002;margin-top:-12px;border-bottom-color:#69738a;margin-right:-6px;","X [data-title]:after":"content:attr(data-title);background:#69738a;color:white;padding:8px 10px;font-size:12px;line-height:12px;white-space:nowrap;margin-right:-18px;border-radius:2px;","X .vertical [data-title]:before,X .vertical [data-title]:after":"top:0%;right:200%;","X .vertical [data-title]:before":"border:6px solid transparent;border-left-color:#69738a;margin-top:8px;margin-right:-30px;","X .select-outline":"fill:none;stroke-width:1;shape-rendering:crispEdges;","X .select-outline-1":"stroke:white;","X .select-outline-2":"stroke:black;stroke-dasharray:2px 2px;",Y:"font-family:'Open Sans';position:fixed;top:50px;right:20px;z-index:10000;font-size:10pt;max-width:180px;","Y p":"margin:0;","Y .notifier-note":"min-width:180px;max-width:250px;border:1px solid #fff;z-index:3000;margin:0;background-color:#8c97af;background-color:rgba(140,151,175,0.9);color:#fff;padding:10px;overflow-wrap:break-word;word-wrap:break-word;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto;","Y .notifier-close":"color:#fff;opacity:0.8;float:right;padding:0 5px;background:none;border:none;font-size:20px;font-weight:bold;line-height:20px;","Y .notifier-close:hover":"color:#444;text-decoration:none;cursor:pointer;"};for(var a in i){var o=a.replace(/^,/," ,").replace(/X/g,".js-plotly-plot .plotly").replace(/Y/g,".plotly-notifier");n.addStyleRule(o,i[a])}},{"../src/lib":169}],2:[function(t,e,r){"use strict";e.exports=t("../src/traces/choroplethmapbox")},{"../src/traces/choroplethmapbox":278}],3:[function(t,e,r){"use strict";e.exports=t("../src/core")},{"../src/core":149}],4:[function(t,e,r){"use strict";e.exports=t("../src/traces/densitymapbox")},{"../src/traces/densitymapbox":286}],5:[function(t,e,r){"use strict";var n=t("./core");n.register([t("./scattermapbox"),t("./choroplethmapbox"),t("./densitymapbox")]),e.exports=n},{"./choroplethmapbox":2,"./core":3,"./densitymapbox":4,"./scattermapbox":6}],6:[function(t,e,r){"use strict";e.exports=t("../src/traces/scattermapbox")},{"../src/traces/scattermapbox":327}],7:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("@turf/meta"),i=6378137;function a(t){var e=0;if(t&&t.length>0){e+=Math.abs(o(t[0]));for(var r=1;r<t.length;r++)e-=Math.abs(o(t[r]))}return e}function o(t){var e,r,n,a,o,l,u=0,c=t.length;if(c>2){for(l=0;l<c;l++)l===c-2?(n=c-2,a=c-1,o=0):l===c-1?(n=c-1,a=0,o=1):(n=l,a=l+1,o=l+2),e=t[n],r=t[a],u+=(s(t[o][0])-s(e[0]))*Math.sin(s(r[1]));u=u*i*i/2}return u}function s(t){return t*Math.PI/180}r.default=function(t){return n.geomReduce(t,function(t,e){return t+function(t){var e,r=0;switch(t.type){case"Polygon":return a(t.coordinates);case"MultiPolygon":for(e=0;e<t.coordinates.length;e++)r+=a(t.coordinates[e]);return r;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0}return 0}(e)},0)}},{"@turf/meta":11}],8:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("@turf/meta");r.default=function(t){var e=[1/0,1/0,-1/0,-1/0];return n.coordEach(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":11}],9:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("@turf/meta"),i=t("@turf/helpers");r.default=function(t,e){void 0===e&&(e={});var r=0,a=0,o=0;return n.coordEach(t,function(t){r+=t[0],a+=t[1],o++}),i.point([r/o,a/o],e.properties)}},{"@turf/helpers":10,"@turf/meta":11}],10:[function(t,e,r){"use strict";function n(t,e,r){void 0===r&&(r={});var n={type:"Feature"};return(0===r.id||r.id)&&(n.id=r.id),r.bbox&&(n.bbox=r.bbox),n.properties=e||{},n.geometry=t,n}function i(t,e,r){return void 0===r&&(r={}),n({type:"Point",coordinates:t},e,r)}function a(t,e,r){void 0===r&&(r={});for(var i=0,a=t;i<a.length;i++){var o=a[i];if(o.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var s=0;s<o[o.length-1].length;s++)if(o[o.length-1][s]!==o[0][s])throw new Error("First and last Position are not equivalent.")}return n({type:"Polygon",coordinates:t},e,r)}function o(t,e,r){if(void 0===r&&(r={}),t.length<2)throw new Error("coordinates must be an array of two or more positions");return n({type:"LineString",coordinates:t},e,r)}function s(t,e){void 0===e&&(e={});var r={type:"FeatureCollection"};return e.id&&(r.id=e.id),e.bbox&&(r.bbox=e.bbox),r.features=t,r}function l(t,e,r){return void 0===r&&(r={}),n({type:"MultiLineString",coordinates:t},e,r)}function u(t,e,r){return void 0===r&&(r={}),n({type:"MultiPoint",coordinates:t},e,r)}function c(t,e,r){return void 0===r&&(r={}),n({type:"MultiPolygon",coordinates:t},e,r)}function p(t,e){void 0===e&&(e="kilometers");var n=r.factors[e];if(!n)throw new Error(e+" units is invalid");return t*n}function h(t,e){void 0===e&&(e="kilometers");var n=r.factors[e];if(!n)throw new Error(e+" units is invalid");return t/n}function f(t){return 180*(t%(2*Math.PI))/Math.PI}function d(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)&&!/^\s*$/.test(t)}Object.defineProperty(r,"__esModule",{value:!0}),r.earthRadius=6371008.8,r.factors={centimeters:100*r.earthRadius,centimetres:100*r.earthRadius,degrees:r.earthRadius/111325,feet:3.28084*r.earthRadius,inches:39.37*r.earthRadius,kilometers:r.earthRadius/1e3,kilometres:r.earthRadius/1e3,meters:r.earthRadius,metres:r.earthRadius,miles:r.earthRadius/1609.344,millimeters:1e3*r.earthRadius,millimetres:1e3*r.earthRadius,nauticalmiles:r.earthRadius/1852,radians:1,yards:r.earthRadius/1.0936},r.unitsFactors={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:.001,kilometres:.001,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/r.earthRadius,yards:1/1.0936},r.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:3.86e-7,millimeters:1e6,millimetres:1e6,yards:1.195990046},r.feature=n,r.geometry=function(t,e,r){switch(void 0===r&&(r={}),t){case"Point":return i(e).geometry;case"LineString":return o(e).geometry;case"Polygon":return a(e).geometry;case"MultiPoint":return u(e).geometry;case"MultiLineString":return l(e).geometry;case"MultiPolygon":return c(e).geometry;default:throw new Error(t+" is invalid")}},r.point=i,r.points=function(t,e,r){return void 0===r&&(r={}),s(t.map(function(t){return i(t,e)}),r)},r.polygon=a,r.polygons=function(t,e,r){return void 0===r&&(r={}),s(t.map(function(t){return a(t,e)}),r)},r.lineString=o,r.lineStrings=function(t,e,r){return void 0===r&&(r={}),s(t.map(function(t){return o(t,e)}),r)},r.featureCollection=s,r.multiLineString=l,r.multiPoint=u,r.multiPolygon=c,r.geometryCollection=function(t,e,r){return void 0===r&&(r={}),n({type:"GeometryCollection",geometries:t},e,r)},r.round=function(t,e){if(void 0===e&&(e=0),e&&!(e>=0))throw new Error("precision must be a positive number");var r=Math.pow(10,e||0);return Math.round(t*r)/r},r.radiansToLength=p,r.lengthToRadians=h,r.lengthToDegrees=function(t,e){return f(h(t,e))},r.bearingToAzimuth=function(t){var e=t%360;return e<0&&(e+=360),e},r.radiansToDegrees=f,r.degreesToRadians=function(t){return t%360*Math.PI/180},r.convertLength=function(t,e,r){if(void 0===e&&(e="kilometers"),void 0===r&&(r="kilometers"),!(t>=0))throw new Error("length must be a positive number");return p(h(t,e),r)},r.convertArea=function(t,e,n){if(void 0===e&&(e="meters"),void 0===n&&(n="kilometers"),!(t>=0))throw new Error("area must be a positive number");var i=r.areaFactors[e];if(!i)throw new Error("invalid original units");var a=r.areaFactors[n];if(!a)throw new Error("invalid final units");return t/i*a},r.isNumber=d,r.isObject=function(t){return!!t&&t.constructor===Object},r.validateBBox=function(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(4!==t.length&&6!==t.length)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach(function(t){if(!d(t))throw new Error("bbox must only contain numbers")})},r.validateId=function(t){if(!t)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof t))throw new Error("id must be a number or a string")},r.radians2degrees=function(){throw new Error("method has been renamed to `radiansToDegrees`")},r.degrees2radians=function(){throw new Error("method has been renamed to `degreesToRadians`")},r.distanceToDegrees=function(){throw new Error("method has been renamed to `lengthToDegrees`")},r.distanceToRadians=function(){throw new Error("method has been renamed to `lengthToRadians`")},r.radiansToDistance=function(){throw new Error("method has been renamed to `radiansToLength`")},r.bearingToAngle=function(){throw new Error("method has been renamed to `bearingToAzimuth`")},r.convertDistance=function(){throw new Error("method has been renamed to `convertLength`")}},{}],11:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("@turf/helpers");function i(t,e,r){if(null!==t)for(var n,a,o,s,l,u,c,p,h=0,f=0,d=t.type,m="FeatureCollection"===d,y="Feature"===d,g=m?t.features.length:1,v=0;v<g;v++){l=(p=!!(c=m?t.features[v].geometry:y?t.geometry:t)&&"GeometryCollection"===c.type)?c.geometries.length:1;for(var _=0;_<l;_++){var x=0,b=0;if(null!==(s=p?c.geometries[_]:c)){u=s.coordinates;var w=s.type;switch(h=!r||"Polygon"!==w&&"MultiPolygon"!==w?0:1,w){case null:break;case"Point":if(!1===e(u,f,v,x,b))return!1;f++,x++;break;case"LineString":case"MultiPoint":for(n=0;n<u.length;n++){if(!1===e(u[n],f,v,x,b))return!1;f++,"MultiPoint"===w&&x++}"LineString"===w&&x++;break;case"Polygon":case"MultiLineString":for(n=0;n<u.length;n++){for(a=0;a<u[n].length-h;a++){if(!1===e(u[n][a],f,v,x,b))return!1;f++}"MultiLineString"===w&&x++,"Polygon"===w&&b++}"Polygon"===w&&x++;break;case"MultiPolygon":for(n=0;n<u.length;n++){for(b=0,a=0;a<u[n].length;a++){for(o=0;o<u[n][a].length-h;o++){if(!1===e(u[n][a][o],f,v,x,b))return!1;f++}b++}x++}break;case"GeometryCollection":for(n=0;n<s.geometries.length;n++)if(!1===i(s.geometries[n],e,r))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function a(t,e){var r;switch(t.type){case"FeatureCollection":for(r=0;r<t.features.length&&!1!==e(t.features[r].properties,r);r++);break;case"Feature":e(t.properties,0)}}function o(t,e){if("Feature"===t.type)e(t,0);else if("FeatureCollection"===t.type)for(var r=0;r<t.features.length&&!1!==e(t.features[r],r);r++);}function s(t,e){var r,n,i,a,o,s,l,u,c,p,h=0,f="FeatureCollection"===t.type,d="Feature"===t.type,m=f?t.features.length:1;for(r=0;r<m;r++){for(s=f?t.features[r].geometry:d?t.geometry:t,u=f?t.features[r].properties:d?t.properties:{},c=f?t.features[r].bbox:d?t.bbox:void 0,p=f?t.features[r].id:d?t.id:void 0,o=(l=!!s&&"GeometryCollection"===s.type)?s.geometries.length:1,i=0;i<o;i++)if(null!==(a=l?s.geometries[i]:s))switch(a.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===e(a,h,u,c,p))return!1;break;case"GeometryCollection":for(n=0;n<a.geometries.length;n++)if(!1===e(a.geometries[n],h,u,c,p))return!1;break;default:throw new Error("Unknown Geometry Type")}else if(!1===e(null,h,u,c,p))return!1;h++}}function l(t,e){s(t,function(t,r,i,a,o){var s,l=null===t?null:t.type;switch(l){case null:case"Point":case"LineString":case"Polygon":return!1!==e(n.feature(t,i,{bbox:a,id:o}),r,0)&&void 0}switch(l){case"MultiPoint":s="Point";break;case"MultiLineString":s="LineString";break;case"MultiPolygon":s="Polygon"}for(var u=0;u<t.coordinates.length;u++){var c={type:s,coordinates:t.coordinates[u]};if(!1===e(n.feature(c,i),r,u))return!1}})}function u(t,e){l(t,function(t,r,a){var o=0;if(t.geometry){var s=t.geometry.type;if("Point"!==s&&"MultiPoint"!==s){var l,u=0,c=0,p=0;return!1!==i(t,function(i,s,h,f,d){if(void 0===l||r>u||f>c||d>p)return l=i,u=r,c=f,p=d,void(o=0);var m=n.lineString([l,i],t.properties);if(!1===e(m,r,a,d,o))return!1;o++,l=i})&&void 0}}})}function c(t,e){if(!t)throw new Error("geojson is required");l(t,function(t,r,i){if(null!==t.geometry){var a=t.geometry.type,o=t.geometry.coordinates;switch(a){case"LineString":if(!1===e(t,r,i,0,0))return!1;break;case"Polygon":for(var s=0;s<o.length;s++)if(!1===e(n.lineString(o[s],t.properties),r,i,s))return!1}}})}r.coordEach=i,r.coordReduce=function(t,e,r,n){var a=r;return i(t,function(t,n,i,o,s){a=0===n&&void 0===r?t:e(a,t,n,i,o,s)},n),a},r.propEach=a,r.propReduce=function(t,e,r){var n=r;return a(t,function(t,i){n=0===i&&void 0===r?t:e(n,t,i)}),n},r.featureEach=o,r.featureReduce=function(t,e,r){var n=r;return o(t,function(t,i){n=0===i&&void 0===r?t:e(n,t,i)}),n},r.coordAll=function(t){var e=[];return i(t,function(t){e.push(t)}),e},r.geomEach=s,r.geomReduce=function(t,e,r){var n=r;return s(t,function(t,i,a,o,s){n=0===i&&void 0===r?t:e(n,t,i,a,o,s)}),n},r.flattenEach=l,r.flattenReduce=function(t,e,r){var n=r;return l(t,function(t,i,a){n=0===i&&0===a&&void 0===r?t:e(n,t,i,a)}),n},r.segmentEach=u,r.segmentReduce=function(t,e,r){var n=r,i=!1;return u(t,function(t,a,o,s,l){n=!1===i&&void 0===r?t:e(n,t,a,o,s,l),i=!0}),n},r.lineEach=c,r.lineReduce=function(t,e,r){var n=r;return c(t,function(t,i,a,o){n=0===i&&void 0===r?t:e(n,t,i,a,o)}),n},r.findSegment=function(t,e){if(e=e||{},!n.isObject(e))throw new Error("options is invalid");var r,i=e.featureIndex||0,a=e.multiFeatureIndex||0,o=e.geometryIndex||0,s=e.segmentIndex||0,l=e.properties;switch(t.type){case"FeatureCollection":i<0&&(i=t.features.length+i),l=l||t.features[i].properties,r=t.features[i].geometry;break;case"Feature":l=l||t.properties,r=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":r=t;break;default:throw new Error("geojson is invalid")}if(null===r)return null;var u=r.coordinates;switch(r.type){case"Point":case"MultiPoint":return null;case"LineString":return s<0&&(s=u.length+s-1),n.lineString([u[s],u[s+1]],l,e);case"Polygon":return o<0&&(o=u.length+o),s<0&&(s=u[o].length+s-1),n.lineString([u[o][s],u[o][s+1]],l,e);case"MultiLineString":return a<0&&(a=u.length+a),s<0&&(s=u[a].length+s-1),n.lineString([u[a][s],u[a][s+1]],l,e);case"MultiPolygon":return a<0&&(a=u.length+a),o<0&&(o=u[a].length+o),s<0&&(s=u[a][o].length-s-1),n.lineString([u[a][o][s],u[a][o][s+1]],l,e)}throw new Error("geojson is invalid")},r.findPoint=function(t,e){if(e=e||{},!n.isObject(e))throw new Error("options is invalid");var r,i=e.featureIndex||0,a=e.multiFeatureIndex||0,o=e.geometryIndex||0,s=e.coordIndex||0,l=e.properties;switch(t.type){case"FeatureCollection":i<0&&(i=t.features.length+i),l=l||t.features[i].properties,r=t.features[i].geometry;break;case"Feature":l=l||t.properties,r=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":r=t;break;default:throw new Error("geojson is invalid")}if(null===r)return null;var u=r.coordinates;switch(r.type){case"Point":return n.point(u,l,e);case"MultiPoint":return a<0&&(a=u.length+a),n.point(u[a],l,e);case"LineString":return s<0&&(s=u.length+s),n.point(u[s],l,e);case"Polygon":return o<0&&(o=u.length+o),s<0&&(s=u[o].length+s),n.point(u[o][s],l,e);case"MultiLineString":return a<0&&(a=u.length+a),s<0&&(s=u[a].length+s),n.point(u[a][s],l,e);case"MultiPolygon":return a<0&&(a=u.length+a),o<0&&(o=u[a].length+o),s<0&&(s=u[a][o].length-s),n.point(u[a][o][s],l,e)}throw new Error("geojson is invalid")}},{"@turf/helpers":10}],12:[function(t,e,r){var n=Object.create||function(t){var e=function(){};return e.prototype=t,new e},i=Object.keys||function(t){var e=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.push(r);return r},a=Function.prototype.bind||function(t){var e=this;return function(){return e.apply(t,arguments)}};function o(){this._events&&Object.prototype.hasOwnProperty.call(this,"_events")||(this._events=n(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0}e.exports=o,o.EventEmitter=o,o.prototype._events=void 0,o.prototype._maxListeners=void 0;var s,l=10;try{var u={};Object.defineProperty&&Object.defineProperty(u,"x",{value:0}),s=0===u.x}catch(t){s=!1}function c(t){return void 0===t._maxListeners?o.defaultMaxListeners:t._maxListeners}function p(t,e,r,i){var a,o,s;if("function"!=typeof r)throw new TypeError('"listener" argument must be a function');if((o=t._events)?(o.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),s=o[e]):(o=t._events=n(null),t._eventsCount=0),s){if("function"==typeof s?s=o[e]=i?[r,s]:[s,r]:i?s.unshift(r):s.push(r),!s.warned&&(a=c(t))&&a>0&&s.length>a){s.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+s.length+' "'+String(e)+'" listeners added. Use emitter.setMaxListeners() to increase limit.');l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=s.length,"object"==typeof console&&console.warn&&console.warn("%s: %s",l.name,l.message)}}else s=o[e]=r,++t._eventsCount;return t}function h(){if(!this.fired)switch(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length){case 0:return this.listener.call(this.target);case 1:return this.listener.call(this.target,arguments[0]);case 2:return this.listener.call(this.target,arguments[0],arguments[1]);case 3:return this.listener.call(this.target,arguments[0],arguments[1],arguments[2]);default:for(var t=new Array(arguments.length),e=0;e<t.length;++e)t[e]=arguments[e];this.listener.apply(this.target,t)}}function f(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=a.call(h,n);return i.listener=r,n.wrapFn=i,i}function d(t,e,r){var n=t._events;if(!n)return[];var i=n[e];return i?"function"==typeof i?r?[i.listener||i]:[i]:r?function(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}(i):y(i,i.length):[]}function m(t){var e=this._events;if(e){var r=e[t];if("function"==typeof r)return 1;if(r)return r.length}return 0}function y(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}s?Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return l},set:function(t){if("number"!=typeof t||t<0||t!=t)throw new TypeError('"defaultMaxListeners" must be a positive number');l=t}}):o.defaultMaxListeners=l,o.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||isNaN(t))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=t,this},o.prototype.getMaxListeners=function(){return c(this)},o.prototype.emit=function(t){var e,r,n,i,a,o,s="error"===t;if(o=this._events)s=s&&null==o.error;else if(!s)return!1;if(s){if(arguments.length>1&&(e=arguments[1]),e instanceof Error)throw e;var l=new Error('Unhandled "error" event. ('+e+")");throw l.context=e,l}if(!(r=o[t]))return!1;var u="function"==typeof r;switch(n=arguments.length){case 1:!function(t,e,r){if(e)t.call(r);else for(var n=t.length,i=y(t,n),a=0;a<n;++a)i[a].call(r)}(r,u,this);break;case 2:!function(t,e,r,n){if(e)t.call(r,n);else for(var i=t.length,a=y(t,i),o=0;o<i;++o)a[o].call(r,n)}(r,u,this,arguments[1]);break;case 3:!function(t,e,r,n,i){if(e)t.call(r,n,i);else for(var a=t.length,o=y(t,a),s=0;s<a;++s)o[s].call(r,n,i)}(r,u,this,arguments[1],arguments[2]);break;case 4:!function(t,e,r,n,i,a){if(e)t.call(r,n,i,a);else for(var o=t.length,s=y(t,o),l=0;l<o;++l)s[l].call(r,n,i,a)}(r,u,this,arguments[1],arguments[2],arguments[3]);break;default:for(i=new Array(n-1),a=1;a<n;a++)i[a-1]=arguments[a];!function(t,e,r,n){if(e)t.apply(r,n);else for(var i=t.length,a=y(t,i),o=0;o<i;++o)a[o].apply(r,n)}(r,u,this,i)}return!0},o.prototype.addListener=function(t,e){return p(this,t,e,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(t,e){return p(this,t,e,!0)},o.prototype.once=function(t,e){if("function"!=typeof e)throw new TypeError('"listener" argument must be a function');return this.on(t,f(this,t,e)),this},o.prototype.prependOnceListener=function(t,e){if("function"!=typeof e)throw new TypeError('"listener" argument must be a function');return this.prependListener(t,f(this,t,e)),this},o.prototype.removeListener=function(t,e){var r,i,a,o,s;if("function"!=typeof e)throw new TypeError('"listener" argument must be a function');if(!(i=this._events))return this;if(!(r=i[t]))return this;if(r===e||r.listener===e)0==--this._eventsCount?this._events=n(null):(delete i[t],i.removeListener&&this.emit("removeListener",t,r.listener||e));else if("function"!=typeof r){for(a=-1,o=r.length-1;o>=0;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,a=o;break}if(a<0)return this;0===a?r.shift():function(t,e){for(var r=e,n=r+1,i=t.length;n<i;r+=1,n+=1)t[r]=t[n];t.pop()}(r,a),1===r.length&&(i[t]=r[0]),i.removeListener&&this.emit("removeListener",t,s||e)}return this},o.prototype.removeAllListeners=function(t){var e,r,a;if(!(r=this._events))return this;if(!r.removeListener)return 0===arguments.length?(this._events=n(null),this._eventsCount=0):r[t]&&(0==--this._eventsCount?this._events=n(null):delete r[t]),this;if(0===arguments.length){var o,s=i(r);for(a=0;a<s.length;++a)"removeListener"!==(o=s[a])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=n(null),this._eventsCount=0,this}if("function"==typeof(e=r[t]))this.removeListener(t,e);else if(e)for(a=e.length-1;a>=0;a--)this.removeListener(t,e[a]);return this},o.prototype.listeners=function(t){return d(this,t,!0)},o.prototype.rawListeners=function(t){return d(this,t,!1)},o.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):m.call(t,e)},o.prototype.listenerCount=m,o.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]}},{}],13:[function(t,e,r){e.exports={AFG:"afghan",ALA:"\\b\\wland",ALB:"albania",DZA:"algeria",ASM:"^(?=.*americ).*samoa",AND:"andorra",AGO:"angola",AIA:"anguill?a",ATA:"antarctica",ATG:"antigua",ARG:"argentin",ARM:"armenia",ABW:"^(?!.*bonaire).*\\baruba",AUS:"australia",AUT:"^(?!.*hungary).*austria|\\baustri.*\\bemp",AZE:"azerbaijan",BHS:"bahamas",BHR:"bahrain",BGD:"bangladesh|^(?=.*east).*paki?stan",BRB:"barbados",BLR:"belarus|byelo",BEL:"^(?!.*luxem).*belgium",BLZ:"belize|^(?=.*british).*honduras",BEN:"benin|dahome",BMU:"bermuda",BTN:"bhutan",BOL:"bolivia",BES:"^(?=.*bonaire).*eustatius|^(?=.*carib).*netherlands|\\bbes.?islands",BIH:"herzegovina|bosnia",BWA:"botswana|bechuana",BVT:"bouvet",BRA:"brazil",IOT:"british.?indian.?ocean",BRN:"brunei",BGR:"bulgaria",BFA:"burkina|\\bfaso|upper.?volta",BDI:"burundi",CPV:"verde",KHM:"cambodia|kampuchea|khmer",CMR:"cameroon",CAN:"canada",CYM:"cayman",CAF:"\\bcentral.african.republic",TCD:"\\bchad",CHL:"\\bchile",CHN:"^(?!.*\\bmac)(?!.*\\bhong)(?!.*\\btai)(?!.*\\brep).*china|^(?=.*peo)(?=.*rep).*china",CXR:"christmas",CCK:"\\bcocos|keeling",COL:"colombia",COM:"comoro",COG:"^(?!.*\\bdem)(?!.*\\bd[\\.]?r)(?!.*kinshasa)(?!.*zaire)(?!.*belg)(?!.*l.opoldville)(?!.*free).*\\bcongo",COK:"\\bcook",CRI:"costa.?rica",CIV:"ivoire|ivory",HRV:"croatia",CUB:"\\bcuba",CUW:"^(?!.*bonaire).*\\bcura(c|\xe7)ao",CYP:"cyprus",CSK:"czechoslovakia",CZE:"^(?=.*rep).*czech|czechia|bohemia",COD:"\\bdem.*congo|congo.*\\bdem|congo.*\\bd[\\.]?r|\\bd[\\.]?r.*congo|belgian.?congo|congo.?free.?state|kinshasa|zaire|l.opoldville|drc|droc|rdc",DNK:"denmark",DJI:"djibouti",DMA:"dominica(?!n)",DOM:"dominican.rep",ECU:"ecuador",EGY:"egypt",SLV:"el.?salvador",GNQ:"guine.*eq|eq.*guine|^(?=.*span).*guinea",ERI:"eritrea",EST:"estonia",ETH:"ethiopia|abyssinia",FLK:"falkland|malvinas",FRO:"faroe|faeroe",FJI:"fiji",FIN:"finland",FRA:"^(?!.*\\bdep)(?!.*martinique).*france|french.?republic|\\bgaul",GUF:"^(?=.*french).*guiana",PYF:"french.?polynesia|tahiti",ATF:"french.?southern",GAB:"gabon",GMB:"gambia",GEO:"^(?!.*south).*georgia",DDR:"german.?democratic.?republic|democratic.?republic.*germany|east.germany",DEU:"^(?!.*east).*germany|^(?=.*\\bfed.*\\brep).*german",GHA:"ghana|gold.?coast",GIB:"gibraltar",GRC:"greece|hellenic|hellas",GRL:"greenland",GRD:"grenada",GLP:"guadeloupe",GUM:"\\bguam",GTM:"guatemala",GGY:"guernsey",GIN:"^(?!.*eq)(?!.*span)(?!.*bissau)(?!.*portu)(?!.*new).*guinea",GNB:"bissau|^(?=.*portu).*guinea",GUY:"guyana|british.?guiana",HTI:"haiti",HMD:"heard.*mcdonald",VAT:"holy.?see|vatican|papal.?st",HND:"^(?!.*brit).*honduras",HKG:"hong.?kong",HUN:"^(?!.*austr).*hungary",ISL:"iceland",IND:"india(?!.*ocea)",IDN:"indonesia",IRN:"\\biran|persia",IRQ:"\\biraq|mesopotamia",IRL:"(^ireland)|(^republic.*ireland)",IMN:"^(?=.*isle).*\\bman",ISR:"israel",ITA:"italy",JAM:"jamaica",JPN:"japan",JEY:"jersey",JOR:"jordan",KAZ:"kazak",KEN:"kenya|british.?east.?africa|east.?africa.?prot",KIR:"kiribati",PRK:"^(?=.*democrat|people|north|d.*p.*.r).*\\bkorea|dprk|korea.*(d.*p.*r)",KWT:"kuwait",KGZ:"kyrgyz|kirghiz",LAO:"\\blaos?\\b",LVA:"latvia",LBN:"lebanon",LSO:"lesotho|basuto",LBR:"liberia",LBY:"libya",LIE:"liechtenstein",LTU:"lithuania",LUX:"^(?!.*belg).*luxem",MAC:"maca(o|u)",MDG:"madagascar|malagasy",MWI:"malawi|nyasa",MYS:"malaysia",MDV:"maldive",MLI:"\\bmali\\b",MLT:"\\bmalta",MHL:"marshall",MTQ:"martinique",MRT:"mauritania",MUS:"mauritius",MYT:"\\bmayotte",MEX:"\\bmexic",FSM:"fed.*micronesia|micronesia.*fed",MCO:"monaco",MNG:"mongolia",MNE:"^(?!.*serbia).*montenegro",MSR:"montserrat",MAR:"morocco|\\bmaroc",MOZ:"mozambique",MMR:"myanmar|burma",NAM:"namibia",NRU:"nauru",NPL:"nepal",NLD:"^(?!.*\\bant)(?!.*\\bcarib).*netherlands",ANT:"^(?=.*\\bant).*(nether|dutch)",NCL:"new.?caledonia",NZL:"new.?zealand",NIC:"nicaragua",NER:"\\bniger(?!ia)",NGA:"nigeria",NIU:"niue",NFK:"norfolk",MNP:"mariana",NOR:"norway",OMN:"\\boman|trucial",PAK:"^(?!.*east).*paki?stan",PLW:"palau",PSE:"palestin|\\bgaza|west.?bank",PAN:"panama",PNG:"papua|new.?guinea",PRY:"paraguay",PER:"peru",PHL:"philippines",PCN:"pitcairn",POL:"poland",PRT:"portugal",PRI:"puerto.?rico",QAT:"qatar",KOR:"^(?!.*d.*p.*r)(?!.*democrat)(?!.*people)(?!.*north).*\\bkorea(?!.*d.*p.*r)",MDA:"moldov|b(a|e)ssarabia",REU:"r(e|\xe9)union",ROU:"r(o|u|ou)mania",RUS:"\\brussia|soviet.?union|u\\.?s\\.?s\\.?r|socialist.?republics",RWA:"rwanda",BLM:"barth(e|\xe9)lemy",SHN:"helena",KNA:"kitts|\\bnevis",LCA:"\\blucia",MAF:"^(?=.*collectivity).*martin|^(?=.*france).*martin(?!ique)|^(?=.*french).*martin(?!ique)",SPM:"miquelon",VCT:"vincent",WSM:"^(?!.*amer).*samoa",SMR:"san.?marino",STP:"\\bs(a|\xe3)o.?tom(e|\xe9)",SAU:"\\bsa\\w*.?arabia",SEN:"senegal",SRB:"^(?!.*monte).*serbia",SYC:"seychell",SLE:"sierra",SGP:"singapore",SXM:"^(?!.*martin)(?!.*saba).*maarten",SVK:"^(?!.*cze).*slovak",SVN:"slovenia",SLB:"solomon",SOM:"somali",ZAF:"south.africa|s\\\\..?africa",SGS:"south.?georgia|sandwich",SSD:"\\bs\\w*.?sudan",ESP:"spain",LKA:"sri.?lanka|ceylon",SDN:"^(?!.*\\bs(?!u)).*sudan",SUR:"surinam|dutch.?guiana",SJM:"svalbard",SWZ:"swaziland",SWE:"sweden",CHE:"switz|swiss",SYR:"syria",TWN:"taiwan|taipei|formosa|^(?!.*peo)(?=.*rep).*china",TJK:"tajik",THA:"thailand|\\bsiam",MKD:"macedonia|fyrom",TLS:"^(?=.*leste).*timor|^(?=.*east).*timor",TGO:"togo",TKL:"tokelau",TON:"tonga",TTO:"trinidad|tobago",TUN:"tunisia",TUR:"turkey",TKM:"turkmen",TCA:"turks",TUV:"tuvalu",UGA:"uganda",UKR:"ukrain",ARE:"emirates|^u\\.?a\\.?e\\.?$|united.?arab.?em",GBR:"united.?kingdom|britain|^u\\.?k\\.?$",TZA:"tanzania",USA:"united.?states\\b(?!.*islands)|\\bu\\.?s\\.?a\\.?\\b|^\\s*u\\.?s\\.?\\b(?!.*islands)",UMI:"minor.?outlying.?is",URY:"uruguay",UZB:"uzbek",VUT:"vanuatu|new.?hebrides",VEN:"venezuela",VNM:"^(?!.*republic).*viet.?nam|^(?=.*socialist).*viet.?nam",VGB:"^(?=.*\\bu\\.?\\s?k).*virgin|^(?=.*brit).*virgin|^(?=.*kingdom).*virgin",VIR:"^(?=.*\\bu\\.?\\s?s).*virgin|^(?=.*states).*virgin",WLF:"futuna|wallis",ESH:"western.sahara",YEM:"^(?!.*arab)(?!.*north)(?!.*sana)(?!.*peo)(?!.*dem)(?!.*south)(?!.*aden)(?!.*\\bp\\.?d\\.?r).*yemen",YMD:"^(?=.*peo).*yemen|^(?!.*rep)(?=.*dem).*yemen|^(?=.*south).*yemen|^(?=.*aden).*yemen|^(?=.*\\bp\\.?d\\.?r).*yemen",YUG:"yugoslavia",ZMB:"zambia|northern.?rhodesia",EAZ:"zanzibar",ZWE:"zimbabwe|^(?!.*northern).*rhodesia"}},{}],14:[function(t,e,r){!function(){var t={version:"3.5.17"},r=[].slice,n=function(t){return r.call(t)},i=this.document;function a(t){return t&&(t.ownerDocument||t.document||t).documentElement}function o(t){return t&&(t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView)}if(i)try{n(i.documentElement.childNodes)[0].nodeType}catch(t){n=function(t){for(var e=t.length,r=new Array(e);e--;)r[e]=t[e];return r}}if(Date.now||(Date.now=function(){return+new Date}),i)try{i.createElement("DIV").style.setProperty("opacity",0,"")}catch(t){var s=this.Element.prototype,l=s.setAttribute,u=s.setAttributeNS,c=this.CSSStyleDeclaration.prototype,p=c.setProperty;s.setAttribute=function(t,e){l.call(this,t,e+"")},s.setAttributeNS=function(t,e,r){u.call(this,t,e,r+"")},c.setProperty=function(t,e,r){p.call(this,t,e+"",r)}}function h(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function f(t){return null===t?NaN:+t}function d(t){return!isNaN(t)}function m(t){return{left:function(e,r,n,i){for(arguments.length<3&&(n=0),arguments.length<4&&(i=e.length);n<i;){var a=n+i>>>1;t(e[a],r)<0?n=a+1:i=a}return n},right:function(e,r,n,i){for(arguments.length<3&&(n=0),arguments.length<4&&(i=e.length);n<i;){var a=n+i>>>1;t(e[a],r)>0?i=a:n=a+1}return n}}}t.ascending=h,t.descending=function(t,e){return e<t?-1:e>t?1:e>=t?0:NaN},t.min=function(t,e){var r,n,i=-1,a=t.length;if(1===arguments.length){for(;++i<a;)if(null!=(n=t[i])&&n>=n){r=n;break}for(;++i<a;)null!=(n=t[i])&&r>n&&(r=n)}else{for(;++i<a;)if(null!=(n=e.call(t,t[i],i))&&n>=n){r=n;break}for(;++i<a;)null!=(n=e.call(t,t[i],i))&&r>n&&(r=n)}return r},t.max=function(t,e){var r,n,i=-1,a=t.length;if(1===arguments.length){for(;++i<a;)if(null!=(n=t[i])&&n>=n){r=n;break}for(;++i<a;)null!=(n=t[i])&&n>r&&(r=n)}else{for(;++i<a;)if(null!=(n=e.call(t,t[i],i))&&n>=n){r=n;break}for(;++i<a;)null!=(n=e.call(t,t[i],i))&&n>r&&(r=n)}return r},t.extent=function(t,e){var r,n,i,a=-1,o=t.length;if(1===arguments.length){for(;++a<o;)if(null!=(n=t[a])&&n>=n){r=i=n;break}for(;++a<o;)null!=(n=t[a])&&(r>n&&(r=n),i<n&&(i=n))}else{for(;++a<o;)if(null!=(n=e.call(t,t[a],a))&&n>=n){r=i=n;break}for(;++a<o;)null!=(n=e.call(t,t[a],a))&&(r>n&&(r=n),i<n&&(i=n))}return[r,i]},t.sum=function(t,e){var r,n=0,i=t.length,a=-1;if(1===arguments.length)for(;++a<i;)d(r=+t[a])&&(n+=r);else for(;++a<i;)d(r=+e.call(t,t[a],a))&&(n+=r);return n},t.mean=function(t,e){var r,n=0,i=t.length,a=-1,o=i;if(1===arguments.length)for(;++a<i;)d(r=f(t[a]))?n+=r:--o;else for(;++a<i;)d(r=f(e.call(t,t[a],a)))?n+=r:--o;if(o)return n/o},t.quantile=function(t,e){var r=(t.length-1)*e+1,n=Math.floor(r),i=+t[n-1],a=r-n;return a?i+a*(t[n]-i):i},t.median=function(e,r){var n,i=[],a=e.length,o=-1;if(1===arguments.length)for(;++o<a;)d(n=f(e[o]))&&i.push(n);else for(;++o<a;)d(n=f(r.call(e,e[o],o)))&&i.push(n);if(i.length)return t.quantile(i.sort(h),.5)},t.variance=function(t,e){var r,n,i=t.length,a=0,o=0,s=-1,l=0;if(1===arguments.length)for(;++s<i;)d(r=f(t[s]))&&(o+=(n=r-a)*(r-(a+=n/++l)));else for(;++s<i;)d(r=f(e.call(t,t[s],s)))&&(o+=(n=r-a)*(r-(a+=n/++l)));if(l>1)return o/(l-1)},t.deviation=function(){var e=t.variance.apply(this,arguments);return e?Math.sqrt(e):e};var y=m(h);function g(t){return t.length}t.bisectLeft=y.left,t.bisect=t.bisectRight=y.right,t.bisector=function(t){return m(1===t.length?function(e,r){return h(t(e),r)}:t)},t.shuffle=function(t,e,r){(a=arguments.length)<3&&(r=t.length,a<2&&(e=0));for(var n,i,a=r-e;a;)i=Math.random()*a--|0,n=t[a+e],t[a+e]=t[i+e],t[i+e]=n;return t},t.permute=function(t,e){for(var r=e.length,n=new Array(r);r--;)n[r]=t[e[r]];return n},t.pairs=function(t){for(var e=0,r=t.length-1,n=t[0],i=new Array(r<0?0:r);e<r;)i[e]=[n,n=t[++e]];return i},t.transpose=function(e){if(!(a=e.length))return[];for(var r=-1,n=t.min(e,g),i=new Array(n);++r<n;)for(var a,o=-1,s=i[r]=new Array(a);++o<a;)s[o]=e[o][r];return i},t.zip=function(){return t.transpose(arguments)},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e},t.values=function(t){var e=[];for(var r in t)e.push(t[r]);return e},t.entries=function(t){var e=[];for(var r in t)e.push({key:r,value:t[r]});return e},t.merge=function(t){for(var e,r,n,i=t.length,a=-1,o=0;++a<i;)o+=t[a].length;for(r=new Array(o);--i>=0;)for(e=(n=t[i]).length;--e>=0;)r[--o]=n[e];return r};var v=Math.abs;function _(t,e){for(var r in e)Object.defineProperty(t.prototype,r,{value:e[r],enumerable:!1})}function x(){this._=Object.create(null)}t.range=function(t,e,r){if(arguments.length<3&&(r=1,arguments.length<2&&(e=t,t=0)),(e-t)/r==1/0)throw new Error("infinite range");var n,i=[],a=function(t){var e=1;for(;t*e%1;)e*=10;return e}(v(r)),o=-1;if(t*=a,e*=a,(r*=a)<0)for(;(n=t+r*++o)>e;)i.push(n/a);else for(;(n=t+r*++o)<e;)i.push(n/a);return i},t.map=function(t,e){var r=new x;if(t instanceof x)t.forEach(function(t,e){r.set(t,e)});else if(Array.isArray(t)){var n,i=-1,a=t.length;if(1===arguments.length)for(;++i<a;)r.set(i,t[i]);else for(;++i<a;)r.set(e.call(t,n=t[i],i),n)}else for(var o in t)r.set(o,t[o]);return r};var b="__proto__",w="\0";function k(t){return(t+="")===b||t[0]===w?w+t:t}function T(t){return(t+="")[0]===w?t.slice(1):t}function A(t){return k(t)in this._}function M(t){return(t=k(t))in this._&&delete this._[t]}function S(){var t=[];for(var e in this._)t.push(T(e));return t}function L(){var t=0;for(var e in this._)++t;return t}function C(){for(var t in this._)return!1;return!0}function E(){this._=Object.create(null)}function z(t){return t}function P(t,e,r){return function(){var n=r.apply(e,arguments);return n===e?t:n}}function I(t,e){if(e in t)return e;e=e.charAt(0).toUpperCase()+e.slice(1);for(var r=0,n=D.length;r<n;++r){var i=D[r]+e;if(i in t)return i}}_(x,{has:A,get:function(t){return this._[k(t)]},set:function(t,e){return this._[k(t)]=e},remove:M,keys:S,values:function(){var t=[];for(var e in this._)t.push(this._[e]);return t},entries:function(){var t=[];for(var e in this._)t.push({key:T(e),value:this._[e]});return t},size:L,empty:C,forEach:function(t){for(var e in this._)t.call(this,T(e),this._[e])}}),t.nest=function(){var e,r,n={},i=[],a=[];function o(t,a,s){if(s>=i.length)return r?r.call(n,a):e?a.sort(e):a;for(var l,u,c,p,h=-1,f=a.length,d=i[s++],m=new x;++h<f;)(p=m.get(l=d(u=a[h])))?p.push(u):m.set(l,[u]);return t?(u=t(),c=function(e,r){u.set(e,o(t,r,s))}):(u={},c=function(e,r){u[e]=o(t,r,s)}),m.forEach(c),u}return n.map=function(t,e){return o(e,t,0)},n.entries=function(e){return function t(e,r){if(r>=i.length)return e;var n=[],o=a[r++];return e.forEach(function(e,i){n.push({key:e,values:t(i,r)})}),o?n.sort(function(t,e){return o(t.key,e.key)}):n}(o(t.map,e,0),0)},n.key=function(t){return i.push(t),n},n.sortKeys=function(t){return a[i.length-1]=t,n},n.sortValues=function(t){return e=t,n},n.rollup=function(t){return r=t,n},n},t.set=function(t){var e=new E;if(t)for(var r=0,n=t.length;r<n;++r)e.add(t[r]);return e},_(E,{has:A,add:function(t){return this._[k(t+="")]=!0,t},remove:M,values:S,size:L,empty:C,forEach:function(t){for(var e in this._)t.call(this,T(e))}}),t.behavior={},t.rebind=function(t,e){for(var r,n=1,i=arguments.length;++n<i;)t[r=arguments[n]]=P(t,e,e[r]);return t};var D=["webkit","ms","moz","Moz","o","O"];function O(){}function R(){}function F(t){var e=[],r=new x;function n(){for(var r,n=e,i=-1,a=n.length;++i<a;)(r=n[i].on)&&r.apply(this,arguments);return t}return n.on=function(n,i){var a,o=r.get(n);return arguments.length<2?o&&o.on:(o&&(o.on=null,e=e.slice(0,a=e.indexOf(o)).concat(e.slice(a+1)),r.remove(n)),i&&e.push(r.set(n,{on:i})),t)},n}function B(){t.event.preventDefault()}function N(){for(var e,r=t.event;e=r.sourceEvent;)r=e;return r}function U(e){for(var r=new R,n=0,i=arguments.length;++n<i;)r[arguments[n]]=F(r);return r.of=function(n,i){return function(a){try{var o=a.sourceEvent=t.event;a.target=e,t.event=a,r[a.type].apply(n,i)}finally{t.event=o}}},r}t.dispatch=function(){for(var t=new R,e=-1,r=arguments.length;++e<r;)t[arguments[e]]=F(t);return t},R.prototype.on=function(t,e){var r=t.indexOf("."),n="";if(r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),t)return arguments.length<2?this[t].on(n):this[t].on(n,e);if(2===arguments.length){if(null==e)for(t in this)this.hasOwnProperty(t)&&this[t].on(n,null);return this}},t.event=null,t.requote=function(t){return t.replace(j,"\\$&")};var j=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,V={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var r in e)t[r]=e[r]};function q(t){return V(t,X),t}var G=function(t,e){return e.querySelector(t)},H=function(t,e){return e.querySelectorAll(t)},Z=function(t,e){var r=t.matches||t[I(t,"matchesSelector")];return(Z=function(t,e){return r.call(t,e)})(t,e)};"function"==typeof Sizzle&&(G=function(t,e){return Sizzle(t,e)[0]||null},H=Sizzle,Z=Sizzle.matchesSelector),t.selection=function(){return t.select(i.documentElement)};var X=t.selection.prototype=[];function W(t){return"function"==typeof t?t:function(){return G(t,this)}}function Y(t){return"function"==typeof t?t:function(){return H(t,this)}}X.select=function(t){var e,r,n,i,a=[];t=W(t);for(var o=-1,s=this.length;++o<s;){a.push(e=[]),e.parentNode=(n=this[o]).parentNode;for(var l=-1,u=n.length;++l<u;)(i=n[l])?(e.push(r=t.call(i,i.__data__,l,o)),r&&"__data__"in i&&(r.__data__=i.__data__)):e.push(null)}return q(a)},X.selectAll=function(t){var e,r,i=[];t=Y(t);for(var a=-1,o=this.length;++a<o;)for(var s=this[a],l=-1,u=s.length;++l<u;)(r=s[l])&&(i.push(e=n(t.call(r,r.__data__,l,a))),e.parentNode=r);return q(i)};var K="http://www.w3.org/1999/xhtml",J={svg:"http://www.w3.org/2000/svg",xhtml:K,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function $(e,r){return e=t.ns.qualify(e),null==r?e.local?function(){this.removeAttributeNS(e.space,e.local)}:function(){this.removeAttribute(e)}:"function"==typeof r?e.local?function(){var t=r.apply(this,arguments);null==t?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,t)}:function(){var t=r.apply(this,arguments);null==t?this.removeAttribute(e):this.setAttribute(e,t)}:e.local?function(){this.setAttributeNS(e.space,e.local,r)}:function(){this.setAttribute(e,r)}}function Q(t){return t.trim().replace(/\s+/g," ")}function tt(e){return new RegExp("(?:^|\\s+)"+t.requote(e)+"(?:\\s+|$)","g")}function et(t){return(t+"").trim().split(/^|\s+/)}function rt(t,e){var r=(t=et(t).map(nt)).length;return"function"==typeof e?function(){for(var n=-1,i=e.apply(this,arguments);++n<r;)t[n](this,i)}:function(){for(var n=-1;++n<r;)t[n](this,e)}}function nt(t){var e=tt(t);return function(r,n){if(i=r.classList)return n?i.add(t):i.remove(t);var i=r.getAttribute("class")||"";n?(e.lastIndex=0,e.test(i)||r.setAttribute("class",Q(i+" "+t))):r.setAttribute("class",Q(i.replace(e," ")))}}function it(t,e,r){return null==e?function(){this.style.removeProperty(t)}:"function"==typeof e?function(){var n=e.apply(this,arguments);null==n?this.style.removeProperty(t):this.style.setProperty(t,n,r)}:function(){this.style.setProperty(t,e,r)}}function at(t,e){return null==e?function(){delete this[t]}:"function"==typeof e?function(){var r=e.apply(this,arguments);null==r?delete this[t]:this[t]=r}:function(){this[t]=e}}function ot(e){return"function"==typeof e?e:(e=t.ns.qualify(e)).local?function(){return this.ownerDocument.createElementNS(e.space,e.local)}:function(){var t=this.ownerDocument,r=this.namespaceURI;return r===K&&t.documentElement.namespaceURI===K?t.createElement(e):t.createElementNS(r,e)}}function st(){var t=this.parentNode;t&&t.removeChild(this)}function lt(t){return{__data__:t}}function ut(t){return function(){return Z(this,t)}}function ct(t,e){for(var r=0,n=t.length;r<n;r++)for(var i,a=t[r],o=0,s=a.length;o<s;o++)(i=a[o])&&e(i,o,r);return t}function pt(t){return V(t,ht),t}t.ns={prefix:J,qualify:function(t){var e=t.indexOf(":"),r=t;return e>=0&&"xmlns"!==(r=t.slice(0,e))&&(t=t.slice(e+1)),J.hasOwnProperty(r)?{space:J[r],local:t}:t}},X.attr=function(e,r){if(arguments.length<2){if("string"==typeof e){var n=this.node();return(e=t.ns.qualify(e)).local?n.getAttributeNS(e.space,e.local):n.getAttribute(e)}for(r in e)this.each($(r,e[r]));return this}return this.each($(e,r))},X.classed=function(t,e){if(arguments.length<2){if("string"==typeof t){var r=this.node(),n=(t=et(t)).length,i=-1;if(e=r.classList){for(;++i<n;)if(!e.contains(t[i]))return!1}else for(e=r.getAttribute("class");++i<n;)if(!tt(t[i]).test(e))return!1;return!0}for(e in t)this.each(rt(e,t[e]));return this}return this.each(rt(t,e))},X.style=function(t,e,r){var n=arguments.length;if(n<3){if("string"!=typeof t){for(r in n<2&&(e=""),t)this.each(it(r,t[r],e));return this}if(n<2){var i=this.node();return o(i).getComputedStyle(i,null).getPropertyValue(t)}r=""}return this.each(it(t,e,r))},X.property=function(t,e){if(arguments.length<2){if("string"==typeof t)return this.node()[t];for(e in t)this.each(at(e,t[e]));return this}return this.each(at(t,e))},X.text=function(t){return arguments.length?this.each("function"==typeof t?function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}:null==t?function(){this.textContent=""}:function(){this.textContent=t}):this.node().textContent},X.html=function(t){return arguments.length?this.each("function"==typeof t?function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}:null==t?function(){this.innerHTML=""}:function(){this.innerHTML=t}):this.node().innerHTML},X.append=function(t){return t=ot(t),this.select(function(){return this.appendChild(t.apply(this,arguments))})},X.insert=function(t,e){return t=ot(t),e=W(e),this.select(function(){return this.insertBefore(t.apply(this,arguments),e.apply(this,arguments)||null)})},X.remove=function(){return this.each(st)},X.data=function(t,e){var r,n,i=-1,a=this.length;if(!arguments.length){for(t=new Array(a=(r=this[0]).length);++i<a;)(n=r[i])&&(t[i]=n.__data__);return t}function o(t,r){var n,i,a,o=t.length,c=r.length,p=Math.min(o,c),h=new Array(c),f=new Array(c),d=new Array(o);if(e){var m,y=new x,g=new Array(o);for(n=-1;++n<o;)(i=t[n])&&(y.has(m=e.call(i,i.__data__,n))?d[n]=i:y.set(m,i),g[n]=m);for(n=-1;++n<c;)(i=y.get(m=e.call(r,a=r[n],n)))?!0!==i&&(h[n]=i,i.__data__=a):f[n]=lt(a),y.set(m,!0);for(n=-1;++n<o;)n in g&&!0!==y.get(g[n])&&(d[n]=t[n])}else{for(n=-1;++n<p;)i=t[n],a=r[n],i?(i.__data__=a,h[n]=i):f[n]=lt(a);for(;n<c;++n)f[n]=lt(r[n]);for(;n<o;++n)d[n]=t[n]}f.update=h,f.parentNode=h.parentNode=d.parentNode=t.parentNode,s.push(f),l.push(h),u.push(d)}var s=pt([]),l=q([]),u=q([]);if("function"==typeof t)for(;++i<a;)o(r=this[i],t.call(r,r.parentNode.__data__,i));else for(;++i<a;)o(r=this[i],t);return l.enter=function(){return s},l.exit=function(){return u},l},X.datum=function(t){return arguments.length?this.property("__data__",t):this.property("__data__")},X.filter=function(t){var e,r,n,i=[];"function"!=typeof t&&(t=ut(t));for(var a=0,o=this.length;a<o;a++){i.push(e=[]),e.parentNode=(r=this[a]).parentNode;for(var s=0,l=r.length;s<l;s++)(n=r[s])&&t.call(n,n.__data__,s,a)&&e.push(n)}return q(i)},X.order=function(){for(var t=-1,e=this.length;++t<e;)for(var r,n=this[t],i=n.length-1,a=n[i];--i>=0;)(r=n[i])&&(a&&a!==r.nextSibling&&a.parentNode.insertBefore(r,a),a=r);return this},X.sort=function(t){t=function(t){arguments.length||(t=h);return function(e,r){return e&&r?t(e.__data__,r.__data__):!e-!r}}.apply(this,arguments);for(var e=-1,r=this.length;++e<r;)this[e].sort(t);return this.order()},X.each=function(t){return ct(this,function(e,r,n){t.call(e,e.__data__,r,n)})},X.call=function(t){var e=n(arguments);return t.apply(e[0]=this,e),this},X.empty=function(){return!this.node()},X.node=function(){for(var t=0,e=this.length;t<e;t++)for(var r=this[t],n=0,i=r.length;n<i;n++){var a=r[n];if(a)return a}return null},X.size=function(){var t=0;return ct(this,function(){++t}),t};var ht=[];function ft(e,r,i){var a="__on"+e,o=e.indexOf("."),s=mt;o>0&&(e=e.slice(0,o));var l=dt.get(e);function u(){var t=this[a];t&&(this.removeEventListener(e,t,t.$),delete this[a])}return l&&(e=l,s=yt),o?r?function(){var t=s(r,n(arguments));u.call(this),this.addEventListener(e,this[a]=t,t.$=i),t._=r}:u:r?O:function(){var r,n=new RegExp("^__on([^.]+)"+t.requote(e)+"$");for(var i in this)if(r=i.match(n)){var a=this[i];this.removeEventListener(r[1],a,a.$),delete this[i]}}}t.selection.enter=pt,t.selection.enter.prototype=ht,ht.append=X.append,ht.empty=X.empty,ht.node=X.node,ht.call=X.call,ht.size=X.size,ht.select=function(t){for(var e,r,n,i,a,o=[],s=-1,l=this.length;++s<l;){n=(i=this[s]).update,o.push(e=[]),e.parentNode=i.parentNode;for(var u=-1,c=i.length;++u<c;)(a=i[u])?(e.push(n[u]=r=t.call(i.parentNode,a.__data__,u,s)),r.__data__=a.__data__):e.push(null)}return q(o)},ht.insert=function(t,e){var r,n,i;return arguments.length<2&&(r=this,e=function(t,e,a){var o,s=r[a].update,l=s.length;for(a!=i&&(i=a,n=0),e>=n&&(n=e+1);!(o=s[n])&&++n<l;);return o}),X.insert.call(this,t,e)},t.select=function(t){var e;return"string"==typeof t?(e=[G(t,i)]).parentNode=i.documentElement:(e=[t]).parentNode=a(t),q([e])},t.selectAll=function(t){var e;return"string"==typeof t?(e=n(H(t,i))).parentNode=i.documentElement:(e=n(t)).parentNode=null,q([e])},X.on=function(t,e,r){var n=arguments.length;if(n<3){if("string"!=typeof t){for(r in n<2&&(e=!1),t)this.each(ft(r,t[r],e));return this}if(n<2)return(n=this.node()["__on"+t])&&n._;r=!1}return this.each(ft(t,e,r))};var dt=t.map({mouseenter:"mouseover",mouseleave:"mouseout"});function mt(e,r){return function(n){var i=t.event;t.event=n,r[0]=this.__data__;try{e.apply(this,r)}finally{t.event=i}}}function yt(t,e){var r=mt(t,e);return function(t){var e=t.relatedTarget;e&&(e===this||8&e.compareDocumentPosition(this))||r.call(this,t)}}i&&dt.forEach(function(t){"on"+t in i&&dt.remove(t)});var gt,vt=0;function _t(e){var r=".dragsuppress-"+ ++vt,n="click"+r,i=t.select(o(e)).on("touchmove"+r,B).on("dragstart"+r,B).on("selectstart"+r,B);if(null==gt&&(gt=!("onselectstart"in e)&&I(e.style,"userSelect")),gt){var s=a(e).style,l=s[gt];s[gt]="none"}return function(t){if(i.on(r,null),gt&&(s[gt]=l),t){var e=function(){i.on(n,null)};i.on(n,function(){B(),e()},!0),setTimeout(e,0)}}}t.mouse=function(t){return bt(t,N())};var xt=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;function bt(e,r){r.changedTouches&&(r=r.changedTouches[0]);var n=e.ownerSVGElement||e;if(n.createSVGPoint){var i=n.createSVGPoint();if(xt<0){var a=o(e);if(a.scrollX||a.scrollY){var s=(n=t.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important"))[0][0].getScreenCTM();xt=!(s.f||s.e),n.remove()}}return xt?(i.x=r.pageX,i.y=r.pageY):(i.x=r.clientX,i.y=r.clientY),[(i=i.matrixTransform(e.getScreenCTM().inverse())).x,i.y]}var l=e.getBoundingClientRect();return[r.clientX-l.left-e.clientLeft,r.clientY-l.top-e.clientTop]}function wt(){return t.event.changedTouches[0].identifier}t.touch=function(t,e,r){if(arguments.length<3&&(r=e,e=N().changedTouches),e)for(var n,i=0,a=e.length;i<a;++i)if((n=e[i]).identifier===r)return bt(t,n)},t.behavior.drag=function(){var e=U(a,"drag","dragstart","dragend"),r=null,n=s(O,t.mouse,o,"mousemove","mouseup"),i=s(wt,t.touch,z,"touchmove","touchend");function a(){this.on("mousedown.drag",n).on("touchstart.drag",i)}function s(n,i,a,o,s){return function(){var l,u=t.event.target.correspondingElement||t.event.target,c=this.parentNode,p=e.of(this,arguments),h=0,f=n(),d=".drag"+(null==f?"":"-"+f),m=t.select(a(u)).on(o+d,function(){var t,e,r=i(c,f);if(!r)return;t=r[0]-g[0],e=r[1]-g[1],h|=t|e,g=r,p({type:"drag",x:r[0]+l[0],y:r[1]+l[1],dx:t,dy:e})}).on(s+d,function(){if(!i(c,f))return;m.on(o+d,null).on(s+d,null),y(h),p({type:"dragend"})}),y=_t(u),g=i(c,f);l=r?[(l=r.apply(this,arguments)).x-g[0],l.y-g[1]]:[0,0],p({type:"dragstart"})}}return a.origin=function(t){return arguments.length?(r=t,a):r},t.rebind(a,e,"on")},t.touches=function(t,e){return arguments.length<2&&(e=N().touches),e?n(e).map(function(e){var r=bt(t,e);return r.identifier=e.identifier,r}):[]};var kt=1e-6,Tt=kt*kt,At=Math.PI,Mt=2*At,St=Mt-kt,Lt=At/2,Ct=At/180,Et=180/At;function zt(t){return t>0?1:t<0?-1:0}function Pt(t,e,r){return(e[0]-t[0])*(r[1]-t[1])-(e[1]-t[1])*(r[0]-t[0])}function It(t){return t>1?0:t<-1?At:Math.acos(t)}function Dt(t){return t>1?Lt:t<-1?-Lt:Math.asin(t)}function Ot(t){return((t=Math.exp(t))+1/t)/2}function Rt(t){return(t=Math.sin(t/2))*t}var Ft=Math.SQRT2;t.interpolateZoom=function(t,e){var r,n,i=t[0],a=t[1],o=t[2],s=e[0],l=e[1],u=e[2],c=s-i,p=l-a,h=c*c+p*p;if(h<Tt)n=Math.log(u/o)/Ft,r=function(t){return[i+t*c,a+t*p,o*Math.exp(Ft*t*n)]};else{var f=Math.sqrt(h),d=(u*u-o*o+4*h)/(2*o*2*f),m=(u*u-o*o-4*h)/(2*u*2*f),y=Math.log(Math.sqrt(d*d+1)-d),g=Math.log(Math.sqrt(m*m+1)-m);n=(g-y)/Ft,r=function(t){var e,r=t*n,s=Ot(y),l=o/(2*f)*(s*(e=Ft*r+y,((e=Math.exp(2*e))-1)/(e+1))-function(t){return((t=Math.exp(t))-1/t)/2}(y));return[i+l*c,a+l*p,o*s/Ot(Ft*r+y)]}}return r.duration=1e3*n,r},t.behavior.zoom=function(){var e,r,n,a,s,l,u,c,p,h={x:0,y:0,k:1},f=[960,500],d=Ut,m=250,y=0,g="mousedown.zoom",v="mousemove.zoom",_="mouseup.zoom",x="touchstart.zoom",b=U(w,"zoomstart","zoom","zoomend");function w(t){t.on(g,z).on(Nt+".zoom",I).on("dblclick.zoom",D).on(x,P)}function k(t){return[(t[0]-h.x)/h.k,(t[1]-h.y)/h.k]}function T(t){h.k=Math.max(d[0],Math.min(d[1],t))}function A(t,e){e=function(t){return[t[0]*h.k+h.x,t[1]*h.k+h.y]}(e),h.x+=t[0]-e[0],h.y+=t[1]-e[1]}function M(e,n,i,a){e.__chart__={x:h.x,y:h.y,k:h.k},T(Math.pow(2,a)),A(r=n,i),e=t.select(e),m>0&&(e=e.transition().duration(m)),e.call(w.event)}function S(){u&&u.domain(l.range().map(function(t){return(t-h.x)/h.k}).map(l.invert)),p&&p.domain(c.range().map(function(t){return(t-h.y)/h.k}).map(c.invert))}function L(t){y++||t({type:"zoomstart"})}function C(t){S(),t({type:"zoom",scale:h.k,translate:[h.x,h.y]})}function E(t){--y||(t({type:"zoomend"}),r=null)}function z(){var e=this,r=b.of(e,arguments),n=0,i=t.select(o(e)).on(v,function(){n=1,A(t.mouse(e),a),C(r)}).on(_,function(){i.on(v,null).on(_,null),s(n),E(r)}),a=k(t.mouse(e)),s=_t(e);fs.call(e),L(r)}function P(){var e,r=this,n=b.of(r,arguments),i={},a=0,o=".zoom-"+t.event.changedTouches[0].identifier,l="touchmove"+o,u="touchend"+o,c=[],p=t.select(r),f=_t(r);function d(){var n=t.touches(r);return e=h.k,n.forEach(function(t){t.identifier in i&&(i[t.identifier]=k(t))}),n}function m(){var e=t.event.target;t.select(e).on(l,y).on(u,v),c.push(e);for(var n=t.event.changedTouches,o=0,p=n.length;o<p;++o)i[n[o].identifier]=null;var f=d(),m=Date.now();if(1===f.length){if(m-s<500){var g=f[0];M(r,g,i[g.identifier],Math.floor(Math.log(h.k)/Math.LN2)+1),B()}s=m}else if(f.length>1){g=f[0];var _=f[1],x=g[0]-_[0],b=g[1]-_[1];a=x*x+b*b}}function y(){var o,l,u,c,p=t.touches(r);fs.call(r);for(var h=0,f=p.length;h<f;++h,c=null)if(u=p[h],c=i[u.identifier]){if(l)break;o=u,l=c}if(c){var d=(d=u[0]-o[0])*d+(d=u[1]-o[1])*d,m=a&&Math.sqrt(d/a);o=[(o[0]+u[0])/2,(o[1]+u[1])/2],l=[(l[0]+c[0])/2,(l[1]+c[1])/2],T(m*e)}s=null,A(o,l),C(n)}function v(){if(t.event.touches.length){for(var e=t.event.changedTouches,r=0,a=e.length;r<a;++r)delete i[e[r].identifier];for(var s in i)return void d()}t.selectAll(c).on(o,null),p.on(g,z).on(x,P),f(),E(n)}m(),L(n),p.on(g,null).on(x,m)}function I(){var i=b.of(this,arguments);a?clearTimeout(a):(fs.call(this),e=k(r=n||t.mouse(this)),L(i)),a=setTimeout(function(){a=null,E(i)},50),B(),T(Math.pow(2,.002*Bt())*h.k),A(r,e),C(i)}function D(){var e=t.mouse(this),r=Math.log(h.k)/Math.LN2;M(this,e,k(e),t.event.shiftKey?Math.ceil(r)-1:Math.floor(r)+1)}return Nt||(Nt="onwheel"in i?(Bt=function(){return-t.event.deltaY*(t.event.deltaMode?120:1)},"wheel"):"onmousewheel"in i?(Bt=function(){return t.event.wheelDelta},"mousewheel"):(Bt=function(){return-t.event.detail},"MozMousePixelScroll")),w.event=function(e){e.each(function(){var e=b.of(this,arguments),n=h;ys?t.select(this).transition().each("start.zoom",function(){h=this.__chart__||{x:0,y:0,k:1},L(e)}).tween("zoom:zoom",function(){var i=f[0],a=f[1],o=r?r[0]:i/2,s=r?r[1]:a/2,l=t.interpolateZoom([(o-h.x)/h.k,(s-h.y)/h.k,i/h.k],[(o-n.x)/n.k,(s-n.y)/n.k,i/n.k]);return function(t){var r=l(t),n=i/r[2];this.__chart__=h={x:o-r[0]*n,y:s-r[1]*n,k:n},C(e)}}).each("interrupt.zoom",function(){E(e)}).each("end.zoom",function(){E(e)}):(this.__chart__=h,L(e),C(e),E(e))})},w.translate=function(t){return arguments.length?(h={x:+t[0],y:+t[1],k:h.k},S(),w):[h.x,h.y]},w.scale=function(t){return arguments.length?(h={x:h.x,y:h.y,k:null},T(+t),S(),w):h.k},w.scaleExtent=function(t){return arguments.length?(d=null==t?Ut:[+t[0],+t[1]],w):d},w.center=function(t){return arguments.length?(n=t&&[+t[0],+t[1]],w):n},w.size=function(t){return arguments.length?(f=t&&[+t[0],+t[1]],w):f},w.duration=function(t){return arguments.length?(m=+t,w):m},w.x=function(t){return arguments.length?(u=t,l=t.copy(),h={x:0,y:0,k:1},w):u},w.y=function(t){return arguments.length?(p=t,c=t.copy(),h={x:0,y:0,k:1},w):p},t.rebind(w,b,"on")};var Bt,Nt,Ut=[0,1/0];function jt(){}function Vt(t,e,r){return this instanceof Vt?(this.h=+t,this.s=+e,void(this.l=+r)):arguments.length<2?t instanceof Vt?new Vt(t.h,t.s,t.l):ce(""+t,pe,Vt):new Vt(t,e,r)}t.color=jt,jt.prototype.toString=function(){return this.rgb()+""},t.hsl=Vt;var qt=Vt.prototype=new jt;function Gt(t,e,r){var n,i;function a(t){return Math.round(255*function(t){return t>360?t-=360:t<0&&(t+=360),t<60?n+(i-n)*t/60:t<180?i:t<240?n+(i-n)*(240-t)/60:n}(t))}return t=isNaN(t)?0:(t%=360)<0?t+360:t,e=isNaN(e)?0:e<0?0:e>1?1:e,n=2*(r=r<0?0:r>1?1:r)-(i=r<=.5?r*(1+e):r+e-r*e),new ae(a(t+120),a(t),a(t-120))}function Ht(e,r,n){return this instanceof Ht?(this.h=+e,this.c=+r,void(this.l=+n)):arguments.length<2?e instanceof Ht?new Ht(e.h,e.c,e.l):ee(e instanceof Wt?e.l:(e=he((e=t.rgb(e)).r,e.g,e.b)).l,e.a,e.b):new Ht(e,r,n)}qt.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),new Vt(this.h,this.s,this.l/t)},qt.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new Vt(this.h,this.s,t*this.l)},qt.rgb=function(){return Gt(this.h,this.s,this.l)},t.hcl=Ht;var Zt=Ht.prototype=new jt;function Xt(t,e,r){return isNaN(t)&&(t=0),isNaN(e)&&(e=0),new Wt(r,Math.cos(t*=Ct)*e,Math.sin(t)*e)}function Wt(t,e,r){return this instanceof Wt?(this.l=+t,this.a=+e,void(this.b=+r)):arguments.length<2?t instanceof Wt?new Wt(t.l,t.a,t.b):t instanceof Ht?Xt(t.h,t.c,t.l):he((t=ae(t)).r,t.g,t.b):new Wt(t,e,r)}Zt.brighter=function(t){return new Ht(this.h,this.c,Math.min(100,this.l+Yt*(arguments.length?t:1)))},Zt.darker=function(t){return new Ht(this.h,this.c,Math.max(0,this.l-Yt*(arguments.length?t:1)))},Zt.rgb=function(){return Xt(this.h,this.c,this.l).rgb()},t.lab=Wt;var Yt=18,Kt=.95047,Jt=1,$t=1.08883,Qt=Wt.prototype=new jt;function te(t,e,r){var n=(t+16)/116,i=n+e/500,a=n-r/200;return new ae(ie(3.2404542*(i=re(i)*Kt)-1.5371385*(n=re(n)*Jt)-.4985314*(a=re(a)*$t)),ie(-.969266*i+1.8760108*n+.041556*a),ie(.0556434*i-.2040259*n+1.0572252*a))}function ee(t,e,r){return t>0?new Ht(Math.atan2(r,e)*Et,Math.sqrt(e*e+r*r),t):new Ht(NaN,NaN,t)}function re(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function ne(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function ie(t){return Math.round(255*(t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function ae(t,e,r){return this instanceof ae?(this.r=~~t,this.g=~~e,void(this.b=~~r)):arguments.length<2?t instanceof ae?new ae(t.r,t.g,t.b):ce(""+t,ae,Gt):new ae(t,e,r)}function oe(t){return new ae(t>>16,t>>8&255,255&t)}function se(t){return oe(t)+""}Qt.brighter=function(t){return new Wt(Math.min(100,this.l+Yt*(arguments.length?t:1)),this.a,this.b)},Qt.darker=function(t){return new Wt(Math.max(0,this.l-Yt*(arguments.length?t:1)),this.a,this.b)},Qt.rgb=function(){return te(this.l,this.a,this.b)},t.rgb=ae;var le=ae.prototype=new jt;function ue(t){return t<16?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function ce(t,e,r){var n,i,a,o=0,s=0,l=0;if(n=/([a-z]+)\((.*)\)/.exec(t=t.toLowerCase()))switch(i=n[2].split(","),n[1]){case"hsl":return r(parseFloat(i[0]),parseFloat(i[1])/100,parseFloat(i[2])/100);case"rgb":return e(de(i[0]),de(i[1]),de(i[2]))}return(a=me.get(t))?e(a.r,a.g,a.b):(null==t||"#"!==t.charAt(0)||isNaN(a=parseInt(t.slice(1),16))||(4===t.length?(o=(3840&a)>>4,o|=o>>4,s=240&a,s|=s>>4,l=15&a,l|=l<<4):7===t.length&&(o=(16711680&a)>>16,s=(65280&a)>>8,l=255&a)),e(o,s,l))}function pe(t,e,r){var n,i,a=Math.min(t/=255,e/=255,r/=255),o=Math.max(t,e,r),s=o-a,l=(o+a)/2;return s?(i=l<.5?s/(o+a):s/(2-o-a),n=t==o?(e-r)/s+(e<r?6:0):e==o?(r-t)/s+2:(t-e)/s+4,n*=60):(n=NaN,i=l>0&&l<1?0:n),new Vt(n,i,l)}function he(t,e,r){var n=ne((.4124564*(t=fe(t))+.3575761*(e=fe(e))+.1804375*(r=fe(r)))/Kt),i=ne((.2126729*t+.7151522*e+.072175*r)/Jt);return Wt(116*i-16,500*(n-i),200*(i-ne((.0193339*t+.119192*e+.9503041*r)/$t)))}function fe(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function de(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}le.brighter=function(t){t=Math.pow(.7,arguments.length?t:1);var e=this.r,r=this.g,n=this.b,i=30;return e||r||n?(e&&e<i&&(e=i),r&&r<i&&(r=i),n&&n<i&&(n=i),new ae(Math.min(255,e/t),Math.min(255,r/t),Math.min(255,n/t))):new ae(i,i,i)},le.darker=function(t){return new ae((t=Math.pow(.7,arguments.length?t:1))*this.r,t*this.g,t*this.b)},le.hsl=function(){return pe(this.r,this.g,this.b)},le.toString=function(){return"#"+ue(this.r)+ue(this.g)+ue(this.b)};var me=t.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});function ye(t){return"function"==typeof t?t:function(){return t}}function ge(t){return function(e,r,n){return 2===arguments.length&&"function"==typeof r&&(n=r,r=null),ve(e,r,t,n)}}function ve(e,r,i,a){var o={},s=t.dispatch("beforesend","progress","load","error"),l={},u=new XMLHttpRequest,c=null;function p(){var t,e=u.status;if(!e&&function(t){var e=t.responseType;return e&&"text"!==e?t.response:t.responseText}(u)||e>=200&&e<300||304===e){try{t=i.call(o,u)}catch(t){return void s.error.call(o,t)}s.load.call(o,t)}else s.error.call(o,u)}return!this.XDomainRequest||"withCredentials"in u||!/^(http(s)?:)?\/\//.test(e)||(u=new XDomainRequest),"onload"in u?u.onload=u.onerror=p:u.onreadystatechange=function(){u.readyState>3&&p()},u.onprogress=function(e){var r=t.event;t.event=e;try{s.progress.call(o,u)}finally{t.event=r}},o.header=function(t,e){return t=(t+"").toLowerCase(),arguments.length<2?l[t]:(null==e?delete l[t]:l[t]=e+"",o)},o.mimeType=function(t){return arguments.length?(r=null==t?null:t+"",o):r},o.responseType=function(t){return arguments.length?(c=t,o):c},o.response=function(t){return i=t,o},["get","post"].forEach(function(t){o[t]=function(){return o.send.apply(o,[t].concat(n(arguments)))}}),o.send=function(t,n,i){if(2===arguments.length&&"function"==typeof n&&(i=n,n=null),u.open(t,e,!0),null==r||"accept"in l||(l.accept=r+",*/*"),u.setRequestHeader)for(var a in l)u.setRequestHeader(a,l[a]);return null!=r&&u.overrideMimeType&&u.overrideMimeType(r),null!=c&&(u.responseType=c),null!=i&&o.on("error",i).on("load",function(t){i(null,t)}),s.beforesend.call(o,u),u.send(null==n?null:n),o},o.abort=function(){return u.abort(),o},t.rebind(o,s,"on"),null==a?o:o.get(function(t){return 1===t.length?function(e,r){t(null==e?r:null)}:t}(a))}me.forEach(function(t,e){me.set(t,oe(e))}),t.functor=ye,t.xhr=ge(z),t.dsv=function(t,e){var r=new RegExp('["'+t+"\n]"),n=t.charCodeAt(0);function i(t,r,n){arguments.length<3&&(n=r,r=null);var i=ve(t,e,null==r?a:o(r),n);return i.row=function(t){return arguments.length?i.response(null==(r=t)?a:o(t)):r},i}function a(t){return i.parse(t.responseText)}function o(t){return function(e){return i.parse(e.responseText,t)}}function s(e){return e.map(l).join(t)}function l(t){return r.test(t)?'"'+t.replace(/\"/g,'""')+'"':t}return i.parse=function(t,e){var r;return i.parseRows(t,function(t,n){if(r)return r(t,n-1);var i=new Function("d","return {"+t.map(function(t,e){return JSON.stringify(t)+": d["+e+"]"}).join(",")+"}");r=e?function(t,r){return e(i(t),r)}:i})},i.parseRows=function(t,e){var r,i,a={},o={},s=[],l=t.length,u=0,c=0;function p(){if(u>=l)return o;if(i)return i=!1,a;var e=u;if(34===t.charCodeAt(e)){for(var r=e;r++<l;)if(34===t.charCodeAt(r)){if(34!==t.charCodeAt(r+1))break;++r}return u=r+2,13===(s=t.charCodeAt(r+1))?(i=!0,10===t.charCodeAt(r+2)&&++u):10===s&&(i=!0),t.slice(e+1,r).replace(/""/g,'"')}for(;u<l;){var s,c=1;if(10===(s=t.charCodeAt(u++)))i=!0;else if(13===s)i=!0,10===t.charCodeAt(u)&&(++u,++c);else if(s!==n)continue;return t.slice(e,u-c)}return t.slice(e)}for(;(r=p())!==o;){for(var h=[];r!==a&&r!==o;)h.push(r),r=p();e&&null==(h=e(h,c++))||s.push(h)}return s},i.format=function(e){if(Array.isArray(e[0]))return i.formatRows(e);var r=new E,n=[];return e.forEach(function(t){for(var e in t)r.has(e)||n.push(r.add(e))}),[n.map(l).join(t)].concat(e.map(function(e){return n.map(function(t){return l(e[t])}).join(t)})).join("\n")},i.formatRows=function(t){return t.map(s).join("\n")},i},t.csv=t.dsv(",","text/csv"),t.tsv=t.dsv("\t","text/tab-separated-values");var _e,xe,be,we,ke=this[I(this,"requestAnimationFrame")]||function(t){setTimeout(t,17)};function Te(t,e,r){var n=arguments.length;n<2&&(e=0),n<3&&(r=Date.now());var i={c:t,t:r+e,n:null};return xe?xe.n=i:_e=i,xe=i,be||(we=clearTimeout(we),be=1,ke(Ae)),i}function Ae(){var t=Me(),e=Se()-t;e>24?(isFinite(e)&&(clearTimeout(we),we=setTimeout(Ae,e)),be=0):(be=1,ke(Ae))}function Me(){for(var t=Date.now(),e=_e;e;)t>=e.t&&e.c(t-e.t)&&(e.c=null),e=e.n;return t}function Se(){for(var t,e=_e,r=1/0;e;)e.c?(e.t<r&&(r=e.t),e=(t=e).n):e=t?t.n=e.n:_e=e.n;return xe=t,r}function Le(t,e){return e-(t?Math.ceil(Math.log(t)/Math.LN10):1)}t.timer=function(){Te.apply(this,arguments)},t.timer.flush=function(){Me(),Se()},t.round=function(t,e){return e?Math.round(t*(e=Math.pow(10,e)))/e:Math.round(t)};var Ce=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"].map(function(t,e){var r=Math.pow(10,3*v(8-e));return{scale:e>8?function(t){return t/r}:function(t){return t*r},symbol:t}});function Ee(e){var r=e.decimal,n=e.thousands,i=e.grouping,a=e.currency,o=i&&n?function(t,e){for(var r=t.length,a=[],o=0,s=i[0],l=0;r>0&&s>0&&(l+s+1>e&&(s=Math.max(1,e-l)),a.push(t.substring(r-=s,r+s)),!((l+=s+1)>e));)s=i[o=(o+1)%i.length];return a.reverse().join(n)}:z;return function(e){var n=ze.exec(e),i=n[1]||" ",s=n[2]||">",l=n[3]||"-",u=n[4]||"",c=n[5],p=+n[6],h=n[7],f=n[8],d=n[9],m=1,y="",g="",v=!1,_=!0;switch(f&&(f=+f.substring(1)),(c||"0"===i&&"="===s)&&(c=i="0",s="="),d){case"n":h=!0,d="g";break;case"%":m=100,g="%",d="f";break;case"p":m=100,g="%",d="r";break;case"b":case"o":case"x":case"X":"#"===u&&(y="0"+d.toLowerCase());case"c":_=!1;case"d":v=!0,f=0;break;case"s":m=-1,d="r"}"$"===u&&(y=a[0],g=a[1]),"r"!=d||f||(d="g"),null!=f&&("g"==d?f=Math.max(1,Math.min(21,f)):"e"!=d&&"f"!=d||(f=Math.max(0,Math.min(20,f)))),d=Pe.get(d)||Ie;var x=c&&h;return function(e){var n=g;if(v&&e%1)return"";var a=e<0||0===e&&1/e<0?(e=-e,"-"):"-"===l?"":l;if(m<0){var u=t.formatPrefix(e,f);e=u.scale(e),n=u.symbol+g}else e*=m;var b,w,k=(e=d(e,f)).lastIndexOf(".");if(k<0){var T=_?e.lastIndexOf("e"):-1;T<0?(b=e,w=""):(b=e.substring(0,T),w=e.substring(T))}else b=e.substring(0,k),w=r+e.substring(k+1);!c&&h&&(b=o(b,1/0));var A=y.length+b.length+w.length+(x?0:a.length),M=A<p?new Array(A=p-A+1).join(i):"";return x&&(b=o(M+b,M.length?p-w.length:1/0)),a+=y,e=b+w,("<"===s?a+e+M:">"===s?M+a+e:"^"===s?M.substring(0,A>>=1)+a+e+M.substring(A):a+(x?e:M+e))+n}}}t.formatPrefix=function(e,r){var n=0;return(e=+e)&&(e<0&&(e*=-1),r&&(e=t.round(e,Le(e,r))),n=1+Math.floor(1e-12+Math.log(e)/Math.LN10),n=Math.max(-24,Math.min(24,3*Math.floor((n-1)/3)))),Ce[8+n/3]};var ze=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,Pe=t.map({b:function(t){return t.toString(2)},c:function(t){return String.fromCharCode(t)},o:function(t){return t.toString(8)},x:function(t){return t.toString(16)},X:function(t){return t.toString(16).toUpperCase()},g:function(t,e){return t.toPrecision(e)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},r:function(e,r){return(e=t.round(e,Le(e,r))).toFixed(Math.max(0,Math.min(20,Le(e*(1+1e-15),r))))}});function Ie(t){return t+""}var De=t.time={},Oe=Date;function Re(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}Re.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){Fe.setUTCDate.apply(this._,arguments)},setDay:function(){Fe.setUTCDay.apply(this._,arguments)},setFullYear:function(){Fe.setUTCFullYear.apply(this._,arguments)},setHours:function(){Fe.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){Fe.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){Fe.setUTCMinutes.apply(this._,arguments)},setMonth:function(){Fe.setUTCMonth.apply(this._,arguments)},setSeconds:function(){Fe.setUTCSeconds.apply(this._,arguments)},setTime:function(){Fe.setTime.apply(this._,arguments)}};var Fe=Date.prototype;function Be(t,e,r){function n(e){var r=t(e),n=a(r,1);return e-r<n-e?r:n}function i(r){return e(r=t(new Oe(r-1)),1),r}function a(t,r){return e(t=new Oe(+t),r),t}function o(t,n,a){var o=i(t),s=[];if(a>1)for(;o<n;)r(o)%a||s.push(new Date(+o)),e(o,1);else for(;o<n;)s.push(new Date(+o)),e(o,1);return s}t.floor=t,t.round=n,t.ceil=i,t.offset=a,t.range=o;var s=t.utc=Ne(t);return s.floor=s,s.round=Ne(n),s.ceil=Ne(i),s.offset=Ne(a),s.range=function(t,e,r){try{Oe=Re;var n=new Re;return n._=t,o(n,e,r)}finally{Oe=Date}},t}function Ne(t){return function(e,r){try{Oe=Re;var n=new Re;return n._=e,t(n,r)._}finally{Oe=Date}}}function Ue(e){var r=e.dateTime,n=e.date,i=e.time,a=e.periods,o=e.days,s=e.shortDays,l=e.months,u=e.shortMonths;function c(t){var e=t.length;function r(r){for(var n,i,a,o=[],s=-1,l=0;++s<e;)37===t.charCodeAt(s)&&(o.push(t.slice(l,s)),null!=(i=je[n=t.charAt(++s)])&&(n=t.charAt(++s)),(a=b[n])&&(n=a(r,null==i?"e"===n?" ":"0":i)),o.push(n),l=s+1);return o.push(t.slice(l,s)),o.join("")}return r.parse=function(e){var r={y:1900,m:0,d:1,H:0,M:0,S:0,L:0,Z:null};if(p(r,t,e,0)!=e.length)return null;"p"in r&&(r.H=r.H%12+12*r.p);var n=null!=r.Z&&Oe!==Re,i=new(n?Re:Oe);return"j"in r?i.setFullYear(r.y,0,r.j):"W"in r||"U"in r?("w"in r||(r.w="W"in r?1:0),i.setFullYear(r.y,0,1),i.setFullYear(r.y,0,"W"in r?(r.w+6)%7+7*r.W-(i.getDay()+5)%7:r.w+7*r.U-(i.getDay()+6)%7)):i.setFullYear(r.y,r.m,r.d),i.setHours(r.H+(r.Z/100|0),r.M+r.Z%100,r.S,r.L),n?i._:i},r.toString=function(){return t},r}function p(t,e,r,n){for(var i,a,o,s=0,l=e.length,u=r.length;s<l;){if(n>=u)return-1;if(37===(i=e.charCodeAt(s++))){if(o=e.charAt(s++),!(a=w[o in je?e.charAt(s++):o])||(n=a(t,r,n))<0)return-1}else if(i!=r.charCodeAt(n++))return-1}return n}c.utc=function(t){var e=c(t);function r(t){try{var r=new(Oe=Re);return r._=t,e(r)}finally{Oe=Date}}return r.parse=function(t){try{Oe=Re;var r=e.parse(t);return r&&r._}finally{Oe=Date}},r.toString=e.toString,r},c.multi=c.utc.multi=lr;var h=t.map(),f=He(o),d=Ze(o),m=He(s),y=Ze(s),g=He(l),v=Ze(l),_=He(u),x=Ze(u);a.forEach(function(t,e){h.set(t.toLowerCase(),e)});var b={a:function(t){return s[t.getDay()]},A:function(t){return o[t.getDay()]},b:function(t){return u[t.getMonth()]},B:function(t){return l[t.getMonth()]},c:c(r),d:function(t,e){return Ge(t.getDate(),e,2)},e:function(t,e){return Ge(t.getDate(),e,2)},H:function(t,e){return Ge(t.getHours(),e,2)},I:function(t,e){return Ge(t.getHours()%12||12,e,2)},j:function(t,e){return Ge(1+De.dayOfYear(t),e,3)},L:function(t,e){return Ge(t.getMilliseconds(),e,3)},m:function(t,e){return Ge(t.getMonth()+1,e,2)},M:function(t,e){return Ge(t.getMinutes(),e,2)},p:function(t){return a[+(t.getHours()>=12)]},S:function(t,e){return Ge(t.getSeconds(),e,2)},U:function(t,e){return Ge(De.sundayOfYear(t),e,2)},w:function(t){return t.getDay()},W:function(t,e){return Ge(De.mondayOfYear(t),e,2)},x:c(n),X:c(i),y:function(t,e){return Ge(t.getFullYear()%100,e,2)},Y:function(t,e){return Ge(t.getFullYear()%1e4,e,4)},Z:or,"%":function(){return"%"}},w={a:function(t,e,r){m.lastIndex=0;var n=m.exec(e.slice(r));return n?(t.w=y.get(n[0].toLowerCase()),r+n[0].length):-1},A:function(t,e,r){f.lastIndex=0;var n=f.exec(e.slice(r));return n?(t.w=d.get(n[0].toLowerCase()),r+n[0].length):-1},b:function(t,e,r){_.lastIndex=0;var n=_.exec(e.slice(r));return n?(t.m=x.get(n[0].toLowerCase()),r+n[0].length):-1},B:function(t,e,r){g.lastIndex=0;var n=g.exec(e.slice(r));return n?(t.m=v.get(n[0].toLowerCase()),r+n[0].length):-1},c:function(t,e,r){return p(t,b.c.toString(),e,r)},d:tr,e:tr,H:rr,I:rr,j:er,L:ar,m:Qe,M:nr,p:function(t,e,r){var n=h.get(e.slice(r,r+=2).toLowerCase());return null==n?-1:(t.p=n,r)},S:ir,U:We,w:Xe,W:Ye,x:function(t,e,r){return p(t,b.x.toString(),e,r)},X:function(t,e,r){return p(t,b.X.toString(),e,r)},y:Je,Y:Ke,Z:$e,"%":sr};return c}De.year=Be(function(t){return(t=De.day(t)).setMonth(0,1),t},function(t,e){t.setFullYear(t.getFullYear()+e)},function(t){return t.getFullYear()}),De.years=De.year.range,De.years.utc=De.year.utc.range,De.day=Be(function(t){var e=new Oe(2e3,0);return e.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),e},function(t,e){t.setDate(t.getDate()+e)},function(t){return t.getDate()-1}),De.days=De.day.range,De.days.utc=De.day.utc.range,De.dayOfYear=function(t){var e=De.year(t);return Math.floor((t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(t,e){e=7-e;var r=De[t]=Be(function(t){return(t=De.day(t)).setDate(t.getDate()-(t.getDay()+e)%7),t},function(t,e){t.setDate(t.getDate()+7*Math.floor(e))},function(t){var r=De.year(t).getDay();return Math.floor((De.dayOfYear(t)+(r+e)%7)/7)-(r!==e)});De[t+"s"]=r.range,De[t+"s"].utc=r.utc.range,De[t+"OfYear"]=function(t){var r=De.year(t).getDay();return Math.floor((De.dayOfYear(t)+(r+e)%7)/7)}}),De.week=De.sunday,De.weeks=De.sunday.range,De.weeks.utc=De.sunday.utc.range,De.weekOfYear=De.sundayOfYear;var je={"-":"",_:" ",0:"0"},Ve=/^\s*\d+/,qe=/^%/;function Ge(t,e,r){var n=t<0?"-":"",i=(n?-t:t)+"",a=i.length;return n+(a<r?new Array(r-a+1).join(e)+i:i)}function He(e){return new RegExp("^(?:"+e.map(t.requote).join("|")+")","i")}function Ze(t){for(var e=new x,r=-1,n=t.length;++r<n;)e.set(t[r].toLowerCase(),r);return e}function Xe(t,e,r){Ve.lastIndex=0;var n=Ve.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function We(t,e,r){Ve.lastIndex=0;var n=Ve.exec(e.slice(r));return n?(t.U=+n[0],r+n[0].length):-1}function Ye(t,e,r){Ve.lastIndex=0;var n=Ve.exec(e.slice(r));return n?(t.W=+n[0],r+n[0].length):-1}function Ke(t,e,r){Ve.lastIndex=0;var n=Ve.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function Je(t,e,r){Ve.lastIndex=0;var n,i=Ve.exec(e.slice(r,r+2));return i?(t.y=(n=+i[0])+(n>68?1900:2e3),r+i[0].length):-1}function $e(t,e,r){return/^[+-]\d{4}$/.test(e=e.slice(r,r+5))?(t.Z=-e,r+5):-1}function Qe(t,e,r){Ve.lastIndex=0;var n=Ve.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function tr(t,e,r){Ve.lastIndex=0;var n=Ve.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function er(t,e,r){Ve.lastIndex=0;var n=Ve.exec(e.slice(r,r+3));return n?(t.j=+n[0],r+n[0].length):-1}function rr(t,e,r){Ve.lastIndex=0;var n=Ve.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function nr(t,e,r){Ve.lastIndex=0;var n=Ve.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function ir(t,e,r){Ve.lastIndex=0;var n=Ve.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function ar(t,e,r){Ve.lastIndex=0;var n=Ve.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function or(t){var e=t.getTimezoneOffset(),r=e>0?"-":"+",n=v(e)/60|0,i=v(e)%60;return r+Ge(n,"0",2)+Ge(i,"0",2)}function sr(t,e,r){qe.lastIndex=0;var n=qe.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function lr(t){for(var e=t.length,r=-1;++r<e;)t[r][0]=this(t[r][0]);return function(e){for(var r=0,n=t[r];!n[1](e);)n=t[++r];return n[0](e)}}t.locale=function(t){return{numberFormat:Ee(t),timeFormat:Ue(t)}};var ur=t.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function cr(){}t.format=ur.numberFormat,t.geo={},cr.prototype={s:0,t:0,add:function(t){hr(t,this.t,pr),hr(pr.s,this.s,this),this.s?this.t+=pr.t:this.s=pr.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var pr=new cr;function hr(t,e,r){var n=r.s=t+e,i=n-t,a=n-i;r.t=t-a+(e-i)}function fr(t,e){t&&mr.hasOwnProperty(t.type)&&mr[t.type](t,e)}t.geo.stream=function(t,e){t&&dr.hasOwnProperty(t.type)?dr[t.type](t,e):fr(t,e)};var dr={Feature:function(t,e){fr(t.geometry,e)},FeatureCollection:function(t,e){for(var r=t.features,n=-1,i=r.length;++n<i;)fr(r[n].geometry,e)}},mr={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var r=t.coordinates,n=-1,i=r.length;++n<i;)t=r[n],e.point(t[0],t[1],t[2])},LineString:function(t,e){yr(t.coordinates,e,0)},MultiLineString:function(t,e){for(var r=t.coordinates,n=-1,i=r.length;++n<i;)yr(r[n],e,0)},Polygon:function(t,e){gr(t.coordinates,e)},MultiPolygon:function(t,e){for(var r=t.coordinates,n=-1,i=r.length;++n<i;)gr(r[n],e)},GeometryCollection:function(t,e){for(var r=t.geometries,n=-1,i=r.length;++n<i;)fr(r[n],e)}};function yr(t,e,r){var n,i=-1,a=t.length-r;for(e.lineStart();++i<a;)n=t[i],e.point(n[0],n[1],n[2]);e.lineEnd()}function gr(t,e){var r=-1,n=t.length;for(e.polygonStart();++r<n;)yr(t[r],e,1);e.polygonEnd()}t.geo.area=function(e){return vr=0,t.geo.stream(e,zr),vr};var vr,_r,xr,br,wr,kr,Tr,Ar,Mr,Sr,Lr,Cr,Er=new cr,zr={sphere:function(){vr+=4*At},point:O,lineStart:O,lineEnd:O,polygonStart:function(){Er.reset(),zr.lineStart=Pr},polygonEnd:function(){var t=2*Er;vr+=t<0?4*At+t:t,zr.lineStart=zr.lineEnd=zr.point=O}};function Pr(){var t,e,r,n,i;function a(t,e){e=e*Ct/2+At/4;var a=(t*=Ct)-r,o=a>=0?1:-1,s=o*a,l=Math.cos(e),u=Math.sin(e),c=i*u,p=n*l+c*Math.cos(s),h=c*o*Math.sin(s);Er.add(Math.atan2(h,p)),r=t,n=l,i=u}zr.point=function(o,s){zr.point=a,r=(t=o)*Ct,n=Math.cos(s=(e=s)*Ct/2+At/4),i=Math.sin(s)},zr.lineEnd=function(){a(t,e)}}function Ir(t){var e=t[0],r=t[1],n=Math.cos(r);return[n*Math.cos(e),n*Math.sin(e),Math.sin(r)]}function Dr(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Or(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function Rr(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function Fr(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function Br(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function Nr(t){return[Math.atan2(t[1],t[0]),Dt(t[2])]}function Ur(t,e){return v(t[0]-e[0])<kt&&v(t[1]-e[1])<kt}t.geo.bounds=function(){var e,r,n,i,a,o,s,l,u,c,p,h={point:f,lineStart:m,lineEnd:y,polygonStart:function(){h.point=g,h.lineStart=_,h.lineEnd=x,u=0,zr.polygonStart()},polygonEnd:function(){zr.polygonEnd(),h.point=f,h.lineStart=m,h.lineEnd=y,Er<0?(e=-(n=180),r=-(i=90)):u>kt?i=90:u<-kt&&(r=-90),p[0]=e,p[1]=n}};function f(t,a){c.push(p=[e=t,n=t]),a<r&&(r=a),a>i&&(i=a)}function d(t,o){var s=Ir([t*Ct,o*Ct]);if(l){var u=Or(l,s),c=Or([u[1],-u[0],0],u);Br(c),c=Nr(c);var p=t-a,h=p>0?1:-1,d=c[0]*Et*h,m=v(p)>180;if(m^(h*a<d&&d<h*t))(y=c[1]*Et)>i&&(i=y);else if(m^(h*a<(d=(d+360)%360-180)&&d<h*t)){var y;(y=-c[1]*Et)<r&&(r=y)}else o<r&&(r=o),o>i&&(i=o);m?t<a?b(e,t)>b(e,n)&&(n=t):b(t,n)>b(e,n)&&(e=t):n>=e?(t<e&&(e=t),t>n&&(n=t)):t>a?b(e,t)>b(e,n)&&(n=t):b(t,n)>b(e,n)&&(e=t)}else f(t,o);l=s,a=t}function m(){h.point=d}function y(){p[0]=e,p[1]=n,h.point=f,l=null}function g(t,e){if(l){var r=t-a;u+=v(r)>180?r+(r>0?360:-360):r}else o=t,s=e;zr.point(t,e),d(t,e)}function _(){zr.lineStart()}function x(){g(o,s),zr.lineEnd(),v(u)>kt&&(e=-(n=180)),p[0]=e,p[1]=n,l=null}function b(t,e){return(e-=t)<0?e+360:e}function w(t,e){return t[0]-e[0]}function k(t,e){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t<e[0]||e[1]<t}return function(a){if(i=n=-(e=r=1/0),c=[],t.geo.stream(a,h),u=c.length){c.sort(w);for(var o=1,s=[m=c[0]];o<u;++o)k((f=c[o])[0],m)||k(f[1],m)?(b(m[0],f[1])>b(m[0],m[1])&&(m[1]=f[1]),b(f[0],m[1])>b(m[0],m[1])&&(m[0]=f[0])):s.push(m=f);for(var l,u,f,d=-1/0,m=(o=0,s[u=s.length-1]);o<=u;m=f,++o)f=s[o],(l=b(m[1],f[0]))>d&&(d=l,e=f[0],n=m[1])}return c=p=null,e===1/0||r===1/0?[[NaN,NaN],[NaN,NaN]]:[[e,r],[n,i]]}}(),t.geo.centroid=function(e){_r=xr=br=wr=kr=Tr=Ar=Mr=Sr=Lr=Cr=0,t.geo.stream(e,jr);var r=Sr,n=Lr,i=Cr,a=r*r+n*n+i*i;return a<Tt&&(r=Tr,n=Ar,i=Mr,xr<kt&&(r=br,n=wr,i=kr),(a=r*r+n*n+i*i)<Tt)?[NaN,NaN]:[Math.atan2(n,r)*Et,Dt(i/Math.sqrt(a))*Et]};var jr={sphere:O,point:Vr,lineStart:Gr,lineEnd:Hr,polygonStart:function(){jr.lineStart=Zr},polygonEnd:function(){jr.lineStart=Gr}};function Vr(t,e){t*=Ct;var r=Math.cos(e*=Ct);qr(r*Math.cos(t),r*Math.sin(t),Math.sin(e))}function qr(t,e,r){br+=(t-br)/++_r,wr+=(e-wr)/_r,kr+=(r-kr)/_r}function Gr(){var t,e,r;function n(n,i){n*=Ct;var a=Math.cos(i*=Ct),o=a*Math.cos(n),s=a*Math.sin(n),l=Math.sin(i),u=Math.atan2(Math.sqrt((u=e*l-r*s)*u+(u=r*o-t*l)*u+(u=t*s-e*o)*u),t*o+e*s+r*l);xr+=u,Tr+=u*(t+(t=o)),Ar+=u*(e+(e=s)),Mr+=u*(r+(r=l)),qr(t,e,r)}jr.point=function(i,a){i*=Ct;var o=Math.cos(a*=Ct);t=o*Math.cos(i),e=o*Math.sin(i),r=Math.sin(a),jr.point=n,qr(t,e,r)}}function Hr(){jr.point=Vr}function Zr(){var t,e,r,n,i;function a(t,e){t*=Ct;var a=Math.cos(e*=Ct),o=a*Math.cos(t),s=a*Math.sin(t),l=Math.sin(e),u=n*l-i*s,c=i*o-r*l,p=r*s-n*o,h=Math.sqrt(u*u+c*c+p*p),f=r*o+n*s+i*l,d=h&&-It(f)/h,m=Math.atan2(h,f);Sr+=d*u,Lr+=d*c,Cr+=d*p,xr+=m,Tr+=m*(r+(r=o)),Ar+=m*(n+(n=s)),Mr+=m*(i+(i=l)),qr(r,n,i)}jr.point=function(o,s){t=o,e=s,jr.point=a,o*=Ct;var l=Math.cos(s*=Ct);r=l*Math.cos(o),n=l*Math.sin(o),i=Math.sin(s),qr(r,n,i)},jr.lineEnd=function(){a(t,e),jr.lineEnd=Hr,jr.point=Vr}}function Xr(t,e){function r(r,n){return r=t(r,n),e(r[0],r[1])}return t.invert&&e.invert&&(r.invert=function(r,n){return(r=e.invert(r,n))&&t.invert(r[0],r[1])}),r}function Wr(){return!0}function Yr(t,e,r,n,i){var a=[],o=[];if(t.forEach(function(t){if(!((e=t.length-1)<=0)){var e,r=t[0],n=t[e];if(Ur(r,n)){i.lineStart();for(var s=0;s<e;++s)i.point((r=t[s])[0],r[1]);i.lineEnd()}else{var l=new Jr(r,t,null,!0),u=new Jr(r,null,l,!1);l.o=u,a.push(l),o.push(u),l=new Jr(n,t,null,!1),u=new Jr(n,null,l,!0),l.o=u,a.push(l),o.push(u)}}}),o.sort(e),Kr(a),Kr(o),a.length){for(var s=0,l=r,u=o.length;s<u;++s)o[s].e=l=!l;for(var c,p,h=a[0];;){for(var f=h,d=!0;f.v;)if((f=f.n)===h)return;c=f.z,i.lineStart();do{if(f.v=f.o.v=!0,f.e){if(d)for(s=0,u=c.length;s<u;++s)i.point((p=c[s])[0],p[1]);else n(f.x,f.n.x,1,i);f=f.n}else{if(d)for(s=(c=f.p.z).length-1;s>=0;--s)i.point((p=c[s])[0],p[1]);else n(f.x,f.p.x,-1,i);f=f.p}c=(f=f.o).z,d=!d}while(!f.v);i.lineEnd()}}}function Kr(t){if(e=t.length){for(var e,r,n=0,i=t[0];++n<e;)i.n=r=t[n],r.p=i,i=r;i.n=r=t[0],r.p=i}}function Jr(t,e,r,n){this.x=t,this.z=e,this.o=r,this.e=n,this.v=!1,this.n=this.p=null}function $r(e,r,n,i){return function(a,o){var s,l=r(o),u=a.invert(i[0],i[1]),c={point:p,lineStart:f,lineEnd:d,polygonStart:function(){c.point=x,c.lineStart=b,c.lineEnd=w,s=[],m=[]},polygonEnd:function(){c.point=p,c.lineStart=f,c.lineEnd=d,s=t.merge(s);var e=function(t,e){var r=t[0],n=t[1],i=[Math.sin(r),-Math.cos(r),0],a=0,o=0;Er.reset();for(var s=0,l=e.length;s<l;++s){var u=e[s],c=u.length;if(c)for(var p=u[0],h=p[0],f=p[1]/2+At/4,d=Math.sin(f),m=Math.cos(f),y=1;;){y===c&&(y=0);var g=(t=u[y])[0],v=t[1]/2+At/4,_=Math.sin(v),x=Math.cos(v),b=g-h,w=b>=0?1:-1,k=w*b,T=k>At,A=d*_;if(Er.add(Math.atan2(A*w*Math.sin(k),m*x+A*Math.cos(k))),a+=T?b+w*Mt:b,T^h>=r^g>=r){var M=Or(Ir(p),Ir(t));Br(M);var S=Or(i,M);Br(S);var L=(T^b>=0?-1:1)*Dt(S[2]);(n>L||n===L&&(M[0]||M[1]))&&(o+=T^b>=0?1:-1)}if(!y++)break;h=g,d=_,m=x,p=t}}return(a<-kt||a<kt&&Er<-kt)^1&o}(u,m);s.length?(_||(o.polygonStart(),_=!0),Yr(s,en,e,n,o)):e&&(_||(o.polygonStart(),_=!0),o.lineStart(),n(null,null,1,o),o.lineEnd()),_&&(o.polygonEnd(),_=!1),s=m=null},sphere:function(){o.polygonStart(),o.lineStart(),n(null,null,1,o),o.lineEnd(),o.polygonEnd()}};function p(t,r){var n=a(t,r);e(t=n[0],r=n[1])&&o.point(t,r)}function h(t,e){var r=a(t,e);l.point(r[0],r[1])}function f(){c.point=h,l.lineStart()}function d(){c.point=p,l.lineEnd()}var m,y,g=tn(),v=r(g),_=!1;function x(t,e){y.push([t,e]);var r=a(t,e);v.point(r[0],r[1])}function b(){v.lineStart(),y=[]}function w(){x(y[0][0],y[0][1]),v.lineEnd();var t,e=v.clean(),r=g.buffer(),n=r.length;if(y.pop(),m.push(y),y=null,n)if(1&e){var i,a=-1;if((n=(t=r[0]).length-1)>0){for(_||(o.polygonStart(),_=!0),o.lineStart();++a<n;)o.point((i=t[a])[0],i[1]);o.lineEnd()}}else n>1&&2&e&&r.push(r.pop().concat(r.shift())),s.push(r.filter(Qr))}return c}}function Qr(t){return t.length>1}function tn(){var t,e=[];return{lineStart:function(){e.push(t=[])},point:function(e,r){t.push([e,r])},lineEnd:O,buffer:function(){var r=e;return e=[],t=null,r},rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))}}}function en(t,e){return((t=t.x)[0]<0?t[1]-Lt-kt:Lt-t[1])-((e=e.x)[0]<0?e[1]-Lt-kt:Lt-e[1])}var rn=$r(Wr,function(t){var e,r=NaN,n=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(a,o){var s=a>0?At:-At,l=v(a-r);v(l-At)<kt?(t.point(r,n=(n+o)/2>0?Lt:-Lt),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(s,n),t.point(a,n),e=0):i!==s&&l>=At&&(v(r-i)<kt&&(r-=i*kt),v(a-s)<kt&&(a-=s*kt),n=function(t,e,r,n){var i,a,o=Math.sin(t-r);return v(o)>kt?Math.atan((Math.sin(e)*(a=Math.cos(n))*Math.sin(r)-Math.sin(n)*(i=Math.cos(e))*Math.sin(t))/(i*a*o)):(e+n)/2}(r,n,a,o),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(s,n),e=0),t.point(r=a,n=o),i=s},lineEnd:function(){t.lineEnd(),r=n=NaN},clean:function(){return 2-e}}},function(t,e,r,n){var i;if(null==t)i=r*Lt,n.point(-At,i),n.point(0,i),n.point(At,i),n.point(At,0),n.point(At,-i),n.point(0,-i),n.point(-At,-i),n.point(-At,0),n.point(-At,i);else if(v(t[0]-e[0])>kt){var a=t[0]<e[0]?At:-At;i=r*a/2,n.point(-a,i),n.point(0,i),n.point(a,i)}else n.point(e[0],e[1])},[-At,-At/2]);function nn(t,e,r,n){return function(i){var a,o=i.a,s=i.b,l=o.x,u=o.y,c=0,p=1,h=s.x-l,f=s.y-u;if(a=t-l,h||!(a>0)){if(a/=h,h<0){if(a<c)return;a<p&&(p=a)}else if(h>0){if(a>p)return;a>c&&(c=a)}if(a=r-l,h||!(a<0)){if(a/=h,h<0){if(a>p)return;a>c&&(c=a)}else if(h>0){if(a<c)return;a<p&&(p=a)}if(a=e-u,f||!(a>0)){if(a/=f,f<0){if(a<c)return;a<p&&(p=a)}else if(f>0){if(a>p)return;a>c&&(c=a)}if(a=n-u,f||!(a<0)){if(a/=f,f<0){if(a>p)return;a>c&&(c=a)}else if(f>0){if(a<c)return;a<p&&(p=a)}return c>0&&(i.a={x:l+c*h,y:u+c*f}),p<1&&(i.b={x:l+p*h,y:u+p*f}),i}}}}}}var an=1e9;function on(e,r,n,i){return function(l){var u,c,p,h,f,d,m,y,g,v,_,x=l,b=tn(),w=nn(e,r,n,i),k={point:M,lineStart:function(){k.point=S,c&&c.push(p=[]);v=!0,g=!1,m=y=NaN},lineEnd:function(){u&&(S(h,f),d&&g&&b.rejoin(),u.push(b.buffer()));k.point=M,g&&l.lineEnd()},polygonStart:function(){l=b,u=[],c=[],_=!0},polygonEnd:function(){l=x,u=t.merge(u);var r=function(t){for(var e=0,r=c.length,n=t[1],i=0;i<r;++i)for(var a,o=1,s=c[i],l=s.length,u=s[0];o<l;++o)a=s[o],u[1]<=n?a[1]>n&&Pt(u,a,t)>0&&++e:a[1]<=n&&Pt(u,a,t)<0&&--e,u=a;return 0!==e}([e,i]),n=_&&r,a=u.length;(n||a)&&(l.polygonStart(),n&&(l.lineStart(),T(null,null,1,l),l.lineEnd()),a&&Yr(u,o,r,T,l),l.polygonEnd()),u=c=p=null}};function T(t,o,l,u){var c=0,p=0;if(null==t||(c=a(t,l))!==(p=a(o,l))||s(t,o)<0^l>0)do{u.point(0===c||3===c?e:n,c>1?i:r)}while((c=(c+l+4)%4)!==p);else u.point(o[0],o[1])}function A(t,a){return e<=t&&t<=n&&r<=a&&a<=i}function M(t,e){A(t,e)&&l.point(t,e)}function S(t,e){var r=A(t=Math.max(-an,Math.min(an,t)),e=Math.max(-an,Math.min(an,e)));if(c&&p.push([t,e]),v)h=t,f=e,d=r,v=!1,r&&(l.lineStart(),l.point(t,e));else if(r&&g)l.point(t,e);else{var n={a:{x:m,y:y},b:{x:t,y:e}};w(n)?(g||(l.lineStart(),l.point(n.a.x,n.a.y)),l.point(n.b.x,n.b.y),r||l.lineEnd(),_=!1):r&&(l.lineStart(),l.point(t,e),_=!1)}m=t,y=e,g=r}return k};function a(t,i){return v(t[0]-e)<kt?i>0?0:3:v(t[0]-n)<kt?i>0?2:1:v(t[1]-r)<kt?i>0?1:0:i>0?3:2}function o(t,e){return s(t.x,e.x)}function s(t,e){var r=a(t,1),n=a(e,1);return r!==n?r-n:0===r?e[1]-t[1]:1===r?t[0]-e[0]:2===r?t[1]-e[1]:e[0]-t[0]}}function sn(t){var e=0,r=At/3,n=zn(t),i=n(e,r);return i.parallels=function(t){return arguments.length?n(e=t[0]*At/180,r=t[1]*At/180):[e/At*180,r/At*180]},i}function ln(t,e){var r=Math.sin(t),n=(r+Math.sin(e))/2,i=1+r*(2*n-r),a=Math.sqrt(i)/n;function o(t,e){var r=Math.sqrt(i-2*n*Math.sin(e))/n;return[r*Math.sin(t*=n),a-r*Math.cos(t)]}return o.invert=function(t,e){var r=a-e;return[Math.atan2(t,r)/n,Dt((i-(t*t+r*r)*n*n)/(2*n))]},o}t.geo.clipExtent=function(){var t,e,r,n,i,a,o={stream:function(t){return i&&(i.valid=!1),(i=a(t)).valid=!0,i},extent:function(s){return arguments.length?(a=on(t=+s[0][0],e=+s[0][1],r=+s[1][0],n=+s[1][1]),i&&(i.valid=!1,i=null),o):[[t,e],[r,n]]}};return o.extent([[0,0],[960,500]])},(t.geo.conicEqualArea=function(){return sn(ln)}).raw=ln,t.geo.albers=function(){return t.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},t.geo.albersUsa=function(){var e,r,n,i,a=t.geo.albers(),o=t.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),s=t.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),l={point:function(t,r){e=[t,r]}};function u(t){var a=t[0],o=t[1];return e=null,r(a,o),e||(n(a,o),e)||i(a,o),e}return u.invert=function(t){var e=a.scale(),r=a.translate(),n=(t[0]-r[0])/e,i=(t[1]-r[1])/e;return(i>=.12&&i<.234&&n>=-.425&&n<-.214?o:i>=.166&&i<.234&&n>=-.214&&n<-.115?s:a).invert(t)},u.stream=function(t){var e=a.stream(t),r=o.stream(t),n=s.stream(t);return{point:function(t,i){e.point(t,i),r.point(t,i),n.point(t,i)},sphere:function(){e.sphere(),r.sphere(),n.sphere()},lineStart:function(){e.lineStart(),r.lineStart(),n.lineStart()},lineEnd:function(){e.lineEnd(),r.lineEnd(),n.lineEnd()},polygonStart:function(){e.polygonStart(),r.polygonStart(),n.polygonStart()},polygonEnd:function(){e.polygonEnd(),r.polygonEnd(),n.polygonEnd()}}},u.precision=function(t){return arguments.length?(a.precision(t),o.precision(t),s.precision(t),u):a.precision()},u.scale=function(t){return arguments.length?(a.scale(t),o.scale(.35*t),s.scale(t),u.translate(a.translate())):a.scale()},u.translate=function(t){if(!arguments.length)return a.translate();var e=a.scale(),c=+t[0],p=+t[1];return r=a.translate(t).clipExtent([[c-.455*e,p-.238*e],[c+.455*e,p+.238*e]]).stream(l).point,n=o.translate([c-.307*e,p+.201*e]).clipExtent([[c-.425*e+kt,p+.12*e+kt],[c-.214*e-kt,p+.234*e-kt]]).stream(l).point,i=s.translate([c-.205*e,p+.212*e]).clipExtent([[c-.214*e+kt,p+.166*e+kt],[c-.115*e-kt,p+.234*e-kt]]).stream(l).point,u},u.scale(1070)};var un,cn,pn,hn,fn,dn,mn={point:O,lineStart:O,lineEnd:O,polygonStart:function(){cn=0,mn.lineStart=yn},polygonEnd:function(){mn.lineStart=mn.lineEnd=mn.point=O,un+=v(cn/2)}};function yn(){var t,e,r,n;function i(t,e){cn+=n*t-r*e,r=t,n=e}mn.point=function(a,o){mn.point=i,t=r=a,e=n=o},mn.lineEnd=function(){i(t,e)}}var gn={point:function(t,e){t<pn&&(pn=t);t>fn&&(fn=t);e<hn&&(hn=e);e>dn&&(dn=e)},lineStart:O,lineEnd:O,polygonStart:O,polygonEnd:O};function vn(){var t=_n(4.5),e=[],r={point:n,lineStart:function(){r.point=i},lineEnd:o,polygonStart:function(){r.lineEnd=s},polygonEnd:function(){r.lineEnd=o,r.point=n},pointRadius:function(e){return t=_n(e),r},result:function(){if(e.length){var t=e.join("");return e=[],t}}};function n(r,n){e.push("M",r,",",n,t)}function i(t,n){e.push("M",t,",",n),r.point=a}function a(t,r){e.push("L",t,",",r)}function o(){r.point=n}function s(){e.push("Z")}return r}function _n(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}var xn,bn={point:wn,lineStart:kn,lineEnd:Tn,polygonStart:function(){bn.lineStart=An},polygonEnd:function(){bn.point=wn,bn.lineStart=kn,bn.lineEnd=Tn}};function wn(t,e){br+=t,wr+=e,++kr}function kn(){var t,e;function r(r,n){var i=r-t,a=n-e,o=Math.sqrt(i*i+a*a);Tr+=o*(t+r)/2,Ar+=o*(e+n)/2,Mr+=o,wn(t=r,e=n)}bn.point=function(n,i){bn.point=r,wn(t=n,e=i)}}function Tn(){bn.point=wn}function An(){var t,e,r,n;function i(t,e){var i=t-r,a=e-n,o=Math.sqrt(i*i+a*a);Tr+=o*(r+t)/2,Ar+=o*(n+e)/2,Mr+=o,Sr+=(o=n*t-r*e)*(r+t),Lr+=o*(n+e),Cr+=3*o,wn(r=t,n=e)}bn.point=function(a,o){bn.point=i,wn(t=r=a,e=n=o)},bn.lineEnd=function(){i(t,e)}}function Mn(t){var e=4.5,r={point:n,lineStart:function(){r.point=i},lineEnd:o,polygonStart:function(){r.lineEnd=s},polygonEnd:function(){r.lineEnd=o,r.point=n},pointRadius:function(t){return e=t,r},result:O};function n(r,n){t.moveTo(r+e,n),t.arc(r,n,e,0,Mt)}function i(e,n){t.moveTo(e,n),r.point=a}function a(e,r){t.lineTo(e,r)}function o(){r.point=n}function s(){t.closePath()}return r}function Sn(t){var e=.5,r=Math.cos(30*Ct),n=16;function i(e){return(n?function(e){var r,i,o,s,l,u,c,p,h,f,d,m,y={point:g,lineStart:v,lineEnd:x,polygonStart:function(){e.polygonStart(),y.lineStart=b},polygonEnd:function(){e.polygonEnd(),y.lineStart=v}};function g(r,n){r=t(r,n),e.point(r[0],r[1])}function v(){p=NaN,y.point=_,e.lineStart()}function _(r,i){var o=Ir([r,i]),s=t(r,i);a(p,h,c,f,d,m,p=s[0],h=s[1],c=r,f=o[0],d=o[1],m=o[2],n,e),e.point(p,h)}function x(){y.point=g,e.lineEnd()}function b(){v(),y.point=w,y.lineEnd=k}function w(t,e){_(r=t,e),i=p,o=h,s=f,l=d,u=m,y.point=_}function k(){a(p,h,c,f,d,m,i,o,r,s,l,u,n,e),y.lineEnd=x,x()}return y}:function(e){return Cn(e,function(r,n){r=t(r,n),e.point(r[0],r[1])})})(e)}function a(n,i,o,s,l,u,c,p,h,f,d,m,y,g){var _=c-n,x=p-i,b=_*_+x*x;if(b>4*e&&y--){var w=s+f,k=l+d,T=u+m,A=Math.sqrt(w*w+k*k+T*T),M=Math.asin(T/=A),S=v(v(T)-1)<kt||v(o-h)<kt?(o+h)/2:Math.atan2(k,w),L=t(S,M),C=L[0],E=L[1],z=C-n,P=E-i,I=x*z-_*P;(I*I/b>e||v((_*z+x*P)/b-.5)>.3||s*f+l*d+u*m<r)&&(a(n,i,o,s,l,u,C,E,S,w/=A,k/=A,T,y,g),g.point(C,E),a(C,E,S,w,k,T,c,p,h,f,d,m,y,g))}}return i.precision=function(t){return arguments.length?(n=(e=t*t)>0&&16,i):Math.sqrt(e)},i}function Ln(t){this.stream=t}function Cn(t,e){return{point:e,sphere:function(){t.sphere()},lineStart:function(){t.lineStart()},lineEnd:function(){t.lineEnd()},polygonStart:function(){t.polygonStart()},polygonEnd:function(){t.polygonEnd()}}}function En(t){return zn(function(){return t})()}function zn(e){var r,n,i,a,o,s,l=Sn(function(t,e){return[(t=r(t,e))[0]*u+a,o-t[1]*u]}),u=150,c=480,p=250,h=0,f=0,d=0,m=0,y=0,g=rn,_=z,x=null,b=null;function w(t){return[(t=i(t[0]*Ct,t[1]*Ct))[0]*u+a,o-t[1]*u]}function k(t){return(t=i.invert((t[0]-a)/u,(o-t[1])/u))&&[t[0]*Et,t[1]*Et]}function T(){i=Xr(n=On(d,m,y),r);var t=r(h,f);return a=c-t[0]*u,o=p+t[1]*u,A()}function A(){return s&&(s.valid=!1,s=null),w}return w.stream=function(t){return s&&(s.valid=!1),(s=Pn(g(n,l(_(t))))).valid=!0,s},w.clipAngle=function(t){return arguments.length?(g=null==t?(x=t,rn):function(t){var e=Math.cos(t),r=e>0,n=v(e)>kt;return $r(i,function(t){var e,s,l,u,c;return{lineStart:function(){u=l=!1,c=1},point:function(p,h){var f,d=[p,h],m=i(p,h),y=r?m?0:o(p,h):m?o(p+(p<0?At:-At),h):0;if(!e&&(u=l=m)&&t.lineStart(),m!==l&&(f=a(e,d),(Ur(e,f)||Ur(d,f))&&(d[0]+=kt,d[1]+=kt,m=i(d[0],d[1]))),m!==l)c=0,m?(t.lineStart(),f=a(d,e),t.point(f[0],f[1])):(f=a(e,d),t.point(f[0],f[1]),t.lineEnd()),e=f;else if(n&&e&&r^m){var g;y&s||!(g=a(d,e,!0))||(c=0,r?(t.lineStart(),t.point(g[0][0],g[0][1]),t.point(g[1][0],g[1][1]),t.lineEnd()):(t.point(g[1][0],g[1][1]),t.lineEnd(),t.lineStart(),t.point(g[0][0],g[0][1])))}!m||e&&Ur(e,d)||t.point(d[0],d[1]),e=d,l=m,s=y},lineEnd:function(){l&&t.lineEnd(),e=null},clean:function(){return c|(u&&l)<<1}}},Nn(t,6*Ct),r?[0,-t]:[-At,t-At]);function i(t,r){return Math.cos(t)*Math.cos(r)>e}function a(t,r,n){var i=[1,0,0],a=Or(Ir(t),Ir(r)),o=Dr(a,a),s=a[0],l=o-s*s;if(!l)return!n&&t;var u=e*o/l,c=-e*s/l,p=Or(i,a),h=Fr(i,u);Rr(h,Fr(a,c));var f=p,d=Dr(h,f),m=Dr(f,f),y=d*d-m*(Dr(h,h)-1);if(!(y<0)){var g=Math.sqrt(y),_=Fr(f,(-d-g)/m);if(Rr(_,h),_=Nr(_),!n)return _;var x,b=t[0],w=r[0],k=t[1],T=r[1];w<b&&(x=b,b=w,w=x);var A=w-b,M=v(A-At)<kt;if(!M&&T<k&&(x=k,k=T,T=x),M||A<kt?M?k+T>0^_[1]<(v(_[0]-b)<kt?k:T):k<=_[1]&&_[1]<=T:A>At^(b<=_[0]&&_[0]<=w)){var S=Fr(f,(-d+g)/m);return Rr(S,h),[_,Nr(S)]}}}function o(e,n){var i=r?t:At-t,a=0;return e<-i?a|=1:e>i&&(a|=2),n<-i?a|=4:n>i&&(a|=8),a}}((x=+t)*Ct),A()):x},w.clipExtent=function(t){return arguments.length?(b=t,_=t?on(t[0][0],t[0][1],t[1][0],t[1][1]):z,A()):b},w.scale=function(t){return arguments.length?(u=+t,T()):u},w.translate=function(t){return arguments.length?(c=+t[0],p=+t[1],T()):[c,p]},w.center=function(t){return arguments.length?(h=t[0]%360*Ct,f=t[1]%360*Ct,T()):[h*Et,f*Et]},w.rotate=function(t){return arguments.length?(d=t[0]%360*Ct,m=t[1]%360*Ct,y=t.length>2?t[2]%360*Ct:0,T()):[d*Et,m*Et,y*Et]},t.rebind(w,l,"precision"),function(){return r=e.apply(this,arguments),w.invert=r.invert&&k,T()}}function Pn(t){return Cn(t,function(e,r){t.point(e*Ct,r*Ct)})}function In(t,e){return[t,e]}function Dn(t,e){return[t>At?t-Mt:t<-At?t+Mt:t,e]}function On(t,e,r){return t?e||r?Xr(Fn(t),Bn(e,r)):Fn(t):e||r?Bn(e,r):Dn}function Rn(t){return function(e,r){return[(e+=t)>At?e-Mt:e<-At?e+Mt:e,r]}}function Fn(t){var e=Rn(t);return e.invert=Rn(-t),e}function Bn(t,e){var r=Math.cos(t),n=Math.sin(t),i=Math.cos(e),a=Math.sin(e);function o(t,e){var o=Math.cos(e),s=Math.cos(t)*o,l=Math.sin(t)*o,u=Math.sin(e),c=u*r+s*n;return[Math.atan2(l*i-c*a,s*r-u*n),Dt(c*i+l*a)]}return o.invert=function(t,e){var o=Math.cos(e),s=Math.cos(t)*o,l=Math.sin(t)*o,u=Math.sin(e),c=u*i-l*a;return[Math.atan2(l*i+u*a,s*r+c*n),Dt(c*r-s*n)]},o}function Nn(t,e){var r=Math.cos(t),n=Math.sin(t);return function(i,a,o,s){var l=o*e;null!=i?(i=Un(r,i),a=Un(r,a),(o>0?i<a:i>a)&&(i+=o*Mt)):(i=t+o*Mt,a=t-.5*l);for(var u,c=i;o>0?c>a:c<a;c-=l)s.point((u=Nr([r,-n*Math.cos(c),-n*Math.sin(c)]))[0],u[1])}}function Un(t,e){var r=Ir(e);r[0]-=t,Br(r);var n=It(-r[1]);return((-r[2]<0?-n:n)+2*Math.PI-kt)%(2*Math.PI)}function jn(e,r,n){var i=t.range(e,r-kt,n).concat(r);return function(t){return i.map(function(e){return[t,e]})}}function Vn(e,r,n){var i=t.range(e,r-kt,n).concat(r);return function(t){return i.map(function(e){return[e,t]})}}function qn(t){return t.source}function Gn(t){return t.target}t.geo.path=function(){var e,r,n,i,a,o=4.5;function s(e){return e&&("function"==typeof o&&i.pointRadius(+o.apply(this,arguments)),a&&a.valid||(a=n(i)),t.geo.stream(e,a)),i.result()}function l(){return a=null,s}return s.area=function(e){return un=0,t.geo.stream(e,n(mn)),un},s.centroid=function(e){return br=wr=kr=Tr=Ar=Mr=Sr=Lr=Cr=0,t.geo.stream(e,n(bn)),Cr?[Sr/Cr,Lr/Cr]:Mr?[Tr/Mr,Ar/Mr]:kr?[br/kr,wr/kr]:[NaN,NaN]},s.bounds=function(e){return fn=dn=-(pn=hn=1/0),t.geo.stream(e,n(gn)),[[pn,hn],[fn,dn]]},s.projection=function(t){return arguments.length?(n=(e=t)?t.stream||(r=t,i=Sn(function(t,e){return r([t*Et,e*Et])}),function(t){return Pn(i(t))}):z,l()):e;var r,i},s.context=function(t){return arguments.length?(i=null==(r=t)?new vn:new Mn(t),"function"!=typeof o&&i.pointRadius(o),l()):r},s.pointRadius=function(t){return arguments.length?(o="function"==typeof t?t:(i.pointRadius(+t),+t),s):o},s.projection(t.geo.albersUsa()).context(null)},t.geo.transform=function(t){return{stream:function(e){var r=new Ln(e);for(var n in t)r[n]=t[n];return r}}},Ln.prototype={point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},t.geo.projection=En,t.geo.projectionMutator=zn,(t.geo.equirectangular=function(){return En(In)}).raw=In.invert=In,t.geo.rotation=function(t){function e(e){return(e=t(e[0]*Ct,e[1]*Ct))[0]*=Et,e[1]*=Et,e}return t=On(t[0]%360*Ct,t[1]*Ct,t.length>2?t[2]*Ct:0),e.invert=function(e){return(e=t.invert(e[0]*Ct,e[1]*Ct))[0]*=Et,e[1]*=Et,e},e},Dn.invert=In,t.geo.circle=function(){var t,e,r=[0,0],n=6;function i(){var t="function"==typeof r?r.apply(this,arguments):r,n=On(-t[0]*Ct,-t[1]*Ct,0).invert,i=[];return e(null,null,1,{point:function(t,e){i.push(t=n(t,e)),t[0]*=Et,t[1]*=Et}}),{type:"Polygon",coordinates:[i]}}return i.origin=function(t){return arguments.length?(r=t,i):r},i.angle=function(r){return arguments.length?(e=Nn((t=+r)*Ct,n*Ct),i):t},i.precision=function(r){return arguments.length?(e=Nn(t*Ct,(n=+r)*Ct),i):n},i.angle(90)},t.geo.distance=function(t,e){var r,n=(e[0]-t[0])*Ct,i=t[1]*Ct,a=e[1]*Ct,o=Math.sin(n),s=Math.cos(n),l=Math.sin(i),u=Math.cos(i),c=Math.sin(a),p=Math.cos(a);return Math.atan2(Math.sqrt((r=p*o)*r+(r=u*c-l*p*s)*r),l*c+u*p*s)},t.geo.graticule=function(){var e,r,n,i,a,o,s,l,u,c,p,h,f=10,d=f,m=90,y=360,g=2.5;function _(){return{type:"MultiLineString",coordinates:x()}}function x(){return t.range(Math.ceil(i/m)*m,n,m).map(p).concat(t.range(Math.ceil(l/y)*y,s,y).map(h)).concat(t.range(Math.ceil(r/f)*f,e,f).filter(function(t){return v(t%m)>kt}).map(u)).concat(t.range(Math.ceil(o/d)*d,a,d).filter(function(t){return v(t%y)>kt}).map(c))}return _.lines=function(){return x().map(function(t){return{type:"LineString",coordinates:t}})},_.outline=function(){return{type:"Polygon",coordinates:[p(i).concat(h(s).slice(1),p(n).reverse().slice(1),h(l).reverse().slice(1))]}},_.extent=function(t){return arguments.length?_.majorExtent(t).minorExtent(t):_.minorExtent()},_.majorExtent=function(t){return arguments.length?(i=+t[0][0],n=+t[1][0],l=+t[0][1],s=+t[1][1],i>n&&(t=i,i=n,n=t),l>s&&(t=l,l=s,s=t),_.precision(g)):[[i,l],[n,s]]},_.minorExtent=function(t){return arguments.length?(r=+t[0][0],e=+t[1][0],o=+t[0][1],a=+t[1][1],r>e&&(t=r,r=e,e=t),o>a&&(t=o,o=a,a=t),_.precision(g)):[[r,o],[e,a]]},_.step=function(t){return arguments.length?_.majorStep(t).minorStep(t):_.minorStep()},_.majorStep=function(t){return arguments.length?(m=+t[0],y=+t[1],_):[m,y]},_.minorStep=function(t){return arguments.length?(f=+t[0],d=+t[1],_):[f,d]},_.precision=function(t){return arguments.length?(g=+t,u=jn(o,a,90),c=Vn(r,e,g),p=jn(l,s,90),h=Vn(i,n,g),_):g},_.majorExtent([[-180,-90+kt],[180,90-kt]]).minorExtent([[-180,-80-kt],[180,80+kt]])},t.geo.greatArc=function(){var e,r,n=qn,i=Gn;function a(){return{type:"LineString",coordinates:[e||n.apply(this,arguments),r||i.apply(this,arguments)]}}return a.distance=function(){return t.geo.distance(e||n.apply(this,arguments),r||i.apply(this,arguments))},a.source=function(t){return arguments.length?(n=t,e="function"==typeof t?null:t,a):n},a.target=function(t){return arguments.length?(i=t,r="function"==typeof t?null:t,a):i},a.precision=function(){return arguments.length?a:0},a},t.geo.interpolate=function(t,e){return r=t[0]*Ct,n=t[1]*Ct,i=e[0]*Ct,a=e[1]*Ct,o=Math.cos(n),s=Math.sin(n),l=Math.cos(a),u=Math.sin(a),c=o*Math.cos(r),p=o*Math.sin(r),h=l*Math.cos(i),f=l*Math.sin(i),d=2*Math.asin(Math.sqrt(Rt(a-n)+o*l*Rt(i-r))),m=1/Math.sin(d),(y=d?function(t){var e=Math.sin(t*=d)*m,r=Math.sin(d-t)*m,n=r*c+e*h,i=r*p+e*f,a=r*s+e*u;return[Math.atan2(i,n)*Et,Math.atan2(a,Math.sqrt(n*n+i*i))*Et]}:function(){return[r*Et,n*Et]}).distance=d,y;var r,n,i,a,o,s,l,u,c,p,h,f,d,m,y},t.geo.length=function(e){return xn=0,t.geo.stream(e,Hn),xn};var Hn={sphere:O,point:O,lineStart:function(){var t,e,r;function n(n,i){var a=Math.sin(i*=Ct),o=Math.cos(i),s=v((n*=Ct)-t),l=Math.cos(s);xn+=Math.atan2(Math.sqrt((s=o*Math.sin(s))*s+(s=r*a-e*o*l)*s),e*a+r*o*l),t=n,e=a,r=o}Hn.point=function(i,a){t=i*Ct,e=Math.sin(a*=Ct),r=Math.cos(a),Hn.point=n},Hn.lineEnd=function(){Hn.point=Hn.lineEnd=O}},lineEnd:O,polygonStart:O,polygonEnd:O};function Zn(t,e){function r(e,r){var n=Math.cos(e),i=Math.cos(r),a=t(n*i);return[a*i*Math.sin(e),a*Math.sin(r)]}return r.invert=function(t,r){var n=Math.sqrt(t*t+r*r),i=e(n),a=Math.sin(i),o=Math.cos(i);return[Math.atan2(t*a,n*o),Math.asin(n&&r*a/n)]},r}var Xn=Zn(function(t){return Math.sqrt(2/(1+t))},function(t){return 2*Math.asin(t/2)});(t.geo.azimuthalEqualArea=function(){return En(Xn)}).raw=Xn;var Wn=Zn(function(t){var e=Math.acos(t);return e&&e/Math.sin(e)},z);function Yn(t,e){var r=Math.cos(t),n=function(t){return Math.tan(At/4+t/2)},i=t===e?Math.sin(t):Math.log(r/Math.cos(e))/Math.log(n(e)/n(t)),a=r*Math.pow(n(t),i)/i;if(!i)return $n;function o(t,e){a>0?e<-Lt+kt&&(e=-Lt+kt):e>Lt-kt&&(e=Lt-kt);var r=a/Math.pow(n(e),i);return[r*Math.sin(i*t),a-r*Math.cos(i*t)]}return o.invert=function(t,e){var r=a-e,n=zt(i)*Math.sqrt(t*t+r*r);return[Math.atan2(t,r)/i,2*Math.atan(Math.pow(a/n,1/i))-Lt]},o}function Kn(t,e){var r=Math.cos(t),n=t===e?Math.sin(t):(r-Math.cos(e))/(e-t),i=r/n+t;if(v(n)<kt)return In;function a(t,e){var r=i-e;return[r*Math.sin(n*t),i-r*Math.cos(n*t)]}return a.invert=function(t,e){var r=i-e;return[Math.atan2(t,r)/n,i-zt(n)*Math.sqrt(t*t+r*r)]},a}(t.geo.azimuthalEquidistant=function(){return En(Wn)}).raw=Wn,(t.geo.conicConformal=function(){return sn(Yn)}).raw=Yn,(t.geo.conicEquidistant=function(){return sn(Kn)}).raw=Kn;var Jn=Zn(function(t){return 1/t},Math.atan);function $n(t,e){return[t,Math.log(Math.tan(At/4+e/2))]}function Qn(t){var e,r=En(t),n=r.scale,i=r.translate,a=r.clipExtent;return r.scale=function(){var t=n.apply(r,arguments);return t===r?e?r.clipExtent(null):r:t},r.translate=function(){var t=i.apply(r,arguments);return t===r?e?r.clipExtent(null):r:t},r.clipExtent=function(t){var o=a.apply(r,arguments);if(o===r){if(e=null==t){var s=At*n(),l=i();a([[l[0]-s,l[1]-s],[l[0]+s,l[1]+s]])}}else e&&(o=null);return o},r.clipExtent(null)}(t.geo.gnomonic=function(){return En(Jn)}).raw=Jn,$n.invert=function(t,e){return[t,2*Math.atan(Math.exp(e))-Lt]},(t.geo.mercator=function(){return Qn($n)}).raw=$n;var ti=Zn(function(){return 1},Math.asin);(t.geo.orthographic=function(){return En(ti)}).raw=ti;var ei=Zn(function(t){return 1/(1+t)},function(t){return 2*Math.atan(t)});function ri(t,e){return[Math.log(Math.tan(At/4+e/2)),-t]}function ni(t){return t[0]}function ii(t){return t[1]}function ai(t){for(var e=t.length,r=[0,1],n=2,i=2;i<e;i++){for(;n>1&&Pt(t[r[n-2]],t[r[n-1]],t[i])<=0;)--n;r[n++]=i}return r.slice(0,n)}function oi(t,e){return t[0]-e[0]||t[1]-e[1]}(t.geo.stereographic=function(){return En(ei)}).raw=ei,ri.invert=function(t,e){return[-e,2*Math.atan(Math.exp(t))-Lt]},(t.geo.transverseMercator=function(){var t=Qn(ri),e=t.center,r=t.rotate;return t.center=function(t){return t?e([-t[1],t[0]]):[(t=e())[1],-t[0]]},t.rotate=function(t){return t?r([t[0],t[1],t.length>2?t[2]+90:90]):[(t=r())[0],t[1],t[2]-90]},r([0,0,90])}).raw=ri,t.geom={},t.geom.hull=function(t){var e=ni,r=ii;if(arguments.length)return n(t);function n(t){if(t.length<3)return[];var n,i=ye(e),a=ye(r),o=t.length,s=[],l=[];for(n=0;n<o;n++)s.push([+i.call(this,t[n],n),+a.call(this,t[n],n),n]);for(s.sort(oi),n=0;n<o;n++)l.push([s[n][0],-s[n][1]]);var u=ai(s),c=ai(l),p=c[0]===u[0],h=c[c.length-1]===u[u.length-1],f=[];for(n=u.length-1;n>=0;--n)f.push(t[s[u[n]][2]]);for(n=+p;n<c.length-h;++n)f.push(t[s[c[n]][2]]);return f}return n.x=function(t){return arguments.length?(e=t,n):e},n.y=function(t){return arguments.length?(r=t,n):r},n},t.geom.polygon=function(t){return V(t,si),t};var si=t.geom.polygon.prototype=[];function li(t,e,r){return(r[0]-e[0])*(t[1]-e[1])<(r[1]-e[1])*(t[0]-e[0])}function ui(t,e,r,n){var i=t[0],a=r[0],o=e[0]-i,s=n[0]-a,l=t[1],u=r[1],c=e[1]-l,p=n[1]-u,h=(s*(l-u)-p*(i-a))/(p*o-s*c);return[i+h*o,l+h*c]}function ci(t){var e=t[0],r=t[t.length-1];return!(e[0]-r[0]||e[1]-r[1])}si.area=function(){for(var t,e=-1,r=this.length,n=this[r-1],i=0;++e<r;)t=n,n=this[e],i+=t[1]*n[0]-t[0]*n[1];return.5*i},si.centroid=function(t){var e,r,n=-1,i=this.length,a=0,o=0,s=this[i-1];for(arguments.length||(t=-1/(6*this.area()));++n<i;)e=s,s=this[n],r=e[0]*s[1]-s[0]*e[1],a+=(e[0]+s[0])*r,o+=(e[1]+s[1])*r;return[a*t,o*t]},si.clip=function(t){for(var e,r,n,i,a,o,s=ci(t),l=-1,u=this.length-ci(this),c=this[u-1];++l<u;){for(e=t.slice(),t.length=0,i=this[l],a=e[(n=e.length-s)-1],r=-1;++r<n;)li(o=e[r],c,i)?(li(a,c,i)||t.push(ui(a,o,c,i)),t.push(o)):li(a,c,i)&&t.push(ui(a,o,c,i)),a=o;s&&t.push(t[0]),c=i}return t};var pi,hi,fi,di,mi,yi=[],gi=[];function vi(){Ri(this),this.edge=this.site=this.circle=null}function _i(t){var e=yi.pop()||new vi;return e.site=t,e}function xi(t){Ci(t),fi.remove(t),yi.push(t),Ri(t)}function bi(t){var e=t.circle,r=e.x,n=e.cy,i={x:r,y:n},a=t.P,o=t.N,s=[t];xi(t);for(var l=a;l.circle&&v(r-l.circle.x)<kt&&v(n-l.circle.cy)<kt;)a=l.P,s.unshift(l),xi(l),l=a;s.unshift(l),Ci(l);for(var u=o;u.circle&&v(r-u.circle.x)<kt&&v(n-u.circle.cy)<kt;)o=u.N,s.push(u),xi(u),u=o;s.push(u),Ci(u);var c,p=s.length;for(c=1;c<p;++c)u=s[c],l=s[c-1],Ii(u.edge,l.site,u.site,i);l=s[0],(u=s[p-1]).edge=Pi(l.site,u.site,null,i),Li(l),Li(u)}function wi(t){for(var e,r,n,i,a=t.x,o=t.y,s=fi._;s;)if((n=ki(s,o)-a)>kt)s=s.L;else{if(!((i=a-Ti(s,o))>kt)){n>-kt?(e=s.P,r=s):i>-kt?(e=s,r=s.N):e=r=s;break}if(!s.R){e=s;break}s=s.R}var l=_i(t);if(fi.insert(e,l),e||r){if(e===r)return Ci(e),r=_i(e.site),fi.insert(l,r),l.edge=r.edge=Pi(e.site,l.site),Li(e),void Li(r);if(r){Ci(e),Ci(r);var u=e.site,c=u.x,p=u.y,h=t.x-c,f=t.y-p,d=r.site,m=d.x-c,y=d.y-p,g=2*(h*y-f*m),v=h*h+f*f,_=m*m+y*y,x={x:(y*v-f*_)/g+c,y:(h*_-m*v)/g+p};Ii(r.edge,u,d,x),l.edge=Pi(u,t,null,x),r.edge=Pi(t,d,null,x),Li(e),Li(r)}else l.edge=Pi(e.site,l.site)}}function ki(t,e){var r=t.site,n=r.x,i=r.y,a=i-e;if(!a)return n;var o=t.P;if(!o)return-1/0;var s=(r=o.site).x,l=r.y,u=l-e;if(!u)return s;var c=s-n,p=1/a-1/u,h=c/u;return p?(-h+Math.sqrt(h*h-2*p*(c*c/(-2*u)-l+u/2+i-a/2)))/p+n:(n+s)/2}function Ti(t,e){var r=t.N;if(r)return ki(r,e);var n=t.site;return n.y===e?n.x:1/0}function Ai(t){this.site=t,this.edges=[]}function Mi(t,e){return e.angle-t.angle}function Si(){Ri(this),this.x=this.y=this.arc=this.site=this.cy=null}function Li(t){var e=t.P,r=t.N;if(e&&r){var n=e.site,i=t.site,a=r.site;if(n!==a){var o=i.x,s=i.y,l=n.x-o,u=n.y-s,c=a.x-o,p=2*(l*(y=a.y-s)-u*c);if(!(p>=-Tt)){var h=l*l+u*u,f=c*c+y*y,d=(y*h-u*f)/p,m=(l*f-c*h)/p,y=m+s,g=gi.pop()||new Si;g.arc=t,g.site=i,g.x=d+o,g.y=y+Math.sqrt(d*d+m*m),g.cy=y,t.circle=g;for(var v=null,_=mi._;_;)if(g.y<_.y||g.y===_.y&&g.x<=_.x){if(!_.L){v=_.P;break}_=_.L}else{if(!_.R){v=_;break}_=_.R}mi.insert(v,g),v||(di=g)}}}}function Ci(t){var e=t.circle;e&&(e.P||(di=e.N),mi.remove(e),gi.push(e),Ri(e),t.circle=null)}function Ei(t,e){var r=t.b;if(r)return!0;var n,i,a=t.a,o=e[0][0],s=e[1][0],l=e[0][1],u=e[1][1],c=t.l,p=t.r,h=c.x,f=c.y,d=p.x,m=p.y,y=(h+d)/2,g=(f+m)/2;if(m===f){if(y<o||y>=s)return;if(h>d){if(a){if(a.y>=u)return}else a={x:y,y:l};r={x:y,y:u}}else{if(a){if(a.y<l)return}else a={x:y,y:u};r={x:y,y:l}}}else if(i=g-(n=(h-d)/(m-f))*y,n<-1||n>1)if(h>d){if(a){if(a.y>=u)return}else a={x:(l-i)/n,y:l};r={x:(u-i)/n,y:u}}else{if(a){if(a.y<l)return}else a={x:(u-i)/n,y:u};r={x:(l-i)/n,y:l}}else if(f<m){if(a){if(a.x>=s)return}else a={x:o,y:n*o+i};r={x:s,y:n*s+i}}else{if(a){if(a.x<o)return}else a={x:s,y:n*s+i};r={x:o,y:n*o+i}}return t.a=a,t.b=r,!0}function zi(t,e){this.l=t,this.r=e,this.a=this.b=null}function Pi(t,e,r,n){var i=new zi(t,e);return pi.push(i),r&&Ii(i,t,e,r),n&&Ii(i,e,t,n),hi[t.i].edges.push(new Di(i,t,e)),hi[e.i].edges.push(new Di(i,e,t)),i}function Ii(t,e,r,n){t.a||t.b?t.l===r?t.b=n:t.a=n:(t.a=n,t.l=e,t.r=r)}function Di(t,e,r){var n=t.a,i=t.b;this.edge=t,this.site=e,this.angle=r?Math.atan2(r.y-e.y,r.x-e.x):t.l===e?Math.atan2(i.x-n.x,n.y-i.y):Math.atan2(n.x-i.x,i.y-n.y)}function Oi(){this._=null}function Ri(t){t.U=t.C=t.L=t.R=t.P=t.N=null}function Fi(t,e){var r=e,n=e.R,i=r.U;i?i.L===r?i.L=n:i.R=n:t._=n,n.U=i,r.U=n,r.R=n.L,r.R&&(r.R.U=r),n.L=r}function Bi(t,e){var r=e,n=e.L,i=r.U;i?i.L===r?i.L=n:i.R=n:t._=n,n.U=i,r.U=n,r.L=n.R,r.L&&(r.L.U=r),n.R=r}function Ni(t){for(;t.L;)t=t.L;return t}function Ui(t,e){var r,n,i,a=t.sort(ji).pop();for(pi=[],hi=new Array(t.length),fi=new Oi,mi=new Oi;;)if(i=di,a&&(!i||a.y<i.y||a.y===i.y&&a.x<i.x))a.x===r&&a.y===n||(hi[a.i]=new Ai(a),wi(a),r=a.x,n=a.y),a=t.pop();else{if(!i)break;bi(i.arc)}e&&(function(t){for(var e,r=pi,n=nn(t[0][0],t[0][1],t[1][0],t[1][1]),i=r.length;i--;)(!Ei(e=r[i],t)||!n(e)||v(e.a.x-e.b.x)<kt&&v(e.a.y-e.b.y)<kt)&&(e.a=e.b=null,r.splice(i,1))}(e),function(t){for(var e,r,n,i,a,o,s,l,u,c,p=t[0][0],h=t[1][0],f=t[0][1],d=t[1][1],m=hi,y=m.length;y--;)if((a=m[y])&&a.prepare())for(l=(s=a.edges).length,o=0;o<l;)n=(c=s[o].end()).x,i=c.y,e=(u=s[++o%l].start()).x,r=u.y,(v(n-e)>kt||v(i-r)>kt)&&(s.splice(o,0,new Di((g=a.site,_=c,x=v(n-p)<kt&&d-i>kt?{x:p,y:v(e-p)<kt?r:d}:v(i-d)<kt&&h-n>kt?{x:v(r-d)<kt?e:h,y:d}:v(n-h)<kt&&i-f>kt?{x:h,y:v(e-h)<kt?r:f}:v(i-f)<kt&&n-p>kt?{x:v(r-f)<kt?e:p,y:f}:null,b=void 0,b=new zi(g,null),b.a=_,b.b=x,pi.push(b),b),a.site,null)),++l);var g,_,x,b}(e));var o={cells:hi,edges:pi};return fi=mi=pi=hi=null,o}function ji(t,e){return e.y-t.y||e.x-t.x}Ai.prototype.prepare=function(){for(var t,e=this.edges,r=e.length;r--;)(t=e[r].edge).b&&t.a||e.splice(r,1);return e.sort(Mi),e.length},Di.prototype={start:function(){return this.edge.l===this.site?this.edge.a:this.edge.b},end:function(){return this.edge.l===this.site?this.edge.b:this.edge.a}},Oi.prototype={insert:function(t,e){var r,n,i;if(t){if(e.P=t,e.N=t.N,t.N&&(t.N.P=e),t.N=e,t.R){for(t=t.R;t.L;)t=t.L;t.L=e}else t.R=e;r=t}else this._?(t=Ni(this._),e.P=null,e.N=t,t.P=t.L=e,r=t):(e.P=e.N=null,this._=e,r=null);for(e.L=e.R=null,e.U=r,e.C=!0,t=e;r&&r.C;)r===(n=r.U).L?(i=n.R)&&i.C?(r.C=i.C=!1,n.C=!0,t=n):(t===r.R&&(Fi(this,r),r=(t=r).U),r.C=!1,n.C=!0,Bi(this,n)):(i=n.L)&&i.C?(r.C=i.C=!1,n.C=!0,t=n):(t===r.L&&(Bi(this,r),r=(t=r).U),r.C=!1,n.C=!0,Fi(this,n)),r=t.U;this._.C=!1},remove:function(t){t.N&&(t.N.P=t.P),t.P&&(t.P.N=t.N),t.N=t.P=null;var e,r,n,i=t.U,a=t.L,o=t.R;if(r=a?o?Ni(o):a:o,i?i.L===t?i.L=r:i.R=r:this._=r,a&&o?(n=r.C,r.C=t.C,r.L=a,a.U=r,r!==o?(i=r.U,r.U=t.U,t=r.R,i.L=t,r.R=o,o.U=r):(r.U=i,i=r,t=r.R)):(n=t.C,t=r),t&&(t.U=i),!n)if(t&&t.C)t.C=!1;else{do{if(t===this._)break;if(t===i.L){if((e=i.R).C&&(e.C=!1,i.C=!0,Fi(this,i),e=i.R),e.L&&e.L.C||e.R&&e.R.C){e.R&&e.R.C||(e.L.C=!1,e.C=!0,Bi(this,e),e=i.R),e.C=i.C,i.C=e.R.C=!1,Fi(this,i),t=this._;break}}else if((e=i.L).C&&(e.C=!1,i.C=!0,Bi(this,i),e=i.L),e.L&&e.L.C||e.R&&e.R.C){e.L&&e.L.C||(e.R.C=!1,e.C=!0,Fi(this,e),e=i.L),e.C=i.C,i.C=e.L.C=!1,Bi(this,i),t=this._;break}e.C=!0,t=i,i=i.U}while(!t.C);t&&(t.C=!1)}}},t.geom.voronoi=function(t){var e=ni,r=ii,n=e,i=r,a=Vi;if(t)return o(t);function o(t){var e=new Array(t.length),r=a[0][0],n=a[0][1],i=a[1][0],o=a[1][1];return Ui(s(t),a).cells.forEach(function(a,s){var l=a.edges,u=a.site;(e[s]=l.length?l.map(function(t){var e=t.start();return[e.x,e.y]}):u.x>=r&&u.x<=i&&u.y>=n&&u.y<=o?[[r,o],[i,o],[i,n],[r,n]]:[]).point=t[s]}),e}function s(t){return t.map(function(t,e){return{x:Math.round(n(t,e)/kt)*kt,y:Math.round(i(t,e)/kt)*kt,i:e}})}return o.links=function(t){return Ui(s(t)).edges.filter(function(t){return t.l&&t.r}).map(function(e){return{source:t[e.l.i],target:t[e.r.i]}})},o.triangles=function(t){var e=[];return Ui(s(t)).cells.forEach(function(r,n){for(var i,a,o,s,l=r.site,u=r.edges.sort(Mi),c=-1,p=u.length,h=u[p-1].edge,f=h.l===l?h.r:h.l;++c<p;)h,i=f,f=(h=u[c].edge).l===l?h.r:h.l,n<i.i&&n<f.i&&(o=i,s=f,((a=l).x-s.x)*(o.y-a.y)-(a.x-o.x)*(s.y-a.y)<0)&&e.push([t[n],t[i.i],t[f.i]])}),e},o.x=function(t){return arguments.length?(n=ye(e=t),o):e},o.y=function(t){return arguments.length?(i=ye(r=t),o):r},o.clipExtent=function(t){return arguments.length?(a=null==t?Vi:t,o):a===Vi?null:a},o.size=function(t){return arguments.length?o.clipExtent(t&&[[0,0],t]):a===Vi?null:a&&a[1]},o};var Vi=[[-1e6,-1e6],[1e6,1e6]];function qi(t){return t.x}function Gi(t){return t.y}function Hi(e,r){e=t.rgb(e),r=t.rgb(r);var n=e.r,i=e.g,a=e.b,o=r.r-n,s=r.g-i,l=r.b-a;return function(t){return"#"+ue(Math.round(n+o*t))+ue(Math.round(i+s*t))+ue(Math.round(a+l*t))}}function Zi(t,e){var r,n={},i={};for(r in t)r in e?n[r]=Ji(t[r],e[r]):i[r]=t[r];for(r in e)r in t||(i[r]=e[r]);return function(t){for(r in n)i[r]=n[r](t);return i}}function Xi(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}function Wi(t,e){var r,n,i,a=Yi.lastIndex=Ki.lastIndex=0,o=-1,s=[],l=[];for(t+="",e+="";(r=Yi.exec(t))&&(n=Ki.exec(e));)(i=n.index)>a&&(i=e.slice(a,i),s[o]?s[o]+=i:s[++o]=i),(r=r[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,l.push({i:o,x:Xi(r,n)})),a=Ki.lastIndex;return a<e.length&&(i=e.slice(a),s[o]?s[o]+=i:s[++o]=i),s.length<2?l[0]?(e=l[0].x,function(t){return e(t)+""}):function(){return e}:(e=l.length,function(t){for(var r,n=0;n<e;++n)s[(r=l[n]).i]=r.x(t);return s.join("")})}t.geom.delaunay=function(e){return t.geom.voronoi().triangles(e)},t.geom.quadtree=function(t,e,r,n,i){var a,o=ni,s=ii;if(a=arguments.length)return o=qi,s=Gi,3===a&&(i=r,n=e,r=e=0),l(t);function l(t){var l,u,c,p,h,f,d,m,y,g=ye(o),_=ye(s);if(null!=e)f=e,d=r,m=n,y=i;else if(m=y=-(f=d=1/0),u=[],c=[],h=t.length,a)for(p=0;p<h;++p)(l=t[p]).x<f&&(f=l.x),l.y<d&&(d=l.y),l.x>m&&(m=l.x),l.y>y&&(y=l.y),u.push(l.x),c.push(l.y);else for(p=0;p<h;++p){var x=+g(l=t[p],p),b=+_(l,p);x<f&&(f=x),b<d&&(d=b),x>m&&(m=x),b>y&&(y=b),u.push(x),c.push(b)}var w=m-f,k=y-d;function T(t,e,r,n,i,a,o,s){if(!isNaN(r)&&!isNaN(n))if(t.leaf){var l=t.x,u=t.y;if(null!=l)if(v(l-r)+v(u-n)<.01)A(t,e,r,n,i,a,o,s);else{var c=t.point;t.x=t.y=t.point=null,A(t,c,l,u,i,a,o,s),A(t,e,r,n,i,a,o,s)}else t.x=r,t.y=n,t.point=e}else A(t,e,r,n,i,a,o,s)}function A(t,e,r,n,i,a,o,s){var l=.5*(i+o),u=.5*(a+s),c=r>=l,p=n>=u,h=p<<1|c;t.leaf=!1,c?i=l:o=l,p?a=u:s=u,T(t=t.nodes[h]||(t.nodes[h]={leaf:!0,nodes:[],point:null,x:null,y:null}),e,r,n,i,a,o,s)}w>k?y=d+w:m=f+k;var M={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(t){T(M,t,+g(t,++p),+_(t,p),f,d,m,y)}};if(M.visit=function(t){!function t(e,r,n,i,a,o){if(!e(r,n,i,a,o)){var s=.5*(n+a),l=.5*(i+o),u=r.nodes;u[0]&&t(e,u[0],n,i,s,l),u[1]&&t(e,u[1],s,i,a,l),u[2]&&t(e,u[2],n,l,s,o),u[3]&&t(e,u[3],s,l,a,o)}}(t,M,f,d,m,y)},M.find=function(t){return function(t,e,r,n,i,a,o){var s,l=1/0;return function t(u,c,p,h,f){if(!(c>a||p>o||h<n||f<i)){if(d=u.point){var d,m=e-u.x,y=r-u.y,g=m*m+y*y;if(g<l){var v=Math.sqrt(l=g);n=e-v,i=r-v,a=e+v,o=r+v,s=d}}for(var _=u.nodes,x=.5*(c+h),b=.5*(p+f),w=(r>=b)<<1|e>=x,k=w+4;w<k;++w)if(u=_[3&w])switch(3&w){case 0:t(u,c,p,x,b);break;case 1:t(u,x,p,h,b);break;case 2:t(u,c,b,x,f);break;case 3:t(u,x,b,h,f)}}}(t,n,i,a,o),s}(M,t[0],t[1],f,d,m,y)},p=-1,null==e){for(;++p<h;)T(M,t[p],u[p],c[p],f,d,m,y);--p}else t.forEach(M.add);return u=c=t=l=null,M}return l.x=function(t){return arguments.length?(o=t,l):o},l.y=function(t){return arguments.length?(s=t,l):s},l.extent=function(t){return arguments.length?(null==t?e=r=n=i=null:(e=+t[0][0],r=+t[0][1],n=+t[1][0],i=+t[1][1]),l):null==e?null:[[e,r],[n,i]]},l.size=function(t){return arguments.length?(null==t?e=r=n=i=null:(e=r=0,n=+t[0],i=+t[1]),l):null==e?null:[n-e,i-r]},l},t.interpolateRgb=Hi,t.interpolateObject=Zi,t.interpolateNumber=Xi,t.interpolateString=Wi;var Yi=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ki=new RegExp(Yi.source,"g");function Ji(e,r){for(var n,i=t.interpolators.length;--i>=0&&!(n=t.interpolators[i](e,r)););return n}function $i(t,e){var r,n=[],i=[],a=t.length,o=e.length,s=Math.min(t.length,e.length);for(r=0;r<s;++r)n.push(Ji(t[r],e[r]));for(;r<a;++r)i[r]=t[r];for(;r<o;++r)i[r]=e[r];return function(t){for(r=0;r<s;++r)i[r]=n[r](t);return i}}t.interpolate=Ji,t.interpolators=[function(t,e){var r=typeof e;return("string"===r?me.has(e.toLowerCase())||/^(#|rgb\(|hsl\()/i.test(e)?Hi:Wi:e instanceof jt?Hi:Array.isArray(e)?$i:"object"===r&&isNaN(e)?Zi:Xi)(t,e)}],t.interpolateArray=$i;var Qi=function(){return z},ta=t.map({linear:Qi,poly:function(t){return function(e){return Math.pow(e,t)}},quad:function(){return ia},cubic:function(){return aa},sin:function(){return sa},exp:function(){return la},circle:function(){return ua},elastic:function(t,e){var r;arguments.length<2&&(e=.45);arguments.length?r=e/Mt*Math.asin(1/t):(t=1,r=e/4);return function(n){return 1+t*Math.pow(2,-10*n)*Math.sin((n-r)*Mt/e)}},back:function(t){t||(t=1.70158);return function(e){return e*e*((t+1)*e-t)}},bounce:function(){return ca}}),ea=t.map({in:z,out:ra,"in-out":na,"out-in":function(t){return na(ra(t))}});function ra(t){return function(e){return 1-t(1-e)}}function na(t){return function(e){return.5*(e<.5?t(2*e):2-t(2-2*e))}}function ia(t){return t*t}function aa(t){return t*t*t}function oa(t){if(t<=0)return 0;if(t>=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}function sa(t){return 1-Math.cos(t*Lt)}function la(t){return Math.pow(2,10*(t-1))}function ua(t){return 1-Math.sqrt(1-t*t)}function ca(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}function pa(t,e){return e-=t,function(r){return Math.round(t+e*r)}}function ha(t){var e,r,n,i=[t.a,t.b],a=[t.c,t.d],o=da(i),s=fa(i,a),l=da(((e=a)[0]+=(n=-s)*(r=i)[0],e[1]+=n*r[1],e))||0;i[0]*a[1]<a[0]*i[1]&&(i[0]*=-1,i[1]*=-1,o*=-1,s*=-1),this.rotate=(o?Math.atan2(i[1],i[0]):Math.atan2(-a[0],a[1]))*Et,this.translate=[t.e,t.f],this.scale=[o,l],this.skew=l?Math.atan2(s,l)*Et:0}function fa(t,e){return t[0]*e[0]+t[1]*e[1]}function da(t){var e=Math.sqrt(fa(t,t));return e&&(t[0]/=e,t[1]/=e),e}t.ease=function(t){var e,n=t.indexOf("-"),i=n>=0?t.slice(0,n):t,a=n>=0?t.slice(n+1):"in";return i=ta.get(i)||Qi,a=ea.get(a)||z,e=a(i.apply(null,r.call(arguments,1))),function(t){return t<=0?0:t>=1?1:e(t)}},t.interpolateHcl=function(e,r){e=t.hcl(e),r=t.hcl(r);var n=e.h,i=e.c,a=e.l,o=r.h-n,s=r.c-i,l=r.l-a;isNaN(s)&&(s=0,i=isNaN(i)?r.c:i);isNaN(o)?(o=0,n=isNaN(n)?r.h:n):o>180?o-=360:o<-180&&(o+=360);return function(t){return Xt(n+o*t,i+s*t,a+l*t)+""}},t.interpolateHsl=function(e,r){e=t.hsl(e),r=t.hsl(r);var n=e.h,i=e.s,a=e.l,o=r.h-n,s=r.s-i,l=r.l-a;isNaN(s)&&(s=0,i=isNaN(i)?r.s:i);isNaN(o)?(o=0,n=isNaN(n)?r.h:n):o>180?o-=360:o<-180&&(o+=360);return function(t){return Gt(n+o*t,i+s*t,a+l*t)+""}},t.interpolateLab=function(e,r){e=t.lab(e),r=t.lab(r);var n=e.l,i=e.a,a=e.b,o=r.l-n,s=r.a-i,l=r.b-a;return function(t){return te(n+o*t,i+s*t,a+l*t)+""}},t.interpolateRound=pa,t.transform=function(e){var r=i.createElementNS(t.ns.prefix.svg,"g");return(t.transform=function(t){if(null!=t){r.setAttribute("transform",t);var e=r.transform.baseVal.consolidate()}return new ha(e?e.matrix:ma)})(e)},ha.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var ma={a:1,b:0,c:0,d:1,e:0,f:0};function ya(t){return t.length?t.pop()+",":""}function ga(e,r){var n=[],i=[];return e=t.transform(e),r=t.transform(r),function(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var i=r.push("translate(",null,",",null,")");n.push({i:i-4,x:Xi(t[0],e[0])},{i:i-2,x:Xi(t[1],e[1])})}else(e[0]||e[1])&&r.push("translate("+e+")")}(e.translate,r.translate,n,i),function(t,e,r,n){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),n.push({i:r.push(ya(r)+"rotate(",null,")")-2,x:Xi(t,e)})):e&&r.push(ya(r)+"rotate("+e+")")}(e.rotate,r.rotate,n,i),function(t,e,r,n){t!==e?n.push({i:r.push(ya(r)+"skewX(",null,")")-2,x:Xi(t,e)}):e&&r.push(ya(r)+"skewX("+e+")")}(e.skew,r.skew,n,i),function(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var i=r.push(ya(r)+"scale(",null,",",null,")");n.push({i:i-4,x:Xi(t[0],e[0])},{i:i-2,x:Xi(t[1],e[1])})}else 1===e[0]&&1===e[1]||r.push(ya(r)+"scale("+e+")")}(e.scale,r.scale,n,i),e=r=null,function(t){for(var e,r=-1,a=i.length;++r<a;)n[(e=i[r]).i]=e.x(t);return n.join("")}}function va(t,e){return e=(e-=t=+t)||1/e,function(r){return(r-t)/e}}function _a(t,e){return e=(e-=t=+t)||1/e,function(r){return Math.max(0,Math.min(1,(r-t)/e))}}function xa(t){for(var e=t.source,r=t.target,n=function(t,e){if(t===e)return t;var r=ba(t),n=ba(e),i=r.pop(),a=n.pop(),o=null;for(;i===a;)o=i,i=r.pop(),a=n.pop();return o}(e,r),i=[e];e!==n;)e=e.parent,i.push(e);for(var a=i.length;r!==n;)i.splice(a,0,r),r=r.parent;return i}function ba(t){for(var e=[],r=t.parent;null!=r;)e.push(t),t=r,r=r.parent;return e.push(t),e}function wa(t){t.fixed|=2}function ka(t){t.fixed&=-7}function Ta(t){t.fixed|=4,t.px=t.x,t.py=t.y}function Aa(t){t.fixed&=-5}t.interpolateTransform=ga,t.layout={},t.layout.bundle=function(){return function(t){for(var e=[],r=-1,n=t.length;++r<n;)e.push(xa(t[r]));return e}},t.layout.chord=function(){var e,r,n,i,a,o,s,l={},u=0;function c(){var l,c,h,f,d,m={},y=[],g=t.range(i),v=[];for(e=[],r=[],l=0,f=-1;++f<i;){for(c=0,d=-1;++d<i;)c+=n[f][d];y.push(c),v.push(t.range(i)),l+=c}for(a&&g.sort(function(t,e){return a(y[t],y[e])}),o&&v.forEach(function(t,e){t.sort(function(t,r){return o(n[e][t],n[e][r])})}),l=(Mt-u*i)/l,c=0,f=-1;++f<i;){for(h=c,d=-1;++d<i;){var _=g[f],x=v[_][d],b=n[_][x],w=c,k=c+=b*l;m[_+"-"+x]={index:_,subindex:x,startAngle:w,endAngle:k,value:b}}r[_]={index:_,startAngle:h,endAngle:c,value:y[_]},c+=u}for(f=-1;++f<i;)for(d=f-1;++d<i;){var T=m[f+"-"+d],A=m[d+"-"+f];(T.value||A.value)&&e.push(T.value<A.value?{source:A,target:T}:{source:T,target:A})}s&&p()}function p(){e.sort(function(t,e){return s((t.source.value+t.target.value)/2,(e.source.value+e.target.value)/2)})}return l.matrix=function(t){return arguments.length?(i=(n=t)&&n.length,e=r=null,l):n},l.padding=function(t){return arguments.length?(u=t,e=r=null,l):u},l.sortGroups=function(t){return arguments.length?(a=t,e=r=null,l):a},l.sortSubgroups=function(t){return arguments.length?(o=t,e=null,l):o},l.sortChords=function(t){return arguments.length?(s=t,e&&p(),l):s},l.chords=function(){return e||c(),e},l.groups=function(){return r||c(),r},l},t.layout.force=function(){var e,r,n,i,a,o,s={},l=t.dispatch("start","tick","end"),u=[1,1],c=.9,p=Ma,h=Sa,f=-30,d=La,m=.1,y=.64,g=[],v=[];function _(t){return function(e,r,n,i){if(e.point!==t){var a=e.cx-t.x,o=e.cy-t.y,s=i-r,l=a*a+o*o;if(s*s/y<l){if(l<d){var u=e.charge/l;t.px-=a*u,t.py-=o*u}return!0}if(e.point&&l&&l<d){u=e.pointCharge/l;t.px-=a*u,t.py-=o*u}}return!e.charge}}function x(e){e.px=t.event.x,e.py=t.event.y,s.resume()}return s.tick=function(){if((n*=.99)<.005)return e=null,l.end({type:"end",alpha:n=0}),!0;var r,s,p,h,d,y,x,b,w,k=g.length,T=v.length;for(s=0;s<T;++s)h=(p=v[s]).source,(y=(b=(d=p.target).x-h.x)*b+(w=d.y-h.y)*w)&&(b*=y=n*a[s]*((y=Math.sqrt(y))-i[s])/y,w*=y,d.x-=b*(x=h.weight+d.weight?h.weight/(h.weight+d.weight):.5),d.y-=w*x,h.x+=b*(x=1-x),h.y+=w*x);if((x=n*m)&&(b=u[0]/2,w=u[1]/2,s=-1,x))for(;++s<k;)(p=g[s]).x+=(b-p.x)*x,p.y+=(w-p.y)*x;if(f)for(!function t(e,r,n){var i=0,a=0;e.charge=0;if(!e.leaf)for(var o,s=e.nodes,l=s.length,u=-1;++u<l;)null!=(o=s[u])&&(t(o,r,n),e.charge+=o.charge,i+=o.charge*o.cx,a+=o.charge*o.cy);if(e.point){e.leaf||(e.point.x+=Math.random()-.5,e.point.y+=Math.random()-.5);var c=r*n[e.point.index];e.charge+=e.pointCharge=c,i+=c*e.point.x,a+=c*e.point.y}e.cx=i/e.charge;e.cy=a/e.charge}(r=t.geom.quadtree(g),n,o),s=-1;++s<k;)(p=g[s]).fixed||r.visit(_(p));for(s=-1;++s<k;)(p=g[s]).fixed?(p.x=p.px,p.y=p.py):(p.x-=(p.px-(p.px=p.x))*c,p.y-=(p.py-(p.py=p.y))*c);l.tick({type:"tick",alpha:n})},s.nodes=function(t){return arguments.length?(g=t,s):g},s.links=function(t){return arguments.length?(v=t,s):v},s.size=function(t){return arguments.length?(u=t,s):u},s.linkDistance=function(t){return arguments.length?(p="function"==typeof t?t:+t,s):p},s.distance=s.linkDistance,s.linkStrength=function(t){return arguments.length?(h="function"==typeof t?t:+t,s):h},s.friction=function(t){return arguments.length?(c=+t,s):c},s.charge=function(t){return arguments.length?(f="function"==typeof t?t:+t,s):f},s.chargeDistance=function(t){return arguments.length?(d=t*t,s):Math.sqrt(d)},s.gravity=function(t){return arguments.length?(m=+t,s):m},s.theta=function(t){return arguments.length?(y=t*t,s):Math.sqrt(y)},s.alpha=function(t){return arguments.length?(t=+t,n?t>0?n=t:(e.c=null,e.t=NaN,e=null,l.end({type:"end",alpha:n=0})):t>0&&(l.start({type:"start",alpha:n=t}),e=Te(s.tick)),s):n},s.start=function(){var t,e,r,n=g.length,l=v.length,c=u[0],d=u[1];for(t=0;t<n;++t)(r=g[t]).index=t,r.weight=0;for(t=0;t<l;++t)"number"==typeof(r=v[t]).source&&(r.source=g[r.source]),"number"==typeof r.target&&(r.target=g[r.target]),++r.source.weight,++r.target.weight;for(t=0;t<n;++t)r=g[t],isNaN(r.x)&&(r.x=m("x",c)),isNaN(r.y)&&(r.y=m("y",d)),isNaN(r.px)&&(r.px=r.x),isNaN(r.py)&&(r.py=r.y);if(i=[],"function"==typeof p)for(t=0;t<l;++t)i[t]=+p.call(this,v[t],t);else for(t=0;t<l;++t)i[t]=p;if(a=[],"function"==typeof h)for(t=0;t<l;++t)a[t]=+h.call(this,v[t],t);else for(t=0;t<l;++t)a[t]=h;if(o=[],"function"==typeof f)for(t=0;t<n;++t)o[t]=+f.call(this,g[t],t);else for(t=0;t<n;++t)o[t]=f;function m(r,i){if(!e){for(e=new Array(n),u=0;u<n;++u)e[u]=[];for(u=0;u<l;++u){var a=v[u];e[a.source.index].push(a.target),e[a.target.index].push(a.source)}}for(var o,s=e[t],u=-1,c=s.length;++u<c;)if(!isNaN(o=s[u][r]))return o;return Math.random()*i}return s.resume()},s.resume=function(){return s.alpha(.1)},s.stop=function(){return s.alpha(0)},s.drag=function(){if(r||(r=t.behavior.drag().origin(z).on("dragstart.force",wa).on("drag.force",x).on("dragend.force",ka)),!arguments.length)return r;this.on("mouseover.force",Ta).on("mouseout.force",Aa).call(r)},t.rebind(s,l,"on")};var Ma=20,Sa=1,La=1/0;function Ca(e,r){return t.rebind(e,r,"sort","children","value"),e.nodes=e,e.links=Oa,e}function Ea(t,e){for(var r=[t];null!=(t=r.pop());)if(e(t),(i=t.children)&&(n=i.length))for(var n,i;--n>=0;)r.push(i[n])}function za(t,e){for(var r=[t],n=[];null!=(t=r.pop());)if(n.push(t),(a=t.children)&&(i=a.length))for(var i,a,o=-1;++o<i;)r.push(a[o]);for(;null!=(t=n.pop());)e(t)}function Pa(t){return t.children}function Ia(t){return t.value}function Da(t,e){return e.value-t.value}function Oa(e){return t.merge(e.map(function(t){return(t.children||[]).map(function(e){return{source:t,target:e}})}))}t.layout.hierarchy=function(){var t=Da,e=Pa,r=Ia;function n(i){var a,o=[i],s=[];for(i.depth=0;null!=(a=o.pop());)if(s.push(a),(u=e.call(n,a,a.depth))&&(l=u.length)){for(var l,u,c;--l>=0;)o.push(c=u[l]),c.parent=a,c.depth=a.depth+1;r&&(a.value=0),a.children=u}else r&&(a.value=+r.call(n,a,a.depth)||0),delete a.children;return za(i,function(e){var n,i;t&&(n=e.children)&&n.sort(t),r&&(i=e.parent)&&(i.value+=e.value)}),s}return n.sort=function(e){return arguments.length?(t=e,n):t},n.children=function(t){return arguments.length?(e=t,n):e},n.value=function(t){return arguments.length?(r=t,n):r},n.revalue=function(t){return r&&(Ea(t,function(t){t.children&&(t.value=0)}),za(t,function(t){var e;t.children||(t.value=+r.call(n,t,t.depth)||0),(e=t.parent)&&(e.value+=t.value)})),t},n},t.layout.partition=function(){var e=t.layout.hierarchy(),r=[1,1];function n(t,n){var i=e.call(this,t,n);return function t(e,r,n,i){var a=e.children;if(e.x=r,e.y=e.depth*i,e.dx=n,e.dy=i,a&&(o=a.length)){var o,s,l,u=-1;for(n=e.value?n/e.value:0;++u<o;)t(s=a[u],r,l=s.value*n,i),r+=l}}(i[0],0,r[0],r[1]/function t(e){var r=e.children,n=0;if(r&&(i=r.length))for(var i,a=-1;++a<i;)n=Math.max(n,t(r[a]));return 1+n}(i[0])),i}return n.size=function(t){return arguments.length?(r=t,n):r},Ca(n,e)},t.layout.pie=function(){var e=Number,r=Ra,n=0,i=Mt,a=0;function o(s){var l,u=s.length,c=s.map(function(t,r){return+e.call(o,t,r)}),p=+("function"==typeof n?n.apply(this,arguments):n),h=("function"==typeof i?i.apply(this,arguments):i)-p,f=Math.min(Math.abs(h)/u,+("function"==typeof a?a.apply(this,arguments):a)),d=f*(h<0?-1:1),m=t.sum(c),y=m?(h-u*d)/m:0,g=t.range(u),v=[];return null!=r&&g.sort(r===Ra?function(t,e){return c[e]-c[t]}:function(t,e){return r(s[t],s[e])}),g.forEach(function(t){v[t]={data:s[t],value:l=c[t],startAngle:p,endAngle:p+=l*y+d,padAngle:f}}),v}return o.value=function(t){return arguments.length?(e=t,o):e},o.sort=function(t){return arguments.length?(r=t,o):r},o.startAngle=function(t){return arguments.length?(n=t,o):n},o.endAngle=function(t){return arguments.length?(i=t,o):i},o.padAngle=function(t){return arguments.length?(a=t,o):a},o};var Ra={};function Fa(t){return t.x}function Ba(t){return t.y}function Na(t,e,r){t.y0=e,t.y=r}t.layout.stack=function(){var e=z,r=Va,n=qa,i=Na,a=Fa,o=Ba;function s(l,u){if(!(f=l.length))return l;var c=l.map(function(t,r){return e.call(s,t,r)}),p=c.map(function(t){return t.map(function(t,e){return[a.call(s,t,e),o.call(s,t,e)]})}),h=r.call(s,p,u);c=t.permute(c,h),p=t.permute(p,h);var f,d,m,y,g=n.call(s,p,u),v=c[0].length;for(m=0;m<v;++m)for(i.call(s,c[0][m],y=g[m],p[0][m][1]),d=1;d<f;++d)i.call(s,c[d][m],y+=p[d-1][m][1],p[d][m][1]);return l}return s.values=function(t){return arguments.length?(e=t,s):e},s.order=function(t){return arguments.length?(r="function"==typeof t?t:Ua.get(t)||Va,s):r},s.offset=function(t){return arguments.length?(n="function"==typeof t?t:ja.get(t)||qa,s):n},s.x=function(t){return arguments.length?(a=t,s):a},s.y=function(t){return arguments.length?(o=t,s):o},s.out=function(t){return arguments.length?(i=t,s):i},s};var Ua=t.map({"inside-out":function(e){var r,n,i=e.length,a=e.map(Ga),o=e.map(Ha),s=t.range(i).sort(function(t,e){return a[t]-a[e]}),l=0,u=0,c=[],p=[];for(r=0;r<i;++r)n=s[r],l<u?(l+=o[n],c.push(n)):(u+=o[n],p.push(n));return p.reverse().concat(c)},reverse:function(e){return t.range(e.length).reverse()},default:Va}),ja=t.map({silhouette:function(t){var e,r,n,i=t.length,a=t[0].length,o=[],s=0,l=[];for(r=0;r<a;++r){for(e=0,n=0;e<i;e++)n+=t[e][r][1];n>s&&(s=n),o.push(n)}for(r=0;r<a;++r)l[r]=(s-o[r])/2;return l},wiggle:function(t){var e,r,n,i,a,o,s,l,u,c=t.length,p=t[0],h=p.length,f=[];for(f[0]=l=u=0,r=1;r<h;++r){for(e=0,i=0;e<c;++e)i+=t[e][r][1];for(e=0,a=0,s=p[r][0]-p[r-1][0];e<c;++e){for(n=0,o=(t[e][r][1]-t[e][r-1][1])/(2*s);n<e;++n)o+=(t[n][r][1]-t[n][r-1][1])/s;a+=o*t[e][r][1]}f[r]=l-=i?a/i*s:0,l<u&&(u=l)}for(r=0;r<h;++r)f[r]-=u;return f},expand:function(t){var e,r,n,i=t.length,a=t[0].length,o=1/i,s=[];for(r=0;r<a;++r){for(e=0,n=0;e<i;e++)n+=t[e][r][1];if(n)for(e=0;e<i;e++)t[e][r][1]/=n;else for(e=0;e<i;e++)t[e][r][1]=o}for(r=0;r<a;++r)s[r]=0;return s},zero:qa});function Va(e){return t.range(e.length)}function qa(t){for(var e=-1,r=t[0].length,n=[];++e<r;)n[e]=0;return n}function Ga(t){for(var e,r=1,n=0,i=t[0][1],a=t.length;r<a;++r)(e=t[r][1])>i&&(n=r,i=e);return n}function Ha(t){return t.reduce(Za,0)}function Za(t,e){return t+e[1]}function Xa(t,e){return Wa(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function Wa(t,e){for(var r=-1,n=+t[0],i=(t[1]-n)/e,a=[];++r<=e;)a[r]=i*r+n;return a}function Ya(e){return[t.min(e),t.max(e)]}function Ka(t,e){return t.value-e.value}function Ja(t,e){var r=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=r,r._pack_prev=e}function $a(t,e){t._pack_next=e,e._pack_prev=t}function Qa(t,e){var r=e.x-t.x,n=e.y-t.y,i=t.r+e.r;return.999*i*i>r*r+n*n}function to(t){if((e=t.children)&&(l=e.length)){var e,r,n,i,a,o,s,l,u=1/0,c=-1/0,p=1/0,h=-1/0;if(e.forEach(eo),(r=e[0]).x=-r.r,r.y=0,_(r),l>1&&((n=e[1]).x=n.r,n.y=0,_(n),l>2))for(no(r,n,i=e[2]),_(i),Ja(r,i),r._pack_prev=i,Ja(i,n),n=r._pack_next,a=3;a<l;a++){no(r,n,i=e[a]);var f=0,d=1,m=1;for(o=n._pack_next;o!==n;o=o._pack_next,d++)if(Qa(o,i)){f=1;break}if(1==f)for(s=r._pack_prev;s!==o._pack_prev&&!Qa(s,i);s=s._pack_prev,m++);f?(d<m||d==m&&n.r<r.r?$a(r,n=o):$a(r=s,n),a--):(Ja(r,i),n=i,_(i))}var y=(u+c)/2,g=(p+h)/2,v=0;for(a=0;a<l;a++)(i=e[a]).x-=y,i.y-=g,v=Math.max(v,i.r+Math.sqrt(i.x*i.x+i.y*i.y));t.r=v,e.forEach(ro)}function _(t){u=Math.min(t.x-t.r,u),c=Math.max(t.x+t.r,c),p=Math.min(t.y-t.r,p),h=Math.max(t.y+t.r,h)}}function eo(t){t._pack_next=t._pack_prev=t}function ro(t){delete t._pack_next,delete t._pack_prev}function no(t,e,r){var n=t.r+r.r,i=e.x-t.x,a=e.y-t.y;if(n&&(i||a)){var o=e.r+r.r,s=i*i+a*a,l=.5+((n*=n)-(o*=o))/(2*s),u=Math.sqrt(Math.max(0,2*o*(n+s)-(n-=s)*n-o*o))/(2*s);r.x=t.x+l*i+u*a,r.y=t.y+l*a-u*i}else r.x=t.x+n,r.y=t.y}function io(t,e){return t.parent==e.parent?1:2}function ao(t){var e=t.children;return e.length?e[0]:t.t}function oo(t){var e,r=t.children;return(e=r.length)?r[e-1]:t.t}function so(t,e,r){var n=r/(e.i-t.i);e.c-=n,e.s+=r,t.c+=n,e.z+=r,e.m+=r}function lo(t,e,r){return t.a.parent===e.parent?t.a:r}function uo(t){return{x:t.x,y:t.y,dx:t.dx,dy:t.dy}}function co(t,e){var r=t.x+e[3],n=t.y+e[0],i=t.dx-e[1]-e[3],a=t.dy-e[0]-e[2];return i<0&&(r+=i/2,i=0),a<0&&(n+=a/2,a=0),{x:r,y:n,dx:i,dy:a}}function po(t){var e=t[0],r=t[t.length-1];return e<r?[e,r]:[r,e]}function ho(t){return t.rangeExtent?t.rangeExtent():po(t.range())}function fo(t,e,r,n){var i=r(t[0],t[1]),a=n(e[0],e[1]);return function(t){return a(i(t))}}function mo(t,e){var r,n=0,i=t.length-1,a=t[n],o=t[i];return o<a&&(r=n,n=i,i=r,r=a,a=o,o=r),t[n]=e.floor(a),t[i]=e.ceil(o),t}function yo(t){return t?{floor:function(e){return Math.floor(e/t)*t},ceil:function(e){return Math.ceil(e/t)*t}}:go}t.layout.histogram=function(){var e=!0,r=Number,n=Ya,i=Xa;function a(a,o){for(var s,l,u=[],c=a.map(r,this),p=n.call(this,c,o),h=i.call(this,p,c,o),f=(o=-1,c.length),d=h.length-1,m=e?1:1/f;++o<d;)(s=u[o]=[]).dx=h[o+1]-(s.x=h[o]),s.y=0;if(d>0)for(o=-1;++o<f;)(l=c[o])>=p[0]&&l<=p[1]&&((s=u[t.bisect(h,l,1,d)-1]).y+=m,s.push(a[o]));return u}return a.value=function(t){return arguments.length?(r=t,a):r},a.range=function(t){return arguments.length?(n=ye(t),a):n},a.bins=function(t){return arguments.length?(i="number"==typeof t?function(e){return Wa(e,t)}:ye(t),a):i},a.frequency=function(t){return arguments.length?(e=!!t,a):e},a},t.layout.pack=function(){var e,r=t.layout.hierarchy().sort(Ka),n=0,i=[1,1];function a(t,a){var o=r.call(this,t,a),s=o[0],l=i[0],u=i[1],c=null==e?Math.sqrt:"function"==typeof e?e:function(){return e};if(s.x=s.y=0,za(s,function(t){t.r=+c(t.value)}),za(s,to),n){var p=n*(e?1:Math.max(2*s.r/l,2*s.r/u))/2;za(s,function(t){t.r+=p}),za(s,to),za(s,function(t){t.r-=p})}return function t(e,r,n,i){var a=e.children;e.x=r+=i*e.x;e.y=n+=i*e.y;e.r*=i;if(a)for(var o=-1,s=a.length;++o<s;)t(a[o],r,n,i)}(s,l/2,u/2,e?1:1/Math.max(2*s.r/l,2*s.r/u)),o}return a.size=function(t){return arguments.length?(i=t,a):i},a.radius=function(t){return arguments.length?(e=null==t||"function"==typeof t?t:+t,a):e},a.padding=function(t){return arguments.length?(n=+t,a):n},Ca(a,r)},t.layout.tree=function(){var e=t.layout.hierarchy().sort(null).value(null),r=io,n=[1,1],i=null;function a(t,a){var u=e.call(this,t,a),c=u[0],p=function(t){var e,r={A:null,children:[t]},n=[r];for(;null!=(e=n.pop());)for(var i,a=e.children,o=0,s=a.length;o<s;++o)n.push((a[o]=i={_:a[o],parent:e,children:(i=a[o].children)&&i.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:o}).a=i);return r.children[0]}(c);if(za(p,o),p.parent.m=-p.z,Ea(p,s),i)Ea(c,l);else{var h=c,f=c,d=c;Ea(c,function(t){t.x<h.x&&(h=t),t.x>f.x&&(f=t),t.depth>d.depth&&(d=t)});var m=r(h,f)/2-h.x,y=n[0]/(f.x+r(f,h)/2+m),g=n[1]/(d.depth||1);Ea(c,function(t){t.x=(t.x+m)*y,t.y=t.depth*g})}return u}function o(t){var e=t.children,n=t.parent.children,i=t.i?n[t.i-1]:null;if(e.length){!function(t){var e,r=0,n=0,i=t.children,a=i.length;for(;--a>=0;)(e=i[a]).z+=r,e.m+=r,r+=e.s+(n+=e.c)}(t);var a=(e[0].z+e[e.length-1].z)/2;i?(t.z=i.z+r(t._,i._),t.m=t.z-a):t.z=a}else i&&(t.z=i.z+r(t._,i._));t.parent.A=function(t,e,n){if(e){for(var i,a=t,o=t,s=e,l=a.parent.children[0],u=a.m,c=o.m,p=s.m,h=l.m;s=oo(s),a=ao(a),s&&a;)l=ao(l),(o=oo(o)).a=t,(i=s.z+p-a.z-u+r(s._,a._))>0&&(so(lo(s,t,n),t,i),u+=i,c+=i),p+=s.m,u+=a.m,h+=l.m,c+=o.m;s&&!oo(o)&&(o.t=s,o.m+=p-c),a&&!ao(l)&&(l.t=a,l.m+=u-h,n=t)}return n}(t,i,t.parent.A||n[0])}function s(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function l(t){t.x*=n[0],t.y=t.depth*n[1]}return a.separation=function(t){return arguments.length?(r=t,a):r},a.size=function(t){return arguments.length?(i=null==(n=t)?l:null,a):i?null:n},a.nodeSize=function(t){return arguments.length?(i=null==(n=t)?null:l,a):i?n:null},Ca(a,e)},t.layout.cluster=function(){var e=t.layout.hierarchy().sort(null).value(null),r=io,n=[1,1],i=!1;function a(a,o){var s,l=e.call(this,a,o),u=l[0],c=0;za(u,function(e){var n=e.children;n&&n.length?(e.x=function(t){return t.reduce(function(t,e){return t+e.x},0)/t.length}(n),e.y=function(e){return 1+t.max(e,function(t){return t.y})}(n)):(e.x=s?c+=r(e,s):0,e.y=0,s=e)});var p=function t(e){var r=e.children;return r&&r.length?t(r[0]):e}(u),h=function t(e){var r,n=e.children;return n&&(r=n.length)?t(n[r-1]):e}(u),f=p.x-r(p,h)/2,d=h.x+r(h,p)/2;return za(u,i?function(t){t.x=(t.x-u.x)*n[0],t.y=(u.y-t.y)*n[1]}:function(t){t.x=(t.x-f)/(d-f)*n[0],t.y=(1-(u.y?t.y/u.y:1))*n[1]}),l}return a.separation=function(t){return arguments.length?(r=t,a):r},a.size=function(t){return arguments.length?(i=null==(n=t),a):i?null:n},a.nodeSize=function(t){return arguments.length?(i=null!=(n=t),a):i?n:null},Ca(a,e)},t.layout.treemap=function(){var e,r=t.layout.hierarchy(),n=Math.round,i=[1,1],a=null,o=uo,s=!1,l="squarify",u=.5*(1+Math.sqrt(5));function c(t,e){for(var r,n,i=-1,a=t.length;++i<a;)n=(r=t[i]).value*(e<0?0:e),r.area=isNaN(n)||n<=0?0:n}function p(t){var e=t.children;if(e&&e.length){var r,n,i,a=o(t),s=[],u=e.slice(),h=1/0,m="slice"===l?a.dx:"dice"===l?a.dy:"slice-dice"===l?1&t.depth?a.dy:a.dx:Math.min(a.dx,a.dy);for(c(u,a.dx*a.dy/t.value),s.area=0;(i=u.length)>0;)s.push(r=u[i-1]),s.area+=r.area,"squarify"!==l||(n=f(s,m))<=h?(u.pop(),h=n):(s.area-=s.pop().area,d(s,m,a,!1),m=Math.min(a.dx,a.dy),s.length=s.area=0,h=1/0);s.length&&(d(s,m,a,!0),s.length=s.area=0),e.forEach(p)}}function h(t){var e=t.children;if(e&&e.length){var r,n=o(t),i=e.slice(),a=[];for(c(i,n.dx*n.dy/t.value),a.area=0;r=i.pop();)a.push(r),a.area+=r.area,null!=r.z&&(d(a,r.z?n.dx:n.dy,n,!i.length),a.length=a.area=0);e.forEach(h)}}function f(t,e){for(var r,n=t.area,i=0,a=1/0,o=-1,s=t.length;++o<s;)(r=t[o].area)&&(r<a&&(a=r),r>i&&(i=r));return e*=e,(n*=n)?Math.max(e*i*u/n,n/(e*a*u)):1/0}function d(t,e,r,i){var a,o=-1,s=t.length,l=r.x,u=r.y,c=e?n(t.area/e):0;if(e==r.dx){for((i||c>r.dy)&&(c=r.dy);++o<s;)(a=t[o]).x=l,a.y=u,a.dy=c,l+=a.dx=Math.min(r.x+r.dx-l,c?n(a.area/c):0);a.z=!0,a.dx+=r.x+r.dx-l,r.y+=c,r.dy-=c}else{for((i||c>r.dx)&&(c=r.dx);++o<s;)(a=t[o]).x=l,a.y=u,a.dx=c,u+=a.dy=Math.min(r.y+r.dy-u,c?n(a.area/c):0);a.z=!1,a.dy+=r.y+r.dy-u,r.x+=c,r.dx-=c}}function m(t){var n=e||r(t),a=n[0];return a.x=a.y=0,a.value?(a.dx=i[0],a.dy=i[1]):a.dx=a.dy=0,e&&r.revalue(a),c([a],a.dx*a.dy/a.value),(e?h:p)(a),s&&(e=n),n}return m.size=function(t){return arguments.length?(i=t,m):i},m.padding=function(t){if(!arguments.length)return a;function e(e){return co(e,t)}var r;return o=null==(a=t)?uo:"function"==(r=typeof t)?function(e){var r=t.call(m,e,e.depth);return null==r?uo(e):co(e,"number"==typeof r?[r,r,r,r]:r)}:"number"===r?(t=[t,t,t,t],e):e,m},m.round=function(t){return arguments.length?(n=t?Math.round:Number,m):n!=Number},m.sticky=function(t){return arguments.length?(s=t,e=null,m):s},m.ratio=function(t){return arguments.length?(u=t,m):u},m.mode=function(t){return arguments.length?(l=t+"",m):l},Ca(m,r)},t.random={normal:function(t,e){var r=arguments.length;return r<2&&(e=1),r<1&&(t=0),function(){var r,n,i;do{i=(r=2*Math.random()-1)*r+(n=2*Math.random()-1)*n}while(!i||i>1);return t+e*r*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var e=t.random.normal.apply(t,arguments);return function(){return Math.exp(e())}},bates:function(e){var r=t.random.irwinHall(e);return function(){return r()/e}},irwinHall:function(t){return function(){for(var e=0,r=0;r<t;r++)e+=Math.random();return e}}},t.scale={};var go={floor:z,ceil:z};function vo(e,r,n,i){var a=[],o=[],s=0,l=Math.min(e.length,r.length)-1;for(e[l]<e[0]&&(e=e.slice().reverse(),r=r.slice().reverse());++s<=l;)a.push(n(e[s-1],e[s])),o.push(i(r[s-1],r[s]));return function(r){var n=t.bisect(e,r,1,l)-1;return o[n](a[n](r))}}function _o(e,r){return t.rebind(e,r,"range","rangeRound","interpolate","clamp")}function xo(t,e){return mo(t,yo(bo(t,e)[2])),mo(t,yo(bo(t,e)[2])),t}function bo(t,e){null==e&&(e=10);var r=po(t),n=r[1]-r[0],i=Math.pow(10,Math.floor(Math.log(n/e)/Math.LN10)),a=e/n*i;return a<=.15?i*=10:a<=.35?i*=5:a<=.75&&(i*=2),r[0]=Math.ceil(r[0]/i)*i,r[1]=Math.floor(r[1]/i)*i+.5*i,r[2]=i,r}function wo(e,r){return t.range.apply(t,bo(e,r))}function ko(e,r,n){var i=bo(e,r);if(n){var a=ze.exec(n);if(a.shift(),"s"===a[8]){var o=t.formatPrefix(Math.max(v(i[0]),v(i[1])));return a[7]||(a[7]="."+Ao(o.scale(i[2]))),a[8]="f",n=t.format(a.join("")),function(t){return n(o.scale(t))+o.symbol}}a[7]||(a[7]="."+function(t,e){var r=Ao(e[2]);return t in To?Math.abs(r-Ao(Math.max(v(e[0]),v(e[1]))))+ +("e"!==t):r-2*("%"===t)}(a[8],i)),n=a.join("")}else n=",."+Ao(i[2])+"f";return t.format(n)}t.scale.linear=function(){return function t(e,r,n,i){var a,o;function s(){var t=Math.min(e.length,r.length)>2?vo:fo,s=i?_a:va;return a=t(e,r,s,n),o=t(r,e,s,Ji),l}function l(t){return a(t)}l.invert=function(t){return o(t)};l.domain=function(t){return arguments.length?(e=t.map(Number),s()):e};l.range=function(t){return arguments.length?(r=t,s()):r};l.rangeRound=function(t){return l.range(t).interpolate(pa)};l.clamp=function(t){return arguments.length?(i=t,s()):i};l.interpolate=function(t){return arguments.length?(n=t,s()):n};l.ticks=function(t){return wo(e,t)};l.tickFormat=function(t,r){return ko(e,t,r)};l.nice=function(t){return xo(e,t),s()};l.copy=function(){return t(e,r,n,i)};return s()}([0,1],[0,1],Ji,!1)};var To={s:1,g:1,p:1,r:1,e:1};function Ao(t){return-Math.floor(Math.log(t)/Math.LN10+.01)}t.scale.log=function(){return function e(r,n,i,a){function o(t){return(i?Math.log(t<0?0:t):-Math.log(t>0?0:-t))/Math.log(n)}function s(t){return i?Math.pow(n,t):-Math.pow(n,-t)}function l(t){return r(o(t))}l.invert=function(t){return s(r.invert(t))};l.domain=function(t){return arguments.length?(i=t[0]>=0,r.domain((a=t.map(Number)).map(o)),l):a};l.base=function(t){return arguments.length?(n=+t,r.domain(a.map(o)),l):n};l.nice=function(){var t=mo(a.map(o),i?Math:So);return r.domain(t),a=t.map(s),l};l.ticks=function(){var t=po(a),e=[],r=t[0],l=t[1],u=Math.floor(o(r)),c=Math.ceil(o(l)),p=n%1?2:n;if(isFinite(c-u)){if(i){for(;u<c;u++)for(var h=1;h<p;h++)e.push(s(u)*h);e.push(s(u))}else for(e.push(s(u));u++<c;)for(var h=p-1;h>0;h--)e.push(s(u)*h);for(u=0;e[u]<r;u++);for(c=e.length;e[c-1]>l;c--);e=e.slice(u,c)}return e};l.tickFormat=function(e,r){if(!arguments.length)return Mo;arguments.length<2?r=Mo:"function"!=typeof r&&(r=t.format(r));var i=Math.max(1,n*e/l.ticks().length);return function(t){var e=t/s(Math.round(o(t)));return e*n<n-.5&&(e*=n),e<=i?r(t):""}};l.copy=function(){return e(r.copy(),n,i,a)};return _o(l,r)}(t.scale.linear().domain([0,1]),10,!0,[1,10])};var Mo=t.format(".0e"),So={floor:function(t){return-Math.ceil(-t)},ceil:function(t){return-Math.floor(-t)}};function Lo(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}t.scale.pow=function(){return function t(e,r,n){var i=Lo(r),a=Lo(1/r);function o(t){return e(i(t))}o.invert=function(t){return a(e.invert(t))};o.domain=function(t){return arguments.length?(e.domain((n=t.map(Number)).map(i)),o):n};o.ticks=function(t){return wo(n,t)};o.tickFormat=function(t,e){return ko(n,t,e)};o.nice=function(t){return o.domain(xo(n,t))};o.exponent=function(t){return arguments.length?(i=Lo(r=t),a=Lo(1/r),e.domain(n.map(i)),o):r};o.copy=function(){return t(e.copy(),r,n)};return _o(o,e)}(t.scale.linear(),1,[0,1])},t.scale.sqrt=function(){return t.scale.pow().exponent(.5)},t.scale.ordinal=function(){return function e(r,n){var i,a,o;function s(t){return a[((i.get(t)||("range"===n.t?i.set(t,r.push(t)):NaN))-1)%a.length]}function l(e,n){return t.range(r.length).map(function(t){return e+n*t})}s.domain=function(t){if(!arguments.length)return r;r=[],i=new x;for(var e,a=-1,o=t.length;++a<o;)i.has(e=t[a])||i.set(e,r.push(e));return s[n.t].apply(s,n.a)};s.range=function(t){return arguments.length?(a=t,o=0,n={t:"range",a:arguments},s):a};s.rangePoints=function(t,e){arguments.length<2&&(e=0);var i=t[0],u=t[1],c=r.length<2?(i=(i+u)/2,0):(u-i)/(r.length-1+e);return a=l(i+c*e/2,c),o=0,n={t:"rangePoints",a:arguments},s};s.rangeRoundPoints=function(t,e){arguments.length<2&&(e=0);var i=t[0],u=t[1],c=r.length<2?(i=u=Math.round((i+u)/2),0):(u-i)/(r.length-1+e)|0;return a=l(i+Math.round(c*e/2+(u-i-(r.length-1+e)*c)/2),c),o=0,n={t:"rangeRoundPoints",a:arguments},s};s.rangeBands=function(t,e,i){arguments.length<2&&(e=0),arguments.length<3&&(i=e);var u=t[1]<t[0],c=t[u-0],p=t[1-u],h=(p-c)/(r.length-e+2*i);return a=l(c+h*i,h),u&&a.reverse(),o=h*(1-e),n={t:"rangeBands",a:arguments},s};s.rangeRoundBands=function(t,e,i){arguments.length<2&&(e=0),arguments.length<3&&(i=e);var u=t[1]<t[0],c=t[u-0],p=t[1-u],h=Math.floor((p-c)/(r.length-e+2*i));return a=l(c+Math.round((p-c-(r.length-e)*h)/2),h),u&&a.reverse(),o=Math.round(h*(1-e)),n={t:"rangeRoundBands",a:arguments},s};s.rangeBand=function(){return o};s.rangeExtent=function(){return po(n.a[0])};s.copy=function(){return e(r,n)};return s.domain(r)}([],{t:"range",a:[[]]})},t.scale.category10=function(){return t.scale.ordinal().range(Co)},t.scale.category20=function(){return t.scale.ordinal().range(Eo)},t.scale.category20b=function(){return t.scale.ordinal().range(zo)},t.scale.category20c=function(){return t.scale.ordinal().range(Po)};var Co=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(se),Eo=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(se),zo=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(se),Po=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(se);function Io(){return 0}t.scale.quantile=function(){return function e(r,n){var i;function a(){var e=0,a=n.length;for(i=[];++e<a;)i[e-1]=t.quantile(r,e/a);return o}function o(e){if(!isNaN(e=+e))return n[t.bisect(i,e)]}o.domain=function(t){return arguments.length?(r=t.map(f).filter(d).sort(h),a()):r};o.range=function(t){return arguments.length?(n=t,a()):n};o.quantiles=function(){return i};o.invertExtent=function(t){return(t=n.indexOf(t))<0?[NaN,NaN]:[t>0?i[t-1]:r[0],t<i.length?i[t]:r[r.length-1]]};o.copy=function(){return e(r,n)};return a()}([],[])},t.scale.quantize=function(){return function t(e,r,n){var i,a;function o(t){return n[Math.max(0,Math.min(a,Math.floor(i*(t-e))))]}function s(){return i=n.length/(r-e),a=n.length-1,o}o.domain=function(t){return arguments.length?(e=+t[0],r=+t[t.length-1],s()):[e,r]};o.range=function(t){return arguments.length?(n=t,s()):n};o.invertExtent=function(t){return[t=(t=n.indexOf(t))<0?NaN:t/i+e,t+1/i]};o.copy=function(){return t(e,r,n)};return s()}(0,1,[0,1])},t.scale.threshold=function(){return function e(r,n){function i(e){if(e<=e)return n[t.bisect(r,e)]}i.domain=function(t){return arguments.length?(r=t,i):r};i.range=function(t){return arguments.length?(n=t,i):n};i.invertExtent=function(t){return t=n.indexOf(t),[r[t-1],r[t]]};i.copy=function(){return e(r,n)};return i}([.5],[0,1])},t.scale.identity=function(){return function t(e){function r(t){return+t}r.invert=r;r.domain=r.range=function(t){return arguments.length?(e=t.map(r),r):e};r.ticks=function(t){return wo(e,t)};r.tickFormat=function(t,r){return ko(e,t,r)};r.copy=function(){return t(e)};return r}([0,1])},t.svg={},t.svg.arc=function(){var t=Oo,e=Ro,r=Io,n=Do,i=Fo,a=Bo,o=No;function s(){var s=Math.max(0,+t.apply(this,arguments)),u=Math.max(0,+e.apply(this,arguments)),c=i.apply(this,arguments)-Lt,p=a.apply(this,arguments)-Lt,h=Math.abs(p-c),f=c>p?0:1;if(u<s&&(d=u,u=s,s=d),h>=St)return l(u,f)+(s?l(s,1-f):"")+"Z";var d,m,y,g,v,_,x,b,w,k,T,A,M=0,S=0,L=[];if((g=(+o.apply(this,arguments)||0)/2)&&(y=n===Do?Math.sqrt(s*s+u*u):+n.apply(this,arguments),f||(S*=-1),u&&(S=Dt(y/u*Math.sin(g))),s&&(M=Dt(y/s*Math.sin(g)))),u){v=u*Math.cos(c+S),_=u*Math.sin(c+S),x=u*Math.cos(p-S),b=u*Math.sin(p-S);var C=Math.abs(p-c-2*S)<=At?0:1;if(S&&Uo(v,_,x,b)===f^C){var E=(c+p)/2;v=u*Math.cos(E),_=u*Math.sin(E),x=b=null}}else v=_=0;if(s){w=s*Math.cos(p-M),k=s*Math.sin(p-M),T=s*Math.cos(c+M),A=s*Math.sin(c+M);var z=Math.abs(c-p+2*M)<=At?0:1;if(M&&Uo(w,k,T,A)===1-f^z){var P=(c+p)/2;w=s*Math.cos(P),k=s*Math.sin(P),T=A=null}}else w=k=0;if(h>kt&&(d=Math.min(Math.abs(u-s)/2,+r.apply(this,arguments)))>.001){m=s<u^f?0:1;var I=d,D=d;if(h<At){var O=null==T?[w,k]:null==x?[v,_]:ui([v,_],[T,A],[x,b],[w,k]),R=v-O[0],F=_-O[1],B=x-O[0],N=b-O[1],U=1/Math.sin(Math.acos((R*B+F*N)/(Math.sqrt(R*R+F*F)*Math.sqrt(B*B+N*N)))/2),j=Math.sqrt(O[0]*O[0]+O[1]*O[1]);D=Math.min(d,(s-j)/(U-1)),I=Math.min(d,(u-j)/(U+1))}if(null!=x){var V=jo(null==T?[w,k]:[T,A],[v,_],u,I,f),q=jo([x,b],[w,k],u,I,f);d===I?L.push("M",V[0],"A",I,",",I," 0 0,",m," ",V[1],"A",u,",",u," 0 ",1-f^Uo(V[1][0],V[1][1],q[1][0],q[1][1]),",",f," ",q[1],"A",I,",",I," 0 0,",m," ",q[0]):L.push("M",V[0],"A",I,",",I," 0 1,",m," ",q[0])}else L.push("M",v,",",_);if(null!=T){var G=jo([v,_],[T,A],s,-D,f),H=jo([w,k],null==x?[v,_]:[x,b],s,-D,f);d===D?L.push("L",H[0],"A",D,",",D," 0 0,",m," ",H[1],"A",s,",",s," 0 ",f^Uo(H[1][0],H[1][1],G[1][0],G[1][1]),",",1-f," ",G[1],"A",D,",",D," 0 0,",m," ",G[0]):L.push("L",H[0],"A",D,",",D," 0 0,",m," ",G[0])}else L.push("L",w,",",k)}else L.push("M",v,",",_),null!=x&&L.push("A",u,",",u," 0 ",C,",",f," ",x,",",b),L.push("L",w,",",k),null!=T&&L.push("A",s,",",s," 0 ",z,",",1-f," ",T,",",A);return L.push("Z"),L.join("")}function l(t,e){return"M0,"+t+"A"+t+","+t+" 0 1,"+e+" 0,"+-t+"A"+t+","+t+" 0 1,"+e+" 0,"+t}return s.innerRadius=function(e){return arguments.length?(t=ye(e),s):t},s.outerRadius=function(t){return arguments.length?(e=ye(t),s):e},s.cornerRadius=function(t){return arguments.length?(r=ye(t),s):r},s.padRadius=function(t){return arguments.length?(n=t==Do?Do:ye(t),s):n},s.startAngle=function(t){return arguments.length?(i=ye(t),s):i},s.endAngle=function(t){return arguments.length?(a=ye(t),s):a},s.padAngle=function(t){return arguments.length?(o=ye(t),s):o},s.centroid=function(){var r=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,n=(+i.apply(this,arguments)+ +a.apply(this,arguments))/2-Lt;return[Math.cos(n)*r,Math.sin(n)*r]},s};var Do="auto";function Oo(t){return t.innerRadius}function Ro(t){return t.outerRadius}function Fo(t){return t.startAngle}function Bo(t){return t.endAngle}function No(t){return t&&t.padAngle}function Uo(t,e,r,n){return(t-r)*e-(e-n)*t>0?0:1}function jo(t,e,r,n,i){var a=t[0]-e[0],o=t[1]-e[1],s=(i?n:-n)/Math.sqrt(a*a+o*o),l=s*o,u=-s*a,c=t[0]+l,p=t[1]+u,h=e[0]+l,f=e[1]+u,d=(c+h)/2,m=(p+f)/2,y=h-c,g=f-p,v=y*y+g*g,_=r-n,x=c*f-h*p,b=(g<0?-1:1)*Math.sqrt(Math.max(0,_*_*v-x*x)),w=(x*g-y*b)/v,k=(-x*y-g*b)/v,T=(x*g+y*b)/v,A=(-x*y+g*b)/v,M=w-d,S=k-m,L=T-d,C=A-m;return M*M+S*S>L*L+C*C&&(w=T,k=A),[[w-l,k-u],[w*r/_,k*r/_]]}function Vo(t){var e=ni,r=ii,n=Wr,i=Go,a=i.key,o=.7;function s(a){var s,l=[],u=[],c=-1,p=a.length,h=ye(e),f=ye(r);function d(){l.push("M",i(t(u),o))}for(;++c<p;)n.call(this,s=a[c],c)?u.push([+h.call(this,s,c),+f.call(this,s,c)]):u.length&&(d(),u=[]);return u.length&&d(),l.length?l.join(""):null}return s.x=function(t){return arguments.length?(e=t,s):e},s.y=function(t){return arguments.length?(r=t,s):r},s.defined=function(t){return arguments.length?(n=t,s):n},s.interpolate=function(t){return arguments.length?(a="function"==typeof t?i=t:(i=qo.get(t)||Go).key,s):a},s.tension=function(t){return arguments.length?(o=t,s):o},s}t.svg.line=function(){return Vo(z)};var qo=t.map({linear:Go,"linear-closed":Ho,step:function(t){var e=0,r=t.length,n=t[0],i=[n[0],",",n[1]];for(;++e<r;)i.push("H",(n[0]+(n=t[e])[0])/2,"V",n[1]);r>1&&i.push("H",n[0]);return i.join("")},"step-before":Zo,"step-after":Xo,basis:Ko,"basis-open":function(t){if(t.length<4)return Go(t);var e,r=[],n=-1,i=t.length,a=[0],o=[0];for(;++n<3;)e=t[n],a.push(e[0]),o.push(e[1]);r.push(Jo(ts,a)+","+Jo(ts,o)),--n;for(;++n<i;)e=t[n],a.shift(),a.push(e[0]),o.shift(),o.push(e[1]),es(r,a,o);return r.join("")},"basis-closed":function(t){var e,r,n=-1,i=t.length,a=i+4,o=[],s=[];for(;++n<4;)r=t[n%i],o.push(r[0]),s.push(r[1]);e=[Jo(ts,o),",",Jo(ts,s)],--n;for(;++n<a;)r=t[n%i],o.shift(),o.push(r[0]),s.shift(),s.push(r[1]),es(e,o,s);return e.join("")},bundle:function(t,e){var r=t.length-1;if(r)for(var n,i,a=t[0][0],o=t[0][1],s=t[r][0]-a,l=t[r][1]-o,u=-1;++u<=r;)n=t[u],i=u/r,n[0]=e*n[0]+(1-e)*(a+i*s),n[1]=e*n[1]+(1-e)*(o+i*l);return Ko(t)},cardinal:function(t,e){return t.length<3?Go(t):t[0]+Wo(t,Yo(t,e))},"cardinal-open":function(t,e){return t.length<4?Go(t):t[1]+Wo(t.slice(1,-1),Yo(t,e))},"cardinal-closed":function(t,e){return t.length<3?Ho(t):t[0]+Wo((t.push(t[0]),t),Yo([t[t.length-2]].concat(t,[t[1]]),e))},monotone:function(t){return t.length<3?Go(t):t[0]+Wo(t,function(t){var e,r,n,i,a=[],o=function(t){var e=0,r=t.length-1,n=[],i=t[0],a=t[1],o=n[0]=rs(i,a);for(;++e<r;)n[e]=(o+(o=rs(i=a,a=t[e+1])))/2;return n[e]=o,n}(t),s=-1,l=t.length-1;for(;++s<l;)e=rs(t[s],t[s+1]),v(e)<kt?o[s]=o[s+1]=0:(r=o[s]/e,n=o[s+1]/e,(i=r*r+n*n)>9&&(i=3*e/Math.sqrt(i),o[s]=i*r,o[s+1]=i*n));s=-1;for(;++s<=l;)i=(t[Math.min(l,s+1)][0]-t[Math.max(0,s-1)][0])/(6*(1+o[s]*o[s])),a.push([i||0,o[s]*i||0]);return a}(t))}});function Go(t){return t.length>1?t.join("L"):t+"Z"}function Ho(t){return t.join("L")+"Z"}function Zo(t){for(var e=0,r=t.length,n=t[0],i=[n[0],",",n[1]];++e<r;)i.push("V",(n=t[e])[1],"H",n[0]);return i.join("")}function Xo(t){for(var e=0,r=t.length,n=t[0],i=[n[0],",",n[1]];++e<r;)i.push("H",(n=t[e])[0],"V",n[1]);return i.join("")}function Wo(t,e){if(e.length<1||t.length!=e.length&&t.length!=e.length+2)return Go(t);var r=t.length!=e.length,n="",i=t[0],a=t[1],o=e[0],s=o,l=1;if(r&&(n+="Q"+(a[0]-2*o[0]/3)+","+(a[1]-2*o[1]/3)+","+a[0]+","+a[1],i=t[1],l=2),e.length>1){s=e[1],a=t[l],l++,n+="C"+(i[0]+o[0])+","+(i[1]+o[1])+","+(a[0]-s[0])+","+(a[1]-s[1])+","+a[0]+","+a[1];for(var u=2;u<e.length;u++,l++)a=t[l],s=e[u],n+="S"+(a[0]-s[0])+","+(a[1]-s[1])+","+a[0]+","+a[1]}if(r){var c=t[l];n+="Q"+(a[0]+2*s[0]/3)+","+(a[1]+2*s[1]/3)+","+c[0]+","+c[1]}return n}function Yo(t,e){for(var r,n=[],i=(1-e)/2,a=t[0],o=t[1],s=1,l=t.length;++s<l;)r=a,a=o,o=t[s],n.push([i*(o[0]-r[0]),i*(o[1]-r[1])]);return n}function Ko(t){if(t.length<3)return Go(t);var e=1,r=t.length,n=t[0],i=n[0],a=n[1],o=[i,i,i,(n=t[1])[0]],s=[a,a,a,n[1]],l=[i,",",a,"L",Jo(ts,o),",",Jo(ts,s)];for(t.push(t[r-1]);++e<=r;)n=t[e],o.shift(),o.push(n[0]),s.shift(),s.push(n[1]),es(l,o,s);return t.pop(),l.push("L",n),l.join("")}function Jo(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}qo.forEach(function(t,e){e.key=t,e.closed=/-closed$/.test(t)});var $o=[0,2/3,1/3,0],Qo=[0,1/3,2/3,0],ts=[0,1/6,2/3,1/6];function es(t,e,r){t.push("C",Jo($o,e),",",Jo($o,r),",",Jo(Qo,e),",",Jo(Qo,r),",",Jo(ts,e),",",Jo(ts,r))}function rs(t,e){return(e[1]-t[1])/(e[0]-t[0])}function ns(t){for(var e,r,n,i=-1,a=t.length;++i<a;)r=(e=t[i])[0],n=e[1]-Lt,e[0]=r*Math.cos(n),e[1]=r*Math.sin(n);return t}function is(t){var e=ni,r=ni,n=0,i=ii,a=Wr,o=Go,s=o.key,l=o,u="L",c=.7;function p(s){var p,h,f,d=[],m=[],y=[],g=-1,v=s.length,_=ye(e),x=ye(n),b=e===r?function(){return h}:ye(r),w=n===i?function(){return f}:ye(i);function k(){d.push("M",o(t(y),c),u,l(t(m.reverse()),c),"Z")}for(;++g<v;)a.call(this,p=s[g],g)?(m.push([h=+_.call(this,p,g),f=+x.call(this,p,g)]),y.push([+b.call(this,p,g),+w.call(this,p,g)])):m.length&&(k(),m=[],y=[]);return m.length&&k(),d.length?d.join(""):null}return p.x=function(t){return arguments.length?(e=r=t,p):r},p.x0=function(t){return arguments.length?(e=t,p):e},p.x1=function(t){return arguments.length?(r=t,p):r},p.y=function(t){return arguments.length?(n=i=t,p):i},p.y0=function(t){return arguments.length?(n=t,p):n},p.y1=function(t){return arguments.length?(i=t,p):i},p.defined=function(t){return arguments.length?(a=t,p):a},p.interpolate=function(t){return arguments.length?(s="function"==typeof t?o=t:(o=qo.get(t)||Go).key,l=o.reverse||o,u=o.closed?"M":"L",p):s},p.tension=function(t){return arguments.length?(c=t,p):c},p}function as(t){return t.radius}function os(t){return[t.x,t.y]}function ss(){return 64}function ls(){return"circle"}function us(t){var e=Math.sqrt(t/At);return"M0,"+e+"A"+e+","+e+" 0 1,1 0,"+-e+"A"+e+","+e+" 0 1,1 0,"+e+"Z"}t.svg.line.radial=function(){var t=Vo(ns);return t.radius=t.x,delete t.x,t.angle=t.y,delete t.y,t},Zo.reverse=Xo,Xo.reverse=Zo,t.svg.area=function(){return is(z)},t.svg.area.radial=function(){var t=is(ns);return t.radius=t.x,delete t.x,t.innerRadius=t.x0,delete t.x0,t.outerRadius=t.x1,delete t.x1,t.angle=t.y,delete t.y,t.startAngle=t.y0,delete t.y0,t.endAngle=t.y1,delete t.y1,t},t.svg.chord=function(){var t=qn,e=Gn,r=as,n=Fo,i=Bo;function a(r,n){var i,a,u=o(this,t,r,n),c=o(this,e,r,n);return"M"+u.p0+s(u.r,u.p1,u.a1-u.a0)+(a=c,(i=u).a0==a.a0&&i.a1==a.a1?l(u.r,u.p1,u.r,u.p0):l(u.r,u.p1,c.r,c.p0)+s(c.r,c.p1,c.a1-c.a0)+l(c.r,c.p1,u.r,u.p0))+"Z"}function o(t,e,a,o){var s=e.call(t,a,o),l=r.call(t,s,o),u=n.call(t,s,o)-Lt,c=i.call(t,s,o)-Lt;return{r:l,a0:u,a1:c,p0:[l*Math.cos(u),l*Math.sin(u)],p1:[l*Math.cos(c),l*Math.sin(c)]}}function s(t,e,r){return"A"+t+","+t+" 0 "+ +(r>At)+",1 "+e}function l(t,e,r,n){return"Q 0,0 "+n}return a.radius=function(t){return arguments.length?(r=ye(t),a):r},a.source=function(e){return arguments.length?(t=ye(e),a):t},a.target=function(t){return arguments.length?(e=ye(t),a):e},a.startAngle=function(t){return arguments.length?(n=ye(t),a):n},a.endAngle=function(t){return arguments.length?(i=ye(t),a):i},a},t.svg.diagonal=function(){var t=qn,e=Gn,r=os;function n(n,i){var a=t.call(this,n,i),o=e.call(this,n,i),s=(a.y+o.y)/2,l=[a,{x:a.x,y:s},{x:o.x,y:s},o];return"M"+(l=l.map(r))[0]+"C"+l[1]+" "+l[2]+" "+l[3]}return n.source=function(e){return arguments.length?(t=ye(e),n):t},n.target=function(t){return arguments.length?(e=ye(t),n):e},n.projection=function(t){return arguments.length?(r=t,n):r},n},t.svg.diagonal.radial=function(){var e=t.svg.diagonal(),r=os,n=e.projection;return e.projection=function(t){return arguments.length?n(function(t){return function(){var e=t.apply(this,arguments),r=e[0],n=e[1]-Lt;return[r*Math.cos(n),r*Math.sin(n)]}}(r=t)):r},e},t.svg.symbol=function(){var t=ls,e=ss;function r(r,n){return(cs.get(t.call(this,r,n))||us)(e.call(this,r,n))}return r.type=function(e){return arguments.length?(t=ye(e),r):t},r.size=function(t){return arguments.length?(e=ye(t),r):e},r};var cs=t.map({circle:us,cross:function(t){var e=Math.sqrt(t/5)/2;return"M"+-3*e+","+-e+"H"+-e+"V"+-3*e+"H"+e+"V"+-e+"H"+3*e+"V"+e+"H"+e+"V"+3*e+"H"+-e+"V"+e+"H"+-3*e+"Z"},diamond:function(t){var e=Math.sqrt(t/(2*hs)),r=e*hs;return"M0,"+-e+"L"+r+",0 0,"+e+" "+-r+",0Z"},square:function(t){var e=Math.sqrt(t)/2;return"M"+-e+","+-e+"L"+e+","+-e+" "+e+","+e+" "+-e+","+e+"Z"},"triangle-down":function(t){var e=Math.sqrt(t/ps),r=e*ps/2;return"M0,"+r+"L"+e+","+-r+" "+-e+","+-r+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/ps),r=e*ps/2;return"M0,"+-r+"L"+e+","+r+" "+-e+","+r+"Z"}});t.svg.symbolTypes=cs.keys();var ps=Math.sqrt(3),hs=Math.tan(30*Ct);X.transition=function(t){for(var e,r,n=ys||++_s,i=ws(t),a=[],o=gs||{time:Date.now(),ease:oa,delay:0,duration:250},s=-1,l=this.length;++s<l;){a.push(e=[]);for(var u=this[s],c=-1,p=u.length;++c<p;)(r=u[c])&&ks(r,c,i,n,o),e.push(r)}return ms(a,i,n)},X.interrupt=function(t){return this.each(null==t?fs:ds(ws(t)))};var fs=ds(ws());function ds(t){return function(){var e,r,n;(e=this[t])&&(n=e[r=e.active])&&(n.timer.c=null,n.timer.t=NaN,--e.count?delete e[r]:delete this[t],e.active+=.5,n.event&&n.event.interrupt.call(this,this.__data__,n.index))}}function ms(t,e,r){return V(t,vs),t.namespace=e,t.id=r,t}var ys,gs,vs=[],_s=0;function xs(t,e,r,n){var i=t.id,a=t.namespace;return ct(t,"function"==typeof r?function(t,o,s){t[a][i].tween.set(e,n(r.call(t,t.__data__,o,s)))}:(r=n(r),function(t){t[a][i].tween.set(e,r)}))}function bs(t){return null==t&&(t=""),function(){this.textContent=t}}function ws(t){return null==t?"__transition__":"__transition_"+t+"__"}function ks(t,e,r,n,i){var a,o,s,l,u,c=t[r]||(t[r]={active:0,count:0}),p=c[n];function h(r){var i=c.active,h=c[i];for(var d in h&&(h.timer.c=null,h.timer.t=NaN,--c.count,delete c[i],h.event&&h.event.interrupt.call(t,t.__data__,h.index)),c)if(+d<n){var m=c[d];m.timer.c=null,m.timer.t=NaN,--c.count,delete c[d]}o.c=f,Te(function(){return o.c&&f(r||1)&&(o.c=null,o.t=NaN),1},0,a),c.active=n,p.event&&p.event.start.call(t,t.__data__,e),u=[],p.tween.forEach(function(r,n){(n=n.call(t,t.__data__,e))&&u.push(n)}),l=p.ease,s=p.duration}function f(i){for(var a=i/s,o=l(a),h=u.length;h>0;)u[--h].call(t,o);if(a>=1)return p.event&&p.event.end.call(t,t.__data__,e),--c.count?delete c[n]:delete t[r],1}p||(a=i.time,o=Te(function(t){var e=p.delay;if(o.t=e+a,e<=t)return h(t-e);o.c=h},0,a),p=c[n]={tween:new x,time:a,timer:o,delay:i.delay,duration:i.duration,ease:i.ease,index:e},i=null,++c.count)}vs.call=X.call,vs.empty=X.empty,vs.node=X.node,vs.size=X.size,t.transition=function(e,r){return e&&e.transition?ys?e.transition(r):e:t.selection().transition(e)},t.transition.prototype=vs,vs.select=function(t){var e,r,n,i=this.id,a=this.namespace,o=[];t=W(t);for(var s=-1,l=this.length;++s<l;){o.push(e=[]);for(var u=this[s],c=-1,p=u.length;++c<p;)(n=u[c])&&(r=t.call(n,n.__data__,c,s))?("__data__"in n&&(r.__data__=n.__data__),ks(r,c,a,i,n[a][i]),e.push(r)):e.push(null)}return ms(o,a,i)},vs.selectAll=function(t){var e,r,n,i,a,o=this.id,s=this.namespace,l=[];t=Y(t);for(var u=-1,c=this.length;++u<c;)for(var p=this[u],h=-1,f=p.length;++h<f;)if(n=p[h]){a=n[s][o],r=t.call(n,n.__data__,h,u),l.push(e=[]);for(var d=-1,m=r.length;++d<m;)(i=r[d])&&ks(i,d,s,o,a),e.push(i)}return ms(l,s,o)},vs.filter=function(t){var e,r,n=[];"function"!=typeof t&&(t=ut(t));for(var i=0,a=this.length;i<a;i++){n.push(e=[]);for(var o,s=0,l=(o=this[i]).length;s<l;s++)(r=o[s])&&t.call(r,r.__data__,s,i)&&e.push(r)}return ms(n,this.namespace,this.id)},vs.tween=function(t,e){var r=this.id,n=this.namespace;return arguments.length<2?this.node()[n][r].tween.get(t):ct(this,null==e?function(e){e[n][r].tween.remove(t)}:function(i){i[n][r].tween.set(t,e)})},vs.attr=function(e,r){if(arguments.length<2){for(r in e)this.attr(r,e[r]);return this}var n="transform"==e?ga:Ji,i=t.ns.qualify(e);function a(){this.removeAttribute(i)}function o(){this.removeAttributeNS(i.space,i.local)}return xs(this,"attr."+e,r,i.local?function(t){return null==t?o:(t+="",function(){var e,r=this.getAttributeNS(i.space,i.local);return r!==t&&(e=n(r,t),function(t){this.setAttributeNS(i.space,i.local,e(t))})})}:function(t){return null==t?a:(t+="",function(){var e,r=this.getAttribute(i);return r!==t&&(e=n(r,t),function(t){this.setAttribute(i,e(t))})})})},vs.attrTween=function(e,r){var n=t.ns.qualify(e);return this.tween("attr."+e,n.local?function(t,e){var i=r.call(this,t,e,this.getAttributeNS(n.space,n.local));return i&&function(t){this.setAttributeNS(n.space,n.local,i(t))}}:function(t,e){var i=r.call(this,t,e,this.getAttribute(n));return i&&function(t){this.setAttribute(n,i(t))}})},vs.style=function(t,e,r){var n=arguments.length;if(n<3){if("string"!=typeof t){for(r in n<2&&(e=""),t)this.style(r,t[r],e);return this}r=""}function i(){this.style.removeProperty(t)}return xs(this,"style."+t,e,function(e){return null==e?i:(e+="",function(){var n,i=o(this).getComputedStyle(this,null).getPropertyValue(t);return i!==e&&(n=Ji(i,e),function(e){this.style.setProperty(t,n(e),r)})})})},vs.styleTween=function(t,e,r){return arguments.length<3&&(r=""),this.tween("style."+t,function(n,i){var a=e.call(this,n,i,o(this).getComputedStyle(this,null).getPropertyValue(t));return a&&function(e){this.style.setProperty(t,a(e),r)}})},vs.text=function(t){return xs(this,"text",t,bs)},vs.remove=function(){var t=this.namespace;return this.each("end.transition",function(){var e;this[t].count<2&&(e=this.parentNode)&&e.removeChild(this)})},vs.ease=function(e){var r=this.id,n=this.namespace;return arguments.length<1?this.node()[n][r].ease:("function"!=typeof e&&(e=t.ease.apply(t,arguments)),ct(this,function(t){t[n][r].ease=e}))},vs.delay=function(t){var e=this.id,r=this.namespace;return arguments.length<1?this.node()[r][e].delay:ct(this,"function"==typeof t?function(n,i,a){n[r][e].delay=+t.call(n,n.__data__,i,a)}:(t=+t,function(n){n[r][e].delay=t}))},vs.duration=function(t){var e=this.id,r=this.namespace;return arguments.length<1?this.node()[r][e].duration:ct(this,"function"==typeof t?function(n,i,a){n[r][e].duration=Math.max(1,t.call(n,n.__data__,i,a))}:(t=Math.max(1,t),function(n){n[r][e].duration=t}))},vs.each=function(e,r){var n=this.id,i=this.namespace;if(arguments.length<2){var a=gs,o=ys;try{ys=n,ct(this,function(t,r,a){gs=t[i][n],e.call(t,t.__data__,r,a)})}finally{gs=a,ys=o}}else ct(this,function(a){var o=a[i][n];(o.event||(o.event=t.dispatch("start","end","interrupt"))).on(e,r)});return this},vs.transition=function(){for(var t,e,r,n=this.id,i=++_s,a=this.namespace,o=[],s=0,l=this.length;s<l;s++){o.push(t=[]);for(var u,c=0,p=(u=this[s]).length;c<p;c++)(e=u[c])&&ks(e,c,a,i,{time:(r=e[a][n]).time,ease:r.ease,delay:r.delay+r.duration,duration:r.duration}),t.push(e)}return ms(o,a,i)},t.svg.axis=function(){var e,r=t.scale.linear(),i=Ts,a=6,o=6,s=3,l=[10],u=null;function c(n){n.each(function(){var n,c=t.select(this),p=this.__chart__||r,h=this.__chart__=r.copy(),f=null==u?h.ticks?h.ticks.apply(h,l):h.domain():u,d=null==e?h.tickFormat?h.tickFormat.apply(h,l):z:e,m=c.selectAll(".tick").data(f,h),y=m.enter().insert("g",".domain").attr("class","tick").style("opacity",kt),g=t.transition(m.exit()).style("opacity",kt).remove(),v=t.transition(m.order()).style("opacity",1),_=Math.max(a,0)+s,x=ho(h),b=c.selectAll(".domain").data([0]),w=(b.enter().append("path").attr("class","domain"),t.transition(b));y.append("line"),y.append("text");var k,T,A,M,S=y.select("line"),L=v.select("line"),C=m.select("text").text(d),E=y.select("text"),P=v.select("text"),I="top"===i||"left"===i?-1:1;if("bottom"===i||"top"===i?(n=Ms,k="x",A="y",T="x2",M="y2",C.attr("dy",I<0?"0em":".71em").style("text-anchor","middle"),w.attr("d","M"+x[0]+","+I*o+"V0H"+x[1]+"V"+I*o)):(n=Ss,k="y",A="x",T="y2",M="x2",C.attr("dy",".32em").style("text-anchor",I<0?"end":"start"),w.attr("d","M"+I*o+","+x[0]+"H0V"+x[1]+"H"+I*o)),S.attr(M,I*a),E.attr(A,I*_),L.attr(T,0).attr(M,I*a),P.attr(k,0).attr(A,I*_),h.rangeBand){var D=h,O=D.rangeBand()/2;p=h=function(t){return D(t)+O}}else p.rangeBand?p=h:g.call(n,h,p);y.call(n,p,h),v.call(n,h,h)})}return c.scale=function(t){return arguments.length?(r=t,c):r},c.orient=function(t){return arguments.length?(i=t in As?t+"":Ts,c):i},c.ticks=function(){return arguments.length?(l=n(arguments),c):l},c.tickValues=function(t){return arguments.length?(u=t,c):u},c.tickFormat=function(t){return arguments.length?(e=t,c):e},c.tickSize=function(t){var e=arguments.length;return e?(a=+t,o=+arguments[e-1],c):a},c.innerTickSize=function(t){return arguments.length?(a=+t,c):a},c.outerTickSize=function(t){return arguments.length?(o=+t,c):o},c.tickPadding=function(t){return arguments.length?(s=+t,c):s},c.tickSubdivide=function(){return arguments.length&&c},c};var Ts="bottom",As={top:1,right:1,bottom:1,left:1};function Ms(t,e,r){t.attr("transform",function(t){var n=e(t);return"translate("+(isFinite(n)?n:r(t))+",0)"})}function Ss(t,e,r){t.attr("transform",function(t){var n=e(t);return"translate(0,"+(isFinite(n)?n:r(t))+")"})}t.svg.brush=function(){var e,r,n=U(h,"brushstart","brush","brushend"),i=null,a=null,s=[0,0],l=[0,0],u=!0,c=!0,p=Cs[0];function h(e){e.each(function(){var e=t.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",y).on("touchstart.brush",y),r=e.selectAll(".background").data([0]);r.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),e.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var n=e.selectAll(".resize").data(p,z);n.exit().remove(),n.enter().append("g").attr("class",function(t){return"resize "+t}).style("cursor",function(t){return Ls[t]}).append("rect").attr("x",function(t){return/[ew]$/.test(t)?-3:null}).attr("y",function(t){return/^[ns]/.test(t)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),n.style("display",h.empty()?"none":null);var o,s=t.transition(e),l=t.transition(r);i&&(o=ho(i),l.attr("x",o[0]).attr("width",o[1]-o[0]),d(s)),a&&(o=ho(a),l.attr("y",o[0]).attr("height",o[1]-o[0]),m(s)),f(s)})}function f(t){t.selectAll(".resize").attr("transform",function(t){return"translate("+s[+/e$/.test(t)]+","+l[+/^s/.test(t)]+")"})}function d(t){t.select(".extent").attr("x",s[0]),t.selectAll(".extent,.n>rect,.s>rect").attr("width",s[1]-s[0])}function m(t){t.select(".extent").attr("y",l[0]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",l[1]-l[0])}function y(){var p,y,g=this,v=t.select(t.event.target),_=n.of(g,arguments),x=t.select(g),b=v.datum(),w=!/^(n|s)$/.test(b)&&i,k=!/^(e|w)$/.test(b)&&a,T=v.classed("extent"),A=_t(g),M=t.mouse(g),S=t.select(o(g)).on("keydown.brush",function(){32==t.event.keyCode&&(T||(p=null,M[0]-=s[1],M[1]-=l[1],T=2),B())}).on("keyup.brush",function(){32==t.event.keyCode&&2==T&&(M[0]+=s[1],M[1]+=l[1],T=0,B())});if(t.event.changedTouches?S.on("touchmove.brush",E).on("touchend.brush",P):S.on("mousemove.brush",E).on("mouseup.brush",P),x.interrupt().selectAll("*").interrupt(),T)M[0]=s[0]-M[0],M[1]=l[0]-M[1];else if(b){var L=+/w$/.test(b),C=+/^n/.test(b);y=[s[1-L]-M[0],l[1-C]-M[1]],M[0]=s[L],M[1]=l[C]}else t.event.altKey&&(p=M.slice());function E(){var e=t.mouse(g),r=!1;y&&(e[0]+=y[0],e[1]+=y[1]),T||(t.event.altKey?(p||(p=[(s[0]+s[1])/2,(l[0]+l[1])/2]),M[0]=s[+(e[0]<p[0])],M[1]=l[+(e[1]<p[1])]):p=null),w&&z(e,i,0)&&(d(x),r=!0),k&&z(e,a,1)&&(m(x),r=!0),r&&(f(x),_({type:"brush",mode:T?"move":"resize"}))}function z(t,n,i){var a,o,h=ho(n),f=h[0],d=h[1],m=M[i],y=i?l:s,g=y[1]-y[0];if(T&&(f-=m,d-=g+m),a=(i?c:u)?Math.max(f,Math.min(d,t[i])):t[i],T?o=(a+=m)+g:(p&&(m=Math.max(f,Math.min(d,2*p[i]-a))),m<a?(o=a,a=m):o=m),y[0]!=a||y[1]!=o)return i?r=null:e=null,y[0]=a,y[1]=o,!0}function P(){E(),x.style("pointer-events","all").selectAll(".resize").style("display",h.empty()?"none":null),t.select("body").style("cursor",null),S.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),A(),_({type:"brushend"})}x.style("pointer-events","none").selectAll(".resize").style("display",null),t.select("body").style("cursor",v.style("cursor")),_({type:"brushstart"}),E()}return h.event=function(i){i.each(function(){var i=n.of(this,arguments),a={x:s,y:l,i:e,j:r},o=this.__chart__||a;this.__chart__=a,ys?t.select(this).transition().each("start.brush",function(){e=o.i,r=o.j,s=o.x,l=o.y,i({type:"brushstart"})}).tween("brush:brush",function(){var t=$i(s,a.x),n=$i(l,a.y);return e=r=null,function(e){s=a.x=t(e),l=a.y=n(e),i({type:"brush",mode:"resize"})}}).each("end.brush",function(){e=a.i,r=a.j,i({type:"brush",mode:"resize"}),i({type:"brushend"})}):(i({type:"brushstart"}),i({type:"brush",mode:"resize"}),i({type:"brushend"}))})},h.x=function(t){return arguments.length?(p=Cs[!(i=t)<<1|!a],h):i},h.y=function(t){return arguments.length?(p=Cs[!i<<1|!(a=t)],h):a},h.clamp=function(t){return arguments.length?(i&&a?(u=!!t[0],c=!!t[1]):i?u=!!t:a&&(c=!!t),h):i&&a?[u,c]:i?u:a?c:null},h.extent=function(t){var n,o,u,c,p;return arguments.length?(i&&(n=t[0],o=t[1],a&&(n=n[0],o=o[0]),e=[n,o],i.invert&&(n=i(n),o=i(o)),o<n&&(p=n,n=o,o=p),n==s[0]&&o==s[1]||(s=[n,o])),a&&(u=t[0],c=t[1],i&&(u=u[1],c=c[1]),r=[u,c],a.invert&&(u=a(u),c=a(c)),c<u&&(p=u,u=c,c=p),u==l[0]&&c==l[1]||(l=[u,c])),h):(i&&(e?(n=e[0],o=e[1]):(n=s[0],o=s[1],i.invert&&(n=i.invert(n),o=i.invert(o)),o<n&&(p=n,n=o,o=p))),a&&(r?(u=r[0],c=r[1]):(u=l[0],c=l[1],a.invert&&(u=a.invert(u),c=a.invert(c)),c<u&&(p=u,u=c,c=p))),i&&a?[[n,u],[o,c]]:i?[n,o]:a&&[u,c])},h.clear=function(){return h.empty()||(s=[0,0],l=[0,0],e=r=null),h},h.empty=function(){return!!i&&s[0]==s[1]||!!a&&l[0]==l[1]},t.rebind(h,n,"on")};var Ls={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Cs=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],Es=De.format=ur.timeFormat,zs=Es.utc,Ps=zs("%Y-%m-%dT%H:%M:%S.%LZ");function Is(t){return t.toISOString()}function Ds(e,r,n){function i(t){return e(t)}function a(e,n){var i=(e[1]-e[0])/n,a=t.bisect(Rs,i);return a==Rs.length?[r.year,bo(e.map(function(t){return t/31536e6}),n)[2]]:a?r[i/Rs[a-1]<Rs[a]/i?a-1:a]:[Ns,bo(e,n)[2]]}return i.invert=function(t){return Os(e.invert(t))},i.domain=function(t){return arguments.length?(e.domain(t),i):e.domain().map(Os)},i.nice=function(t,e){var r=i.domain(),n=po(r),o=null==t?a(n,10):"number"==typeof t&&a(n,t);function s(r){return!isNaN(r)&&!t.range(r,Os(+r+1),e).length}return o&&(t=o[0],e=o[1]),i.domain(mo(r,e>1?{floor:function(e){for(;s(e=t.floor(e));)e=Os(e-1);return e},ceil:function(e){for(;s(e=t.ceil(e));)e=Os(+e+1);return e}}:t))},i.ticks=function(t,e){var r=po(i.domain()),n=null==t?a(r,10):"number"==typeof t?a(r,t):!t.range&&[{range:t},e];return n&&(t=n[0],e=n[1]),t.range(r[0],Os(+r[1]+1),e<1?1:e)},i.tickFormat=function(){return n},i.copy=function(){return Ds(e.copy(),r,n)},_o(i,e)}function Os(t){return new Date(t)}Es.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?Is:Ps,Is.parse=function(t){var e=new Date(t);return isNaN(e)?null:e},Is.toString=Ps.toString,De.second=Be(function(t){return new Oe(1e3*Math.floor(t/1e3))},function(t,e){t.setTime(t.getTime()+1e3*Math.floor(e))},function(t){return t.getSeconds()}),De.seconds=De.second.range,De.seconds.utc=De.second.utc.range,De.minute=Be(function(t){return new Oe(6e4*Math.floor(t/6e4))},function(t,e){t.setTime(t.getTime()+6e4*Math.floor(e))},function(t){return t.getMinutes()}),De.minutes=De.minute.range,De.minutes.utc=De.minute.utc.range,De.hour=Be(function(t){var e=t.getTimezoneOffset()/60;return new Oe(36e5*(Math.floor(t/36e5-e)+e))},function(t,e){t.setTime(t.getTime()+36e5*Math.floor(e))},function(t){return t.getHours()}),De.hours=De.hour.range,De.hours.utc=De.hour.utc.range,De.month=Be(function(t){return(t=De.day(t)).setDate(1),t},function(t,e){t.setMonth(t.getMonth()+e)},function(t){return t.getMonth()}),De.months=De.month.range,De.months.utc=De.month.utc.range;var Rs=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Fs=[[De.second,1],[De.second,5],[De.second,15],[De.second,30],[De.minute,1],[De.minute,5],[De.minute,15],[De.minute,30],[De.hour,1],[De.hour,3],[De.hour,6],[De.hour,12],[De.day,1],[De.day,2],[De.week,1],[De.month,1],[De.month,3],[De.year,1]],Bs=Es.multi([[".%L",function(t){return t.getMilliseconds()}],[":%S",function(t){return t.getSeconds()}],["%I:%M",function(t){return t.getMinutes()}],["%I %p",function(t){return t.getHours()}],["%a %d",function(t){return t.getDay()&&1!=t.getDate()}],["%b %d",function(t){return 1!=t.getDate()}],["%B",function(t){return t.getMonth()}],["%Y",Wr]]),Ns={range:function(e,r,n){return t.range(Math.ceil(e/n)*n,+r,n).map(Os)},floor:z,ceil:z};Fs.year=De.year,De.scale=function(){return Ds(t.scale.linear(),Fs,Bs)};var Us=Fs.map(function(t){return[t[0].utc,t[1]]}),js=zs.multi([[".%L",function(t){return t.getUTCMilliseconds()}],[":%S",function(t){return t.getUTCSeconds()}],["%I:%M",function(t){return t.getUTCMinutes()}],["%I %p",function(t){return t.getUTCHours()}],["%a %d",function(t){return t.getUTCDay()&&1!=t.getUTCDate()}],["%b %d",function(t){return 1!=t.getUTCDate()}],["%B",function(t){return t.getUTCMonth()}],["%Y",Wr]]);function Vs(t){return JSON.parse(t.responseText)}function qs(t){var e=i.createRange();return e.selectNode(i.body),e.createContextualFragment(t.responseText)}Us.year=De.year.utc,De.scale.utc=function(){return Ds(t.scale.linear(),Us,js)},t.text=ge(function(t){return t.responseText}),t.json=function(t,e){return ve(t,"application/json",Vs,e)},t.html=function(t,e){return ve(t,"text/html",qs,e)},t.xml=ge(function(t){return t.responseXML}),"object"==typeof e&&e.exports?e.exports=t:this.d3=t}()},{}],15:[function(t,e,r){(function(n,i){!function(t,n){"object"==typeof r&&"undefined"!=typeof e?e.exports=n():t.ES6Promise=n()}(this,function(){"use strict";function e(t){return"function"==typeof t}var r=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},a=0,o=void 0,s=void 0,l=function(t,e){m[a]=t,m[a+1]=e,2===(a+=2)&&(s?s(y):b())};var u="undefined"!=typeof window?window:void 0,c=u||{},p=c.MutationObserver||c.WebKitMutationObserver,h="undefined"==typeof self&&"undefined"!=typeof n&&"[object process]"==={}.toString.call(n),f="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function d(){var t=setTimeout;return function(){return t(y,1)}}var m=new Array(1e3);function y(){for(var t=0;t<a;t+=2){(0,m[t])(m[t+1]),m[t]=void 0,m[t+1]=void 0}a=0}var g,v,_,x,b=void 0;function w(t,e){var r=arguments,n=this,i=new this.constructor(A);void 0===i[T]&&V(i);var a,o=n._state;return o?(a=r[o-1],l(function(){return U(o,i,a,n._result)})):R(n,i,t,e),i}function k(t){if(t&&"object"==typeof t&&t.constructor===this)return t;var e=new this(A);return P(e,t),e}h?b=function(){return n.nextTick(y)}:p?(v=0,_=new p(y),x=document.createTextNode(""),_.observe(x,{characterData:!0}),b=function(){x.data=v=++v%2}):f?((g=new MessageChannel).port1.onmessage=y,b=function(){return g.port2.postMessage(0)}):b=void 0===u&&"function"==typeof t?function(){try{var e=t("vertx");return o=e.runOnLoop||e.runOnContext,function(){o(y)}}catch(t){return d()}}():d();var T=Math.random().toString(36).substring(16);function A(){}var M=void 0,S=1,L=2,C=new B;function E(t){try{return t.then}catch(t){return C.error=t,C}}function z(t,r,n){r.constructor===t.constructor&&n===w&&r.constructor.resolve===k?function(t,e){e._state===S?D(t,e._result):e._state===L?O(t,e._result):R(e,void 0,function(e){return P(t,e)},function(e){return O(t,e)})}(t,r):n===C?O(t,C.error):void 0===n?D(t,r):e(n)?function(t,e,r){l(function(t){var n=!1,i=function(t,e,r,n){try{t.call(e,r,n)}catch(t){return t}}(r,e,function(r){n||(n=!0,e!==r?P(t,r):D(t,r))},function(e){n||(n=!0,O(t,e))},t._label);!n&&i&&(n=!0,O(t,i))},t)}(t,r,n):D(t,r)}function P(t,e){var r;t===e?O(t,new TypeError("You cannot resolve a promise with itself")):"function"==typeof(r=e)||"object"==typeof r&&null!==r?z(t,e,E(e)):D(t,e)}function I(t){t._onerror&&t._onerror(t._result),F(t)}function D(t,e){t._state===M&&(t._result=e,t._state=S,0!==t._subscribers.length&&l(F,t))}function O(t,e){t._state===M&&(t._state=L,t._result=e,l(I,t))}function R(t,e,r,n){var i=t._subscribers,a=i.length;t._onerror=null,i[a]=e,i[a+S]=r,i[a+L]=n,0===a&&t._state&&l(F,t)}function F(t){var e=t._subscribers,r=t._state;if(0!==e.length){for(var n=void 0,i=void 0,a=t._result,o=0;o<e.length;o+=3)n=e[o],i=e[o+r],n?U(r,n,i,a):i(a);t._subscribers.length=0}}function B(){this.error=null}var N=new B;function U(t,r,n,i){var a=e(n),o=void 0,s=void 0,l=void 0,u=void 0;if(a){if((o=function(t,e){try{return t(e)}catch(t){return N.error=t,N}}(n,i))===N?(u=!0,s=o.error,o=null):l=!0,r===o)return void O(r,new TypeError("A promises callback cannot return that same promise."))}else o=i,l=!0;r._state!==M||(a&&l?P(r,o):u?O(r,s):t===S?D(r,o):t===L&&O(r,o))}var j=0;function V(t){t[T]=j++,t._state=void 0,t._result=void 0,t._subscribers=[]}function q(t,e){this._instanceConstructor=t,this.promise=new t(A),this.promise[T]||V(this.promise),r(e)?(this._input=e,this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?D(this.promise,this._result):(this.length=this.length||0,this._enumerate(),0===this._remaining&&D(this.promise,this._result))):O(this.promise,new Error("Array Methods must be provided an Array"))}function G(t){this[T]=j++,this._result=this._state=void 0,this._subscribers=[],A!==t&&("function"!=typeof t&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof G?function(t,e){try{e(function(e){P(t,e)},function(e){O(t,e)})}catch(e){O(t,e)}}(this,t):function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}())}function H(){var t=void 0;if("undefined"!=typeof i)t=i;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var e=t.Promise;if(e){var r=null;try{r=Object.prototype.toString.call(e.resolve())}catch(t){}if("[object Promise]"===r&&!e.cast)return}t.Promise=G}return q.prototype._enumerate=function(){for(var t=this.length,e=this._input,r=0;this._state===M&&r<t;r++)this._eachEntry(e[r],r)},q.prototype._eachEntry=function(t,e){var r=this._instanceConstructor,n=r.resolve;if(n===k){var i=E(t);if(i===w&&t._state!==M)this._settledAt(t._state,e,t._result);else if("function"!=typeof i)this._remaining--,this._result[e]=t;else if(r===G){var a=new r(A);z(a,t,i),this._willSettleAt(a,e)}else this._willSettleAt(new r(function(e){return e(t)}),e)}else this._willSettleAt(n(t),e)},q.prototype._settledAt=function(t,e,r){var n=this.promise;n._state===M&&(this._remaining--,t===L?O(n,r):this._result[e]=r),0===this._remaining&&D(n,this._result)},q.prototype._willSettleAt=function(t,e){var r=this;R(t,void 0,function(t){return r._settledAt(S,e,t)},function(t){return r._settledAt(L,e,t)})},G.all=function(t){return new q(this,t).promise},G.race=function(t){var e=this;return r(t)?new e(function(r,n){for(var i=t.length,a=0;a<i;a++)e.resolve(t[a]).then(r,n)}):new e(function(t,e){return e(new TypeError("You must pass an array to race."))})},G.resolve=k,G.reject=function(t){var e=new this(A);return O(e,t),e},G._setScheduler=function(t){s=t},G._setAsap=function(t){l=t},G._asap=l,G.prototype={constructor:G,then:w,catch:function(t){return this.then(null,t)}},H(),G.polyfill=H,G.Promise=G,G})}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:32}],16:[function(t,e,r){"use strict";var n=t("is-string-blank");e.exports=function(t){var e=typeof t;if("string"===e){var r=t;if(0===(t=+t)&&n(r))return!1}else if("number"!==e)return!1;return t-t<1}},{"is-string-blank":21}],17:[function(t,e,r){e.exports=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r+r,s=n+n,l=i+i,u=r*o,c=n*o,p=n*s,h=i*o,f=i*s,d=i*l,m=a*o,y=a*s,g=a*l;return t[0]=1-p-d,t[1]=c+g,t[2]=h-y,t[3]=0,t[4]=c-g,t[5]=1-u-d,t[6]=f+m,t[7]=0,t[8]=h+y,t[9]=f-m,t[10]=1-u-p,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},{}],18:[function(t,e,r){(function(r){"use strict";var n,i=t("is-browser");n="function"==typeof r.matchMedia?!r.matchMedia("(hover: none)").matches:i,e.exports=n}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"is-browser":20}],19:[function(t,e,r){"use strict";var n=t("is-browser");e.exports=n&&function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(e){t=!1}return t}()},{"is-browser":20}],20:[function(t,e,r){e.exports=!0},{}],21:[function(t,e,r){"use strict";e.exports=function(t){for(var e,r=t.length,n=0;n<r;n++)if(((e=t.charCodeAt(n))<9||e>13)&&32!==e&&133!==e&&160!==e&&5760!==e&&6158!==e&&(e<8192||e>8205)&&8232!==e&&8233!==e&&8239!==e&&8287!==e&&8288!==e&&12288!==e&&65279!==e)return!1;return!0}},{}],22:[function(t,e,r){var n,i;n=this,i=function(){"use strict";var t,e,r;function n(n,i){if(t)if(e){var a="var sharedChunk = {}; ("+t+")(sharedChunk); ("+e+")(sharedChunk);",o={};t(o),(r=i(o)).workerUrl=window.URL.createObjectURL(new Blob([a],{type:"text/javascript"}))}else e=i;else t=i}return n(0,function(t){function e(t,e){return t(e={exports:{}},e.exports),e.exports}var r=n;function n(t,e,r,n){this.cx=3*t,this.bx=3*(r-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(n-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=n,this.p2x=r,this.p2y=n}n.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},n.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},n.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},n.prototype.solveCurveX=function(t,e){var r,n,i,a,o;for(void 0===e&&(e=1e-6),i=t,o=0;o<8;o++){if(a=this.sampleCurveX(i)-t,Math.abs(a)<e)return i;var s=this.sampleCurveDerivativeX(i);if(Math.abs(s)<1e-6)break;i-=a/s}if((i=t)<(r=0))return r;if(i>(n=1))return n;for(;r<n;){if(a=this.sampleCurveX(i),Math.abs(a-t)<e)return i;t>a?r=i:n=i,i=.5*(n-r)+r}return i},n.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var i=a;function a(t,e){this.x=t,this.y=e}function o(t,e){if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(var r=0;r<t.length;r++)if(!o(t[r],e[r]))return!1;return!0}if("object"==typeof t&&null!==t&&null!==e){if("object"!=typeof e)return!1;if(Object.keys(t).length!==Object.keys(e).length)return!1;for(var n in t)if(!o(t[n],e[n]))return!1;return!0}return t===e}function s(t,e,n,i){var a=new r(t,e,n,i);return function(t){return a.solve(t)}}a.prototype={clone:function(){return new a(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(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)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},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},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,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},_rotateAround:function(t,e){var r=Math.cos(t),n=Math.sin(t),i=e.x+r*(this.x-e.x)-n*(this.y-e.y),a=e.y+n*(this.x-e.x)+r*(this.y-e.y);return this.x=i,this.y=a,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},a.convert=function(t){return t instanceof a?t:Array.isArray(t)?new a(t[0],t[1]):t};var l=s(.25,.1,.25,1);function u(t,e,r){return Math.min(r,Math.max(e,t))}function c(t,e,r){var n=r-e,i=((t-e)%n+n)%n+e;return i===e?r:i}function p(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var n=0,i=e;n<i.length;n+=1){var a=i[n];for(var o in a)t[o]=a[o]}return t}var h=1;function f(){return h++}function d(){return function t(e){return e?(e^16*Math.random()>>e/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}function m(t){return!!t&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(t)}function y(t,e){t.forEach(function(t){e[t]&&(e[t]=e[t].bind(e))})}function g(t,e){return-1!==t.indexOf(e,t.length-e.length)}function v(t,e,r){var n={};for(var i in t)n[i]=e.call(r||this,t[i],i,t);return n}function _(t,e,r){var n={};for(var i in t)e.call(r||this,t[i],i,t)&&(n[i]=t[i]);return n}function x(t){return Array.isArray(t)?t.map(x):"object"==typeof t&&t?v(t,x):t}var b={};function w(t){b[t]||("undefined"!=typeof console&&console.warn(t),b[t]=!0)}function k(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}function T(t){for(var e=0,r=0,n=t.length,i=n-1,a=void 0,o=void 0;r<n;i=r++)a=t[r],e+=((o=t[i]).x-a.x)*(a.y+o.y);return e}function A(t){var e={};if(t.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,function(t,r,n,i){var a=n||i;return e[r]=!a||a.toLowerCase(),""}),e["max-age"]){var r=parseInt(e["max-age"],10);isNaN(r)?delete e["max-age"]:e["max-age"]=r}return e}function M(t){try{var e=self[t];return e.setItem("_mapbox_test_",1),e.removeItem("_mapbox_test_"),!0}catch(t){return!1}}var S,L,C,E,z=self.performance&&self.performance.now?self.performance.now.bind(self.performance):Date.now.bind(Date),P=self.requestAnimationFrame||self.mozRequestAnimationFrame||self.webkitRequestAnimationFrame||self.msRequestAnimationFrame,I=self.cancelAnimationFrame||self.mozCancelAnimationFrame||self.webkitCancelAnimationFrame||self.msCancelAnimationFrame,D={now:z,frame:function(t){var e=P(t);return{cancel:function(){return I(e)}}},getImageData:function(t){var e=self.document.createElement("canvas"),r=e.getContext("2d");if(!r)throw new Error("failed to create canvas 2d context");return e.width=t.width,e.height=t.height,r.drawImage(t,0,0,t.width,t.height),r.getImageData(0,0,t.width,t.height)},resolveURL:function(t){return S||(S=self.document.createElement("a")),S.href=t,S.href},hardwareConcurrency:self.navigator.hardwareConcurrency||4,get devicePixelRatio(){return self.devicePixelRatio},get prefersReducedMotion(){return!!self.matchMedia&&(null==L&&(L=self.matchMedia("(prefers-reduced-motion: reduce)")),L.matches)}},O={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?0===this.API_URL.indexOf("https://api.mapbox.cn")?"https://events.mapbox.cn/events/v2":0===this.API_URL.indexOf("https://api.mapbox.com")?"https://events.mapbox.com/events/v2":null:null},FEEDBACK_URL:"https://apps.mapbox.com/feedback",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},R={supported:!1,testSupport:function(t){!F&&E&&(B?N(t):C=t)}},F=!1,B=!1;function N(t){var e=t.createTexture();t.bindTexture(t.TEXTURE_2D,e);try{if(t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,E),t.isContextLost())return;R.supported=!0}catch(t){}t.deleteTexture(e),F=!0}self.document&&((E=self.document.createElement("img")).onload=function(){C&&N(C),C=null,B=!0},E.onerror=function(){F=!0,C=null},E.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var U="01",j=function(t,e){this._transformRequestFn=t,this._customAccessToken=e,this._createSkuToken()};function V(t){return 0===t.indexOf("mapbox:")}j.prototype._createSkuToken=function(){var t=function(){for(var t="",e=0;e<10;e++)t+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",U,t].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=t.token,this._skuTokenExpiresAt=t.tokenExpiresAt},j.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},j.prototype.transformRequest=function(t,e){return this._transformRequestFn&&this._transformRequestFn(t,e)||{url:t}},j.prototype.normalizeStyleURL=function(t,e){if(!V(t))return t;var r=Z(t);return r.path="/styles/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||e)},j.prototype.normalizeGlyphsURL=function(t,e){if(!V(t))return t;var r=Z(t);return r.path="/fonts/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||e)},j.prototype.normalizeSourceURL=function(t,e){if(!V(t))return t;var r=Z(t);return r.path="/v4/"+r.authority+".json",r.params.push("secure"),this._makeAPIURL(r,this._customAccessToken||e)},j.prototype.normalizeSpriteURL=function(t,e,r,n){var i=Z(t);return V(t)?(i.path="/styles/v1"+i.path+"/sprite"+e+r,this._makeAPIURL(i,this._customAccessToken||n)):(i.path+=""+e+r,X(i))},j.prototype.normalizeTileURL=function(t,e,r){if(this._isSkuTokenExpired()&&this._createSkuToken(),!e||!V(e))return t;var n=Z(t),i=D.devicePixelRatio>=2||512===r?"@2x":"",a=R.supported?".webp":"$1";return n.path=n.path.replace(/(\.(png|jpg)\d*)(?=$)/,""+i+a),n.path=n.path.replace(/^.+\/v4\//,"/"),n.path="/v4"+n.path,O.REQUIRE_ACCESS_TOKEN&&(O.ACCESS_TOKEN||this._customAccessToken)&&this._skuToken&&n.params.push("sku="+this._skuToken),this._makeAPIURL(n,this._customAccessToken)},j.prototype.canonicalizeTileURL=function(t){var e=Z(t);if(!e.path.match(/(^\/v4\/)/)||!e.path.match(/\.[\w]+$/))return t;var r="mapbox://tiles/";r+=e.path.replace("/v4/","");var n=e.params.filter(function(t){return!t.match(/^access_token=/)});return n.length&&(r+="?"+n.join("&")),r},j.prototype.canonicalizeTileset=function(t,e){if(!V(e))return t.tiles||[];for(var r=[],n=0,i=t.tiles;n<i.length;n+=1){var a=i[n],o=this.canonicalizeTileURL(a);r.push(o)}return r},j.prototype._makeAPIURL=function(t,e){var r="See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes",n=Z(O.API_URL);if(t.protocol=n.protocol,t.authority=n.authority,"/"!==n.path&&(t.path=""+n.path+t.path),!O.REQUIRE_ACCESS_TOKEN)return X(t);if(!(e=e||O.ACCESS_TOKEN))throw new Error("An API access token is required to use Mapbox GL. "+r);if("s"===e[0])throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+r);return t.params=t.params.filter(function(t){return-1===t.indexOf("access_token")}),t.params.push("access_token="+e),X(t)};var q=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function G(t){return q.test(t)}var H=/^(\w+):\/\/([^\/?]*)(\/[^?]+)?\??(.+)?/;function Z(t){var e=t.match(H);if(!e)throw new Error("Unable to parse URL object");return{protocol:e[1],authority:e[2],path:e[3]||"/",params:e[4]?e[4].split("&"):[]}}function X(t){var e=t.params.length?"?"+t.params.join("&"):"";return t.protocol+"://"+t.authority+t.path+e}function W(t){if(!t)return null;var e,r=t.split(".");if(!r||3!==r.length)return null;try{return JSON.parse((e=r[1],decodeURIComponent(self.atob(e).split("").map(function(t){return"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)}).join(""))))}catch(t){return null}}var Y=function(t){this.type=t,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null};Y.prototype.getStorageKey=function(t){var e,r=W(O.ACCESS_TOKEN),n="";return r&&r.u?(e=r.u,n=self.btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,function(t,e){return String.fromCharCode(Number("0x"+e))}))):n=O.ACCESS_TOKEN||"",t?"mapbox.eventData."+t+":"+n:"mapbox.eventData:"+n},Y.prototype.fetchEventData=function(){var t=M("localStorage"),e=this.getStorageKey(),r=this.getStorageKey("uuid");if(t)try{var n=self.localStorage.getItem(e);n&&(this.eventData=JSON.parse(n));var i=self.localStorage.getItem(r);i&&(this.anonId=i)}catch(t){w("Unable to read from LocalStorage")}},Y.prototype.saveEventData=function(){var t=M("localStorage"),e=this.getStorageKey(),r=this.getStorageKey("uuid");if(t)try{self.localStorage.setItem(r,this.anonId),Object.keys(this.eventData).length>=1&&self.localStorage.setItem(e,JSON.stringify(this.eventData))}catch(t){w("Unable to write to LocalStorage")}},Y.prototype.processRequests=function(t){},Y.prototype.postEvent=function(t,e,r,n){var i=this;if(O.EVENTS_URL){var a=Z(O.EVENTS_URL);a.params.push("access_token="+(n||O.ACCESS_TOKEN||""));var o={event:this.type,created:new Date(t).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:"1.3.2",skuId:U,userId:this.anonId},s=e?p(o,e):o,l={url:X(a),headers:{"Content-Type":"text/plain"},body:JSON.stringify([s])};this.pendingRequest=gt(l,function(t){i.pendingRequest=null,r(t),i.saveEventData(),i.processRequests(n)})}},Y.prototype.queueRequest=function(t,e){this.queue.push(t),this.processRequests(e)};var K,J=function(t){function e(){t.call(this,"map.load"),this.success={},this.skuToken=""}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.postMapLoadEvent=function(t,e,r,n){this.skuToken=r,(O.EVENTS_URL&&n||O.ACCESS_TOKEN&&Array.isArray(t)&&t.some(function(t){return V(t)||G(t)}))&&this.queueRequest({id:e,timestamp:Date.now()},n)},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){var r=this.queue.shift(),n=r.id,i=r.timestamp;n&&this.success[n]||(this.anonId||this.fetchEventData(),m(this.anonId)||(this.anonId=d()),this.postEvent(i,{skuToken:this.skuToken},function(t){t||n&&(e.success[n]=!0)},t))}},e}(Y),$=new(function(t){function e(e){t.call(this,"appUserTurnstile"),this._customAccessToken=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.postTurnstileEvent=function(t,e){O.EVENTS_URL&&O.ACCESS_TOKEN&&Array.isArray(t)&&t.some(function(t){return V(t)||G(t)})&&this.queueRequest(Date.now(),e)},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();var r=W(O.ACCESS_TOKEN),n=r?r.u:O.ACCESS_TOKEN,i=n!==this.eventData.tokenU;m(this.anonId)||(this.anonId=d(),i=!0);var a=this.queue.shift();if(this.eventData.lastSuccess){var o=new Date(this.eventData.lastSuccess),s=new Date(a),l=(a-this.eventData.lastSuccess)/864e5;i=i||l>=1||l<-1||o.getDate()!==s.getDate()}else i=!0;if(!i)return this.processRequests();this.postEvent(a,{"enabled.telemetry":!1},function(t){t||(e.eventData.lastSuccess=a,e.eventData.tokenU=n)},t)}},e}(Y)),Q=$.postTurnstileEvent.bind($),tt=new J,et=tt.postMapLoadEvent.bind(tt),rt="mapbox-tiles",nt=500,it=50,at=42e4;function ot(t){var e=t.indexOf("?");return e<0?t:t.slice(0,e)}var st=1/0,lt={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(lt);var ut=function(t){function e(e,r,n){401===r&&G(n)&&(e+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),t.call(this,e),this.status=r,this.url=n,this.name=this.constructor.name,this.message=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},e}(Error);function ct(){return"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope}var pt=ct()?function(){return self.worker&&self.worker.referrer}:function(){return("blob:"===self.location.protocol?self.parent:self).location.href};function ht(t,e){var r,n=new self.AbortController,i=new self.Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,referrer:pt(),signal:n.signal}),a=!1,o=!1,s=(r=i.url).indexOf("sku=")>0&&G(r);"json"===t.type&&i.headers.set("Accept","application/json");var l=function(r,n,a){if(!o){if(r&&"SecurityError"!==r.message&&w(r),n&&a)return u(n);var l=Date.now();self.fetch(i).then(function(r){if(r.ok){var n=s?r.clone():null;return u(r,n,l)}return e(new ut(r.statusText,r.status,t.url))}).catch(function(t){20!==t.code&&e(new Error(t.message))})}},u=function(r,n,s){("arrayBuffer"===t.type?r.arrayBuffer():"json"===t.type?r.json():r.text()).then(function(t){o||(n&&s&&function(t,e,r){if(self.caches){var n={status:e.status,statusText:e.statusText,headers:new self.Headers};e.headers.forEach(function(t,e){return n.headers.set(e,t)});var i=A(e.headers.get("Cache-Control")||"");i["no-store"]||(i["max-age"]&&n.headers.set("Expires",new Date(r+1e3*i["max-age"]).toUTCString()),new Date(n.headers.get("Expires")).getTime()-r<at||function(t,e){if(void 0===K)try{new Response(new ReadableStream),K=!0}catch(t){K=!1}K?e(t.body):t.blob().then(e)}(e,function(e){var r=new self.Response(e,n);self.caches.open(rt).then(function(e){return e.put(ot(t.url),r)}).catch(function(t){return w(t.message)})}))}}(i,n,s),a=!0,e(null,t,r.headers.get("Cache-Control"),r.headers.get("Expires")))}).catch(function(t){return e(new Error(t.message))})};return s?function(t,e){if(!self.caches)return e(null);var r=ot(t.url);self.caches.open(rt).then(function(t){t.match(r).then(function(n){var i=function(t){if(!t)return!1;var e=new Date(t.headers.get("Expires")),r=A(t.headers.get("Cache-Control")||"");return e>Date.now()&&!r["no-cache"]}(n);t.delete(r),i&&t.put(r,n.clone()),e(null,n,i)}).catch(e)}).catch(e)}(i,l):l(null,null),{cancel:function(){o=!0,a||n.abort()}}}var ft,dt,mt=function(t,e){if(r=t.url,!(/^file:/.test(r)||/^file:/.test(pt())&&!/^\w+:/.test(r))){if(self.fetch&&self.Request&&self.AbortController&&self.Request.prototype.hasOwnProperty("signal"))return ht(t,e);if(ct()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",t,e)}var r;return function(t,e){var r=new self.XMLHttpRequest;for(var n in r.open(t.method||"GET",t.url,!0),"arrayBuffer"===t.type&&(r.responseType="arraybuffer"),t.headers)r.setRequestHeader(n,t.headers[n]);return"json"===t.type&&(r.responseType="text",r.setRequestHeader("Accept","application/json")),r.withCredentials="include"===t.credentials,r.onerror=function(){e(new Error(r.statusText))},r.onload=function(){if((r.status>=200&&r.status<300||0===r.status)&&null!==r.response){var n=r.response;if("json"===t.type)try{n=JSON.parse(r.response)}catch(t){return e(t)}e(null,n,r.getResponseHeader("Cache-Control"),r.getResponseHeader("Expires"))}else e(new ut(r.statusText,r.status,t.url))},r.send(t.body),{cancel:function(){return r.abort()}}}(t,e)},yt=function(t,e){return mt(p(t,{type:"arrayBuffer"}),e)},gt=function(t,e){return mt(p(t,{method:"POST"}),e)};ft=[],dt=0;var vt=function(t,e){if(dt>=O.MAX_PARALLEL_IMAGE_REQUESTS){var r={requestParameters:t,callback:e,cancelled:!1,cancel:function(){this.cancelled=!0}};return ft.push(r),r}dt++;var n=!1,i=function(){if(!n)for(n=!0,dt--;ft.length&&dt<O.MAX_PARALLEL_IMAGE_REQUESTS;){var t=ft.shift(),e=t.requestParameters,r=t.callback;t.cancelled||(t.cancel=vt(e,r).cancel)}},a=yt(t,function(t,r,n,a){if(i(),t)e(t);else if(r){var o=new self.Image,s=self.URL||self.webkitURL;o.onload=function(){e(null,o),s.revokeObjectURL(o.src)},o.onerror=function(){return e(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))};var l=new self.Blob([new Uint8Array(r)],{type:"image/png"});o.cacheControl=n,o.expires=a,o.src=r.byteLength?s.createObjectURL(l):"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII="}});return{cancel:function(){a.cancel(),i()}}};function _t(t,e,r){r[t]&&-1!==r[t].indexOf(e)||(r[t]=r[t]||[],r[t].push(e))}function xt(t,e,r){if(r&&r[t]){var n=r[t].indexOf(e);-1!==n&&r[t].splice(n,1)}}var bt=function(t,e){void 0===e&&(e={}),p(this,e),this.type=t},wt=function(t){function e(e,r){void 0===r&&(r={}),t.call(this,"error",p({error:e},r))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(bt),kt=function(){};kt.prototype.on=function(t,e){return this._listeners=this._listeners||{},_t(t,e,this._listeners),this},kt.prototype.off=function(t,e){return xt(t,e,this._listeners),xt(t,e,this._oneTimeListeners),this},kt.prototype.once=function(t,e){return this._oneTimeListeners=this._oneTimeListeners||{},_t(t,e,this._oneTimeListeners),this},kt.prototype.fire=function(t,e){"string"==typeof t&&(t=new bt(t,e||{}));var r=t.type;if(this.listens(r)){t.target=this;for(var n=0,i=this._listeners&&this._listeners[r]?this._listeners[r].slice():[];n<i.length;n+=1)i[n].call(this,t);for(var a=0,o=this._oneTimeListeners&&this._oneTimeListeners[r]?this._oneTimeListeners[r].slice():[];a<o.length;a+=1){var s=o[a];xt(r,s,this._oneTimeListeners),s.call(this,t)}var l=this._eventedParent;l&&(p(t,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),l.fire(t))}else t instanceof wt&&console.error(t.error);return this},kt.prototype.listens=function(t){return this._listeners&&this._listeners[t]&&this._listeners[t].length>0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)},kt.prototype.setEventedParent=function(t,e){return this._eventedParent=t,this._eventedParentData=e,this};var Tt={$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_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},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"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1}},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:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},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"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"string",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"},{"!":"text-variable-anchor"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:22,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},expression_name:{type:"enum",values:{let:{group:"Variable binding"},var:{group:"Variable binding"},literal:{group:"Types"},array:{group:"Types"},at:{group:"Lookup"},case:{group:"Decision"},match:{group:"Decision"},coalesce:{group:"Decision"},step:{group:"Ramps, scales, curves"},interpolate:{group:"Ramps, scales, curves"},"interpolate-hcl":{group:"Ramps, scales, curves"},"interpolate-lab":{group:"Ramps, scales, curves"},ln2:{group:"Math"},pi:{group:"Math"},e:{group:"Math"},typeof:{group:"Types"},string:{group:"Types"},number:{group:"Types"},boolean:{group:"Types"},object:{group:"Types"},collator:{group:"Types"},format:{group:"Types"},"number-format":{group:"Types"},"to-string":{group:"Types"},"to-number":{group:"Types"},"to-boolean":{group:"Types"},"to-rgba":{group:"Color"},"to-color":{group:"Types"},rgb:{group:"Color"},rgba:{group:"Color"},get:{group:"Lookup"},has:{group:"Lookup"},length:{group:"Lookup"},properties:{group:"Feature data"},"feature-state":{group:"Feature data"},"geometry-type":{group:"Feature data"},id:{group:"Feature data"},zoom:{group:"Zoom"},"heatmap-density":{group:"Heatmap"},"line-progress":{group:"Feature data"},accumulated:{group:"Feature data"},"+":{group:"Math"},"*":{group:"Math"},"-":{group:"Math"},"/":{group:"Math"},"%":{group:"Math"},"^":{group:"Math"},sqrt:{group:"Math"},log10:{group:"Math"},ln:{group:"Math"},log2:{group:"Math"},sin:{group:"Math"},cos:{group:"Math"},tan:{group:"Math"},asin:{group:"Math"},acos:{group:"Math"},atan:{group:"Math"},min:{group:"Math"},max:{group:"Math"},round:{group:"Math"},abs:{group:"Math"},ceil:{group:"Math"},floor:{group:"Math"},"==":{group:"Decision"},"!=":{group:"Decision"},">":{group:"Decision"},"<":{group:"Decision"},">=":{group:"Decision"},"<=":{group:"Decision"},all:{group:"Decision"},any:{group:"Decision"},"!":{group:"Decision"},"is-supported-script":{group:"String"},upcase:{group:"String"},downcase:{group:"String"},concat:{group:"String"},"resolved-locale":{group:"String"}}},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"string",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"string",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"string",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"string",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}}},At=function(t,e,r,n){this.message=(t?t+": ":"")+r,n&&(this.identifier=n),null!=e&&e.__line__&&(this.line=e.__line__)};function Mt(t){var e=t.key,r=t.value;return r?[new At(e,r,"constants have been deprecated as of v8")]:[]}function St(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var n=0,i=e;n<i.length;n+=1){var a=i[n];for(var o in a)t[o]=a[o]}return t}function Lt(t){return t instanceof Number||t instanceof String||t instanceof Boolean}function Ct(t){return Lt(t)?t.valueOf():t}function Et(t){if(Array.isArray(t))return t.map(Et);if(t instanceof Object&&!Lt(t)){var e={};for(var r in t)e[r]=Et(t[r]);return e}return Ct(t)}var zt=function(t){function e(e,r){t.call(this,r),this.message=r,this.key=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Error),Pt=function(t,e){void 0===e&&(e=[]),this.parent=t,this.bindings={};for(var r=0,n=e;r<n.length;r+=1){var i=n[r],a=i[0],o=i[1];this.bindings[a]=o}};Pt.prototype.concat=function(t){return new Pt(this,t)},Pt.prototype.get=function(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error(t+" not found in scope.")},Pt.prototype.has=function(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)};var It={kind:"null"},Dt={kind:"number"},Ot={kind:"string"},Rt={kind:"boolean"},Ft={kind:"color"},Bt={kind:"object"},Nt={kind:"value"},Ut={kind:"collator"},jt={kind:"formatted"};function Vt(t,e){return{kind:"array",itemType:t,N:e}}function qt(t){if("array"===t.kind){var e=qt(t.itemType);return"number"==typeof t.N?"array<"+e+", "+t.N+">":"value"===t.itemType.kind?"array":"array<"+e+">"}return t.kind}var Gt=[It,Dt,Ot,Rt,Ft,jt,Bt,Vt(Nt)];function Ht(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!Ht(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(var r=0,n=Gt;r<n.length;r+=1)if(!Ht(n[r],e))return null}return"Expected "+qt(t)+" but found "+qt(e)+" instead."}var Zt=e(function(t,e){var r={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],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function n(t){return(t=Math.round(t))<0?0:t>255?255:t}function i(t){return t<0?0:t>1?1:t}function a(t){return"%"===t[t.length-1]?n(parseFloat(t)/100*255):n(parseInt(t))}function o(t){return"%"===t[t.length-1]?i(parseFloat(t)/100):i(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}try{e.parseCSSColor=function(t){var e,i=t.replace(/ /g,"").toLowerCase();if(i in r)return r[i].slice();if("#"===i[0])return 4===i.length?(e=parseInt(i.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:7===i.length&&(e=parseInt(i.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var l=i.indexOf("("),u=i.indexOf(")");if(-1!==l&&u+1===i.length){var c=i.substr(0,l),p=i.substr(l+1,u-(l+1)).split(","),h=1;switch(c){case"rgba":if(4!==p.length)return null;h=o(p.pop());case"rgb":return 3!==p.length?null:[a(p[0]),a(p[1]),a(p[2]),h];case"hsla":if(4!==p.length)return null;h=o(p.pop());case"hsl":if(3!==p.length)return null;var f=(parseFloat(p[0])%360+360)%360/360,d=o(p[1]),m=o(p[2]),y=m<=.5?m*(d+1):m+d-m*d,g=2*m-y;return[n(255*s(g,y,f+1/3)),n(255*s(g,y,f)),n(255*s(g,y,f-1/3)),h];default:return null}}return null}}catch(t){}}).parseCSSColor,Xt=function(t,e,r,n){void 0===n&&(n=1),this.r=t,this.g=e,this.b=r,this.a=n};Xt.parse=function(t){if(t){if(t instanceof Xt)return t;if("string"==typeof t){var e=Zt(t);if(e)return new Xt(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3])}}},Xt.prototype.toString=function(){var t=this.toArray(),e=t[0],r=t[1],n=t[2],i=t[3];return"rgba("+Math.round(e)+","+Math.round(r)+","+Math.round(n)+","+i+")"},Xt.prototype.toArray=function(){var t=this.r,e=this.g,r=this.b,n=this.a;return 0===n?[0,0,0,0]:[255*t/n,255*e/n,255*r/n,n]},Xt.black=new Xt(0,0,0,1),Xt.white=new Xt(1,1,1,1),Xt.transparent=new Xt(0,0,0,0),Xt.red=new Xt(1,0,0,1);var Wt=function(t,e,r){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};Wt.prototype.compare=function(t,e){return this.collator.compare(t,e)},Wt.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var Yt=function(t,e,r,n){this.text=t,this.scale=e,this.fontStack=r,this.textColor=n},Kt=function(t){this.sections=t};function Jt(t,e,r,n){return"number"==typeof t&&t>=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:"Invalid rgba value ["+[t,e,r,n].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"==typeof n?[t,e,r,n]:[t,e,r]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function $t(t){if(null===t)return It;if("string"==typeof t)return Ot;if("boolean"==typeof t)return Rt;if("number"==typeof t)return Dt;if(t instanceof Xt)return Ft;if(t instanceof Wt)return Ut;if(t instanceof Kt)return jt;if(Array.isArray(t)){for(var e,r=t.length,n=0,i=t;n<i.length;n+=1){var a=$t(i[n]);if(e){if(e===a)continue;e=Nt;break}e=a}return Vt(e||Nt,r)}return Bt}function Qt(t){var e=typeof t;return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof Xt||t instanceof Kt?t.toString():JSON.stringify(t)}Kt.fromString=function(t){return new Kt([new Yt(t,null,null,null)])},Kt.prototype.toString=function(){return this.sections.map(function(t){return t.text}).join("")},Kt.prototype.serialize=function(){for(var t=["format"],e=0,r=this.sections;e<r.length;e+=1){var n=r[e];t.push(n.text);var i={};n.fontStack&&(i["text-font"]=["literal",n.fontStack.split(",")]),n.scale&&(i["font-scale"]=n.scale),n.textColor&&(i["text-color"]=["rgba"].concat(n.textColor.toArray())),t.push(i)}return t};var te=function(t,e){this.type=t,this.value=e};te.parse=function(t,e){if(2!==t.length)return e.error("'literal' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(!function t(e){if(null===e)return!0;if("string"==typeof e)return!0;if("boolean"==typeof e)return!0;if("number"==typeof e)return!0;if(e instanceof Xt)return!0;if(e instanceof Wt)return!0;if(e instanceof Kt)return!0;if(Array.isArray(e)){for(var r=0,n=e;r<n.length;r+=1)if(!t(n[r]))return!1;return!0}if("object"==typeof e){for(var i in e)if(!t(e[i]))return!1;return!0}return!1}(t[1]))return e.error("invalid value");var r=t[1],n=$t(r),i=e.expectedType;return"array"!==n.kind||0!==n.N||!i||"array"!==i.kind||"number"==typeof i.N&&0!==i.N||(n=i),new te(n,r)},te.prototype.evaluate=function(){return this.value},te.prototype.eachChild=function(){},te.prototype.possibleOutputs=function(){return[this.value]},te.prototype.serialize=function(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof Xt?["rgba"].concat(this.value.toArray()):this.value instanceof Kt?this.value.serialize():this.value};var ee=function(t){this.name="ExpressionEvaluationError",this.message=t};ee.prototype.toJSON=function(){return this.message};var re={string:Ot,number:Dt,boolean:Rt,object:Bt},ne=function(t,e){this.type=t,this.args=e};ne.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r,n=1,i=t[0];if("array"===i){var a,o;if(t.length>2){var s=t[1];if("string"!=typeof s||!(s in re)||"object"===s)return e.error('The item type argument of "array" must be one of string, number, boolean',1);a=re[s],n++}else a=Nt;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);o=t[2],n++}r=Vt(a,o)}else r=re[i];for(var l=[];n<t.length;n++){var u=e.parse(t[n],n,Nt);if(!u)return null;l.push(u)}return new ne(r,l)},ne.prototype.evaluate=function(t){for(var e=0;e<this.args.length;e++){var r=this.args[e].evaluate(t);if(!Ht(this.type,$t(r)))return r;if(e===this.args.length-1)throw new ee("Expected value to be of type "+qt(this.type)+", but found "+qt($t(r))+" instead.")}return null},ne.prototype.eachChild=function(t){this.args.forEach(t)},ne.prototype.possibleOutputs=function(){var t;return(t=[]).concat.apply(t,this.args.map(function(t){return t.possibleOutputs()}))},ne.prototype.serialize=function(){var t=this.type,e=[t.kind];if("array"===t.kind){var r=t.itemType;if("string"===r.kind||"number"===r.kind||"boolean"===r.kind){e.push(r.kind);var n=t.N;("number"==typeof n||this.args.length>1)&&e.push(n)}}return e.concat(this.args.map(function(t){return t.serialize()}))};var ie=function(t){this.type=jt,this.sections=t};ie.parse=function(t,e){if(t.length<3)return e.error("Expected at least two arguments.");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");for(var r=[],n=1;n<t.length-1;n+=2){var i=e.parse(t[n],1,Nt);if(!i)return null;var a=i.type.kind;if("string"!==a&&"value"!==a&&"null"!==a)return e.error("Formatted text type must be 'string', 'value', or 'null'.");var o=t[n+1];if("object"!=typeof o||Array.isArray(o))return e.error("Format options argument must be an object.");var s=null;if(o["font-scale"]&&!(s=e.parse(o["font-scale"],1,Dt)))return null;var l=null;if(o["text-font"]&&!(l=e.parse(o["text-font"],1,Vt(Ot))))return null;var u=null;if(o["text-color"]&&!(u=e.parse(o["text-color"],1,Ft)))return null;r.push({text:i,scale:s,font:l,textColor:u})}return new ie(r)},ie.prototype.evaluate=function(t){return new Kt(this.sections.map(function(e){return new Yt(Qt(e.text.evaluate(t)),e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)}))},ie.prototype.eachChild=function(t){for(var e=0,r=this.sections;e<r.length;e+=1){var n=r[e];t(n.text),n.scale&&t(n.scale),n.font&&t(n.font),n.textColor&&t(n.textColor)}},ie.prototype.possibleOutputs=function(){return[void 0]},ie.prototype.serialize=function(){for(var t=["format"],e=0,r=this.sections;e<r.length;e+=1){var n=r[e];t.push(n.text.serialize());var i={};n.scale&&(i["font-scale"]=n.scale.serialize()),n.font&&(i["text-font"]=n.font.serialize()),n.textColor&&(i["text-color"]=n.textColor.serialize()),t.push(i)}return t};var ae={"to-boolean":Rt,"to-color":Ft,"to-number":Dt,"to-string":Ot},oe=function(t,e){this.type=t,this.args=e};oe.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[0];if(("to-boolean"===r||"to-string"===r)&&2!==t.length)return e.error("Expected one argument.");for(var n=ae[r],i=[],a=1;a<t.length;a++){var o=e.parse(t[a],a,Nt);if(!o)return null;i.push(o)}return new oe(n,i)},oe.prototype.evaluate=function(t){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(t));if("color"===this.type.kind){for(var e,r,n=0,i=this.args;n<i.length;n+=1){if(r=null,(e=i[n].evaluate(t))instanceof Xt)return e;if("string"==typeof e){var a=t.parseColor(e);if(a)return a}else if(Array.isArray(e)&&!(r=e.length<3||e.length>4?"Invalid rbga value "+JSON.stringify(e)+": expected an array containing either three or four numeric values.":Jt(e[0],e[1],e[2],e[3])))return new Xt(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new ee(r||"Could not parse color from value '"+("string"==typeof e?e:String(JSON.stringify(e)))+"'")}if("number"===this.type.kind){for(var o=null,s=0,l=this.args;s<l.length;s+=1){if(null===(o=l[s].evaluate(t)))return 0;var u=Number(o);if(!isNaN(u))return u}throw new ee("Could not convert "+JSON.stringify(o)+" to number.")}return"formatted"===this.type.kind?Kt.fromString(Qt(this.args[0].evaluate(t))):Qt(this.args[0].evaluate(t))},oe.prototype.eachChild=function(t){this.args.forEach(t)},oe.prototype.possibleOutputs=function(){var t;return(t=[]).concat.apply(t,this.args.map(function(t){return t.possibleOutputs()}))},oe.prototype.serialize=function(){if("formatted"===this.type.kind)return new ie([{text:this.args[0],scale:null,font:null,textColor:null}]).serialize();var t=["to-"+this.type.kind];return this.eachChild(function(e){t.push(e.serialize())}),t};var se=["Unknown","Point","LineString","Polygon"],le=function(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={}};le.prototype.id=function(){return this.feature&&"id"in this.feature?this.feature.id:null},le.prototype.geometryType=function(){return this.feature?"number"==typeof this.feature.type?se[this.feature.type]:this.feature.type:null},le.prototype.properties=function(){return this.feature&&this.feature.properties||{}},le.prototype.parseColor=function(t){var e=this._parseColorCache[t];return e||(e=this._parseColorCache[t]=Xt.parse(t)),e};var ue=function(t,e,r,n){this.name=t,this.type=e,this._evaluate=r,this.args=n};ue.prototype.evaluate=function(t){return this._evaluate(t,this.args)},ue.prototype.eachChild=function(t){this.args.forEach(t)},ue.prototype.possibleOutputs=function(){return[void 0]},ue.prototype.serialize=function(){return[this.name].concat(this.args.map(function(t){return t.serialize()}))},ue.parse=function(t,e){var r,n=t[0],i=ue.definitions[n];if(!i)return e.error('Unknown expression "'+n+'". If you wanted a literal array, use ["literal", [...]].',0);for(var a=Array.isArray(i)?i[0]:i.type,o=Array.isArray(i)?[[i[1],i[2]]]:i.overloads,s=o.filter(function(e){var r=e[0];return!Array.isArray(r)||r.length===t.length-1}),l=null,u=0,c=s;u<c.length;u+=1){var p=c[u],h=p[0],f=p[1];l=new me(e.registry,e.path,null,e.scope);for(var d=[],m=!1,y=1;y<t.length;y++){var g=t[y],v=Array.isArray(h)?h[y-1]:h.type,_=l.parse(g,1+d.length,v);if(!_){m=!0;break}d.push(_)}if(!m)if(Array.isArray(h)&&h.length!==d.length)l.error("Expected "+h.length+" arguments, but found "+d.length+" instead.");else{for(var x=0;x<d.length;x++){var b=Array.isArray(h)?h[x]:h.type,w=d[x];l.concat(x+1).checkSubtype(b,w.type)}if(0===l.errors.length)return new ue(n,a,f,d)}}if(1===s.length)(r=e.errors).push.apply(r,l.errors);else{for(var k=(s.length?s:o).map(function(t){var e;return e=t[0],Array.isArray(e)?"("+e.map(qt).join(", ")+")":"("+qt(e.type)+"...)"}).join(" | "),T=[],A=1;A<t.length;A++){var M=e.parse(t[A],1+T.length);if(!M)return null;T.push(qt(M.type))}e.error("Expected arguments of type "+k+", but found ("+T.join(", ")+") instead.")}return null},ue.register=function(t,e){for(var r in ue.definitions=e,e)t[r]=ue};var ce=function(t,e,r){this.type=Ut,this.locale=r,this.caseSensitive=t,this.diacriticSensitive=e};function pe(t){if(t instanceof ue){if("get"===t.name&&1===t.args.length)return!1;if("feature-state"===t.name)return!1;if("has"===t.name&&1===t.args.length)return!1;if("properties"===t.name||"geometry-type"===t.name||"id"===t.name)return!1;if(/^filter-/.test(t.name))return!1}var e=!0;return t.eachChild(function(t){e&&!pe(t)&&(e=!1)}),e}function he(t){if(t instanceof ue&&"feature-state"===t.name)return!1;var e=!0;return t.eachChild(function(t){e&&!he(t)&&(e=!1)}),e}function fe(t,e){if(t instanceof ue&&e.indexOf(t.name)>=0)return!1;var r=!0;return t.eachChild(function(t){r&&!fe(t,e)&&(r=!1)}),r}ce.parse=function(t,e){if(2!==t.length)return e.error("Expected one argument.");var r=t[1];if("object"!=typeof r||Array.isArray(r))return e.error("Collator options argument must be an object.");var n=e.parse(void 0!==r["case-sensitive"]&&r["case-sensitive"],1,Rt);if(!n)return null;var i=e.parse(void 0!==r["diacritic-sensitive"]&&r["diacritic-sensitive"],1,Rt);if(!i)return null;var a=null;return r.locale&&!(a=e.parse(r.locale,1,Ot))?null:new ce(n,i,a)},ce.prototype.evaluate=function(t){return new Wt(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)},ce.prototype.eachChild=function(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)},ce.prototype.possibleOutputs=function(){return[void 0]},ce.prototype.serialize=function(){var t={};return t["case-sensitive"]=this.caseSensitive.serialize(),t["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(t.locale=this.locale.serialize()),["collator",t]};var de=function(t,e){this.type=e.type,this.name=t,this.boundExpression=e};de.parse=function(t,e){if(2!==t.length||"string"!=typeof t[1])return e.error("'var' expression requires exactly one string literal argument.");var r=t[1];return e.scope.has(r)?new de(r,e.scope.get(r)):e.error('Unknown variable "'+r+'". Make sure "'+r+'" has been bound in an enclosing "let" expression before using it.',1)},de.prototype.evaluate=function(t){return this.boundExpression.evaluate(t)},de.prototype.eachChild=function(){},de.prototype.possibleOutputs=function(){return[void 0]},de.prototype.serialize=function(){return["var",this.name]};var me=function(t,e,r,n,i){void 0===e&&(e=[]),void 0===n&&(n=new Pt),void 0===i&&(i=[]),this.registry=t,this.path=e,this.key=e.map(function(t){return"["+t+"]"}).join(""),this.scope=n,this.errors=i,this.expectedType=r};function ye(t,e){for(var r,n,i=t.length-1,a=0,o=i,s=0;a<=o;)if(r=t[s=Math.floor((a+o)/2)],n=t[s+1],r<=e){if(s===i||e<n)return s;a=s+1}else{if(!(r>e))throw new ee("Input is not a number.");o=s-1}return 0}me.prototype.parse=function(t,e,r,n,i){return void 0===i&&(i={}),e?this.concat(e,r,n)._parse(t,i):this._parse(t,i)},me.prototype._parse=function(t,e){function r(t,e,r){return"assert"===r?new ne(e,[t]):"coerce"===r?new oe(e,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var n=t[0];if("string"!=typeof n)return this.error("Expression name must be a string, but found "+typeof n+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var i=this.registry[n];if(i){var a=i.parse(t,this);if(!a)return null;if(this.expectedType){var o=this.expectedType,s=a.type;if("string"!==o.kind&&"number"!==o.kind&&"boolean"!==o.kind&&"object"!==o.kind&&"array"!==o.kind||"value"!==s.kind)if("color"!==o.kind&&"formatted"!==o.kind||"value"!==s.kind&&"string"!==s.kind){if(this.checkSubtype(o,s))return null}else a=r(a,o,e.typeAnnotation||"coerce");else a=r(a,o,e.typeAnnotation||"assert")}if(!(a instanceof te)&&function t(e){if(e instanceof de)return t(e.boundExpression);if(e instanceof ue&&"error"===e.name)return!1;if(e instanceof ce)return!1;var r=e instanceof oe||e instanceof ne,n=!0;return e.eachChild(function(e){n=r?n&&t(e):n&&e instanceof te}),!!n&&(pe(e)&&fe(e,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"]))}(a)){var l=new le;try{a=new te(a.type,a.evaluate(l))}catch(t){return this.error(t.message),null}}return a}return this.error('Unknown expression "'+n+'". If you wanted a literal array, use ["literal", [...]].',0)}return void 0===t?this.error("'undefined' value invalid. Use null instead."):"object"==typeof t?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found "+typeof t+" instead.")},me.prototype.concat=function(t,e,r){var n="number"==typeof t?this.path.concat(t):this.path,i=r?this.scope.concat(r):this.scope;return new me(this.registry,n,e||null,i,this.errors)},me.prototype.error=function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];var n=""+this.key+e.map(function(t){return"["+t+"]"}).join("");this.errors.push(new zt(n,t))},me.prototype.checkSubtype=function(t,e){var r=Ht(t,e);return r&&this.error(r),r};var ge=function(t,e,r){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(var n=0,i=r;n<i.length;n+=1){var a=i[n],o=a[0],s=a[1];this.labels.push(o),this.outputs.push(s)}};function ve(t,e,r){return t*(1-r)+e*r}ge.parse=function(t,e){if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");var r=e.parse(t[1],1,Dt);if(!r)return null;var n=[],i=null;e.expectedType&&"value"!==e.expectedType.kind&&(i=e.expectedType);for(var a=1;a<t.length;a+=2){var o=1===a?-1/0:t[a],s=t[a+1],l=a,u=a+1;if("number"!=typeof o)return e.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',l);if(n.length&&n[n.length-1][0]>=o)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',l);var c=e.parse(s,u,i);if(!c)return null;i=i||c.type,n.push([o,c])}return new ge(i,r,n)},ge.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);var i=e.length;return n>=e[i-1]?r[i-1].evaluate(t):r[ye(e,n)].evaluate(t)},ge.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e<r.length;e+=1)t(r[e])},ge.prototype.possibleOutputs=function(){var t;return(t=[]).concat.apply(t,this.outputs.map(function(t){return t.possibleOutputs()}))},ge.prototype.serialize=function(){for(var t=["step",this.input.serialize()],e=0;e<this.labels.length;e++)e>0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t};var _e=Object.freeze({number:ve,color:function(t,e,r){return new Xt(ve(t.r,e.r,r),ve(t.g,e.g,r),ve(t.b,e.b,r),ve(t.a,e.a,r))},array:function(t,e,r){return t.map(function(t,n){return ve(t,e[n],r)})}}),xe=.95047,be=1,we=1.08883,ke=4/29,Te=6/29,Ae=3*Te*Te,Me=Te*Te*Te,Se=Math.PI/180,Le=180/Math.PI;function Ce(t){return t>Me?Math.pow(t,1/3):t/Ae+ke}function Ee(t){return t>Te?t*t*t:Ae*(t-ke)}function ze(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Pe(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Ie(t){var e=Pe(t.r),r=Pe(t.g),n=Pe(t.b),i=Ce((.4124564*e+.3575761*r+.1804375*n)/xe),a=Ce((.2126729*e+.7151522*r+.072175*n)/be);return{l:116*a-16,a:500*(i-a),b:200*(a-Ce((.0193339*e+.119192*r+.9503041*n)/we)),alpha:t.a}}function De(t){var e=(t.l+16)/116,r=isNaN(t.a)?e:e+t.a/500,n=isNaN(t.b)?e:e-t.b/200;return e=be*Ee(e),r=xe*Ee(r),n=we*Ee(n),new Xt(ze(3.2404542*r-1.5371385*e-.4985314*n),ze(-.969266*r+1.8760108*e+.041556*n),ze(.0556434*r-.2040259*e+1.0572252*n),t.alpha)}function Oe(t,e,r){var n=e-t;return t+r*(n>180||n<-180?n-360*Math.round(n/360):n)}var Re={forward:Ie,reverse:De,interpolate:function(t,e,r){return{l:ve(t.l,e.l,r),a:ve(t.a,e.a,r),b:ve(t.b,e.b,r),alpha:ve(t.alpha,e.alpha,r)}}},Fe={forward:function(t){var e=Ie(t),r=e.l,n=e.a,i=e.b,a=Math.atan2(i,n)*Le;return{h:a<0?a+360:a,c:Math.sqrt(n*n+i*i),l:r,alpha:t.a}},reverse:function(t){var e=t.h*Se,r=t.c;return De({l:t.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:t.alpha})},interpolate:function(t,e,r){return{h:Oe(t.h,e.h,r),c:ve(t.c,e.c,r),l:ve(t.l,e.l,r),alpha:ve(t.alpha,e.alpha,r)}}},Be=Object.freeze({lab:Re,hcl:Fe}),Ne=function(t,e,r,n,i){this.type=t,this.operator=e,this.interpolation=r,this.input=n,this.labels=[],this.outputs=[];for(var a=0,o=i;a<o.length;a+=1){var s=o[a],l=s[0],u=s[1];this.labels.push(l),this.outputs.push(u)}};function Ue(t,e,r,n){var i=n-r,a=t-r;return 0===i?0:1===e?a/i:(Math.pow(e,a)-1)/(Math.pow(e,i)-1)}Ne.interpolationFactor=function(t,e,n,i){var a=0;if("exponential"===t.name)a=Ue(e,t.base,n,i);else if("linear"===t.name)a=Ue(e,1,n,i);else if("cubic-bezier"===t.name){var o=t.controlPoints;a=new r(o[0],o[1],o[2],o[3]).solve(Ue(e,1,n,i))}return a},Ne.parse=function(t,e){var r=t[0],n=t[1],i=t[2],a=t.slice(3);if(!Array.isArray(n)||0===n.length)return e.error("Expected an interpolation type expression.",1);if("linear"===n[0])n={name:"linear"};else if("exponential"===n[0]){var o=n[1];if("number"!=typeof o)return e.error("Exponential interpolation requires a numeric base.",1,1);n={name:"exponential",base:o}}else{if("cubic-bezier"!==n[0])return e.error("Unknown interpolation type "+String(n[0]),1,0);var s=n.slice(1);if(4!==s.length||s.some(function(t){return"number"!=typeof t||t<0||t>1}))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:s}}if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(!(i=e.parse(i,2,Dt)))return null;var l=[],u=null;"interpolate-hcl"===r||"interpolate-lab"===r?u=Ft:e.expectedType&&"value"!==e.expectedType.kind&&(u=e.expectedType);for(var c=0;c<a.length;c+=2){var p=a[c],h=a[c+1],f=c+3,d=c+4;if("number"!=typeof p)return e.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',f);if(l.length&&l[l.length-1][0]>=p)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',f);var m=e.parse(h,d,u);if(!m)return null;u=u||m.type,l.push([p,m])}return"number"===u.kind||"color"===u.kind||"array"===u.kind&&"number"===u.itemType.kind&&"number"==typeof u.N?new Ne(u,r,n,i,l):e.error("Type "+qt(u)+" is not interpolatable.")},Ne.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);var i=e.length;if(n>=e[i-1])return r[i-1].evaluate(t);var a=ye(e,n),o=e[a],s=e[a+1],l=Ne.interpolationFactor(this.interpolation,n,o,s),u=r[a].evaluate(t),c=r[a+1].evaluate(t);return"interpolate"===this.operator?_e[this.type.kind.toLowerCase()](u,c,l):"interpolate-hcl"===this.operator?Fe.reverse(Fe.interpolate(Fe.forward(u),Fe.forward(c),l)):Re.reverse(Re.interpolate(Re.forward(u),Re.forward(c),l))},Ne.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e<r.length;e+=1)t(r[e])},Ne.prototype.possibleOutputs=function(){var t;return(t=[]).concat.apply(t,this.outputs.map(function(t){return t.possibleOutputs()}))},Ne.prototype.serialize=function(){var t;t="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);for(var e=[this.operator,t,this.input.serialize()],r=0;r<this.labels.length;r++)e.push(this.labels[r],this.outputs[r].serialize());return e};var je=function(t,e){this.type=t,this.args=e};je.parse=function(t,e){if(t.length<2)return e.error("Expectected at least one argument.");var r=null,n=e.expectedType;n&&"value"!==n.kind&&(r=n);for(var i=[],a=0,o=t.slice(1);a<o.length;a+=1){var s=o[a],l=e.parse(s,1+i.length,r,void 0,{typeAnnotation:"omit"});if(!l)return null;r=r||l.type,i.push(l)}var u=n&&i.some(function(t){return Ht(n,t.type)});return new je(u?Nt:r,i)},je.prototype.evaluate=function(t){for(var e=null,r=0,n=this.args;r<n.length&&null===(e=n[r].evaluate(t));r+=1);return e},je.prototype.eachChild=function(t){this.args.forEach(t)},je.prototype.possibleOutputs=function(){var t;return(t=[]).concat.apply(t,this.args.map(function(t){return t.possibleOutputs()}))},je.prototype.serialize=function(){var t=["coalesce"];return this.eachChild(function(e){t.push(e.serialize())}),t};var Ve=function(t,e){this.type=e.type,this.bindings=[].concat(t),this.result=e};Ve.prototype.evaluate=function(t){return this.result.evaluate(t)},Ve.prototype.eachChild=function(t){for(var e=0,r=this.bindings;e<r.length;e+=1)t(r[e][1]);t(this.result)},Ve.parse=function(t,e){if(t.length<4)return e.error("Expected at least 3 arguments, but found "+(t.length-1)+" instead.");for(var r=[],n=1;n<t.length-1;n+=2){var i=t[n];if("string"!=typeof i)return e.error("Expected string, but found "+typeof i+" instead.",n);if(/[^a-zA-Z0-9_]/.test(i))return e.error("Variable names must contain only alphanumeric characters or '_'.",n);var a=e.parse(t[n+1],n+1);if(!a)return null;r.push([i,a])}var o=e.parse(t[t.length-1],t.length-1,e.expectedType,r);return o?new Ve(r,o):null},Ve.prototype.possibleOutputs=function(){return this.result.possibleOutputs()},Ve.prototype.serialize=function(){for(var t=["let"],e=0,r=this.bindings;e<r.length;e+=1){var n=r[e],i=n[0],a=n[1];t.push(i,a.serialize())}return t.push(this.result.serialize()),t};var qe=function(t,e,r){this.type=t,this.index=e,this.input=r};qe.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,Dt),n=e.parse(t[2],2,Vt(e.expectedType||Nt));if(!r||!n)return null;var i=n.type;return new qe(i.itemType,r,n)},qe.prototype.evaluate=function(t){var e=this.index.evaluate(t),r=this.input.evaluate(t);if(e<0)throw new ee("Array index out of bounds: "+e+" < 0.");if(e>=r.length)throw new ee("Array index out of bounds: "+e+" > "+(r.length-1)+".");if(e!==Math.floor(e))throw new ee("Array index must be an integer, but found "+e+" instead.");return r[e]},qe.prototype.eachChild=function(t){t(this.index),t(this.input)},qe.prototype.possibleOutputs=function(){return[void 0]},qe.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var Ge=function(t,e,r,n,i,a){this.inputType=t,this.type=e,this.input=r,this.cases=n,this.outputs=i,this.otherwise=a};Ge.parse=function(t,e){if(t.length<5)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if(t.length%2!=1)return e.error("Expected an even number of arguments.");var r,n;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);for(var i={},a=[],o=2;o<t.length-1;o+=2){var s=t[o],l=t[o+1];Array.isArray(s)||(s=[s]);var u=e.concat(o);if(0===s.length)return u.error("Expected at least one branch label.");for(var c=0,p=s;c<p.length;c+=1){var h=p[c];if("number"!=typeof h&&"string"!=typeof h)return u.error("Branch labels must be numbers or strings.");if("number"==typeof h&&Math.abs(h)>Number.MAX_SAFE_INTEGER)return u.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof h&&Math.floor(h)!==h)return u.error("Numeric branch labels must be integer values.");if(r){if(u.checkSubtype(r,$t(h)))return null}else r=$t(h);if(void 0!==i[String(h)])return u.error("Branch labels must be unique.");i[String(h)]=a.length}var f=e.parse(l,o,n);if(!f)return null;n=n||f.type,a.push(f)}var d=e.parse(t[1],1,Nt);if(!d)return null;var m=e.parse(t[t.length-1],t.length-1,n);return m?"value"!==d.type.kind&&e.concat(1).checkSubtype(r,d.type)?null:new Ge(r,n,d,i,a,m):null},Ge.prototype.evaluate=function(t){var e=this.input.evaluate(t);return($t(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},Ge.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},Ge.prototype.possibleOutputs=function(){var t;return(t=[]).concat.apply(t,this.outputs.map(function(t){return t.possibleOutputs()})).concat(this.otherwise.possibleOutputs())},Ge.prototype.serialize=function(){for(var t=this,e=["match",this.input.serialize()],r=[],n={},i=0,a=Object.keys(this.cases).sort();i<a.length;i+=1){var o=a[i];void 0===(p=n[this.cases[o]])?(n[this.cases[o]]=r.length,r.push([this.cases[o],[o]])):r[p][1].push(o)}for(var s=function(e){return"number"===t.inputType.kind?Number(e):e},l=0,u=r;l<u.length;l+=1){var c=u[l],p=c[0],h=c[1];1===h.length?e.push(s(h[0])):e.push(h.map(s)),e.push(this.outputs[outputIndex$1].serialize())}return e.push(this.otherwise.serialize()),e};var He=function(t,e,r){this.type=t,this.branches=e,this.otherwise=r};function Ze(t,e){return"=="===t||"!="===t?"boolean"===e.kind||"string"===e.kind||"number"===e.kind||"null"===e.kind||"value"===e.kind:"string"===e.kind||"number"===e.kind||"value"===e.kind}function Xe(t,e,r,n){return 0===n.compare(e,r)}function We(t,e,r){var n="=="!==t&&"!="!==t;return function(){function i(t,e,r){this.type=Rt,this.lhs=t,this.rhs=e,this.collator=r,this.hasUntypedArgument="value"===t.type.kind||"value"===e.type.kind}return i.parse=function(t,e){if(3!==t.length&&4!==t.length)return e.error("Expected two or three arguments.");var r=t[0],a=e.parse(t[1],1,Nt);if(!a)return null;if(!Ze(r,a.type))return e.concat(1).error('"'+r+"\" comparisons are not supported for type '"+qt(a.type)+"'.");var o=e.parse(t[2],2,Nt);if(!o)return null;if(!Ze(r,o.type))return e.concat(2).error('"'+r+"\" comparisons are not supported for type '"+qt(o.type)+"'.");if(a.type.kind!==o.type.kind&&"value"!==a.type.kind&&"value"!==o.type.kind)return e.error("Cannot compare types '"+qt(a.type)+"' and '"+qt(o.type)+"'.");n&&("value"===a.type.kind&&"value"!==o.type.kind?a=new ne(o.type,[a]):"value"!==a.type.kind&&"value"===o.type.kind&&(o=new ne(a.type,[o])));var s=null;if(4===t.length){if("string"!==a.type.kind&&"string"!==o.type.kind&&"value"!==a.type.kind&&"value"!==o.type.kind)return e.error("Cannot use collator to compare non-string types.");if(!(s=e.parse(t[3],3,Ut)))return null}return new i(a,o,s)},i.prototype.evaluate=function(i){var a=this.lhs.evaluate(i),o=this.rhs.evaluate(i);if(n&&this.hasUntypedArgument){var s=$t(a),l=$t(o);if(s.kind!==l.kind||"string"!==s.kind&&"number"!==s.kind)throw new ee('Expected arguments for "'+t+'" to be (string, string) or (number, number), but found ('+s.kind+", "+l.kind+") instead.")}if(this.collator&&!n&&this.hasUntypedArgument){var u=$t(a),c=$t(o);if("string"!==u.kind||"string"!==c.kind)return e(i,a,o)}return this.collator?r(i,a,o,this.collator.evaluate(i)):e(i,a,o)},i.prototype.eachChild=function(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator)},i.prototype.possibleOutputs=function(){return[!0,!1]},i.prototype.serialize=function(){var e=[t];return this.eachChild(function(t){e.push(t.serialize())}),e},i}()}He.parse=function(t,e){if(t.length<4)return e.error("Expected at least 3 arguments, but found only "+(t.length-1)+".");if(t.length%2!=0)return e.error("Expected an odd number of arguments.");var r;e.expectedType&&"value"!==e.expectedType.kind&&(r=e.expectedType);for(var n=[],i=1;i<t.length-1;i+=2){var a=e.parse(t[i],i,Rt);if(!a)return null;var o=e.parse(t[i+1],i+1,r);if(!o)return null;n.push([a,o]),r=r||o.type}var s=e.parse(t[t.length-1],t.length-1,r);return s?new He(r,n,s):null},He.prototype.evaluate=function(t){for(var e=0,r=this.branches;e<r.length;e+=1){var n=r[e],i=n[0],a=n[1];if(i.evaluate(t))return a.evaluate(t)}return this.otherwise.evaluate(t)},He.prototype.eachChild=function(t){for(var e=0,r=this.branches;e<r.length;e+=1){var n=r[e],i=n[0],a=n[1];t(i),t(a)}t(this.otherwise)},He.prototype.possibleOutputs=function(){var t;return(t=[]).concat.apply(t,this.branches.map(function(t){return t[0],t[1].possibleOutputs()})).concat(this.otherwise.possibleOutputs())},He.prototype.serialize=function(){var t=["case"];return this.eachChild(function(e){t.push(e.serialize())}),t};var Ye=We("==",function(t,e,r){return e===r},Xe),Ke=We("!=",function(t,e,r){return e!==r},function(t,e,r,n){return!Xe(0,e,r,n)}),Je=We("<",function(t,e,r){return e<r},function(t,e,r,n){return n.compare(e,r)<0}),$e=We(">",function(t,e,r){return e>r},function(t,e,r,n){return n.compare(e,r)>0}),Qe=We("<=",function(t,e,r){return e<=r},function(t,e,r,n){return n.compare(e,r)<=0}),tr=We(">=",function(t,e,r){return e>=r},function(t,e,r,n){return n.compare(e,r)>=0}),er=function(t,e,r,n,i){this.type=Ot,this.number=t,this.locale=e,this.currency=r,this.minFractionDigits=n,this.maxFractionDigits=i};er.parse=function(t,e){if(3!==t.length)return e.error("Expected two arguments.");var r=e.parse(t[1],1,Dt);if(!r)return null;var n=t[2];if("object"!=typeof n||Array.isArray(n))return e.error("NumberFormat options argument must be an object.");var i=null;if(n.locale&&!(i=e.parse(n.locale,1,Ot)))return null;var a=null;if(n.currency&&!(a=e.parse(n.currency,1,Ot)))return null;var o=null;if(n["min-fraction-digits"]&&!(o=e.parse(n["min-fraction-digits"],1,Dt)))return null;var s=null;return n["max-fraction-digits"]&&!(s=e.parse(n["max-fraction-digits"],1,Dt))?null:new er(r,i,a,o,s)},er.prototype.evaluate=function(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))},er.prototype.eachChild=function(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)},er.prototype.possibleOutputs=function(){return[void 0]},er.prototype.serialize=function(){var t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.minFractionDigits&&(t["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(t["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),t]};var rr=function(t){this.type=Dt,this.input=t};rr.parse=function(t,e){if(2!==t.length)return e.error("Expected 1 argument, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?e.error("Expected argument of type string or array, but found "+qt(r.type)+" instead."):new rr(r):null},rr.prototype.evaluate=function(t){var e=this.input.evaluate(t);if("string"==typeof e)return e.length;if(Array.isArray(e))return e.length;throw new ee("Expected value to be of type string or array, but found "+qt($t(e))+" instead.")},rr.prototype.eachChild=function(t){t(this.input)},rr.prototype.possibleOutputs=function(){return[void 0]},rr.prototype.serialize=function(){var t=["length"];return this.eachChild(function(e){t.push(e.serialize())}),t};var nr={"==":Ye,"!=":Ke,">":$e,"<":Je,">=":tr,"<=":Qe,array:ne,at:qe,boolean:ne,case:He,coalesce:je,collator:ce,format:ie,interpolate:Ne,"interpolate-hcl":Ne,"interpolate-lab":Ne,length:rr,let:Ve,literal:te,match:Ge,number:ne,"number-format":er,object:ne,step:ge,string:ne,"to-boolean":oe,"to-color":oe,"to-number":oe,"to-string":oe,var:de};function ir(t,e){var r=e[0],n=e[1],i=e[2],a=e[3];r=r.evaluate(t),n=n.evaluate(t),i=i.evaluate(t);var o=a?a.evaluate(t):1,s=Jt(r,n,i,o);if(s)throw new ee(s);return new Xt(r/255*o,n/255*o,i/255*o,o)}function ar(t,e){return t in e}function or(t,e){var r=e[t];return void 0===r?null:r}function sr(t){return{type:t}}function lr(t){return{result:"success",value:t}}function ur(t){return{result:"error",value:t}}function cr(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function pr(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function hr(t){return!!t.expression&&t.expression.interpolated}function fr(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function dr(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function mr(t){return t}function yr(t,e,r){return void 0!==t?t:void 0!==e?e:void 0!==r?r:void 0}function gr(t,e,r,n,i){return yr(typeof r===i?n[r]:void 0,t.default,e.default)}function vr(t,e,r){if("number"!==fr(r))return yr(t.default,e.default);var n=t.stops.length;if(1===n)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[n-1][0])return t.stops[n-1][1];var i=ye(t.stops.map(function(t){return t[0]}),r);return t.stops[i][1]}function _r(t,e,r){var n=void 0!==t.base?t.base:1;if("number"!==fr(r))return yr(t.default,e.default);var i=t.stops.length;if(1===i)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[i-1][0])return t.stops[i-1][1];var a=ye(t.stops.map(function(t){return t[0]}),r),o=function(t,e,r,n){var i=n-r,a=t-r;return 0===i?0:1===e?a/i:(Math.pow(e,a)-1)/(Math.pow(e,i)-1)}(r,n,t.stops[a][0],t.stops[a+1][0]),s=t.stops[a][1],l=t.stops[a+1][1],u=_e[e.type]||mr;if(t.colorSpace&&"rgb"!==t.colorSpace){var c=Be[t.colorSpace];u=function(t,e){return c.reverse(c.interpolate(c.forward(t),c.forward(e),o))}}return"function"==typeof s.evaluate?{evaluate:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var r=s.evaluate.apply(void 0,t),n=l.evaluate.apply(void 0,t);if(void 0!==r&&void 0!==n)return u(r,n,o)}}:u(s,l,o)}function xr(t,e,r){return"color"===e.type?r=Xt.parse(r):"formatted"===e.type?r=Kt.fromString(r.toString()):fr(r)===e.type||"enum"===e.type&&e.values[r]||(r=void 0),yr(r,t.default,e.default)}ue.register(nr,{error:[{kind:"error"},[Ot],function(t,e){var r=e[0];throw new ee(r.evaluate(t))}],typeof:[Ot,[Nt],function(t,e){return qt($t(e[0].evaluate(t)))}],"to-rgba":[Vt(Dt,4),[Ft],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[Ft,[Dt,Dt,Dt],ir],rgba:[Ft,[Dt,Dt,Dt,Dt],ir],has:{type:Rt,overloads:[[[Ot],function(t,e){return ar(e[0].evaluate(t),t.properties())}],[[Ot,Bt],function(t,e){var r=e[0],n=e[1];return ar(r.evaluate(t),n.evaluate(t))}]]},get:{type:Nt,overloads:[[[Ot],function(t,e){return or(e[0].evaluate(t),t.properties())}],[[Ot,Bt],function(t,e){var r=e[0],n=e[1];return or(r.evaluate(t),n.evaluate(t))}]]},"feature-state":[Nt,[Ot],function(t,e){return or(e[0].evaluate(t),t.featureState||{})}],properties:[Bt,[],function(t){return t.properties()}],"geometry-type":[Ot,[],function(t){return t.geometryType()}],id:[Nt,[],function(t){return t.id()}],zoom:[Dt,[],function(t){return t.globals.zoom}],"heatmap-density":[Dt,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[Dt,[],function(t){return t.globals.lineProgress||0}],accumulated:[Nt,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[Dt,sr(Dt),function(t,e){for(var r=0,n=0,i=e;n<i.length;n+=1)r+=i[n].evaluate(t);return r}],"*":[Dt,sr(Dt),function(t,e){for(var r=1,n=0,i=e;n<i.length;n+=1)r*=i[n].evaluate(t);return r}],"-":{type:Dt,overloads:[[[Dt,Dt],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)-n.evaluate(t)}],[[Dt],function(t,e){return-e[0].evaluate(t)}]]},"/":[Dt,[Dt,Dt],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)/n.evaluate(t)}],"%":[Dt,[Dt,Dt],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)%n.evaluate(t)}],ln2:[Dt,[],function(){return Math.LN2}],pi:[Dt,[],function(){return Math.PI}],e:[Dt,[],function(){return Math.E}],"^":[Dt,[Dt,Dt],function(t,e){var r=e[0],n=e[1];return Math.pow(r.evaluate(t),n.evaluate(t))}],sqrt:[Dt,[Dt],function(t,e){var r=e[0];return Math.sqrt(r.evaluate(t))}],log10:[Dt,[Dt],function(t,e){var r=e[0];return Math.log(r.evaluate(t))/Math.LN10}],ln:[Dt,[Dt],function(t,e){var r=e[0];return Math.log(r.evaluate(t))}],log2:[Dt,[Dt],function(t,e){var r=e[0];return Math.log(r.evaluate(t))/Math.LN2}],sin:[Dt,[Dt],function(t,e){var r=e[0];return Math.sin(r.evaluate(t))}],cos:[Dt,[Dt],function(t,e){var r=e[0];return Math.cos(r.evaluate(t))}],tan:[Dt,[Dt],function(t,e){var r=e[0];return Math.tan(r.evaluate(t))}],asin:[Dt,[Dt],function(t,e){var r=e[0];return Math.asin(r.evaluate(t))}],acos:[Dt,[Dt],function(t,e){var r=e[0];return Math.acos(r.evaluate(t))}],atan:[Dt,[Dt],function(t,e){var r=e[0];return Math.atan(r.evaluate(t))}],min:[Dt,sr(Dt),function(t,e){return Math.min.apply(Math,e.map(function(e){return e.evaluate(t)}))}],max:[Dt,sr(Dt),function(t,e){return Math.max.apply(Math,e.map(function(e){return e.evaluate(t)}))}],abs:[Dt,[Dt],function(t,e){var r=e[0];return Math.abs(r.evaluate(t))}],round:[Dt,[Dt],function(t,e){var r=e[0].evaluate(t);return r<0?-Math.round(-r):Math.round(r)}],floor:[Dt,[Dt],function(t,e){var r=e[0];return Math.floor(r.evaluate(t))}],ceil:[Dt,[Dt],function(t,e){var r=e[0];return Math.ceil(r.evaluate(t))}],"filter-==":[Rt,[Ot,Nt],function(t,e){var r=e[0],n=e[1];return t.properties()[r.value]===n.value}],"filter-id-==":[Rt,[Nt],function(t,e){var r=e[0];return t.id()===r.value}],"filter-type-==":[Rt,[Ot],function(t,e){var r=e[0];return t.geometryType()===r.value}],"filter-<":[Rt,[Ot,Nt],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],a=n.value;return typeof i==typeof a&&i<a}],"filter-id-<":[Rt,[Nt],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n<i}],"filter->":[Rt,[Ot,Nt],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],a=n.value;return typeof i==typeof a&&i>a}],"filter-id->":[Rt,[Nt],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>i}],"filter-<=":[Rt,[Ot,Nt],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],a=n.value;return typeof i==typeof a&&i<=a}],"filter-id-<=":[Rt,[Nt],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n<=i}],"filter->=":[Rt,[Ot,Nt],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],a=n.value;return typeof i==typeof a&&i>=a}],"filter-id->=":[Rt,[Nt],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>=i}],"filter-has":[Rt,[Nt],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[Rt,[],function(t){return null!==t.id()}],"filter-type-in":[Rt,[Vt(Ot)],function(t,e){return e[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[Rt,[Vt(Nt)],function(t,e){return e[0].value.indexOf(t.id())>=0}],"filter-in-small":[Rt,[Ot,Vt(Nt)],function(t,e){var r=e[0];return e[1].value.indexOf(t.properties()[r.value])>=0}],"filter-in-large":[Rt,[Ot,Vt(Nt)],function(t,e){var r=e[0],n=e[1];return function(t,e,r,n){for(;r<=n;){var i=r+n>>1;if(e[i]===t)return!0;e[i]>t?n=i-1:r=i+1}return!1}(t.properties()[r.value],n.value,0,n.value.length-1)}],all:{type:Rt,overloads:[[[Rt,Rt],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)&&n.evaluate(t)}],[sr(Rt),function(t,e){for(var r=0,n=e;r<n.length;r+=1)if(!n[r].evaluate(t))return!1;return!0}]]},any:{type:Rt,overloads:[[[Rt,Rt],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)||n.evaluate(t)}],[sr(Rt),function(t,e){for(var r=0,n=e;r<n.length;r+=1)if(n[r].evaluate(t))return!0;return!1}]]},"!":[Rt,[Rt],function(t,e){return!e[0].evaluate(t)}],"is-supported-script":[Rt,[Ot],function(t,e){var r=e[0],n=t.globals&&t.globals.isSupportedScript;return!n||n(r.evaluate(t))}],upcase:[Ot,[Ot],function(t,e){return e[0].evaluate(t).toUpperCase()}],downcase:[Ot,[Ot],function(t,e){return e[0].evaluate(t).toLowerCase()}],concat:[Ot,sr(Nt),function(t,e){return e.map(function(e){return Qt(e.evaluate(t))}).join("")}],"resolved-locale":[Ot,[Ut],function(t,e){return e[0].evaluate(t).resolvedLocale()}]});var br=function(t,e){this.expression=t,this._warningHistory={},this._evaluator=new le,this._defaultValue=e?function(t){return"color"===t.type&&dr(t.default)?new Xt(0,0,0,0):"color"===t.type?Xt.parse(t.default)||null:void 0===t.default?null:t.default}(e):null,this._enumValues=e&&"enum"===e.type?e.values:null};function wr(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in nr}function kr(t,e){var r=new me(nr,[],e?function(t){var e={color:Ft,string:Ot,number:Dt,enum:Ot,boolean:Rt,formatted:jt};return"array"===t.type?Vt(e[t.value]||Nt,t.length):e[t.type]}(e):void 0),n=r.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return n?lr(new br(n,e)):ur(r.errors)}br.prototype.evaluateWithoutErrorHandling=function(t,e,r,n){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=r,this._evaluator.formattedSection=n,this.expression.evaluate(this._evaluator)},br.prototype.evaluate=function(t,e,r,n){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=r||null,this._evaluator.formattedSection=n||null;try{var i=this.expression.evaluate(this._evaluator);if(null==i)return this._defaultValue;if(this._enumValues&&!(i in this._enumValues))throw new ee("Expected value to be one of "+Object.keys(this._enumValues).map(function(t){return JSON.stringify(t)}).join(", ")+", but found "+JSON.stringify(i)+" instead.");return i}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}};var Tr=function(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!he(e.expression)};Tr.prototype.evaluateWithoutErrorHandling=function(t,e,r,n){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n)},Tr.prototype.evaluate=function(t,e,r,n){return this._styleExpression.evaluate(t,e,r,n)};var Ar=function(t,e,r,n){this.kind=t,this.zoomStops=r,this._styleExpression=e,this.isStateDependent="camera"!==t&&!he(e.expression),this.interpolationType=n};function Mr(t,e){if("error"===(t=kr(t,e)).result)return t;var r=t.value.expression,n=pe(r);if(!n&&!cr(e))return ur([new zt("","data expressions not supported")]);var i=fe(r,["zoom"]);if(!i&&!pr(e))return ur([new zt("","zoom expressions not supported")]);var a=function t(e){var r=null;if(e instanceof Ve)r=t(e.result);else if(e instanceof je)for(var n=0,i=e.args;n<i.length;n+=1){var a=i[n];if(r=t(a))break}else(e instanceof ge||e instanceof Ne)&&e.input instanceof ue&&"zoom"===e.input.name&&(r=e);return r instanceof zt?r:(e.eachChild(function(e){var n=t(e);n instanceof zt?r=n:!r&&n?r=new zt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):r&&n&&r!==n&&(r=new zt("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),r)}(r);if(!a&&!i)return ur([new zt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(a instanceof zt)return ur([a]);if(a instanceof Ne&&!hr(e))return ur([new zt("",'"interpolate" expressions cannot be used with this property')]);if(!a)return lr(new Tr(n?"constant":"source",t.value));var o=a instanceof Ne?a.interpolation:void 0;return lr(new Ar(n?"camera":"composite",t.value,a.labels,o))}Ar.prototype.evaluateWithoutErrorHandling=function(t,e,r,n){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n)},Ar.prototype.evaluate=function(t,e,r,n){return this._styleExpression.evaluate(t,e,r,n)},Ar.prototype.interpolationFactor=function(t,e,r){return this.interpolationType?Ne.interpolationFactor(this.interpolationType,t,e,r):0};var Sr=function(t,e){this._parameters=t,this._specification=e,St(this,function t(e,r){var n,i,a,o="color"===r.type,s=e.stops&&"object"==typeof e.stops[0][0],l=s||void 0!==e.property,u=s||!l,c=e.type||(hr(r)?"exponential":"interval");if(o&&((e=St({},e)).stops&&(e.stops=e.stops.map(function(t){return[t[0],Xt.parse(t[1])]})),e.default?e.default=Xt.parse(e.default):e.default=Xt.parse(r.default)),e.colorSpace&&"rgb"!==e.colorSpace&&!Be[e.colorSpace])throw new Error("Unknown color space: "+e.colorSpace);if("exponential"===c)n=_r;else if("interval"===c)n=vr;else if("categorical"===c){n=gr,i=Object.create(null);for(var p=0,h=e.stops;p<h.length;p+=1){var f=h[p];i[f[0]]=f[1]}a=typeof e.stops[0][0]}else{if("identity"!==c)throw new Error('Unknown function type "'+c+'"');n=xr}if(s){for(var d={},m=[],y=0;y<e.stops.length;y++){var g=e.stops[y],v=g[0].zoom;void 0===d[v]&&(d[v]={zoom:v,type:e.type,property:e.property,default:e.default,stops:[]},m.push(v)),d[v].stops.push([g[0].value,g[1]])}for(var _=[],x=0,b=m;x<b.length;x+=1){var w=b[x];_.push([d[w].zoom,t(d[w],r)])}var k={name:"linear"};return{kind:"composite",interpolationType:k,interpolationFactor:Ne.interpolationFactor.bind(void 0,k),zoomStops:_.map(function(t){return t[0]}),evaluate:function(t,n){var i=t.zoom;return _r({stops:_,base:e.base},r,i).evaluate(i,n)}}}if(u){var T="exponential"===c?{name:"exponential",base:void 0!==e.base?e.base:1}:null;return{kind:"camera",interpolationType:T,interpolationFactor:Ne.interpolationFactor.bind(void 0,T),zoomStops:e.stops.map(function(t){return t[0]}),evaluate:function(t){var o=t.zoom;return n(e,r,o,i,a)}}}return{kind:"source",evaluate:function(t,o){var s=o&&o.properties?o.properties[e.property]:void 0;return void 0===s?yr(e.default,r.default):n(e,r,s,i,a)}}}(this._parameters,this._specification))};function Lr(t){var e=t.key,r=t.value,n=t.valueSpec||{},i=t.objectElementValidators||{},a=t.style,o=t.styleSpec,s=[],l=fr(r);if("object"!==l)return[new At(e,r,"object expected, "+l+" found")];for(var u in r){var c=u.split(".")[0],p=n[c]||n["*"],h=void 0;if(i[c])h=i[c];else if(n[c])h=$r;else if(i["*"])h=i["*"];else{if(!n["*"]){s.push(new At(e,r[u],'unknown property "'+u+'"'));continue}h=$r}s=s.concat(h({key:(e?e+".":e)+u,value:r[u],valueSpec:p,style:a,styleSpec:o,object:r,objectKey:u},r))}for(var f in n)i[f]||n[f].required&&void 0===n[f].default&&void 0===r[f]&&s.push(new At(e,r,'missing required property "'+f+'"'));return s}function Cr(t){var e=t.value,r=t.valueSpec,n=t.style,i=t.styleSpec,a=t.key,o=t.arrayElementValidator||$r;if("array"!==fr(e))return[new At(a,e,"array expected, "+fr(e)+" found")];if(r.length&&e.length!==r.length)return[new At(a,e,"array length "+r.length+" expected, length "+e.length+" found")];if(r["min-length"]&&e.length<r["min-length"])return[new At(a,e,"array length at least "+r["min-length"]+" expected, length "+e.length+" found")];var s={type:r.value,values:r.values};i.$version<7&&(s.function=r.function),"object"===fr(r.value)&&(s=r.value);for(var l=[],u=0;u<e.length;u++)l=l.concat(o({array:e,arrayIndex:u,value:e[u],valueSpec:s,style:n,styleSpec:i,key:a+"["+u+"]"}));return l}function Er(t){var e=t.key,r=t.value,n=t.valueSpec,i=fr(r);return"number"!==i?[new At(e,r,"number expected, "+i+" found")]:"minimum"in n&&r<n.minimum?[new At(e,r,r+" is less than the minimum value "+n.minimum)]:"maximum"in n&&r>n.maximum?[new At(e,r,r+" is greater than the maximum value "+n.maximum)]:[]}function zr(t){var e,r,n,i=t.valueSpec,a=Ct(t.value.type),o={},s="categorical"!==a&&void 0===t.value.property,l=!s,u="array"===fr(t.value.stops)&&"array"===fr(t.value.stops[0])&&"object"===fr(t.value.stops[0][0]),c=Lr({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===a)return[new At(t.key,t.value,'identity function may not have a "stops" property')];var e=[],r=t.value;return e=e.concat(Cr({key:t.key,value:r,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:p})),"array"===fr(r)&&0===r.length&&e.push(new At(t.key,r,"array must have at least one stop")),e},default:function(t){return $r({key:t.key,value:t.value,valueSpec:i,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===a&&s&&c.push(new At(t.key,t.value,'missing required property "property"')),"identity"===a||t.value.stops||c.push(new At(t.key,t.value,'missing required property "stops"')),"exponential"===a&&t.valueSpec.expression&&!hr(t.valueSpec)&&c.push(new At(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(l&&!cr(t.valueSpec)?c.push(new At(t.key,t.value,"property functions not supported")):s&&!pr(t.valueSpec)&&c.push(new At(t.key,t.value,"zoom functions not supported"))),"categorical"!==a&&!u||void 0!==t.value.property||c.push(new At(t.key,t.value,'"property" property is required')),c;function p(t){var e=[],a=t.value,s=t.key;if("array"!==fr(a))return[new At(s,a,"array expected, "+fr(a)+" found")];if(2!==a.length)return[new At(s,a,"array length 2 expected, length "+a.length+" found")];if(u){if("object"!==fr(a[0]))return[new At(s,a,"object expected, "+fr(a[0])+" found")];if(void 0===a[0].zoom)return[new At(s,a,"object stop key must have zoom")];if(void 0===a[0].value)return[new At(s,a,"object stop key must have value")];if(n&&n>Ct(a[0].zoom))return[new At(s,a[0].zoom,"stop zoom values must appear in ascending order")];Ct(a[0].zoom)!==n&&(n=Ct(a[0].zoom),r=void 0,o={}),e=e.concat(Lr({key:s+"[0]",value:a[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:Er,value:h}}))}else e=e.concat(h({key:s+"[0]",value:a[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},a));return wr(Et(a[1]))?e.concat([new At(s+"[1]",a[1],"expressions are not allowed in function stops.")]):e.concat($r({key:s+"[1]",value:a[1],valueSpec:i,style:t.style,styleSpec:t.styleSpec}))}function h(t,n){var s=fr(t.value),l=Ct(t.value),u=null!==t.value?t.value:n;if(e){if(s!==e)return[new At(t.key,u,s+" stop domain type must match previous stop domain type "+e)]}else e=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return[new At(t.key,u,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==a){var c="number expected, "+s+" found";return cr(i)&&void 0===a&&(c+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new At(t.key,u,c)]}return"categorical"!==a||"number"!==s||isFinite(l)&&Math.floor(l)===l?"categorical"!==a&&"number"===s&&void 0!==r&&l<r?[new At(t.key,u,"stop domain values must appear in ascending order")]:(r=l,"categorical"===a&&l in o?[new At(t.key,u,"stop domain values must be unique")]:(o[l]=!0,[])):[new At(t.key,u,"integer expected, found "+l)]}}function Pr(t){var e=("property"===t.expressionContext?Mr:kr)(Et(t.value),t.valueSpec);if("error"===e.result)return e.value.map(function(e){return new At(""+t.key+e.key,t.value,e.message)});var r=e.value.expression||e.value._styleExpression.expression;if("property"===t.expressionContext&&"text-font"===t.propertyKey&&-1!==r.possibleOutputs().indexOf(void 0))return[new At(t.key,t.value,'Invalid data expression for "'+t.propertyKey+'". Output values must be contained as literals within the expression.')];if("property"===t.expressionContext&&"layout"===t.propertyType&&!he(r))return[new At(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===t.expressionContext&&!he(r))return[new At(t.key,t.value,'"feature-state" data expressions are not supported with filters.')];if(t.expressionContext&&0===t.expressionContext.indexOf("cluster")){if(!fe(r,["zoom","feature-state"]))return[new At(t.key,t.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===t.expressionContext&&!pe(r))return[new At(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Ir(t){var e=t.key,r=t.value,n=t.valueSpec,i=[];return Array.isArray(n.values)?-1===n.values.indexOf(Ct(r))&&i.push(new At(e,r,"expected one of ["+n.values.join(", ")+"], "+JSON.stringify(r)+" found")):-1===Object.keys(n.values).indexOf(Ct(r))&&i.push(new At(e,r,"expected one of ["+Object.keys(n.values).join(", ")+"], "+JSON.stringify(r)+" found")),i}function Dr(t){if(!0===t||!1===t)return!0;if(!Array.isArray(t)||0===t.length)return!1;switch(t[0]){case"has":return t.length>=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(var e=0,r=t.slice(1);e<r.length;e+=1){var n=r[e];if(!Dr(n)&&"boolean"!=typeof n)return!1}return!0;default:return!0}}Sr.deserialize=function(t){return new Sr(t._parameters,t._specification)},Sr.serialize=function(t){return{_parameters:t._parameters,_specification:t._specification}};var Or={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Rr(t){if(null==t)return function(){return!0};Dr(t)||(t=Br(t));var e=kr(t,Or);if("error"===e.result)throw new Error(e.value.map(function(t){return t.key+": "+t.message}).join(", "));return function(t,r){return e.value.evaluate(t,r)}}function Fr(t,e){return t<e?-1:t>e?1:0}function Br(t){if(!t)return!0;var e,r=t[0];return t.length<=1?"any"!==r:"=="===r?Nr(t[1],t[2],"=="):"!="===r?Vr(Nr(t[1],t[2],"==")):"<"===r||">"===r||"<="===r||">="===r?Nr(t[1],t[2],r):"any"===r?(e=t.slice(1),["any"].concat(e.map(Br))):"all"===r?["all"].concat(t.slice(1).map(Br)):"none"===r?["all"].concat(t.slice(1).map(Br).map(Vr)):"in"===r?Ur(t[1],t.slice(2)):"!in"===r?Vr(Ur(t[1],t.slice(2))):"has"===r?jr(t[1]):"!has"!==r||Vr(jr(t[1]))}function Nr(t,e,r){switch(t){case"$type":return["filter-type-"+r,e];case"$id":return["filter-id-"+r,e];default:return["filter-"+r,t,e]}}function Ur(t,e){if(0===e.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some(function(t){return typeof t!=typeof e[0]})?["filter-in-large",t,["literal",e.sort(Fr)]]:["filter-in-small",t,["literal",e]]}}function jr(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function Vr(t){return["!",t]}function qr(t){return Dr(Et(t.value))?Pr(St({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function t(e){var r=e.value,n=e.key;if("array"!==fr(r))return[new At(n,r,"array expected, "+fr(r)+" found")];var i,a=e.styleSpec,o=[];if(r.length<1)return[new At(n,r,"filter array must have at least 1 element")];switch(o=o.concat(Ir({key:n+"[0]",value:r[0],valueSpec:a.filter_operator,style:e.style,styleSpec:e.styleSpec})),Ct(r[0])){case"<":case"<=":case">":case">=":r.length>=2&&"$type"===Ct(r[1])&&o.push(new At(n,r,'"$type" cannot be use with operator "'+r[0]+'"'));case"==":case"!=":3!==r.length&&o.push(new At(n,r,'filter array for operator "'+r[0]+'" must have 3 elements'));case"in":case"!in":r.length>=2&&"string"!==(i=fr(r[1]))&&o.push(new At(n+"[1]",r[1],"string expected, "+i+" found"));for(var s=2;s<r.length;s++)i=fr(r[s]),"$type"===Ct(r[1])?o=o.concat(Ir({key:n+"["+s+"]",value:r[s],valueSpec:a.geometry_type,style:e.style,styleSpec:e.styleSpec})):"string"!==i&&"number"!==i&&"boolean"!==i&&o.push(new At(n+"["+s+"]",r[s],"string, number, or boolean expected, "+i+" found"));break;case"any":case"all":case"none":for(var l=1;l<r.length;l++)o=o.concat(t({key:n+"["+l+"]",value:r[l],style:e.style,styleSpec:e.styleSpec}));break;case"has":case"!has":i=fr(r[1]),2!==r.length?o.push(new At(n,r,'filter array for "'+r[0]+'" operator must have 2 elements')):"string"!==i&&o.push(new At(n+"[1]",r[1],"string expected, "+i+" found"))}return o}(t)}function Gr(t,e){var r=t.key,n=t.style,i=t.styleSpec,a=t.value,o=t.objectKey,s=i[e+"_"+t.layerType];if(!s)return[];var l=o.match(/^(.*)-transition$/);if("paint"===e&&l&&s[l[1]]&&s[l[1]].transition)return $r({key:r,value:a,valueSpec:i.transition,style:n,styleSpec:i});var u,c=t.valueSpec||s[o];if(!c)return[new At(r,a,'unknown property "'+o+'"')];if("string"===fr(a)&&cr(c)&&!c.tokens&&(u=/^{([^}]+)}$/.exec(a)))return[new At(r,a,'"'+o+'" does not support interpolation syntax\nUse an identity property function instead: `{ "type": "identity", "property": '+JSON.stringify(u[1])+" }`.")];var p=[];return"symbol"===t.layerType&&("text-field"===o&&n&&!n.glyphs&&p.push(new At(r,a,'use of "text-field" requires a style "glyphs" property')),"text-font"===o&&dr(Et(a))&&"identity"===Ct(a.type)&&p.push(new At(r,a,'"text-font" does not support identity functions'))),p.concat($r({key:t.key,value:a,valueSpec:c,style:n,styleSpec:i,expressionContext:"property",propertyType:e,propertyKey:o}))}function Hr(t){return Gr(t,"paint")}function Zr(t){return Gr(t,"layout")}function Xr(t){var e=[],r=t.value,n=t.key,i=t.style,a=t.styleSpec;r.type||r.ref||e.push(new At(n,r,'either "type" or "ref" is required'));var o,s=Ct(r.type),l=Ct(r.ref);if(r.id)for(var u=Ct(r.id),c=0;c<t.arrayIndex;c++){var p=i.layers[c];Ct(p.id)===u&&e.push(new At(n,r.id,'duplicate layer id "'+r.id+'", previously used at line '+p.id.__line__))}if("ref"in r)["type","source","source-layer","filter","layout"].forEach(function(t){t in r&&e.push(new At(n,r[t],'"'+t+'" is prohibited for ref layers'))}),i.layers.forEach(function(t){Ct(t.id)===l&&(o=t)}),o?o.ref?e.push(new At(n,r.ref,"ref cannot reference another ref layer")):s=Ct(o.type):e.push(new At(n,r.ref,'ref layer "'+l+'" not found'));else if("background"!==s)if(r.source){var h=i.sources&&i.sources[r.source],f=h&&Ct(h.type);h?"vector"===f&&"raster"===s?e.push(new At(n,r.source,'layer "'+r.id+'" requires a raster source')):"raster"===f&&"raster"!==s?e.push(new At(n,r.source,'layer "'+r.id+'" requires a vector source')):"vector"!==f||r["source-layer"]?"raster-dem"===f&&"hillshade"!==s?e.push(new At(n,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):"line"!==s||!r.paint||!r.paint["line-gradient"]||"geojson"===f&&h.lineMetrics||e.push(new At(n,r,'layer "'+r.id+'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.')):e.push(new At(n,r,'layer "'+r.id+'" must specify a "source-layer"')):e.push(new At(n,r.source,'source "'+r.source+'" not found'))}else e.push(new At(n,r,'missing required property "source"'));return e=e.concat(Lr({key:n,value:r,valueSpec:a.layer,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(){return[]},type:function(){return $r({key:n+".type",value:r.type,valueSpec:a.layer.type,style:t.style,styleSpec:t.styleSpec,object:r,objectKey:"type"})},filter:qr,layout:function(t){return Lr({layer:r,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return Zr(St({layerType:s},t))}}})},paint:function(t){return Lr({layer:r,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return Hr(St({layerType:s},t))}}})}}}))}function Wr(t){var e=t.value,r=t.key,n=t.styleSpec,i=t.style;if(!e.type)return[new At(r,e,'"type" is required')];var a,o=Ct(e.type);switch(o){case"vector":case"raster":case"raster-dem":return Lr({key:r,value:e,valueSpec:n["source_"+o.replace("-","_")],style:t.style,styleSpec:n});case"geojson":if(a=Lr({key:r,value:e,valueSpec:n.source_geojson,style:i,styleSpec:n}),e.cluster)for(var s in e.clusterProperties){var l=e.clusterProperties[s],u=l[0],c=l[1],p="string"==typeof u?[u,["accumulated"],["get",s]]:u;a.push.apply(a,Pr({key:r+"."+s+".map",value:c,expressionContext:"cluster-map"})),a.push.apply(a,Pr({key:r+"."+s+".reduce",value:p,expressionContext:"cluster-reduce"}))}return a;case"video":return Lr({key:r,value:e,valueSpec:n.source_video,style:i,styleSpec:n});case"image":return Lr({key:r,value:e,valueSpec:n.source_image,style:i,styleSpec:n});case"canvas":return[new At(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Ir({key:r+".type",value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:i,styleSpec:n})}}function Yr(t){var e=t.value,r=t.styleSpec,n=r.light,i=t.style,a=[],o=fr(e);if(void 0===e)return a;if("object"!==o)return a.concat([new At("light",e,"object expected, "+o+" found")]);for(var s in e){var l=s.match(/^(.*)-transition$/);a=l&&n[l[1]]&&n[l[1]].transition?a.concat($r({key:s,value:e[s],valueSpec:r.transition,style:i,styleSpec:r})):n[s]?a.concat($r({key:s,value:e[s],valueSpec:n[s],style:i,styleSpec:r})):a.concat([new At(s,e[s],'unknown property "'+s+'"')])}return a}function Kr(t){var e=t.value,r=t.key,n=fr(e);return"string"!==n?[new At(r,e,"string expected, "+n+" found")]:[]}var Jr={"*":function(){return[]},array:Cr,boolean:function(t){var e=t.value,r=t.key,n=fr(e);return"boolean"!==n?[new At(r,e,"boolean expected, "+n+" found")]:[]},number:Er,color:function(t){var e=t.key,r=t.value,n=fr(r);return"string"!==n?[new At(e,r,"color expected, "+n+" found")]:null===Zt(r)?[new At(e,r,'color expected, "'+r+'" found')]:[]},constants:Mt,enum:Ir,filter:qr,function:zr,layer:Xr,object:Lr,source:Wr,light:Yr,string:Kr,formatted:function(t){return 0===Kr(t).length?[]:Pr(t)}};function $r(t){var e=t.value,r=t.valueSpec,n=t.styleSpec;return r.expression&&dr(Ct(e))?zr(t):r.expression&&wr(Et(e))?Pr(t):r.type&&Jr[r.type]?Jr[r.type](t):Lr(St({},t,{valueSpec:r.type?n[r.type]:r}))}function Qr(t){var e=t.value,r=t.key,n=Kr(t);return n.length?n:(-1===e.indexOf("{fontstack}")&&n.push(new At(r,e,'"glyphs" url must include a "{fontstack}" token')),-1===e.indexOf("{range}")&&n.push(new At(r,e,'"glyphs" url must include a "{range}" token')),n)}function tn(t,e){e=e||Tt;var r=[];return r=r.concat($r({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,objectElementValidators:{glyphs:Qr,"*":function(){return[]}}})),t.constants&&(r=r.concat(Mt({key:"constants",value:t.constants,style:t,styleSpec:e}))),en(r)}function en(t){return[].concat(t).sort(function(t,e){return t.line-e.line})}function rn(t){return function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];return en(t.apply(this,e))}}tn.source=rn(Wr),tn.light=rn(Yr),tn.layer=rn(Xr),tn.filter=rn(qr),tn.paintProperty=rn(Hr),tn.layoutProperty=rn(Zr);var nn=tn,an=nn.light,on=nn.paintProperty,sn=nn.layoutProperty;function ln(t,e){var r=!1;if(e&&e.length)for(var n=0,i=e;n<i.length;n+=1){var a=i[n];t.fire(new wt(new Error(a.message))),r=!0}return r}var un=pn,cn=3;function pn(t,e,r){var n=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;var i=new Int32Array(this.arrayBuffer);t=i[0],e=i[1],r=i[2],this.d=e+2*r;for(var a=0;a<this.d*this.d;a++){var o=i[cn+a],s=i[cn+a+1];n.push(o===s?null:i.subarray(o,s))}var l=i[cn+n.length],u=i[cn+n.length+1];this.keys=i.subarray(l,u),this.bboxes=i.subarray(u),this.insert=this._insertReadonly}else{this.d=e+2*r;for(var c=0;c<this.d*this.d;c++)n.push([]);this.keys=[],this.bboxes=[]}this.n=e,this.extent=t,this.padding=r,this.scale=e/t,this.uid=0;var p=r/e*t;this.min=-p,this.max=t+p}pn.prototype.insert=function(t,e,r,n,i){this._forEachCell(e,r,n,i,this._insertCell,this.uid++),this.keys.push(t),this.bboxes.push(e),this.bboxes.push(r),this.bboxes.push(n),this.bboxes.push(i)},pn.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},pn.prototype._insertCell=function(t,e,r,n,i,a){this.cells[i].push(a)},pn.prototype.query=function(t,e,r,n,i){var a=this.min,o=this.max;if(t<=a&&e<=a&&o<=r&&o<=n&&!i)return Array.prototype.slice.call(this.keys);var s=[];return this._forEachCell(t,e,r,n,this._queryCell,s,{},i),s},pn.prototype._queryCell=function(t,e,r,n,i,a,o,s){var l=this.cells[i];if(null!==l)for(var u=this.keys,c=this.bboxes,p=0;p<l.length;p++){var h=l[p];if(void 0===o[h]){var f=4*h;(s?s(c[f+0],c[f+1],c[f+2],c[f+3]):t<=c[f+2]&&e<=c[f+3]&&r>=c[f+0]&&n>=c[f+1])?(o[h]=!0,a.push(u[h])):o[h]=!1}}},pn.prototype._forEachCell=function(t,e,r,n,i,a,o,s){for(var l=this._convertToCellCoord(t),u=this._convertToCellCoord(e),c=this._convertToCellCoord(r),p=this._convertToCellCoord(n),h=l;h<=c;h++)for(var f=u;f<=p;f++){var d=this.d*f+h;if((!s||s(this._convertFromCellCoord(h),this._convertFromCellCoord(f),this._convertFromCellCoord(h+1),this._convertFromCellCoord(f+1)))&&i.call(this,t,e,r,n,d,a,o,s))return}},pn.prototype._convertFromCellCoord=function(t){return(t-this.padding)/this.scale},pn.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},pn.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=cn+this.cells.length+1+1,r=0,n=0;n<this.cells.length;n++)r+=this.cells[n].length;var i=new Int32Array(e+r+this.keys.length+this.bboxes.length);i[0]=this.extent,i[1]=this.n,i[2]=this.padding;for(var a=e,o=0;o<t.length;o++){var s=t[o];i[cn+o]=a,i.set(s,a),a+=s.length}return i[cn+t.length]=a,i.set(this.keys,a),a+=this.keys.length,i[cn+t.length+1]=a,i.set(this.bboxes,a),a+=this.bboxes.length,i.buffer};var hn=self.ImageData,fn={};function dn(t,e,r){void 0===r&&(r={}),Object.defineProperty(e,"_classRegistryKey",{value:t,writeable:!1}),fn[t]={klass:e,omit:r.omit||[],shallow:r.shallow||[]}}for(var mn in dn("Object",Object),un.serialize=function(t,e){var r=t.toArrayBuffer();return e&&e.push(r),{buffer:r}},un.deserialize=function(t){return new un(t.buffer)},dn("Grid",un),dn("Color",Xt),dn("Error",Error),dn("StylePropertyFunction",Sr),dn("StyleExpression",br,{omit:["_evaluator"]}),dn("ZoomDependentExpression",Ar),dn("ZoomConstantExpression",Tr),dn("CompoundExpression",ue,{omit:["_evaluate"]}),nr)nr[mn]._classRegistryKey||dn("Expression_"+mn,nr[mn]);function yn(t,e){if(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp)return t;if(t instanceof ArrayBuffer)return e&&e.push(t),t;if(ArrayBuffer.isView(t)){var r=t;return e&&e.push(r.buffer),r}if(t instanceof hn)return e&&e.push(t.data.buffer),t;if(Array.isArray(t)){for(var n=[],i=0,a=t;i<a.length;i+=1){var o=a[i];n.push(yn(o,e))}return n}if("object"==typeof t){var s=t.constructor,l=s._classRegistryKey;if(!l)throw new Error("can't serialize object of unregistered class");var u=s.serialize?s.serialize(t,e):{};if(!s.serialize){for(var c in t)if(t.hasOwnProperty(c)&&!(fn[l].omit.indexOf(c)>=0)){var p=t[c];u[c]=fn[l].shallow.indexOf(c)>=0?p:yn(p,e)}t instanceof Error&&(u.message=t.message)}if(u.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==l&&(u.$name=l),u}throw new Error("can't serialize object of type "+typeof t)}function gn(t){if(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||t instanceof ArrayBuffer||ArrayBuffer.isView(t)||t instanceof hn)return t;if(Array.isArray(t))return t.map(gn);if("object"==typeof t){var e=t.$name||"Object",r=fn[e].klass;if(!r)throw new Error("can't deserialize unregistered class "+e);if(r.deserialize)return r.deserialize(t);for(var n=Object.create(r.prototype),i=0,a=Object.keys(t);i<a.length;i+=1){var o=a[i];if("$name"!==o){var s=t[o];n[o]=fn[e].shallow.indexOf(o)>=0?s:gn(s)}}return n}throw new Error("can't deserialize object of type "+typeof t)}var vn=function(){this.first=!0};vn.prototype.update=function(t,e){var r=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=r,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=r,!0):(this.lastFloorZoom>r?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=e):this.lastFloorZoom<r&&(this.lastIntegerZoom=r,this.lastIntegerZoomTime=e),t!==this.lastZoom&&(this.lastZoom=t,this.lastFloorZoom=r,!0))};var _n={"Latin-1 Supplement":function(t){return t>=128&&t<=255},Arabic:function(t){return t>=1536&&t<=1791},"Arabic Supplement":function(t){return t>=1872&&t<=1919},"Arabic Extended-A":function(t){return t>=2208&&t<=2303},"Hangul Jamo":function(t){return t>=4352&&t<=4607},"Unified Canadian Aboriginal Syllabics":function(t){return t>=5120&&t<=5759},Khmer:function(t){return t>=6016&&t<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(t){return t>=6320&&t<=6399},"General Punctuation":function(t){return t>=8192&&t<=8303},"Letterlike Symbols":function(t){return t>=8448&&t<=8527},"Number Forms":function(t){return t>=8528&&t<=8591},"Miscellaneous Technical":function(t){return t>=8960&&t<=9215},"Control Pictures":function(t){return t>=9216&&t<=9279},"Optical Character Recognition":function(t){return t>=9280&&t<=9311},"Enclosed Alphanumerics":function(t){return t>=9312&&t<=9471},"Geometric Shapes":function(t){return t>=9632&&t<=9727},"Miscellaneous Symbols":function(t){return t>=9728&&t<=9983},"Miscellaneous Symbols and Arrows":function(t){return t>=11008&&t<=11263},"CJK Radicals Supplement":function(t){return t>=11904&&t<=12031},"Kangxi Radicals":function(t){return t>=12032&&t<=12255},"Ideographic Description Characters":function(t){return t>=12272&&t<=12287},"CJK Symbols and Punctuation":function(t){return t>=12288&&t<=12351},Hiragana:function(t){return t>=12352&&t<=12447},Katakana:function(t){return t>=12448&&t<=12543},Bopomofo:function(t){return t>=12544&&t<=12591},"Hangul Compatibility Jamo":function(t){return t>=12592&&t<=12687},Kanbun:function(t){return t>=12688&&t<=12703},"Bopomofo Extended":function(t){return t>=12704&&t<=12735},"CJK Strokes":function(t){return t>=12736&&t<=12783},"Katakana Phonetic Extensions":function(t){return t>=12784&&t<=12799},"Enclosed CJK Letters and Months":function(t){return t>=12800&&t<=13055},"CJK Compatibility":function(t){return t>=13056&&t<=13311},"CJK Unified Ideographs Extension A":function(t){return t>=13312&&t<=19903},"Yijing Hexagram Symbols":function(t){return t>=19904&&t<=19967},"CJK Unified Ideographs":function(t){return t>=19968&&t<=40959},"Yi Syllables":function(t){return t>=40960&&t<=42127},"Yi Radicals":function(t){return t>=42128&&t<=42191},"Hangul Jamo Extended-A":function(t){return t>=43360&&t<=43391},"Hangul Syllables":function(t){return t>=44032&&t<=55215},"Hangul Jamo Extended-B":function(t){return t>=55216&&t<=55295},"Private Use Area":function(t){return t>=57344&&t<=63743},"CJK Compatibility Ideographs":function(t){return t>=63744&&t<=64255},"Arabic Presentation Forms-A":function(t){return t>=64336&&t<=65023},"Vertical Forms":function(t){return t>=65040&&t<=65055},"CJK Compatibility Forms":function(t){return t>=65072&&t<=65103},"Small Form Variants":function(t){return t>=65104&&t<=65135},"Arabic Presentation Forms-B":function(t){return t>=65136&&t<=65279},"Halfwidth and Fullwidth Forms":function(t){return t>=65280&&t<=65519}};function xn(t){for(var e=0,r=t;e<r.length;e+=1)if(wn(r[e].charCodeAt(0)))return!0;return!1}function bn(t){return!(_n.Arabic(t)||_n["Arabic Supplement"](t)||_n["Arabic Extended-A"](t)||_n["Arabic Presentation Forms-A"](t)||_n["Arabic Presentation Forms-B"](t))}function wn(t){return!!(746===t||747===t||!(t<4352)&&(_n["Bopomofo Extended"](t)||_n.Bopomofo(t)||_n["CJK Compatibility Forms"](t)&&!(t>=65097&&t<=65103)||_n["CJK Compatibility Ideographs"](t)||_n["CJK Compatibility"](t)||_n["CJK Radicals Supplement"](t)||_n["CJK Strokes"](t)||!(!_n["CJK Symbols and Punctuation"](t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||_n["CJK Unified Ideographs Extension A"](t)||_n["CJK Unified Ideographs"](t)||_n["Enclosed CJK Letters and Months"](t)||_n["Hangul Compatibility Jamo"](t)||_n["Hangul Jamo Extended-A"](t)||_n["Hangul Jamo Extended-B"](t)||_n["Hangul Jamo"](t)||_n["Hangul Syllables"](t)||_n.Hiragana(t)||_n["Ideographic Description Characters"](t)||_n.Kanbun(t)||_n["Kangxi Radicals"](t)||_n["Katakana Phonetic Extensions"](t)||_n.Katakana(t)&&12540!==t||!(!_n["Halfwidth and Fullwidth Forms"](t)||65288===t||65289===t||65293===t||t>=65306&&t<=65310||65339===t||65341===t||65343===t||t>=65371&&t<=65503||65507===t||t>=65512&&t<=65519)||!(!_n["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||_n["Unified Canadian Aboriginal Syllabics"](t)||_n["Unified Canadian Aboriginal Syllabics Extended"](t)||_n["Vertical Forms"](t)||_n["Yijing Hexagram Symbols"](t)||_n["Yi Syllables"](t)||_n["Yi Radicals"](t)))}function kn(t){return!(wn(t)||function(t){return!!(_n["Latin-1 Supplement"](t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||_n["General Punctuation"](t)&&(8214===t||8224===t||8225===t||8240===t||8241===t||8251===t||8252===t||8258===t||8263===t||8264===t||8265===t||8273===t)||_n["Letterlike Symbols"](t)||_n["Number Forms"](t)||_n["Miscellaneous Technical"](t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||9003===t||t>=9085&&t<=9114||t>=9150&&t<=9165||9167===t||t>=9169&&t<=9179||t>=9186&&t<=9215)||_n["Control Pictures"](t)&&9251!==t||_n["Optical Character Recognition"](t)||_n["Enclosed Alphanumerics"](t)||_n["Geometric Shapes"](t)||_n["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||_n["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||_n["CJK Symbols and Punctuation"](t)||_n.Katakana(t)||_n["Private Use Area"](t)||_n["CJK Compatibility Forms"](t)||_n["Small Form Variants"](t)||_n["Halfwidth and Fullwidth Forms"](t)||8734===t||8756===t||8757===t||t>=9984&&t<=10087||t>=10102&&t<=10131||65532===t||65533===t)}(t))}function Tn(t,e){return!(!e&&(t>=1424&&t<=2303||_n["Arabic Presentation Forms-A"](t)||_n["Arabic Presentation Forms-B"](t))||t>=2304&&t<=3583||t>=3840&&t<=4255||_n.Khmer(t))}var An,Mn=!1,Sn=null,Ln=!1,Cn=new kt,En={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return Ln||null!=En.applyArabicShaping}},zn=function(t,e){this.zoom=t,e?(this.now=e.now,this.fadeDuration=e.fadeDuration,this.zoomHistory=e.zoomHistory,this.transition=e.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new vn,this.transition={})};zn.prototype.isSupportedScript=function(t){return function(t,e){for(var r=0,n=t;r<n.length;r+=1)if(!Tn(n[r].charCodeAt(0),e))return!1;return!0}(t,En.isLoaded())},zn.prototype.crossFadingFactor=function(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},zn.prototype.getCrossfadeParameters=function(){var t=this.zoom,e=t-Math.floor(t),r=this.crossFadingFactor();return t>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:e+(1-e)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*e}};var Pn=function(t,e){this.property=t,this.value=e,this.expression=function(t,e){if(dr(t))return new Sr(t,e);if(wr(t)){var r=Mr(t,e);if("error"===r.result)throw new Error(r.value.map(function(t){return t.key+": "+t.message}).join(", "));return r.value}var n=t;return"string"==typeof t&&"color"===e.type&&(n=Xt.parse(t)),{kind:"constant",evaluate:function(){return n}}}(void 0===e?t.specification.default:e,t.specification)};Pn.prototype.isDataDriven=function(){return"source"===this.expression.kind||"composite"===this.expression.kind},Pn.prototype.possiblyEvaluate=function(t){return this.property.possiblyEvaluate(this,t)};var In=function(t){this.property=t,this.value=new Pn(t,void 0)};In.prototype.transitioned=function(t,e){return new On(this.property,this.value,e,p({},t.transition,this.transition),t.now)},In.prototype.untransitioned=function(){return new On(this.property,this.value,null,{},0)};var Dn=function(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)};Dn.prototype.getValue=function(t){return x(this._values[t].value.value)},Dn.prototype.setValue=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new In(this._values[t].property)),this._values[t].value=new Pn(this._values[t].property,null===e?void 0:x(e))},Dn.prototype.getTransition=function(t){return x(this._values[t].transition)},Dn.prototype.setTransition=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new In(this._values[t].property)),this._values[t].transition=x(e)||void 0},Dn.prototype.serialize=function(){for(var t={},e=0,r=Object.keys(this._values);e<r.length;e+=1){var n=r[e],i=this.getValue(n);void 0!==i&&(t[n]=i);var a=this.getTransition(n);void 0!==a&&(t[n+"-transition"]=a)}return t},Dn.prototype.transitioned=function(t,e){for(var r=new Rn(this._properties),n=0,i=Object.keys(this._values);n<i.length;n+=1){var a=i[n];r._values[a]=this._values[a].transitioned(t,e._values[a])}return r},Dn.prototype.untransitioned=function(){for(var t=new Rn(this._properties),e=0,r=Object.keys(this._values);e<r.length;e+=1){var n=r[e];t._values[n]=this._values[n].untransitioned()}return t};var On=function(t,e,r,n,i){this.property=t,this.value=e,this.begin=i+n.delay||0,this.end=this.begin+n.duration||0,t.specification.transition&&(n.delay||n.duration)&&(this.prior=r)};On.prototype.possiblyEvaluate=function(t){var e=t.now||0,r=this.value.possiblyEvaluate(t),n=this.prior;if(n){if(e>this.end)return this.prior=null,r;if(this.value.isDataDriven())return this.prior=null,r;if(e<this.begin)return n.possiblyEvaluate(t);var i=(e-this.begin)/(this.end-this.begin);return this.property.interpolate(n.possiblyEvaluate(t),r,function(t){if(i<=0)return 0;if(i>=1)return 1;var e=i*i,r=e*i;return 4*(i<.5?r:3*(i-e)+r-.75)}())}return r};var Rn=function(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)};Rn.prototype.possiblyEvaluate=function(t){for(var e=new Nn(this._properties),r=0,n=Object.keys(this._values);r<n.length;r+=1){var i=n[r];e._values[i]=this._values[i].possiblyEvaluate(t)}return e},Rn.prototype.hasTransition=function(){for(var t=0,e=Object.keys(this._values);t<e.length;t+=1){var r=e[t];if(this._values[r].prior)return!0}return!1};var Fn=function(t){this._properties=t,this._values=Object.create(t.defaultPropertyValues)};Fn.prototype.getValue=function(t){return x(this._values[t].value)},Fn.prototype.setValue=function(t,e){this._values[t]=new Pn(this._values[t].property,null===e?void 0:x(e))},Fn.prototype.serialize=function(){for(var t={},e=0,r=Object.keys(this._values);e<r.length;e+=1){var n=r[e],i=this.getValue(n);void 0!==i&&(t[n]=i)}return t},Fn.prototype.possiblyEvaluate=function(t){for(var e=new Nn(this._properties),r=0,n=Object.keys(this._values);r<n.length;r+=1){var i=n[r];e._values[i]=this._values[i].possiblyEvaluate(t)}return e};var Bn=function(t,e,r){this.property=t,this.value=e,this.parameters=r};Bn.prototype.isConstant=function(){return"constant"===this.value.kind},Bn.prototype.constantOr=function(t){return"constant"===this.value.kind?this.value.value:t},Bn.prototype.evaluate=function(t,e){return this.property.evaluate(this.value,this.parameters,t,e)};var Nn=function(t){this._properties=t,this._values=Object.create(t.defaultPossiblyEvaluatedValues)};Nn.prototype.get=function(t){return this._values[t]};var Un=function(t){this.specification=t};Un.prototype.possiblyEvaluate=function(t,e){return t.expression.evaluate(e)},Un.prototype.interpolate=function(t,e,r){var n=_e[this.specification.type];return n?n(t,e,r):t};var jn=function(t,e){this.specification=t,this.overrides=e};jn.prototype.possiblyEvaluate=function(t,e){return"constant"===t.expression.kind||"camera"===t.expression.kind?new Bn(this,{kind:"constant",value:t.expression.evaluate(e)},e):new Bn(this,t.expression,e)},jn.prototype.interpolate=function(t,e,r){if("constant"!==t.value.kind||"constant"!==e.value.kind)return t;if(void 0===t.value.value||void 0===e.value.value)return new Bn(this,{kind:"constant",value:void 0},t.parameters);var n=_e[this.specification.type];return n?new Bn(this,{kind:"constant",value:n(t.value.value,e.value.value,r)},t.parameters):t},jn.prototype.evaluate=function(t,e,r,n){return"constant"===t.kind?t.value:t.evaluate(e,r,n)};var Vn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.possiblyEvaluate=function(t,e){if(void 0===t.value)return new Bn(this,{kind:"constant",value:void 0},e);if("constant"===t.expression.kind){var r=t.expression.evaluate(e),n=this._calculate(r,r,r,e);return new Bn(this,{kind:"constant",value:n},e)}if("camera"===t.expression.kind){var i=this._calculate(t.expression.evaluate({zoom:e.zoom-1}),t.expression.evaluate({zoom:e.zoom}),t.expression.evaluate({zoom:e.zoom+1}),e);return new Bn(this,{kind:"constant",value:i},e)}return new Bn(this,t.expression,e)},e.prototype.evaluate=function(t,e,r,n){if("source"===t.kind){var i=t.evaluate(e,r,n);return this._calculate(i,i,i,e)}return"composite"===t.kind?this._calculate(t.evaluate({zoom:Math.floor(e.zoom)-1},r,n),t.evaluate({zoom:Math.floor(e.zoom)},r,n),t.evaluate({zoom:Math.floor(e.zoom)+1},r,n),e):t.value},e.prototype._calculate=function(t,e,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},e.prototype.interpolate=function(t){return t},e}(jn),qn=function(t){this.specification=t};qn.prototype.possiblyEvaluate=function(t,e){if(void 0!==t.value){if("constant"===t.expression.kind){var r=t.expression.evaluate(e);return this._calculate(r,r,r,e)}return this._calculate(t.expression.evaluate(new zn(Math.floor(e.zoom-1),e)),t.expression.evaluate(new zn(Math.floor(e.zoom),e)),t.expression.evaluate(new zn(Math.floor(e.zoom+1),e)),e)}},qn.prototype._calculate=function(t,e,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},qn.prototype.interpolate=function(t){return t};var Gn=function(t){this.specification=t};Gn.prototype.possiblyEvaluate=function(t,e){return!!t.expression.evaluate(e)},Gn.prototype.interpolate=function(){return!1};var Hn=function(t){for(var e in this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],t){var r=t[e];r.specification.overridable&&this.overridableProperties.push(e);var n=this.defaultPropertyValues[e]=new Pn(r,void 0),i=this.defaultTransitionablePropertyValues[e]=new In(r);this.defaultTransitioningPropertyValues[e]=i.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=n.possiblyEvaluate({})}};dn("DataDrivenProperty",jn),dn("DataConstantProperty",Un),dn("CrossFadedDataDrivenProperty",Vn),dn("CrossFadedProperty",qn),dn("ColorRampProperty",Gn);var Zn=function(t){function e(e,r){if(t.call(this),this.id=e.id,this.type=e.type,this._featureFilter=function(){return!0},"custom"!==e.type&&(e=e,this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,"background"!==e.type&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),r.layout&&(this._unevaluatedLayout=new Fn(r.layout)),r.paint)){for(var n in this._transitionablePaint=new Dn(r.paint),e.paint)this.setPaintProperty(n,e.paint[n],{validate:!1});for(var i in e.layout)this.setLayoutProperty(i,e.layout[i],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned()}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},e.prototype.getLayoutProperty=function(t){return"visibility"===t?this.visibility:this._unevaluatedLayout.getValue(t)},e.prototype.setLayoutProperty=function(t,e,r){if(void 0===r&&(r={}),null!=e){var n="layers."+this.id+".layout."+t;if(this._validate(sn,n,t,e,r))return}"visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility=e},e.prototype.getPaintProperty=function(t){return g(t,"-transition")?this._transitionablePaint.getTransition(t.slice(0,-"-transition".length)):this._transitionablePaint.getValue(t)},e.prototype.setPaintProperty=function(t,e,r){if(void 0===r&&(r={}),null!=e){var n="layers."+this.id+".paint."+t;if(this._validate(on,n,t,e,r))return!1}if(g(t,"-transition"))return this._transitionablePaint.setTransition(t.slice(0,-"-transition".length),e||void 0),!1;var i=this._transitionablePaint._values[t],a="cross-faded-data-driven"===i.property.specification["property-type"],o=i.value.isDataDriven(),s=i.value;this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t);var l=this._transitionablePaint._values[t].value;return l.isDataDriven()||o||a||this._handleOverridablePaintPropertyUpdate(t,s,l)},e.prototype._handleSpecialPaintPropertyUpdate=function(t){},e.prototype._handleOverridablePaintPropertyUpdate=function(t,e,r){return!1},e.prototype.isHidden=function(t){return!!(this.minzoom&&t<this.minzoom)||!!(this.maxzoom&&t>=this.maxzoom)||"none"===this.visibility},e.prototype.updateTransitions=function(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)},e.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},e.prototype.recalculate=function(t){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t)),this.paint=this._transitioningPaint.possiblyEvaluate(t)},e.prototype.serialize=function(){var t={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(t.layout=t.layout||{},t.layout.visibility=this.visibility),_(t,function(t,e){return!(void 0===t||"layout"===e&&!Object.keys(t).length||"paint"===e&&!Object.keys(t).length)})},e.prototype._validate=function(t,e,r,n,i){return void 0===i&&(i={}),(!i||!1!==i.validate)&&ln(this,t.call(nn,{key:e,layerType:this.type,objectKey:r,value:n,styleSpec:Tt,style:{glyphs:!0,sprite:!0}}))},e.prototype.is3D=function(){return!1},e.prototype.isTileClipped=function(){return!1},e.prototype.hasOffscreenPass=function(){return!1},e.prototype.resize=function(){},e.prototype.isStateDependent=function(){for(var t in this.paint._values){var e=this.paint.get(t);if(e instanceof Bn&&cr(e.property.specification)&&("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent)return!0}return!1},e}(kt),Xn={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Wn=function(t,e){this._structArray=t,this._pos1=e*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},Yn=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function Kn(t,e){void 0===e&&(e=1);var r=0,n=0;return{members:t.map(function(t){var i,a=(i=t.type,Xn[i].BYTES_PER_ELEMENT),o=r=Jn(r,Math.max(e,a)),s=t.components||1;return n=Math.max(n,a),r+=a*s,{name:t.name,type:t.type,components:s,offset:o}}),size:Jn(r,Math.max(n,e)),alignment:e}}function Jn(t,e){return Math.ceil(t/e)*e}Yn.serialize=function(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}},Yn.deserialize=function(t){var e=Object.create(this.prototype);return e.arrayBuffer=t.arrayBuffer,e.length=t.length,e.capacity=t.arrayBuffer.byteLength/e.bytesPerElement,e._refreshViews(),e},Yn.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},Yn.prototype.clear=function(){this.length=0},Yn.prototype.resize=function(t){this.reserve(t),this.length=t},Yn.prototype.reserve=function(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}},Yn.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var $n=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.int16[n+0]=e,this.int16[n+1]=r,t},e}(Yn);$n.prototype.bytesPerElement=4,dn("StructArrayLayout2i4",$n);var Qn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,i){var a=4*t;return this.int16[a+0]=e,this.int16[a+1]=r,this.int16[a+2]=n,this.int16[a+3]=i,t},e}(Yn);Qn.prototype.bytesPerElement=8,dn("StructArrayLayout4i8",Qn);var ti=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i,a)},e.prototype.emplace=function(t,e,r,n,i,a,o){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=a,this.int16[s+5]=o,t},e}(Yn);ti.prototype.bytesPerElement=12,dn("StructArrayLayout2i4i12",ti);var ei=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i,a)},e.prototype.emplace=function(t,e,r,n,i,a,o){var s=4*t,l=8*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.uint8[l+4]=n,this.uint8[l+5]=i,this.uint8[l+6]=a,this.uint8[l+7]=o,t},e}(Yn);ei.prototype.bytesPerElement=8,dn("StructArrayLayout2i4ub8",ei);var ri=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s){var l=this.length;return this.resize(l+1),this.emplace(l,t,e,r,n,i,a,o,s)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,l){var u=8*t;return this.uint16[u+0]=e,this.uint16[u+1]=r,this.uint16[u+2]=n,this.uint16[u+3]=i,this.uint16[u+4]=a,this.uint16[u+5]=o,this.uint16[u+6]=s,this.uint16[u+7]=l,t},e}(Yn);ri.prototype.bytesPerElement=16,dn("StructArrayLayout8ui16",ri);var ni=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s){var l=this.length;return this.resize(l+1),this.emplace(l,t,e,r,n,i,a,o,s)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,l){var u=8*t;return this.int16[u+0]=e,this.int16[u+1]=r,this.int16[u+2]=n,this.int16[u+3]=i,this.uint16[u+4]=a,this.uint16[u+5]=o,this.uint16[u+6]=s,this.uint16[u+7]=l,t},e}(Yn);ni.prototype.bytesPerElement=16,dn("StructArrayLayout4i4ui16",ni);var ii=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=3*t;return this.float32[i+0]=e,this.float32[i+1]=r,this.float32[i+2]=n,t},e}(Yn);ii.prototype.bytesPerElement=12,dn("StructArrayLayout3f12",ii);var ai=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){var r=1*t;return this.uint32[r+0]=e,t},e}(Yn);ai.prototype.bytesPerElement=4,dn("StructArrayLayout1ul4",ai);var oi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s,l,u,c){var p=this.length;return this.resize(p+1),this.emplace(p,t,e,r,n,i,a,o,s,l,u,c)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,l,u,c,p){var h=12*t,f=6*t;return this.int16[h+0]=e,this.int16[h+1]=r,this.int16[h+2]=n,this.int16[h+3]=i,this.int16[h+4]=a,this.int16[h+5]=o,this.uint32[f+3]=s,this.uint16[h+8]=l,this.uint16[h+9]=u,this.int16[h+10]=c,this.int16[h+11]=p,t},e}(Yn);oi.prototype.bytesPerElement=24,dn("StructArrayLayout6i1ul2ui2i24",oi);var si=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i,a)},e.prototype.emplace=function(t,e,r,n,i,a,o){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=a,this.int16[s+5]=o,t},e}(Yn);si.prototype.bytesPerElement=12,dn("StructArrayLayout2i2i2i12",si);var li=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,i){var a=12*t,o=3*t;return this.uint8[a+0]=e,this.uint8[a+1]=r,this.float32[o+1]=n,this.float32[o+2]=i,t},e}(Yn);li.prototype.bytesPerElement=12,dn("StructArrayLayout2ub2f12",li);var ui=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s,l,u,c,p,h,f,d,m){var y=this.length;return this.resize(y+1),this.emplace(y,t,e,r,n,i,a,o,s,l,u,c,p,h,f,d,m)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,l,u,c,p,h,f,d,m,y){var g=22*t,v=11*t,_=44*t;return this.int16[g+0]=e,this.int16[g+1]=r,this.uint16[g+2]=n,this.uint16[g+3]=i,this.uint32[v+2]=a,this.uint32[v+3]=o,this.uint32[v+4]=s,this.uint16[g+10]=l,this.uint16[g+11]=u,this.uint16[g+12]=c,this.float32[v+7]=p,this.float32[v+8]=h,this.uint8[_+36]=f,this.uint8[_+37]=d,this.uint8[_+38]=m,this.uint32[v+10]=y,t},e}(Yn);ui.prototype.bytesPerElement=44,dn("StructArrayLayout2i2ui3ul3ui2f3ub1ul44",ui);var ci=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s,l,u,c,p,h,f,d,m,y,g,v,_){var x=this.length;return this.resize(x+1),this.emplace(x,t,e,r,n,i,a,o,s,l,u,c,p,h,f,d,m,y,g,v,_)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,l,u,c,p,h,f,d,m,y,g,v,_,x){var b=24*t,w=12*t;return this.int16[b+0]=e,this.int16[b+1]=r,this.int16[b+2]=n,this.int16[b+3]=i,this.int16[b+4]=a,this.int16[b+5]=o,this.uint16[b+6]=s,this.uint16[b+7]=l,this.uint16[b+8]=u,this.uint16[b+9]=c,this.uint16[b+10]=p,this.uint16[b+11]=h,this.uint16[b+12]=f,this.uint16[b+13]=d,this.uint16[b+14]=m,this.uint16[b+15]=y,this.uint16[b+16]=g,this.uint32[w+9]=v,this.float32[w+10]=_,this.float32[w+11]=x,t},e}(Yn);ci.prototype.bytesPerElement=48,dn("StructArrayLayout6i11ui1ul2f48",ci);var pi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){var r=1*t;return this.float32[r+0]=e,t},e}(Yn);pi.prototype.bytesPerElement=4,dn("StructArrayLayout1f4",pi);var hi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=3*t;return this.int16[i+0]=e,this.int16[i+1]=r,this.int16[i+2]=n,t},e}(Yn);hi.prototype.bytesPerElement=6,dn("StructArrayLayout3i6",hi);var fi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=2*t,a=4*t;return this.uint32[i+0]=e,this.uint16[a+2]=r,this.uint16[a+3]=n,t},e}(Yn);fi.prototype.bytesPerElement=8,dn("StructArrayLayout1ul2ui8",fi);var di=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=3*t;return this.uint16[i+0]=e,this.uint16[i+1]=r,this.uint16[i+2]=n,t},e}(Yn);di.prototype.bytesPerElement=6,dn("StructArrayLayout3ui6",di);var mi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.uint16[n+0]=e,this.uint16[n+1]=r,t},e}(Yn);mi.prototype.bytesPerElement=4,dn("StructArrayLayout2ui4",mi);var yi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){var r=1*t;return this.uint16[r+0]=e,t},e}(Yn);yi.prototype.bytesPerElement=2,dn("StructArrayLayout1ui2",yi);var gi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.float32[n+0]=e,this.float32[n+1]=r,t},e}(Yn);gi.prototype.bytesPerElement=8,dn("StructArrayLayout2f8",gi);var vi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,i){var a=4*t;return this.float32[a+0]=e,this.float32[a+1]=r,this.float32[a+2]=n,this.float32[a+3]=i,t},e}(Yn);vi.prototype.bytesPerElement=16,dn("StructArrayLayout4f16",vi);var _i=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={anchorPointX:{configurable:!0},anchorPointY:{configurable:!0},x1:{configurable:!0},y1:{configurable:!0},x2:{configurable:!0},y2:{configurable:!0},featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0},radius:{configurable:!0},signedDistanceFromAnchor:{configurable:!0},anchorPoint:{configurable:!0}};return r.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorPointX.set=function(t){this._structArray.int16[this._pos2+0]=t},r.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},r.anchorPointY.set=function(t){this._structArray.int16[this._pos2+1]=t},r.x1.get=function(){return this._structArray.int16[this._pos2+2]},r.x1.set=function(t){this._structArray.int16[this._pos2+2]=t},r.y1.get=function(){return this._structArray.int16[this._pos2+3]},r.y1.set=function(t){this._structArray.int16[this._pos2+3]=t},r.x2.get=function(){return this._structArray.int16[this._pos2+4]},r.x2.set=function(t){this._structArray.int16[this._pos2+4]=t},r.y2.get=function(){return this._structArray.int16[this._pos2+5]},r.y2.set=function(t){this._structArray.int16[this._pos2+5]=t},r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.featureIndex.set=function(t){this._structArray.uint32[this._pos4+3]=t},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},r.sourceLayerIndex.set=function(t){this._structArray.uint16[this._pos2+8]=t},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.bucketIndex.set=function(t){this._structArray.uint16[this._pos2+9]=t},r.radius.get=function(){return this._structArray.int16[this._pos2+10]},r.radius.set=function(t){this._structArray.int16[this._pos2+10]=t},r.signedDistanceFromAnchor.get=function(){return this._structArray.int16[this._pos2+11]},r.signedDistanceFromAnchor.set=function(t){this._structArray.int16[this._pos2+11]=t},r.anchorPoint.get=function(){return new i(this.anchorPointX,this.anchorPointY)},Object.defineProperties(e.prototype,r),e}(Wn);_i.prototype.size=24;var xi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new _i(this,t)},e}(oi);dn("CollisionBoxArray",xi);var bi=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},glyphStartIndex:{configurable:!0},numGlyphs:{configurable:!0},vertexStartIndex:{configurable:!0},lineStartIndex:{configurable:!0},lineLength:{configurable:!0},segment:{configurable:!0},lowerSize:{configurable:!0},upperSize:{configurable:!0},lineOffsetX:{configurable:!0},lineOffsetY:{configurable:!0},writingMode:{configurable:!0},placedOrientation:{configurable:!0},hidden:{configurable:!0},crossTileID:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorX.set=function(t){this._structArray.int16[this._pos2+0]=t},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.anchorY.set=function(t){this._structArray.int16[this._pos2+1]=t},r.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.glyphStartIndex.set=function(t){this._structArray.uint16[this._pos2+2]=t},r.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},r.numGlyphs.set=function(t){this._structArray.uint16[this._pos2+3]=t},r.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},r.vertexStartIndex.set=function(t){this._structArray.uint32[this._pos4+2]=t},r.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.lineStartIndex.set=function(t){this._structArray.uint32[this._pos4+3]=t},r.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},r.lineLength.set=function(t){this._structArray.uint32[this._pos4+4]=t},r.segment.get=function(){return this._structArray.uint16[this._pos2+10]},r.segment.set=function(t){this._structArray.uint16[this._pos2+10]=t},r.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},r.lowerSize.set=function(t){this._structArray.uint16[this._pos2+11]=t},r.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},r.upperSize.set=function(t){this._structArray.uint16[this._pos2+12]=t},r.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},r.lineOffsetX.set=function(t){this._structArray.float32[this._pos4+7]=t},r.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},r.lineOffsetY.set=function(t){this._structArray.float32[this._pos4+8]=t},r.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},r.writingMode.set=function(t){this._structArray.uint8[this._pos1+36]=t},r.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},r.placedOrientation.set=function(t){this._structArray.uint8[this._pos1+37]=t},r.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},r.hidden.set=function(t){this._structArray.uint8[this._pos1+38]=t},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},r.crossTileID.set=function(t){this._structArray.uint32[this._pos4+10]=t},Object.defineProperties(e.prototype,r),e}(Wn);bi.prototype.size=44;var wi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new bi(this,t)},e}(ui);dn("PlacedSymbolArray",wi);var ki=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},verticalTextBoxStartIndex:{configurable:!0},verticalTextBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},radialTextOffset:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorX.set=function(t){this._structArray.int16[this._pos2+0]=t},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.anchorY.set=function(t){this._structArray.int16[this._pos2+1]=t},r.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},r.rightJustifiedTextSymbolIndex.set=function(t){this._structArray.int16[this._pos2+2]=t},r.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},r.centerJustifiedTextSymbolIndex.set=function(t){this._structArray.int16[this._pos2+3]=t},r.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},r.leftJustifiedTextSymbolIndex.set=function(t){this._structArray.int16[this._pos2+4]=t},r.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},r.verticalPlacedTextSymbolIndex.set=function(t){this._structArray.int16[this._pos2+5]=t},r.key.get=function(){return this._structArray.uint16[this._pos2+6]},r.key.set=function(t){this._structArray.uint16[this._pos2+6]=t},r.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+7]},r.textBoxStartIndex.set=function(t){this._structArray.uint16[this._pos2+7]=t},r.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+8]},r.textBoxEndIndex.set=function(t){this._structArray.uint16[this._pos2+8]=t},r.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.verticalTextBoxStartIndex.set=function(t){this._structArray.uint16[this._pos2+9]=t},r.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},r.verticalTextBoxEndIndex.set=function(t){this._structArray.uint16[this._pos2+10]=t},r.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},r.iconBoxStartIndex.set=function(t){this._structArray.uint16[this._pos2+11]=t},r.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},r.iconBoxEndIndex.set=function(t){this._structArray.uint16[this._pos2+12]=t},r.featureIndex.get=function(){return this._structArray.uint16[this._pos2+13]},r.featureIndex.set=function(t){this._structArray.uint16[this._pos2+13]=t},r.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+14]},r.numHorizontalGlyphVertices.set=function(t){this._structArray.uint16[this._pos2+14]=t},r.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+15]},r.numVerticalGlyphVertices.set=function(t){this._structArray.uint16[this._pos2+15]=t},r.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+16]},r.numIconVertices.set=function(t){this._structArray.uint16[this._pos2+16]=t},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+9]},r.crossTileID.set=function(t){this._structArray.uint32[this._pos4+9]=t},r.textBoxScale.get=function(){return this._structArray.float32[this._pos4+10]},r.textBoxScale.set=function(t){this._structArray.float32[this._pos4+10]=t},r.radialTextOffset.get=function(){return this._structArray.float32[this._pos4+11]},r.radialTextOffset.set=function(t){this._structArray.float32[this._pos4+11]=t},Object.defineProperties(e.prototype,r),e}(Wn);ki.prototype.size=48;var Ti=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new ki(this,t)},e}(ci);dn("SymbolInstanceArray",Ti);var Ai=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={offsetX:{configurable:!0}};return r.offsetX.get=function(){return this._structArray.float32[this._pos4+0]},r.offsetX.set=function(t){this._structArray.float32[this._pos4+0]=t},Object.defineProperties(e.prototype,r),e}(Wn);Ai.prototype.size=4;var Mi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getoffsetX=function(t){return this.float32[1*t+0]},e.prototype.get=function(t){return new Ai(this,t)},e}(pi);dn("GlyphOffsetArray",Mi);var Si=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={x:{configurable:!0},y:{configurable:!0},tileUnitDistanceFromAnchor:{configurable:!0}};return r.x.get=function(){return this._structArray.int16[this._pos2+0]},r.x.set=function(t){this._structArray.int16[this._pos2+0]=t},r.y.get=function(){return this._structArray.int16[this._pos2+1]},r.y.set=function(t){this._structArray.int16[this._pos2+1]=t},r.tileUnitDistanceFromAnchor.get=function(){return this._structArray.int16[this._pos2+2]},r.tileUnitDistanceFromAnchor.set=function(t){this._structArray.int16[this._pos2+2]=t},Object.defineProperties(e.prototype,r),e}(Wn);Si.prototype.size=6;var Li=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getx=function(t){return this.int16[3*t+0]},e.prototype.gety=function(t){return this.int16[3*t+1]},e.prototype.gettileUnitDistanceFromAnchor=function(t){return this.int16[3*t+2]},e.prototype.get=function(t){return new Si(this,t)},e}(hi);dn("SymbolLineVertexArray",Li);var Ci=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},r.featureIndex.set=function(t){this._structArray.uint32[this._pos4+0]=t},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.sourceLayerIndex.set=function(t){this._structArray.uint16[this._pos2+2]=t},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},r.bucketIndex.set=function(t){this._structArray.uint16[this._pos2+3]=t},Object.defineProperties(e.prototype,r),e}(Wn);Ci.prototype.size=8;var Ei=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new Ci(this,t)},e}(fi);dn("FeatureIndexArray",Ei);var zi=Kn([{name:"a_pos",components:2,type:"Int16"}],4).members,Pi=function(t){void 0===t&&(t=[]),this.segments=t};function Ii(t,e){return 256*(t=u(Math.floor(t),0,255))+u(Math.floor(e),0,255)}Pi.prototype.prepareSegment=function(t,e,r,n){var i=this.segments[this.segments.length-1];return t>Pi.MAX_VERTEX_ARRAY_LENGTH&&w("Max vertices per segment is "+Pi.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+t),(!i||i.vertexLength+t>Pi.MAX_VERTEX_ARRAY_LENGTH||i.sortKey!==n)&&(i={vertexOffset:e.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},void 0!==n&&(i.sortKey=n),this.segments.push(i)),i},Pi.prototype.get=function(){return this.segments},Pi.prototype.destroy=function(){for(var t=0,e=this.segments;t<e.length;t+=1){var r=e[t];for(var n in r.vaos)r.vaos[n].destroy()}},Pi.simpleSegment=function(t,e,r,n){return new Pi([{vertexOffset:t,primitiveOffset:e,vertexLength:r,primitiveLength:n,vaos:{},sortKey:0}])},Pi.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,dn("SegmentVector",Pi);var Di=function(){this.ids=[],this.positions=[],this.indexed=!1};function Oi(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}Di.prototype.add=function(t,e,r,n){this.ids.push(t),this.positions.push(e,r,n)},Di.prototype.getPositions=function(t){for(var e=0,r=this.ids.length-1;e<r;){var n=e+r>>1;this.ids[n]>=t?r=n:e=n+1}for(var i=[];this.ids[e]===t;){var a=this.positions[3*e],o=this.positions[3*e+1],s=this.positions[3*e+2];i.push({index:a,start:o,end:s}),e++}return i},Di.serialize=function(t,e){var r=new Float64Array(t.ids),n=new Uint32Array(t.positions);return function t(e,r,n,i){if(!(n>=i)){for(var a=e[n+i>>1],o=n-1,s=i+1;;){do{o++}while(e[o]<a);do{s--}while(e[s]>a);if(o>=s)break;Oi(e,o,s),Oi(r,3*o,3*s),Oi(r,3*o+1,3*s+1),Oi(r,3*o+2,3*s+2)}t(e,r,n,s),t(e,r,s+1,i)}}(r,n,0,r.length-1),e.push(r.buffer,n.buffer),{ids:r,positions:n}},Di.deserialize=function(t){var e=new Di;return e.ids=t.ids,e.positions=t.positions,e.indexed=!0,e},dn("FeaturePositionMap",Di);var Ri=function(t,e){this.gl=t.gl,this.location=e},Fi=function(t){function e(e,r){t.call(this,e,r),this.current=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){this.current!==t&&(this.current=t,this.gl.uniform1i(this.location,t))},e}(Ri),Bi=function(t){function e(e,r){t.call(this,e,r),this.current=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){this.current!==t&&(this.current=t,this.gl.uniform1f(this.location,t))},e}(Ri),Ni=function(t){function e(e,r){t.call(this,e,r),this.current=[0,0]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){t[0]===this.current[0]&&t[1]===this.current[1]||(this.current=t,this.gl.uniform2f(this.location,t[0],t[1]))},e}(Ri),Ui=function(t){function e(e,r){t.call(this,e,r),this.current=[0,0,0]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){t[0]===this.current[0]&&t[1]===this.current[1]&&t[2]===this.current[2]||(this.current=t,this.gl.uniform3f(this.location,t[0],t[1],t[2]))},e}(Ri),ji=function(t){function e(e,r){t.call(this,e,r),this.current=[0,0,0,0]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){t[0]===this.current[0]&&t[1]===this.current[1]&&t[2]===this.current[2]&&t[3]===this.current[3]||(this.current=t,this.gl.uniform4f(this.location,t[0],t[1],t[2],t[3]))},e}(Ri),Vi=function(t){function e(e,r){t.call(this,e,r),this.current=Xt.transparent}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){t.r===this.current.r&&t.g===this.current.g&&t.b===this.current.b&&t.a===this.current.a||(this.current=t,this.gl.uniform4f(this.location,t.r,t.g,t.b,t.a))},e}(Ri),qi=new Float32Array(16),Gi=function(t){function e(e,r){t.call(this,e,r),this.current=qi}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){if(t[12]!==this.current[12]||t[0]!==this.current[0])return this.current=t,void this.gl.uniformMatrix4fv(this.location,!1,t);for(var e=1;e<16;e++)if(t[e]!==this.current[e]){this.current=t,this.gl.uniformMatrix4fv(this.location,!1,t);break}},e}(Ri);function Hi(t){return[Ii(255*t.r,255*t.g),Ii(255*t.b,255*t.a)]}var Zi=function(t,e,r){this.value=t,this.names=e,this.uniformNames=this.names.map(function(t){return"u_"+t}),this.type=r,this.maxValue=-1/0};Zi.prototype.defines=function(){return this.names.map(function(t){return"#define HAS_UNIFORM_u_"+t})},Zi.prototype.setConstantPatternPositions=function(){},Zi.prototype.populatePaintArray=function(){},Zi.prototype.updatePaintArray=function(){},Zi.prototype.upload=function(){},Zi.prototype.destroy=function(){},Zi.prototype.setUniforms=function(t,e,r,n){e.set(n.constantOr(this.value))},Zi.prototype.getBinding=function(t,e){return"color"===this.type?new Vi(t,e):new Bi(t,e)},Zi.serialize=function(t){var e=t.value,r=t.names,n=t.type;return{value:yn(e),names:r,type:n}},Zi.deserialize=function(t){var e=t.value,r=t.names,n=t.type;return new Zi(gn(e),r,n)};var Xi=function(t,e,r){this.value=t,this.names=e,this.uniformNames=this.names.map(function(t){return"u_"+t}),this.type=r,this.maxValue=-1/0,this.patternPositions={patternTo:null,patternFrom:null}};Xi.prototype.defines=function(){return this.names.map(function(t){return"#define HAS_UNIFORM_u_"+t})},Xi.prototype.populatePaintArray=function(){},Xi.prototype.updatePaintArray=function(){},Xi.prototype.upload=function(){},Xi.prototype.destroy=function(){},Xi.prototype.setConstantPatternPositions=function(t,e){this.patternPositions.patternTo=t.tlbr,this.patternPositions.patternFrom=e.tlbr},Xi.prototype.setUniforms=function(t,e,r,n,i){var a=this.patternPositions;"u_pattern_to"===i&&a.patternTo&&e.set(a.patternTo),"u_pattern_from"===i&&a.patternFrom&&e.set(a.patternFrom)},Xi.prototype.getBinding=function(t,e){return new ji(t,e)};var Wi=function(t,e,r,n){this.expression=t,this.names=e,this.type=r,this.uniformNames=this.names.map(function(t){return"a_"+t}),this.maxValue=-1/0,this.paintVertexAttributes=e.map(function(t){return{name:"a_"+t,type:"Float32",components:"color"===r?2:1,offset:0}}),this.paintVertexArray=new n};Wi.prototype.defines=function(){return[]},Wi.prototype.setConstantPatternPositions=function(){},Wi.prototype.populatePaintArray=function(t,e,r,n){var i=this.paintVertexArray,a=i.length;i.reserve(t);var o=this.expression.evaluate(new zn(0),e,{},n);if("color"===this.type)for(var s=Hi(o),l=a;l<t;l++)i.emplaceBack(s[0],s[1]);else{for(var u=a;u<t;u++)i.emplaceBack(o);this.maxValue=Math.max(this.maxValue,o)}},Wi.prototype.updatePaintArray=function(t,e,r,n){var i=this.paintVertexArray,a=this.expression.evaluate({zoom:0},r,n);if("color"===this.type)for(var o=Hi(a),s=t;s<e;s++)i.emplace(s,o[0],o[1]);else{for(var l=t;l<e;l++)i.emplace(l,a);this.maxValue=Math.max(this.maxValue,a)}},Wi.prototype.upload=function(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},Wi.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()},Wi.prototype.setUniforms=function(t,e){e.set(0)},Wi.prototype.getBinding=function(t,e){return new Bi(t,e)};var Yi=function(t,e,r,n,i,a){this.expression=t,this.names=e,this.uniformNames=this.names.map(function(t){return"u_"+t+"_t"}),this.type=r,this.useIntegerZoom=n,this.zoom=i,this.maxValue=-1/0;var o=a;this.paintVertexAttributes=e.map(function(t){return{name:"a_"+t,type:"Float32",components:"color"===r?4:2,offset:0}}),this.paintVertexArray=new o};Yi.prototype.defines=function(){return[]},Yi.prototype.setConstantPatternPositions=function(){},Yi.prototype.populatePaintArray=function(t,e,r,n){var i=this.paintVertexArray,a=i.length;i.reserve(t);var o=this.expression.evaluate(new zn(this.zoom),e,{},n),s=this.expression.evaluate(new zn(this.zoom+1),e,{},n);if("color"===this.type)for(var l=Hi(o),u=Hi(s),c=a;c<t;c++)i.emplaceBack(l[0],l[1],u[0],u[1]);else{for(var p=a;p<t;p++)i.emplaceBack(o,s);this.maxValue=Math.max(this.maxValue,o,s)}},Yi.prototype.updatePaintArray=function(t,e,r,n){var i=this.paintVertexArray,a=this.expression.evaluate({zoom:this.zoom},r,n),o=this.expression.evaluate({zoom:this.zoom+1},r,n);if("color"===this.type)for(var s=Hi(a),l=Hi(o),u=t;u<e;u++)i.emplace(u,s[0],s[1],l[0],l[1]);else{for(var c=t;c<e;c++)i.emplace(c,a,o);this.maxValue=Math.max(this.maxValue,a,o)}},Yi.prototype.upload=function(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},Yi.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()},Yi.prototype.interpolationFactor=function(t){return this.useIntegerZoom?this.expression.interpolationFactor(Math.floor(t),this.zoom,this.zoom+1):this.expression.interpolationFactor(t,this.zoom,this.zoom+1)},Yi.prototype.setUniforms=function(t,e,r){e.set(this.interpolationFactor(r.zoom))},Yi.prototype.getBinding=function(t,e){return new Bi(t,e)};var Ki=function(t,e,r,n,i,a,o){this.expression=t,this.names=e,this.type=r,this.uniformNames=this.names.map(function(t){return"u_"+t+"_t"}),this.useIntegerZoom=n,this.zoom=i,this.maxValue=-1/0,this.layerId=o,this.paintVertexAttributes=e.map(function(t){return{name:"a_"+t,type:"Uint16",components:4,offset:0}}),this.zoomInPaintVertexArray=new a,this.zoomOutPaintVertexArray=new a};Ki.prototype.defines=function(){return[]},Ki.prototype.setConstantPatternPositions=function(){},Ki.prototype.populatePaintArray=function(t,e,r){var n=this.zoomInPaintVertexArray,i=this.zoomOutPaintVertexArray,a=this.layerId,o=n.length;if(n.reserve(t),i.reserve(t),r&&e.patterns&&e.patterns[a]){var s=e.patterns[a],l=s.min,u=s.mid,c=s.max,p=r[l],h=r[u],f=r[c];if(!p||!h||!f)return;for(var d=o;d<t;d++)n.emplaceBack(h.tl[0],h.tl[1],h.br[0],h.br[1],p.tl[0],p.tl[1],p.br[0],p.br[1]),i.emplaceBack(h.tl[0],h.tl[1],h.br[0],h.br[1],f.tl[0],f.tl[1],f.br[0],f.br[1])}},Ki.prototype.updatePaintArray=function(t,e,r,n,i){var a=this.zoomInPaintVertexArray,o=this.zoomOutPaintVertexArray,s=this.layerId;if(i&&r.patterns&&r.patterns[s]){var l=r.patterns[s],u=l.min,c=l.mid,p=l.max,h=i[u],f=i[c],d=i[p];if(!h||!f||!d)return;for(var m=t;m<e;m++)a.emplace(m,f.tl[0],f.tl[1],f.br[0],f.br[1],h.tl[0],h.tl[1],h.br[0],h.br[1]),o.emplace(m,f.tl[0],f.tl[1],f.br[0],f.br[1],d.tl[0],d.tl[1],d.br[0],d.br[1])}},Ki.prototype.upload=function(t){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=t.createVertexBuffer(this.zoomInPaintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=t.createVertexBuffer(this.zoomOutPaintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},Ki.prototype.destroy=function(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()},Ki.prototype.setUniforms=function(t,e){e.set(0)},Ki.prototype.getBinding=function(t,e){return new Bi(t,e)};var Ji=function(){this.binders={},this.cacheKey="",this._buffers=[],this._featureMap=new Di,this._bufferOffset=0};Ji.createDynamic=function(t,e,r){var n=new Ji,i=[];for(var a in t.paint._values)if(r(a)){var o=t.paint.get(a);if(o instanceof Bn&&cr(o.property.specification)){var s=Qi(a,t.type),l=o.property.specification.type,u=o.property.useIntegerZoom;if("cross-faded"===o.property.specification["property-type"]||"cross-faded-data-driven"===o.property.specification["property-type"])if("constant"===o.value.kind)n.binders[a]=new Xi(o.value.value,s,l),i.push("/u_"+a);else{var c=ta(a,l,"source");n.binders[a]=new Ki(o.value,s,l,u,e,c,t.id),i.push("/a_"+a)}else if("constant"===o.value.kind)n.binders[a]=new Zi(o.value.value,s,l),i.push("/u_"+a);else if("source"===o.value.kind){var p=ta(a,l,"source");n.binders[a]=new Wi(o.value,s,l,p),i.push("/a_"+a)}else{var h=ta(a,l,"composite");n.binders[a]=new Yi(o.value,s,l,u,e,h),i.push("/z_"+a)}}}return n.cacheKey=i.sort().join(""),n},Ji.prototype.populatePaintArrays=function(t,e,r,n,i){for(var a in this.binders)this.binders[a].populatePaintArray(t,e,n,i);void 0!==e.id&&this._featureMap.add(+e.id,r,this._bufferOffset,t),this._bufferOffset=t},Ji.prototype.setConstantPatternPositions=function(t,e){for(var r in this.binders)this.binders[r].setConstantPatternPositions(t,e)},Ji.prototype.updatePaintArrays=function(t,e,r,n){var i=!1;for(var a in t)for(var o=0,s=this._featureMap.getPositions(+a);o<s.length;o+=1){var l=s[o],u=e.feature(l.index);for(var c in this.binders){var p=this.binders[c];if(!(p instanceof Zi||p instanceof Xi)&&!0===p.expression.isStateDependent){var h=r.paint.get(c);p.expression=h.value,p.updatePaintArray(l.start,l.end,u,t[a],n),i=!0}}}return i},Ji.prototype.defines=function(){var t=[];for(var e in this.binders)t.push.apply(t,this.binders[e].defines());return t},Ji.prototype.getPaintVertexBuffers=function(){return this._buffers},Ji.prototype.getUniforms=function(t,e){var r=[];for(var n in this.binders)for(var i=this.binders[n],a=0,o=i.uniformNames;a<o.length;a+=1){var s=o[a];if(e[s]){var l=i.getBinding(t,e[s]);r.push({name:s,property:n,binding:l})}}return r},Ji.prototype.setUniforms=function(t,e,r,n){for(var i=0,a=e;i<a.length;i+=1){var o=a[i],s=o.name,l=o.property,u=o.binding;this.binders[l].setUniforms(t,u,n,r.get(l),s)}},Ji.prototype.updatePatternPaintBuffers=function(t){var e=[];for(var r in this.binders){var n=this.binders[r];if(n instanceof Ki){var i=2===t.fromScale?n.zoomInPaintVertexBuffer:n.zoomOutPaintVertexBuffer;i&&e.push(i)}else(n instanceof Wi||n instanceof Yi)&&n.paintVertexBuffer&&e.push(n.paintVertexBuffer)}this._buffers=e},Ji.prototype.upload=function(t){for(var e in this.binders)this.binders[e].upload(t);var r=[];for(var n in this.binders){var i=this.binders[n];(i instanceof Wi||i instanceof Yi)&&i.paintVertexBuffer&&r.push(i.paintVertexBuffer)}this._buffers=r},Ji.prototype.destroy=function(){for(var t in this.binders)this.binders[t].destroy()};var $i=function(t,e,r,n){void 0===n&&(n=function(){return!0}),this.programConfigurations={};for(var i=0,a=e;i<a.length;i+=1){var o=a[i];this.programConfigurations[o.id]=Ji.createDynamic(o,r,n),this.programConfigurations[o.id].layoutAttributes=t}this.needsUpload=!1};function Qi(t,e){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from"],"fill-pattern":["pattern_to","pattern_from"],"fill-extrusion-pattern":["pattern_to","pattern_from"]}[t]||[t.replace(e+"-","").replace(/-/g,"_")]}function ta(t,e,r){var n={color:{source:gi,composite:vi},number:{source:pi,composite:gi}},i=function(t){return{"line-pattern":{source:ri,composite:ri},"fill-pattern":{source:ri,composite:ri},"fill-extrusion-pattern":{source:ri,composite:ri}}[t]}(t);return i&&i[r]||n[e][r]}$i.prototype.populatePaintArrays=function(t,e,r,n,i){for(var a in this.programConfigurations)this.programConfigurations[a].populatePaintArrays(t,e,r,n,i);this.needsUpload=!0},$i.prototype.updatePaintArrays=function(t,e,r,n){for(var i=0,a=r;i<a.length;i+=1){var o=a[i];this.needsUpload=this.programConfigurations[o.id].updatePaintArrays(t,e,o,n)||this.needsUpload}},$i.prototype.get=function(t){return this.programConfigurations[t]},$i.prototype.upload=function(t){if(this.needsUpload){for(var e in this.programConfigurations)this.programConfigurations[e].upload(t);this.needsUpload=!1}},$i.prototype.destroy=function(){for(var t in this.programConfigurations)this.programConfigurations[t].destroy()},dn("ConstantBinder",Zi),dn("CrossFadedConstantBinder",Xi),dn("SourceExpressionBinder",Wi),dn("CrossFadedCompositeBinder",Ki),dn("CompositeExpressionBinder",Yi),dn("ProgramConfiguration",Ji,{omit:["_buffers"]}),dn("ProgramConfigurationSet",$i);var ea=8192,ra=(15,{min:-1*Math.pow(2,14),max:Math.pow(2,14)-1});function na(t){for(var e=ea/t.extent,r=t.loadGeometry(),n=0;n<r.length;n++)for(var i=r[n],a=0;a<i.length;a++){var o=i[a];o.x=Math.round(o.x*e),o.y=Math.round(o.y*e),(o.x<ra.min||o.x>ra.max||o.y<ra.min||o.y>ra.max)&&(w("Geometry exceeds allowed extent, reduce your vector tile buffer size"),o.x=u(o.x,ra.min,ra.max),o.y=u(o.y,ra.min,ra.max))}return r}function ia(t,e,r,n,i){t.emplaceBack(2*e+(n+1)/2,2*r+(i+1)/2)}var aa=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(function(t){return t.id}),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new $n,this.indexArray=new di,this.segments=new Pi,this.programConfigurations=new $i(zi,t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter(function(t){return t.isStateDependent()}).map(function(t){return t.id})};function oa(t,e){for(var r=0;r<t.length;r++)if(ma(e,t[r]))return!0;for(var n=0;n<e.length;n++)if(ma(t,e[n]))return!0;return!!ca(t,e)}function sa(t,e,r){return!!ma(t,e)||!!ha(e,t,r)}function la(t,e){if(1===t.length)return da(e,t[0]);for(var r=0;r<e.length;r++)for(var n=e[r],i=0;i<n.length;i++)if(ma(t,n[i]))return!0;for(var a=0;a<t.length;a++)if(da(e,t[a]))return!0;for(var o=0;o<e.length;o++)if(ca(t,e[o]))return!0;return!1}function ua(t,e,r){if(t.length>1){if(ca(t,e))return!0;for(var n=0;n<e.length;n++)if(ha(e[n],t,r))return!0}for(var i=0;i<t.length;i++)if(ha(t[i],e,r))return!0;return!1}function ca(t,e){if(0===t.length||0===e.length)return!1;for(var r=0;r<t.length-1;r++)for(var n=t[r],i=t[r+1],a=0;a<e.length-1;a++)if(pa(n,i,e[a],e[a+1]))return!0;return!1}function pa(t,e,r,n){return k(t,r,n)!==k(e,r,n)&&k(t,e,r)!==k(t,e,n)}function ha(t,e,r){var n=r*r;if(1===e.length)return t.distSqr(e[0])<n;for(var i=1;i<e.length;i++)if(fa(t,e[i-1],e[i])<n)return!0;return!1}function fa(t,e,r){var n=e.distSqr(r);if(0===n)return t.distSqr(e);var i=((t.x-e.x)*(r.x-e.x)+(t.y-e.y)*(r.y-e.y))/n;return i<0?t.distSqr(e):i>1?t.distSqr(r):t.distSqr(r.sub(e)._mult(i)._add(e))}function da(t,e){for(var r,n,i,a=!1,o=0;o<t.length;o++)for(var s=0,l=(r=t[o]).length-1;s<r.length;l=s++)n=r[s],i=r[l],n.y>e.y!=i.y>e.y&&e.x<(i.x-n.x)*(e.y-n.y)/(i.y-n.y)+n.x&&(a=!a);return a}function ma(t,e){for(var r=!1,n=0,i=t.length-1;n<t.length;i=n++){var a=t[n],o=t[i];a.y>e.y!=o.y>e.y&&e.x<(o.x-a.x)*(e.y-a.y)/(o.y-a.y)+a.x&&(r=!r)}return r}function ya(t,e,r){var n=r[0],i=r[2];if(t.x<n.x&&e.x<n.x||t.x>i.x&&e.x>i.x||t.y<n.y&&e.y<n.y||t.y>i.y&&e.y>i.y)return!1;var a=k(t,e,r[0]);return a!==k(t,e,r[1])||a!==k(t,e,r[2])||a!==k(t,e,r[3])}function ga(t,e,r){var n=e.paint.get(t).value;return"constant"===n.kind?n.value:r.programConfigurations.get(e.id).binders[t].maxValue}function va(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function _a(t,e,r,n,a){if(!e[0]&&!e[1])return t;var o=i.convert(e)._mult(a);"viewport"===r&&o._rotate(-n);for(var s=[],l=0;l<t.length;l++){var u=t[l];s.push(u.sub(o))}return s}aa.prototype.populate=function(t,e){var r=this.layers[0],n=[],i=null;"circle"===r.type&&(i=r.layout.get("circle-sort-key"));for(var a=0,o=t;a<o.length;a+=1){var s=o[a],l=s.feature,u=s.index,c=s.sourceLayerIndex;if(this.layers[0]._featureFilter(new zn(this.zoom),l)){var p=na(l),h=i?i.evaluate(l,{}):void 0,f={id:l.id,properties:l.properties,type:l.type,sourceLayerIndex:c,index:u,geometry:p,patterns:{},sortKey:h};n.push(f)}}i&&n.sort(function(t,e){return t.sortKey-e.sortKey});for(var d=0,m=n;d<m.length;d+=1){var y=m[d],g=y,v=g.geometry,_=g.index,x=g.sourceLayerIndex,b=t[_].feature;this.addFeature(y,v,_),e.featureIndex.insert(b,v,_,x,this.index)}},aa.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)},aa.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},aa.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},aa.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,zi),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},aa.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},aa.prototype.addFeature=function(t,e,r){for(var n=0,i=e;n<i.length;n+=1)for(var a=0,o=i[n];a<o.length;a+=1){var s=o[a],l=s.x,u=s.y;if(!(l<0||l>=ea||u<0||u>=ea)){var c=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),p=c.vertexLength;ia(this.layoutVertexArray,l,u,-1,-1),ia(this.layoutVertexArray,l,u,1,-1),ia(this.layoutVertexArray,l,u,1,1),ia(this.layoutVertexArray,l,u,-1,1),this.indexArray.emplaceBack(p,p+1,p+2),this.indexArray.emplaceBack(p,p+3,p+2),c.vertexLength+=4,c.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{})},dn("CircleBucket",aa,{omit:["layers"]});var xa,ba=new Hn({"circle-sort-key":new jn(Tt.layout_circle["circle-sort-key"])}),wa={paint:new Hn({"circle-radius":new jn(Tt.paint_circle["circle-radius"]),"circle-color":new jn(Tt.paint_circle["circle-color"]),"circle-blur":new jn(Tt.paint_circle["circle-blur"]),"circle-opacity":new jn(Tt.paint_circle["circle-opacity"]),"circle-translate":new Un(Tt.paint_circle["circle-translate"]),"circle-translate-anchor":new Un(Tt.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new Un(Tt.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new Un(Tt.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new jn(Tt.paint_circle["circle-stroke-width"]),"circle-stroke-color":new jn(Tt.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new jn(Tt.paint_circle["circle-stroke-opacity"])}),layout:ba},ka="undefined"!=typeof Float32Array?Float32Array:Array;function Ta(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,t[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,t[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,t[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,t}Math.hypot||(Math.hypot=function(){for(var t=arguments,e=0,r=arguments.length;r--;)e+=t[r]*t[r];return Math.sqrt(e)}),xa=new ka(3),ka!=Float32Array&&(xa[0]=0,xa[1]=0,xa[2]=0),function(){var t=new ka(4);ka!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0)}();var Aa=function(t){function e(e){t.call(this,e,wa)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createBucket=function(t){return new aa(t)},e.prototype.queryRadius=function(t){var e=t;return ga("circle-radius",this,e)+ga("circle-stroke-width",this,e)+va(this.paint.get("circle-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,a,o,s){for(var l=_a(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),a.angle,o),u=this.paint.get("circle-radius").evaluate(e,r)+this.paint.get("circle-stroke-width").evaluate(e,r),c="map"===this.paint.get("circle-pitch-alignment"),p=c?l:function(t,e){return l.map(function(t){return Ma(t,e)})}(0,s),h=c?u*o:u,f=0,d=n;f<d.length;f+=1)for(var m=0,y=d[f];m<y.length;m+=1){var g=y[m],v=c?g:Ma(g,s),_=h,x=Ta([],[g.x,g.y,0,1],s);if("viewport"===this.paint.get("circle-pitch-scale")&&"map"===this.paint.get("circle-pitch-alignment")?_*=x[3]/a.cameraToCenterDistance:"map"===this.paint.get("circle-pitch-scale")&&"viewport"===this.paint.get("circle-pitch-alignment")&&(_*=a.cameraToCenterDistance/x[3]),sa(p,v,_))return!0}return!1},e}(Zn);function Ma(t,e){var r=Ta([],[t.x,t.y,0,1],e);return new i(r[0]/r[3],r[1]/r[3])}var Sa=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(aa);function La(t,e,r,n){var i=e.width,a=e.height;if(n){if(n instanceof Uint8ClampedArray)n=new Uint8Array(n.buffer);else if(n.length!==i*a*r)throw new RangeError("mismatched image size")}else n=new Uint8Array(i*a*r);return t.width=i,t.height=a,t.data=n,t}function Ca(t,e,r){var n=e.width,i=e.height;if(n!==t.width||i!==t.height){var a=La({},{width:n,height:i},r);Ea(t,a,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,n),height:Math.min(t.height,i)},r),t.width=n,t.height=i,t.data=a.data}}function Ea(t,e,r,n,i,a){if(0===i.width||0===i.height)return e;if(i.width>t.width||i.height>t.height||r.x>t.width-i.width||r.y>t.height-i.height)throw new RangeError("out of range source coordinates for image copy");if(i.width>e.width||i.height>e.height||n.x>e.width-i.width||n.y>e.height-i.height)throw new RangeError("out of range destination coordinates for image copy");for(var o=t.data,s=e.data,l=0;l<i.height;l++)for(var u=((r.y+l)*t.width+r.x)*a,c=((n.y+l)*e.width+n.x)*a,p=0;p<i.width*a;p++)s[c+p]=o[u+p];return e}dn("HeatmapBucket",Sa,{omit:["layers"]});var za=function(t,e){La(this,t,1,e)};za.prototype.resize=function(t){Ca(this,t,1)},za.prototype.clone=function(){return new za({width:this.width,height:this.height},new Uint8Array(this.data))},za.copy=function(t,e,r,n,i){Ea(t,e,r,n,i,1)};var Pa=function(t,e){La(this,t,4,e)};Pa.prototype.resize=function(t){Ca(this,t,4)},Pa.prototype.replace=function(t,e){e?this.data.set(t):t instanceof Uint8ClampedArray?this.data=new Uint8Array(t.buffer):this.data=t},Pa.prototype.clone=function(){return new Pa({width:this.width,height:this.height},new Uint8Array(this.data))},Pa.copy=function(t,e,r,n,i){Ea(t,e,r,n,i,4)},dn("AlphaImage",za),dn("RGBAImage",Pa);var Ia={paint:new Hn({"heatmap-radius":new jn(Tt.paint_heatmap["heatmap-radius"]),"heatmap-weight":new jn(Tt.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Un(Tt.paint_heatmap["heatmap-intensity"]),"heatmap-color":new Gn(Tt.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Un(Tt.paint_heatmap["heatmap-opacity"])})};function Da(t,e){for(var r=new Uint8Array(1024),n={},i=0,a=0;i<256;i++,a+=4){n[e]=i/255;var o=t.evaluate(n);r[a+0]=Math.floor(255*o.r/o.a),r[a+1]=Math.floor(255*o.g/o.a),r[a+2]=Math.floor(255*o.b/o.a),r[a+3]=Math.floor(255*o.a)}return new Pa({width:256,height:1},r)}var Oa=function(t){function e(e){t.call(this,e,Ia),this._updateColorRamp()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createBucket=function(t){return new Sa(t)},e.prototype._handleSpecialPaintPropertyUpdate=function(t){"heatmap-color"===t&&this._updateColorRamp()},e.prototype._updateColorRamp=function(){var t=this._transitionablePaint._values["heatmap-color"].value.expression;this.colorRamp=Da(t,"heatmapDensity"),this.colorRampTexture=null},e.prototype.resize=function(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)},e.prototype.queryRadius=function(){return 0},e.prototype.queryIntersectsFeature=function(){return!1},e.prototype.hasOffscreenPass=function(){return 0!==this.paint.get("heatmap-opacity")&&"none"!==this.visibility},e}(Zn),Ra={paint:new Hn({"hillshade-illumination-direction":new Un(Tt.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new Un(Tt.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new Un(Tt.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new Un(Tt.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new Un(Tt.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new Un(Tt.paint_hillshade["hillshade-accent-color"])})},Fa=function(t){function e(e){t.call(this,e,Ra)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.hasOffscreenPass=function(){return 0!==this.paint.get("hillshade-exaggeration")&&"none"!==this.visibility},e}(Zn),Ba=Kn([{name:"a_pos",components:2,type:"Int16"}],4).members,Na=ja,Ua=ja;function ja(t,e,r){r=r||2;var n,i,a,o,s,l,u,c=e&&e.length,p=c?e[0]*r:t.length,h=Va(t,0,p,r,!0),f=[];if(!h||h.next===h.prev)return f;if(c&&(h=function(t,e,r,n){var i,a,o,s=[];for(i=0,a=e.length;i<a;i++)(o=Va(t,e[i]*n,i<a-1?e[i+1]*n:t.length,n,!1))===o.next&&(o.steiner=!0),s.push(Qa(o));for(s.sort(Ya),i=0;i<s.length;i++)Ka(s[i],r),r=qa(r,r.next);return r}(t,e,h,r)),t.length>80*r){n=a=t[0],i=o=t[1];for(var d=r;d<p;d+=r)(s=t[d])<n&&(n=s),(l=t[d+1])<i&&(i=l),s>a&&(a=s),l>o&&(o=l);u=0!==(u=Math.max(a-n,o-i))?1/u:0}return Ga(h,f,r,n,i,u),f}function Va(t,e,r,n,i){var a,o;if(i===ho(t,e,r,n)>0)for(a=e;a<r;a+=n)o=uo(a,t[a],t[a+1],o);else for(a=r-n;a>=e;a-=n)o=uo(a,t[a],t[a+1],o);return o&&no(o,o.next)&&(co(o),o=o.next),o}function qa(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!no(n,n.next)&&0!==ro(n.prev,n,n.next))n=n.next;else{if(co(n),(n=e=n.prev)===n.next)break;r=!0}}while(r||n!==e);return e}function Ga(t,e,r,n,i,a,o){if(t){!o&&a&&function(t,e,r,n){var i=t;do{null===i.z&&(i.z=$a(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,r,n,i,a,o,s,l,u=1;do{for(r=t,t=null,a=null,o=0;r;){for(o++,n=r,s=0,e=0;e<u&&(s++,n=n.nextZ);e++);for(l=u;s>0||l>0&&n;)0!==s&&(0===l||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,l--),a?a.nextZ=i:t=i,i.prevZ=a,a=i;r=n}a.nextZ=null,u*=2}while(o>1)}(i)}(t,n,i,a);for(var s,l,u=t;t.prev!==t.next;)if(s=t.prev,l=t.next,a?Za(t,n,i,a):Ha(t))e.push(s.i/r),e.push(t.i/r),e.push(l.i/r),co(t),t=l.next,u=l.next;else if((t=l)===u){o?1===o?Ga(t=Xa(qa(t),e,r),e,r,n,i,a,2):2===o&&Wa(t,e,r,n,i,a):Ga(qa(t),e,r,n,i,a,1);break}}}function Ha(t){var e=t.prev,r=t,n=t.next;if(ro(e,r,n)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(to(e.x,e.y,r.x,r.y,n.x,n.y,i.x,i.y)&&ro(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function Za(t,e,r,n){var i=t.prev,a=t,o=t.next;if(ro(i,a,o)>=0)return!1;for(var s=i.x<a.x?i.x<o.x?i.x:o.x:a.x<o.x?a.x:o.x,l=i.y<a.y?i.y<o.y?i.y:o.y:a.y<o.y?a.y:o.y,u=i.x>a.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,c=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,p=$a(s,l,e,r,n),h=$a(u,c,e,r,n),f=t.prevZ,d=t.nextZ;f&&f.z>=p&&d&&d.z<=h;){if(f!==t.prev&&f!==t.next&&to(i.x,i.y,a.x,a.y,o.x,o.y,f.x,f.y)&&ro(f.prev,f,f.next)>=0)return!1;if(f=f.prevZ,d!==t.prev&&d!==t.next&&to(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&ro(d.prev,d,d.next)>=0)return!1;d=d.nextZ}for(;f&&f.z>=p;){if(f!==t.prev&&f!==t.next&&to(i.x,i.y,a.x,a.y,o.x,o.y,f.x,f.y)&&ro(f.prev,f,f.next)>=0)return!1;f=f.prevZ}for(;d&&d.z<=h;){if(d!==t.prev&&d!==t.next&&to(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&ro(d.prev,d,d.next)>=0)return!1;d=d.nextZ}return!0}function Xa(t,e,r){var n=t;do{var i=n.prev,a=n.next.next;!no(i,a)&&io(i,n,n.next,a)&&so(i,a)&&so(a,i)&&(e.push(i.i/r),e.push(n.i/r),e.push(a.i/r),co(n),co(n.next),n=t=a),n=n.next}while(n!==t);return qa(n)}function Wa(t,e,r,n,i,a){var o=t;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&eo(o,s)){var l=lo(o,s);return o=qa(o,o.next),l=qa(l,l.next),Ga(o,e,r,n,i,a),void Ga(l,e,r,n,i,a)}s=s.next}o=o.next}while(o!==t)}function Ya(t,e){return t.x-e.x}function Ka(t,e){if(e=function(t,e){var r,n=e,i=t.x,a=t.y,o=-1/0;do{if(a<=n.y&&a>=n.next.y&&n.next.y!==n.y){var s=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>o){if(o=s,s===i){if(a===n.y)return n;if(a===n.next.y)return n.next}r=n.x<n.next.x?n:n.next}}n=n.next}while(n!==e);if(!r)return null;if(i===o)return r;var l,u=r,c=r.x,p=r.y,h=1/0;n=r;do{i>=n.x&&n.x>=c&&i!==n.x&&to(a<p?i:o,a,c,p,a<p?o:i,a,n.x,n.y)&&(l=Math.abs(a-n.y)/(i-n.x),so(n,t)&&(l<h||l===h&&(n.x>r.x||n.x===r.x&&Ja(r,n)))&&(r=n,h=l)),n=n.next}while(n!==u);return r}(t,e)){var r=lo(e,t);qa(r,r.next)}}function Ja(t,e){return ro(t.prev,t,e.prev)<0&&ro(e.next,t,t.next)<0}function $a(t,e,r,n,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*i)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*i)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Qa(t){var e=t,r=t;do{(e.x<r.x||e.x===r.x&&e.y<r.y)&&(r=e),e=e.next}while(e!==t);return r}function to(t,e,r,n,i,a,o,s){return(i-o)*(e-s)-(t-o)*(a-s)>=0&&(t-o)*(n-s)-(r-o)*(e-s)>=0&&(r-o)*(a-s)-(i-o)*(n-s)>=0}function eo(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&io(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(so(t,e)&&so(e,t)&&function(t,e){var r=t,n=!1,i=(t.x+e.x)/2,a=(t.y+e.y)/2;do{r.y>a!=r.next.y>a&&r.next.y!==r.y&&i<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}(t,e)&&(ro(t.prev,t,e.prev)||ro(t,e.prev,e))||no(t,e)&&ro(t.prev,t,t.next)>0&&ro(e.prev,e,e.next)>0)}function ro(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function no(t,e){return t.x===e.x&&t.y===e.y}function io(t,e,r,n){var i=oo(ro(t,e,r)),a=oo(ro(t,e,n)),o=oo(ro(r,n,t)),s=oo(ro(r,n,e));return i!==a&&o!==s||!(0!==i||!ao(t,r,e))||!(0!==a||!ao(t,n,e))||!(0!==o||!ao(r,t,n))||!(0!==s||!ao(r,e,n))}function ao(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function oo(t){return t>0?1:t<0?-1:0}function so(t,e){return ro(t.prev,t,t.next)<0?ro(t,e,t.next)>=0&&ro(t,t.prev,e)>=0:ro(t,e,t.prev)<0||ro(t,t.next,e)<0}function lo(t,e){var r=new po(t.i,t.x,t.y),n=new po(e.i,e.x,e.y),i=t.next,a=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,a.next=n,n.prev=a,n}function uo(t,e,r,n){var i=new po(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function co(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function po(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function ho(t,e,r,n){for(var i=0,a=e,o=r-n;a<r;a+=n)i+=(t[o]-t[a])*(t[a+1]+t[o+1]),o=a;return i}function fo(t,e,r,n,i){!function t(e,r,n,i,a){for(;i>n;){if(i-n>600){var o=i-n+1,s=r-n+1,l=Math.log(o),u=.5*Math.exp(2*l/3),c=.5*Math.sqrt(l*u*(o-u)/o)*(s-o/2<0?-1:1);t(e,r,Math.max(n,Math.floor(r-s*u/o+c)),Math.min(i,Math.floor(r+(o-s)*u/o+c)),a)}var p=e[r],h=n,f=i;for(mo(e,n,r),a(e[i],p)>0&&mo(e,n,i);h<f;){for(mo(e,h,f),h++,f--;a(e[h],p)<0;)h++;for(;a(e[f],p)>0;)f--}0===a(e[n],p)?mo(e,n,f):mo(e,++f,i),f<=r&&(n=f+1),r<=f&&(i=f-1)}}(t,e,r||0,n||t.length-1,i||yo)}function mo(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function yo(t,e){return t<e?-1:t>e?1:0}function go(t,e){var r=t.length;if(r<=1)return[t];for(var n,i,a=[],o=0;o<r;o++){var s=T(t[o]);0!==s&&(t[o].area=Math.abs(s),void 0===i&&(i=s<0),i===s<0?(n&&a.push(n),n=[t[o]]):n.push(t[o]))}if(n&&a.push(n),e>1)for(var l=0;l<a.length;l++)a[l].length<=e||(fo(a[l],e,1,a[l].length-1,vo),a[l]=a[l].slice(0,e));return a}function vo(t,e){return e.area-t.area}function _o(t,e,r){for(var n=r.patternDependencies,i=!1,a=0,o=e;a<o.length;a+=1){var s=o[a].paint.get(t+"-pattern");s.isConstant()||(i=!0);var l=s.constantOr(null);l&&(i=!0,n[l.to]=!0,n[l.from]=!0)}return i}function xo(t,e,r,n,i){for(var a=i.patternDependencies,o=0,s=e;o<s.length;o+=1){var l=s[o],u=l.paint.get(t+"-pattern").value;if("constant"!==u.kind){var c=u.evaluate({zoom:n-1},r,{}),p=u.evaluate({zoom:n},r,{}),h=u.evaluate({zoom:n+1},r,{});a[c]=!0,a[p]=!0,a[h]=!0,r.patterns[l.id]={min:c,mid:p,max:h}}}return r}ja.deviation=function(t,e,r,n){var i=e&&e.length,a=i?e[0]*r:t.length,o=Math.abs(ho(t,0,a,r));if(i)for(var s=0,l=e.length;s<l;s++){var u=e[s]*r,c=s<l-1?e[s+1]*r:t.length;o-=Math.abs(ho(t,u,c,r))}var p=0;for(s=0;s<n.length;s+=3){var h=n[s]*r,f=n[s+1]*r,d=n[s+2]*r;p+=Math.abs((t[h]-t[d])*(t[f+1]-t[h+1])-(t[h]-t[f])*(t[d+1]-t[h+1]))}return 0===o&&0===p?0:Math.abs((p-o)/o)},ja.flatten=function(t){for(var e=t[0][0].length,r={vertices:[],holes:[],dimensions:e},n=0,i=0;i<t.length;i++){for(var a=0;a<t[i].length;a++)for(var o=0;o<e;o++)r.vertices.push(t[i][a][o]);i>0&&(n+=t[i-1].length,r.holes.push(n))}return r},Na.default=Ua;var bo=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(function(t){return t.id}),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new $n,this.indexArray=new di,this.indexArray2=new mi,this.programConfigurations=new $i(Ba,t.layers,t.zoom),this.segments=new Pi,this.segments2=new Pi,this.stateDependentLayerIds=this.layers.filter(function(t){return t.isStateDependent()}).map(function(t){return t.id})};bo.prototype.populate=function(t,e){this.hasPattern=_o("fill",this.layers,e);for(var r=this.layers[0].layout.get("fill-sort-key"),n=[],i=0,a=t;i<a.length;i+=1){var o=a[i],s=o.feature,l=o.index,u=o.sourceLayerIndex;if(this.layers[0]._featureFilter(new zn(this.zoom),s)){var c=na(s),p=r?r.evaluate(s,{}):void 0,h={id:s.id,properties:s.properties,type:s.type,sourceLayerIndex:u,index:l,geometry:c,patterns:{},sortKey:p};n.push(h)}}r&&n.sort(function(t,e){return t.sortKey-e.sortKey});for(var f=0,d=n;f<d.length;f+=1){var m=d[f],y=m,g=y.geometry,v=y.index,_=y.sourceLayerIndex;if(this.hasPattern){var x=xo("fill",this.layers,m,this.zoom,e);this.patternFeatures.push(x)}else this.addFeature(m,g,v,{});var b=t[v].feature;e.featureIndex.insert(b,g,v,_,this.index)}},bo.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)},bo.prototype.addFeatures=function(t,e){for(var r=0,n=this.patternFeatures;r<n.length;r+=1){var i=n[r];this.addFeature(i,i.geometry,i.index,e)}},bo.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},bo.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},bo.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Ba),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(t),this.uploaded=!0},bo.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())},bo.prototype.addFeature=function(t,e,r,n){for(var i=0,a=go(e,500);i<a.length;i+=1){for(var o=a[i],s=0,l=0,u=o;l<u.length;l+=1)s+=u[l].length;for(var c=this.segments.prepareSegment(s,this.layoutVertexArray,this.indexArray),p=c.vertexLength,h=[],f=[],d=0,m=o;d<m.length;d+=1){var y=m[d];if(0!==y.length){y!==o[0]&&f.push(h.length/2);var g=this.segments2.prepareSegment(y.length,this.layoutVertexArray,this.indexArray2),v=g.vertexLength;this.layoutVertexArray.emplaceBack(y[0].x,y[0].y),this.indexArray2.emplaceBack(v+y.length-1,v),h.push(y[0].x),h.push(y[0].y);for(var _=1;_<y.length;_++)this.layoutVertexArray.emplaceBack(y[_].x,y[_].y),this.indexArray2.emplaceBack(v+_-1,v+_),h.push(y[_].x),h.push(y[_].y);g.vertexLength+=y.length,g.primitiveLength+=y.length}}for(var x=Na(h,f),b=0;b<x.length;b+=3)this.indexArray.emplaceBack(p+x[b],p+x[b+1],p+x[b+2]);c.vertexLength+=s,c.primitiveLength+=x.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,n)},dn("FillBucket",bo,{omit:["layers","patternFeatures"]});var wo=new Hn({"fill-sort-key":new jn(Tt.layout_fill["fill-sort-key"])}),ko={paint:new Hn({"fill-antialias":new Un(Tt.paint_fill["fill-antialias"]),"fill-opacity":new jn(Tt.paint_fill["fill-opacity"]),"fill-color":new jn(Tt.paint_fill["fill-color"]),"fill-outline-color":new jn(Tt.paint_fill["fill-outline-color"]),"fill-translate":new Un(Tt.paint_fill["fill-translate"]),"fill-translate-anchor":new Un(Tt.paint_fill["fill-translate-anchor"]),"fill-pattern":new Vn(Tt.paint_fill["fill-pattern"])}),layout:wo},To=function(t){function e(e){t.call(this,e,ko)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.recalculate=function(e){t.prototype.recalculate.call(this,e);var r=this.paint._values["fill-outline-color"];"constant"===r.value.kind&&void 0===r.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])},e.prototype.createBucket=function(t){return new bo(t)},e.prototype.queryRadius=function(){return va(this.paint.get("fill-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,a,o){return la(_a(t,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),a.angle,o),n)},e.prototype.isTileClipped=function(){return!0},e}(Zn),Ao=Kn([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4).members,Mo=So;function So(t,e,r,n,i){this.properties={},this.extent=r,this.type=0,this._pbf=t,this._geometry=-1,this._keys=n,this._values=i,t.readFields(Lo,this,e)}function Lo(t,e,r){1==t?e.id=r.readVarint():2==t?function(t,e){for(var r=t.readVarint()+t.pos;t.pos<r;){var n=e._keys[t.readVarint()],i=e._values[t.readVarint()];e.properties[n]=i}}(r,e):3==t?e.type=r.readVarint():4==t&&(e._geometry=r.pos)}function Co(t){for(var e,r,n=0,i=0,a=t.length,o=a-1;i<a;o=i++)e=t[i],n+=((r=t[o]).x-e.x)*(e.y+r.y);return n}So.types=["Unknown","Point","LineString","Polygon"],So.prototype.loadGeometry=function(){var t=this._pbf;t.pos=this._geometry;for(var e,r=t.readVarint()+t.pos,n=1,a=0,o=0,s=0,l=[];t.pos<r;){if(a<=0){var u=t.readVarint();n=7&u,a=u>>3}if(a--,1===n||2===n)o+=t.readSVarint(),s+=t.readSVarint(),1===n&&(e&&l.push(e),e=[]),e.push(new i(o,s));else{if(7!==n)throw new Error("unknown command "+n);e&&e.push(e[0].clone())}}return e&&l.push(e),l},So.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,n=0,i=0,a=0,o=1/0,s=-1/0,l=1/0,u=-1/0;t.pos<e;){if(n<=0){var c=t.readVarint();r=7&c,n=c>>3}if(n--,1===r||2===r)(i+=t.readSVarint())<o&&(o=i),i>s&&(s=i),(a+=t.readSVarint())<l&&(l=a),a>u&&(u=a);else if(7!==r)throw new Error("unknown command "+r)}return[o,l,s,u]},So.prototype.toGeoJSON=function(t,e,r){var n,i,a=this.extent*Math.pow(2,r),o=this.extent*t,s=this.extent*e,l=this.loadGeometry(),u=So.types[this.type];function c(t){for(var e=0;e<t.length;e++){var r=t[e],n=180-360*(r.y+s)/a;t[e]=[360*(r.x+o)/a-180,360/Math.PI*Math.atan(Math.exp(n*Math.PI/180))-90]}}switch(this.type){case 1:var p=[];for(n=0;n<l.length;n++)p[n]=l[n][0];c(l=p);break;case 2:for(n=0;n<l.length;n++)c(l[n]);break;case 3:for(l=function(t){var e=t.length;if(e<=1)return[t];for(var r,n,i=[],a=0;a<e;a++){var o=Co(t[a]);0!==o&&(void 0===n&&(n=o<0),n===o<0?(r&&i.push(r),r=[t[a]]):r.push(t[a]))}return r&&i.push(r),i}(l),n=0;n<l.length;n++)for(i=0;i<l[n].length;i++)c(l[n][i])}1===l.length?l=l[0]:u="Multi"+u;var h={type:"Feature",geometry:{type:u,coordinates:l},properties:this.properties};return"id"in this&&(h.id=this.id),h};var Eo=zo;function zo(t,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(Po,this,e),this.length=this._features.length}function Po(t,e,r){15===t?e.version=r.readVarint():1===t?e.name=r.readString():5===t?e.extent=r.readVarint():2===t?e._features.push(r.pos):3===t?e._keys.push(r.readString()):4===t&&e._values.push(function(t){for(var e=null,r=t.readVarint()+t.pos;t.pos<r;){var n=t.readVarint()>>3;e=1===n?t.readString():2===n?t.readFloat():3===n?t.readDouble():4===n?t.readVarint64():5===n?t.readVarint():6===n?t.readSVarint():7===n?t.readBoolean():null}return e}(r))}function Io(t,e,r){if(3===t){var n=new Eo(r,r.readVarint()+r.pos);n.length&&(e[n.name]=n)}}zo.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new Mo(this._pbf,e,this.extent,this._keys,this._values)};var Do={VectorTile:function(t,e){this.layers=t.readFields(Io,{},e)},VectorTileFeature:Mo,VectorTileLayer:Eo},Oo=Do.VectorTileFeature.types,Ro=Math.pow(2,13);function Fo(t,e,r,n,i,a,o,s){t.emplaceBack(e,r,2*Math.floor(n*Ro)+o,i*Ro*2,a*Ro*2,Math.round(s))}var Bo=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(function(t){return t.id}),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new ti,this.indexArray=new di,this.programConfigurations=new $i(Ao,t.layers,t.zoom),this.segments=new Pi,this.stateDependentLayerIds=this.layers.filter(function(t){return t.isStateDependent()}).map(function(t){return t.id})};function No(t,e){return t.x===e.x&&(t.x<0||t.x>ea)||t.y===e.y&&(t.y<0||t.y>ea)}function Uo(t){return t.every(function(t){return t.x<0})||t.every(function(t){return t.x>ea})||t.every(function(t){return t.y<0})||t.every(function(t){return t.y>ea})}Bo.prototype.populate=function(t,e){this.features=[],this.hasPattern=_o("fill-extrusion",this.layers,e);for(var r=0,n=t;r<n.length;r+=1){var i=n[r],a=i.feature,o=i.index,s=i.sourceLayerIndex;if(this.layers[0]._featureFilter(new zn(this.zoom),a)){var l=na(a),u={sourceLayerIndex:s,index:o,geometry:l,properties:a.properties,type:a.type,patterns:{}};void 0!==a.id&&(u.id=a.id),this.hasPattern?this.features.push(xo("fill-extrusion",this.layers,u,this.zoom,e)):this.addFeature(u,l,o,{}),e.featureIndex.insert(a,l,o,s,this.index,!0)}}},Bo.prototype.addFeatures=function(t,e){for(var r=0,n=this.features;r<n.length;r+=1){var i=n[r],a=i.geometry;this.addFeature(i,a,i.index,e)}},Bo.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)},Bo.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},Bo.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Bo.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Ao),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},Bo.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},Bo.prototype.addFeature=function(t,e,r,n){for(var i=0,a=go(e,500);i<a.length;i+=1){for(var o=a[i],s=0,l=0,u=o;l<u.length;l+=1)s+=u[l].length;for(var c=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),p=0,h=o;p<h.length;p+=1){var f=h[p];if(0!==f.length&&!Uo(f))for(var d=0,m=0;m<f.length;m++){var y=f[m];if(m>=1){var g=f[m-1];if(!No(y,g)){c.vertexLength+4>Pi.MAX_VERTEX_ARRAY_LENGTH&&(c=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var v=y.sub(g)._perp()._unit(),_=g.dist(y);d+_>32768&&(d=0),Fo(this.layoutVertexArray,y.x,y.y,v.x,v.y,0,0,d),Fo(this.layoutVertexArray,y.x,y.y,v.x,v.y,0,1,d),d+=_,Fo(this.layoutVertexArray,g.x,g.y,v.x,v.y,0,0,d),Fo(this.layoutVertexArray,g.x,g.y,v.x,v.y,0,1,d);var x=c.vertexLength;this.indexArray.emplaceBack(x,x+2,x+1),this.indexArray.emplaceBack(x+1,x+2,x+3),c.vertexLength+=4,c.primitiveLength+=2}}}}if(c.vertexLength+s>Pi.MAX_VERTEX_ARRAY_LENGTH&&(c=this.segments.prepareSegment(s,this.layoutVertexArray,this.indexArray)),"Polygon"===Oo[t.type]){for(var b=[],w=[],k=c.vertexLength,T=0,A=o;T<A.length;T+=1){var M=A[T];if(0!==M.length){M!==o[0]&&w.push(b.length/2);for(var S=0;S<M.length;S++){var L=M[S];Fo(this.layoutVertexArray,L.x,L.y,0,0,1,1,0),b.push(L.x),b.push(L.y)}}}for(var C=Na(b,w),E=0;E<C.length;E+=3)this.indexArray.emplaceBack(k+C[E],k+C[E+2],k+C[E+1]);c.primitiveLength+=C.length/3,c.vertexLength+=s}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,n)},dn("FillExtrusionBucket",Bo,{omit:["layers","features"]});var jo={paint:new Hn({"fill-extrusion-opacity":new Un(Tt["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new jn(Tt["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Un(Tt["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Un(Tt["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Vn(Tt["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new jn(Tt["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new jn(Tt["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Un(Tt["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})},Vo=function(t){function e(e){t.call(this,e,jo)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createBucket=function(t){return new Bo(t)},e.prototype.queryRadius=function(){return va(this.paint.get("fill-extrusion-translate"))},e.prototype.is3D=function(){return!0},e.prototype.queryIntersectsFeature=function(t,e,r,n,a,o,s,l){var u=_a(t,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),o.angle,s),c=this.paint.get("fill-extrusion-height").evaluate(e,r),p=this.paint.get("fill-extrusion-base").evaluate(e,r),h=function(t,e,r,n){for(var a=[],o=0,s=t;o<s.length;o+=1){var l=s[o],u=[l.x,l.y,0,1];Ta(u,u,e),a.push(new i(u[0]/u[3],u[1]/u[3]))}return a}(u,l),f=function(t,e,r,n){for(var a=[],o=[],s=n[8]*e,l=n[9]*e,u=n[10]*e,c=n[11]*e,p=n[8]*r,h=n[9]*r,f=n[10]*r,d=n[11]*r,m=0,y=t;m<y.length;m+=1){for(var g=[],v=[],_=0,x=y[m];_<x.length;_+=1){var b=x[_],w=b.x,k=b.y,T=n[0]*w+n[4]*k+n[12],A=n[1]*w+n[5]*k+n[13],M=n[2]*w+n[6]*k+n[14],S=n[3]*w+n[7]*k+n[15],L=M+u,C=S+c,E=T+p,z=A+h,P=M+f,I=S+d,D=new i((T+s)/C,(A+l)/C);D.z=L/C,g.push(D);var O=new i(E/I,z/I);O.z=P/I,v.push(O)}a.push(g),o.push(v)}return[a,o]}(n,p,c,l);return function(t,e,r){var n=1/0;la(r,e)&&(n=Go(r,e[0]));for(var i=0;i<e.length;i++)for(var a=e[i],o=t[i],s=0;s<a.length-1;s++){var l=a[s],u=a[s+1],c=o[s],p=[l,u,o[s+1],c,l];oa(r,p)&&(n=Math.min(n,Go(r,p)))}return n!==1/0&&n}(f[0],f[1],h)},e}(Zn);function qo(t,e){return t.x*e.x+t.y*e.y}function Go(t,e){if(1===t.length){var r=e[0],n=e[1],i=e[3],a=t[0],o=n.sub(r),s=i.sub(r),l=a.sub(r),u=qo(o,o),c=qo(o,s),p=qo(s,s),h=qo(l,o),f=qo(l,s),d=u*p-c*c,m=(p*h-c*f)/d,y=(u*f-c*h)/d,g=1-m-y;return r.z*g+n.z*m+i.z*y}for(var v=1/0,_=0,x=e;_<x.length;_+=1){var b=x[_];v=Math.min(v,b.z)}return v}var Ho=Kn([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4).members,Zo=Do.VectorTileFeature.types,Xo=Math.cos(Math.PI/180*37.5),Wo=Math.pow(2,14)/.5,Yo=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(function(t){return t.id}),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new ei,this.indexArray=new di,this.programConfigurations=new $i(Ho,t.layers,t.zoom),this.segments=new Pi,this.stateDependentLayerIds=this.layers.filter(function(t){return t.isStateDependent()}).map(function(t){return t.id})};Yo.prototype.populate=function(t,e){this.hasPattern=_o("line",this.layers,e);for(var r=this.layers[0].layout.get("line-sort-key"),n=[],i=0,a=t;i<a.length;i+=1){var o=a[i],s=o.feature,l=o.index,u=o.sourceLayerIndex;if(this.layers[0]._featureFilter(new zn(this.zoom),s)){var c=na(s),p=r?r.evaluate(s,{}):void 0,h={id:s.id,properties:s.properties,type:s.type,sourceLayerIndex:u,index:l,geometry:c,patterns:{},sortKey:p};n.push(h)}}r&&n.sort(function(t,e){return t.sortKey-e.sortKey});for(var f=0,d=n;f<d.length;f+=1){var m=d[f],y=m,g=y.geometry,v=y.index,_=y.sourceLayerIndex;if(this.hasPattern){var x=xo("line",this.layers,m,this.zoom,e);this.patternFeatures.push(x)}else this.addFeature(m,g,v,{});var b=t[v].feature;e.featureIndex.insert(b,g,v,_,this.index)}},Yo.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)},Yo.prototype.addFeatures=function(t,e){for(var r=0,n=this.patternFeatures;r<n.length;r+=1){var i=n[r];this.addFeature(i,i.geometry,i.index,e)}},Yo.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},Yo.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Yo.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Ho),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},Yo.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},Yo.prototype.addFeature=function(t,e,r,n){for(var i=this.layers[0].layout,a=i.get("line-join").evaluate(t,{}),o=i.get("line-cap"),s=i.get("line-miter-limit"),l=i.get("line-round-limit"),u=0,c=e;u<c.length;u+=1){var p=c[u];this.addLine(p,t,a,o,s,l,r,n)}},Yo.prototype.addLine=function(t,e,r,n,i,a,o,s){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,e.properties&&e.properties.hasOwnProperty("mapbox_clip_start")&&e.properties.hasOwnProperty("mapbox_clip_end")){this.clipStart=+e.properties.mapbox_clip_start,this.clipEnd=+e.properties.mapbox_clip_end;for(var l=0;l<t.length-1;l++)this.totalDistance+=t[l].dist(t[l+1])}for(var u="Polygon"===Zo[e.type],c=t.length;c>=2&&t[c-1].equals(t[c-2]);)c--;for(var p=0;p<c-1&&t[p].equals(t[p+1]);)p++;if(!(c<(u?3:2))){"bevel"===r&&(i=1.05);var h,f=ea/(512*this.overscaling)*15,d=this.segments.prepareSegment(10*c,this.layoutVertexArray,this.indexArray),m=void 0,y=void 0,g=void 0,v=void 0;this.e1=this.e2=-1,u&&(h=t[c-2],v=t[p].sub(h)._unit()._perp());for(var _=p;_<c;_++)if(!(y=u&&_===c-1?t[p+1]:t[_+1])||!t[_].equals(y)){v&&(g=v),h&&(m=h),h=t[_],v=y?y.sub(h)._unit()._perp():g;var x=(g=g||v).add(v);0===x.x&&0===x.y||x._unit();var b=g.x*v.x+g.y*v.y,w=x.x*v.x+x.y*v.y,k=0!==w?1/w:1/0,T=2*Math.sqrt(2-2*w),A=w<Xo&&m&&y,M=g.x*v.y-g.y*v.x>0;if(A&&_>p){var S=h.dist(m);if(S>2*f){var L=h.sub(h.sub(m)._mult(f/S)._round());this.updateDistance(m,L),this.addCurrentVertex(L,g,0,0,d),m=L}}var C=m&&y,E=C?r:u?"butt":n;if(C&&"round"===E&&(k<a?E="miter":k<=2&&(E="fakeround")),"miter"===E&&k>i&&(E="bevel"),"bevel"===E&&(k>2&&(E="flipbevel"),k<i&&(E="miter")),m&&this.updateDistance(m,h),"miter"===E)x._mult(k),this.addCurrentVertex(h,x,0,0,d);else if("flipbevel"===E){if(k>100)x=v.mult(-1);else{var z=k*g.add(v).mag()/g.sub(v).mag();x._perp()._mult(z*(M?-1:1))}this.addCurrentVertex(h,x,0,0,d),this.addCurrentVertex(h,x.mult(-1),0,0,d)}else if("bevel"===E||"fakeround"===E){var P=-Math.sqrt(k*k-1),I=M?P:0,D=M?0:P;if(m&&this.addCurrentVertex(h,g,I,D,d),"fakeround"===E)for(var O=Math.round(180*T/Math.PI/20),R=1;R<O;R++){var F=R/O;if(.5!==F){var B=F-.5;F+=F*B*(F-1)*((1.0904+b*(b*(3.55645-1.43519*b)-3.2452))*B*B+(.848013+b*(.215638*b-1.06021)))}var N=v.sub(g)._mult(F)._add(g)._unit()._mult(M?-1:1);this.addHalfVertex(h,N.x,N.y,!1,M,0,d)}y&&this.addCurrentVertex(h,v,-I,-D,d)}else if("butt"===E)this.addCurrentVertex(h,x,0,0,d);else if("square"===E){var U=m?1:-1;this.addCurrentVertex(h,x,U,U,d)}else"round"===E&&(m&&(this.addCurrentVertex(h,g,0,0,d),this.addCurrentVertex(h,g,1,1,d,!0)),y&&(this.addCurrentVertex(h,v,-1,-1,d,!0),this.addCurrentVertex(h,v,0,0,d)));if(A&&_<c-1){var j=h.dist(y);if(j>2*f){var V=h.add(y.sub(h)._mult(f/j)._round());this.updateDistance(h,V),this.addCurrentVertex(V,v,0,0,d),h=V}}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,o,s)}},Yo.prototype.addCurrentVertex=function(t,e,r,n,i,a){void 0===a&&(a=!1);var o=e.x+e.y*r,s=e.y-e.x*r,l=-e.x+e.y*n,u=-e.y-e.x*n;this.addHalfVertex(t,o,s,a,!1,r,i),this.addHalfVertex(t,l,u,a,!0,-n,i),this.distance>Wo/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(t,e,r,n,i,a))},Yo.prototype.addHalfVertex=function(t,e,r,n,i,a,o){var s=t.x,l=t.y,u=.5*this.scaledDistance;this.layoutVertexArray.emplaceBack((s<<1)+(n?1:0),(l<<1)+(i?1:0),Math.round(63*e)+128,Math.round(63*r)+128,1+(0===a?0:a<0?-1:1)|(63&u)<<2,u>>6);var c=o.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,c),o.primitiveLength++),i?this.e2=c:this.e1=c},Yo.prototype.updateDistance=function(t,e){this.distance+=t.dist(e),this.scaledDistance=this.totalDistance>0?(this.clipStart+(this.clipEnd-this.clipStart)*this.distance/this.totalDistance)*(Wo-1):this.distance},dn("LineBucket",Yo,{omit:["layers","patternFeatures"]});var Ko=new Hn({"line-cap":new Un(Tt.layout_line["line-cap"]),"line-join":new jn(Tt.layout_line["line-join"]),"line-miter-limit":new Un(Tt.layout_line["line-miter-limit"]),"line-round-limit":new Un(Tt.layout_line["line-round-limit"]),"line-sort-key":new jn(Tt.layout_line["line-sort-key"])}),Jo={paint:new Hn({"line-opacity":new jn(Tt.paint_line["line-opacity"]),"line-color":new jn(Tt.paint_line["line-color"]),"line-translate":new Un(Tt.paint_line["line-translate"]),"line-translate-anchor":new Un(Tt.paint_line["line-translate-anchor"]),"line-width":new jn(Tt.paint_line["line-width"]),"line-gap-width":new jn(Tt.paint_line["line-gap-width"]),"line-offset":new jn(Tt.paint_line["line-offset"]),"line-blur":new jn(Tt.paint_line["line-blur"]),"line-dasharray":new qn(Tt.paint_line["line-dasharray"]),"line-pattern":new Vn(Tt.paint_line["line-pattern"]),"line-gradient":new Gn(Tt.paint_line["line-gradient"])}),layout:Ko},$o=new(function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.possiblyEvaluate=function(e,r){return r=new zn(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,zoomHistory:r.zoomHistory,transition:r.transition}),t.prototype.possiblyEvaluate.call(this,e,r)},e.prototype.evaluate=function(e,r,n,i){return r=p({},r,{zoom:Math.floor(r.zoom)}),t.prototype.evaluate.call(this,e,r,n,i)},e}(jn))(Jo.paint.properties["line-width"].specification);$o.useIntegerZoom=!0;var Qo=function(t){function e(e){t.call(this,e,Jo)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._handleSpecialPaintPropertyUpdate=function(t){"line-gradient"===t&&this._updateGradient()},e.prototype._updateGradient=function(){var t=this._transitionablePaint._values["line-gradient"].value.expression;this.gradient=Da(t,"lineProgress"),this.gradientTexture=null},e.prototype.recalculate=function(e){t.prototype.recalculate.call(this,e),this.paint._values["line-floorwidth"]=$o.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)},e.prototype.createBucket=function(t){return new Yo(t)},e.prototype.queryRadius=function(t){var e=t,r=ts(ga("line-width",this,e),ga("line-gap-width",this,e)),n=ga("line-offset",this,e);return r/2+Math.abs(n)+va(this.paint.get("line-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,a,o,s){var l=_a(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),o.angle,s),u=s/2*ts(this.paint.get("line-width").evaluate(e,r),this.paint.get("line-gap-width").evaluate(e,r)),c=this.paint.get("line-offset").evaluate(e,r);return c&&(n=function(t,e){for(var r=[],n=new i(0,0),a=0;a<t.length;a++){for(var o=t[a],s=[],l=0;l<o.length;l++){var u=o[l-1],c=o[l],p=o[l+1],h=0===l?n:c.sub(u)._unit()._perp(),f=l===o.length-1?n:p.sub(c)._unit()._perp(),d=h._add(f)._unit(),m=d.x*f.x+d.y*f.y;d._mult(1/m),s.push(d._mult(e)._add(c))}r.push(s)}return r}(n,c*s)),function(t,e,r){for(var n=0;n<e.length;n++){var i=e[n];if(t.length>=3)for(var a=0;a<i.length;a++)if(ma(t,i[a]))return!0;if(ua(t,i,r))return!0}return!1}(l,n,u)},e.prototype.isTileClipped=function(){return!0},e}(Zn);function ts(t,e){return e>0?e+2*t:t}var es=Kn([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"}]),rs=Kn([{name:"a_projected_pos",components:3,type:"Float32"}],4),ns=(Kn([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),Kn([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),is=(Kn([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"},{type:"Int16",name:"radius"},{type:"Int16",name:"signedDistanceFromAnchor"}]),Kn([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),as=Kn([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4);function os(t,e,r){return t.sections.forEach(function(t){t.text=function(t,e,r){var n=e.layout.get("text-transform").evaluate(r,{});return"uppercase"===n?t=t.toLocaleUpperCase():"lowercase"===n&&(t=t.toLocaleLowerCase()),En.applyArabicShaping&&(t=En.applyArabicShaping(t)),t}(t.text,e,r)}),t}Kn([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"}]),Kn([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",name:"radialTextOffset"}]),Kn([{type:"Float32",name:"offsetX"}]),Kn([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var ss={"!":"\ufe15","#":"\uff03",$:"\uff04","%":"\uff05","&":"\uff06","(":"\ufe35",")":"\ufe36","*":"\uff0a","+":"\uff0b",",":"\ufe10","-":"\ufe32",".":"\u30fb","/":"\uff0f",":":"\ufe13",";":"\ufe14","<":"\ufe3f","=":"\uff1d",">":"\ufe40","?":"\ufe16","@":"\uff20","[":"\ufe47","\\":"\uff3c","]":"\ufe48","^":"\uff3e",_:"\ufe33","`":"\uff40","{":"\ufe37","|":"\u2015","}":"\ufe38","~":"\uff5e","\xa2":"\uffe0","\xa3":"\uffe1","\xa5":"\uffe5","\xa6":"\uffe4","\xac":"\uffe2","\xaf":"\uffe3","\u2013":"\ufe32","\u2014":"\ufe31","\u2018":"\ufe43","\u2019":"\ufe44","\u201c":"\ufe41","\u201d":"\ufe42","\u2026":"\ufe19","\u2027":"\u30fb","\u20a9":"\uffe6","\u3001":"\ufe11","\u3002":"\ufe12","\u3008":"\ufe3f","\u3009":"\ufe40","\u300a":"\ufe3d","\u300b":"\ufe3e","\u300c":"\ufe41","\u300d":"\ufe42","\u300e":"\ufe43","\u300f":"\ufe44","\u3010":"\ufe3b","\u3011":"\ufe3c","\u3014":"\ufe39","\u3015":"\ufe3a","\u3016":"\ufe17","\u3017":"\ufe18","\uff01":"\ufe15","\uff08":"\ufe35","\uff09":"\ufe36","\uff0c":"\ufe10","\uff0d":"\ufe32","\uff0e":"\u30fb","\uff1a":"\ufe13","\uff1b":"\ufe14","\uff1c":"\ufe3f","\uff1e":"\ufe40","\uff1f":"\ufe16","\uff3b":"\ufe47","\uff3d":"\ufe48","\uff3f":"\ufe33","\uff5b":"\ufe37","\uff5c":"\u2015","\uff5d":"\ufe38","\uff5f":"\ufe35","\uff60":"\ufe36","\uff61":"\ufe12","\uff62":"\ufe41","\uff63":"\ufe42"},ls=24,us={horizontal:1,vertical:2,horizontalOnly:3},cs=function(){this.text="",this.sectionIndex=[],this.sections=[]};function ps(t,e,r,n,i,a,o,s,l,u,c){var p,h=cs.fromFeature(t,r);u===us.vertical&&h.verticalizePunctuation();var f=En.processBidirectionalText,d=En.processStyledBidirectionalText;if(f&&1===h.sections.length){p=[];for(var m=0,y=f(h.toString(),gs(h,s,n,e));m<y.length;m+=1){var g=y[m],v=new cs;v.text=g,v.sections=h.sections;for(var _=0;_<g.length;_++)v.sectionIndex.push(0);p.push(v)}}else if(d){p=[];for(var x=0,b=d(h.text,h.sectionIndex,gs(h,s,n,e));x<b.length;x+=1){var w=b[x],k=new cs;k.text=w[0],k.sectionIndex=w[1],k.sections=h.sections,p.push(k)}}else p=function(t,e){for(var r=[],n=t.text,i=0,a=0,o=e;a<o.length;a+=1){var s=o[a];r.push(t.substring(i,s)),i=s}return i<n.length&&r.push(t.substring(i,n.length)),r}(h,gs(h,s,n,e));var T=[],A={positionedGlyphs:T,text:h.toString(),top:l[1],bottom:l[1],left:l[0],right:l[0],writingMode:u,lineCount:p.length,yOffset:-17};return function(t,e,r,n,i,a,o,s,l){for(var u=0,c=t.yOffset,p=0,h=t.positionedGlyphs,f="right"===a?1:"left"===a?0:.5,d=0,m=r;d<m.length;d+=1){var y=m[d];y.trim();var g=y.getMaxScale();if(y.length()){for(var v=h.length,_=0;_<y.length();_++){var x=y.getSection(_),b=y.getSectionIndex(_),w=y.getCharCode(_),k=24*(g-x.scale),T=e[x.fontStack],A=T&&T[w];A&&(o===us.horizontal||!l&&!wn(w)||l&&(hs[w]||(S=w,_n.Arabic(S)||_n["Arabic Supplement"](S)||_n["Arabic Extended-A"](S)||_n["Arabic Presentation Forms-A"](S)||_n["Arabic Presentation Forms-B"](S)))?(h.push({glyph:w,x:u,y:c+k,vertical:!1,scale:x.scale,fontStack:x.fontStack,sectionIndex:b}),u+=A.metrics.advance*x.scale+s):(h.push({glyph:w,x:u,y:c+k,vertical:!0,scale:x.scale,fontStack:x.fontStack,sectionIndex:b}),u+=ls*x.scale+s))}if(h.length!==v){var M=u-s;p=Math.max(M,p),_s(h,e,v,h.length-1,f)}u=0,c+=n*g}else c+=n}var S,L=vs(i),C=L.horizontalAlign,E=L.verticalAlign;!function(t,e,r,n,i,a,o){for(var s=(e-r)*i,l=(-n*o+.5)*a,u=0;u<t.length;u++)t[u].x+=s,t[u].y+=l}(h,f,C,E,p,n,r.length);var z=c-t.yOffset;t.top+=-E*z,t.bottom=t.top+z,t.left+=-C*p,t.right=t.left+p}(A,e,p,i,a,o,u,s,c),!!T.length&&A}cs.fromFeature=function(t,e){for(var r=new cs,n=0;n<t.sections.length;n++){var i=t.sections[n];r.sections.push({scale:i.scale||1,fontStack:i.fontStack||e}),r.text+=i.text;for(var a=0;a<i.text.length;a++)r.sectionIndex.push(n)}return r},cs.prototype.length=function(){return this.text.length},cs.prototype.getSection=function(t){return this.sections[this.sectionIndex[t]]},cs.prototype.getSectionIndex=function(t){return this.sectionIndex[t]},cs.prototype.getCharCode=function(t){return this.text.charCodeAt(t)},cs.prototype.verticalizePunctuation=function(){this.text=function(t){for(var e="",r=0;r<t.length;r++){var n=t.charCodeAt(r+1)||null,i=t.charCodeAt(r-1)||null;n&&kn(n)&&!ss[t[r+1]]||i&&kn(i)&&!ss[t[r-1]]||!ss[t[r]]?e+=t[r]:e+=ss[t[r]]}return e}(this.text)},cs.prototype.trim=function(){for(var t=0,e=0;e<this.text.length&&hs[this.text.charCodeAt(e)];e++)t++;for(var r=this.text.length,n=this.text.length-1;n>=0&&n>=t&&hs[this.text.charCodeAt(n)];n--)r--;this.text=this.text.substring(t,r),this.sectionIndex=this.sectionIndex.slice(t,r)},cs.prototype.substring=function(t,e){var r=new cs;return r.text=this.text.substring(t,e),r.sectionIndex=this.sectionIndex.slice(t,e),r.sections=this.sections,r},cs.prototype.toString=function(){return this.text},cs.prototype.getMaxScale=function(){var t=this;return this.sectionIndex.reduce(function(e,r){return Math.max(e,t.sections[r].scale)},0)};var hs={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},fs={};function ds(t,e,r,n){var i=Math.pow(t-e,2);return n?t<e?i/2:2*i:i+Math.abs(r)*r}function ms(t,e,r){var n=0;return 10===t&&(n-=1e4),r&&(n+=150),40!==t&&65288!==t||(n+=50),41!==e&&65289!==e||(n+=50),n}function ys(t,e,r,n,i,a){for(var o=null,s=ds(e,r,i,a),l=0,u=n;l<u.length;l+=1){var c=u[l],p=ds(e-c.x,r,i,a)+c.badness;p<=s&&(o=c,s=p)}return{index:t,x:e,priorBreak:o,badness:s}}function gs(t,e,r,n){if(!r)return[];if(!t)return[];for(var i,a=[],o=function(t,e,r,n){for(var i=0,a=0;a<t.length();a++){var o=t.getSection(a),s=n[o.fontStack],l=s&&s[t.getCharCode(a)];l&&(i+=l.metrics.advance*o.scale+e)}return i/Math.max(1,Math.ceil(i/r))}(t,e,r,n),s=t.text.indexOf("\u200b")>=0,l=0,u=0;u<t.length();u++){var c=t.getSection(u),p=t.getCharCode(u),h=n[c.fontStack],f=h&&h[p];if(f&&!hs[p]&&(l+=f.metrics.advance*c.scale+e),u<t.length()-1){var d=!((i=p)<11904||!(_n["Bopomofo Extended"](i)||_n.Bopomofo(i)||_n["CJK Compatibility Forms"](i)||_n["CJK Compatibility Ideographs"](i)||_n["CJK Compatibility"](i)||_n["CJK Radicals Supplement"](i)||_n["CJK Strokes"](i)||_n["CJK Symbols and Punctuation"](i)||_n["CJK Unified Ideographs Extension A"](i)||_n["CJK Unified Ideographs"](i)||_n["Enclosed CJK Letters and Months"](i)||_n["Halfwidth and Fullwidth Forms"](i)||_n.Hiragana(i)||_n["Ideographic Description Characters"](i)||_n["Kangxi Radicals"](i)||_n["Katakana Phonetic Extensions"](i)||_n.Katakana(i)||_n["Vertical Forms"](i)||_n["Yi Radicals"](i)||_n["Yi Syllables"](i)));(fs[p]||d)&&a.push(ys(u+1,l,o,a,ms(p,t.getCharCode(u+1),d&&s),!1))}}return function t(e){return e?t(e.priorBreak).concat(e.index):[]}(ys(t.length(),l,o,a,0,!0))}function vs(t){var e=.5,r=.5;switch(t){case"right":case"top-right":case"bottom-right":e=1;break;case"left":case"top-left":case"bottom-left":e=0}switch(t){case"bottom":case"bottom-right":case"bottom-left":r=1;break;case"top":case"top-right":case"top-left":r=0}return{horizontalAlign:e,verticalAlign:r}}function _s(t,e,r,n,i){if(i){var a=t[n],o=e[a.fontStack],s=o&&o[a.glyph];if(s)for(var l=s.metrics.advance*a.scale,u=(t[n].x+l)*i,c=r;c<=n;c++)t[c].x-=u}}fs[10]=!0,fs[32]=!0,fs[38]=!0,fs[40]=!0,fs[41]=!0,fs[43]=!0,fs[45]=!0,fs[47]=!0,fs[173]=!0,fs[183]=!0,fs[8203]=!0,fs[8208]=!0,fs[8211]=!0,fs[8231]=!0;var xs=function(t){function e(e,r,n,i){t.call(this,e,r),this.angle=n,void 0!==i&&(this.segment=i)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.clone=function(){return new e(this.x,this.y,this.angle,this.segment)},e}(i);dn("Anchor",xs);var bs=256;function ws(t,e){var r=e.expression;if("constant"===r.kind)return{kind:"constant",layoutSize:r.evaluate(new zn(t+1))};if("source"===r.kind)return{kind:"source"};for(var n=r.zoomStops,i=r.interpolationType,a=0;a<n.length&&n[a]<=t;)a++;for(var o=a=Math.max(0,a-1);o<n.length&&n[o]<t+1;)o++;o=Math.min(n.length-1,o);var s=n[a],l=n[o];return"composite"===r.kind?{kind:"composite",minZoom:s,maxZoom:l,interpolationType:i}:{kind:"camera",minZoom:s,maxZoom:l,minSize:r.evaluate(new zn(s)),maxSize:r.evaluate(new zn(l)),interpolationType:i}}function ks(t,e,r){var n=e.uSize,i=e.uSizeT,a=r.lowerSize,o=r.upperSize;return"source"===t.kind?a/bs:"composite"===t.kind?ve(a/bs,o/bs,i):n}function Ts(t,e){var r=0,n=0;if("constant"===t.kind)n=t.layoutSize;else if("source"!==t.kind){var i=t.interpolationType,a=t.minZoom,o=t.maxZoom,s=i?u(Ne.interpolationFactor(i,e,a,o),0,1):0;"camera"===t.kind?n=ve(t.minSize,t.maxSize,s):r=s}return{uSizeT:r,uSize:n}}var As=Object.freeze({getSizeData:ws,evaluateSizeForFeature:ks,evaluateSizeForZoom:Ts,SIZE_PACK_FACTOR:bs}),Ms=Do.VectorTileFeature.types,Ss=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function Ls(t,e,r,n,i,a,o,s){t.emplaceBack(e,r,Math.round(32*n),Math.round(32*i),a,o,s?s[0]:0,s?s[1]:0)}function Cs(t,e,r){t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r)}var Es=function(t){this.layoutVertexArray=new ni,this.indexArray=new di,this.programConfigurations=t,this.segments=new Pi,this.dynamicLayoutVertexArray=new ii,this.opacityVertexArray=new ai,this.placedSymbolArray=new wi};Es.prototype.upload=function(t,e,r,n){r&&(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,es.members),this.indexBuffer=t.createIndexBuffer(this.indexArray,e),this.dynamicLayoutVertexBuffer=t.createVertexBuffer(this.dynamicLayoutVertexArray,rs.members,!0),this.opacityVertexBuffer=t.createVertexBuffer(this.opacityVertexArray,Ss,!0),this.opacityVertexBuffer.itemSize=1),(r||n)&&this.programConfigurations.upload(t)},Es.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())},dn("SymbolBuffers",Es);var zs=function(t,e,r){this.layoutVertexArray=new t,this.layoutAttributes=e,this.indexArray=new r,this.segments=new Pi,this.collisionVertexArray=new li};zs.prototype.upload=function(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=t.createVertexBuffer(this.collisionVertexArray,ns.members,!0)},zs.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())},dn("CollisionBuffers",zs);var Ps=function(t){this.collisionBoxArray=t.collisionBoxArray,this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(function(t){return t.id}),this.index=t.index,this.pixelRatio=t.pixelRatio,this.sourceLayerIndex=t.sourceLayerIndex,this.hasPattern=!1,this.hasPaintOverrides=!1;var e=this.layers[0]._unevaluatedLayout._values;this.textSizeData=ws(this.zoom,e["text-size"]),this.iconSizeData=ws(this.zoom,e["icon-size"]);var r=this.layers[0].layout,n=r.get("symbol-sort-key"),i=r.get("symbol-z-order");this.sortFeaturesByKey="viewport-y"!==i&&void 0!==n.constantOr(1);var a="viewport-y"===i||"auto"===i&&!this.sortFeaturesByKey;this.sortFeaturesByY=a&&(r.get("text-allow-overlap")||r.get("icon-allow-overlap")||r.get("text-ignore-placement")||r.get("icon-ignore-placement")),"point"===r.get("symbol-placement")&&(this.writingModes=r.get("text-writing-mode").map(function(t){return us[t]})),this.stateDependentLayerIds=this.layers.filter(function(t){return t.isStateDependent()}).map(function(t){return t.id}),this.sourceID=t.sourceID};Ps.prototype.createArrays=function(){var t=this.layers[0].layout;this.hasPaintOverrides=Rs.hasPaintOverrides(t),this.text=new Es(new $i(es.members,this.layers,this.zoom,function(t){return/^text/.test(t)})),this.icon=new Es(new $i(es.members,this.layers,this.zoom,function(t){return/^icon/.test(t)})),this.collisionBox=new zs(si,is.members,mi),this.collisionCircle=new zs(si,as.members,di),this.glyphOffsetArray=new Mi,this.lineVertexArray=new Li,this.symbolInstances=new Ti},Ps.prototype.calculateGlyphDependencies=function(t,e,r,n,i){for(var a=0;a<t.length;a++)if(e[t.charCodeAt(a)]=!0,(r||n)&&i){var o=ss[t.charAt(a)];o&&(e[o.charCodeAt(0)]=!0)}},Ps.prototype.populate=function(t,e){var r=this.layers[0],n=r.layout,i=n.get("text-font"),a=n.get("text-field"),o=n.get("icon-image"),s=("constant"!==a.value.kind||a.value.value.toString().length>0)&&("constant"!==i.value.kind||i.value.value.length>0),l="constant"!==o.value.kind||o.value.value&&o.value.value.length>0,u=n.get("symbol-sort-key");if(this.features=[],s||l){for(var c=e.iconDependencies,p=e.glyphDependencies,h=new zn(this.zoom),f=0,d=t;f<d.length;f+=1){var m=d[f],y=m.feature,g=m.index,v=m.sourceLayerIndex;if(r._featureFilter(h,y)){var _=void 0;if(s){var x=r.getValueAndResolveTokens("text-field",y);_=os(x instanceof Kt?x:Kt.fromString(x),r,y)}var b=void 0;if(l&&(b=r.getValueAndResolveTokens("icon-image",y)),_||b){var w=this.sortFeaturesByKey?u.evaluate(y,{}):void 0,k={text:_,icon:b,index:g,sourceLayerIndex:v,geometry:na(y),properties:y.properties,type:Ms[y.type],sortKey:w};if(void 0!==y.id&&(k.id=y.id),this.features.push(k),b&&(c[b]=!0),_){var T=i.evaluate(y,{}).join(","),A="map"===n.get("text-rotation-alignment")&&"point"!==n.get("symbol-placement");this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(us.vertical)>=0;for(var M=0,S=_.sections;M<S.length;M+=1){var L=S[M],C=xn(_.toString()),E=L.fontStack||T,z=p[E]=p[E]||{};this.calculateGlyphDependencies(L.text,z,A,this.allowVerticalPlacement,C)}}}}}"line"===n.get("symbol-placement")&&(this.features=function(t){var e={},r={},n=[],i=0;function a(e){n.push(t[e]),i++}function o(t,e,i){var a=r[t];return delete r[t],r[e]=a,n[a].geometry[0].pop(),n[a].geometry[0]=n[a].geometry[0].concat(i[0]),a}function s(t,r,i){var a=e[r];return delete e[r],e[t]=a,n[a].geometry[0].shift(),n[a].geometry[0]=i[0].concat(n[a].geometry[0]),a}function l(t,e,r){var n=r?e[0][e[0].length-1]:e[0][0];return t+":"+n.x+":"+n.y}for(var u=0;u<t.length;u++){var c=t[u],p=c.geometry,h=c.text?c.text.toString():null;if(h){var f=l(h,p),d=l(h,p,!0);if(f in r&&d in e&&r[f]!==e[d]){var m=s(f,d,p),y=o(f,d,n[m].geometry);delete e[f],delete r[d],r[l(h,n[y].geometry,!0)]=y,n[m].geometry=null}else f in r?o(f,d,p):d in e?s(f,d,p):(a(u),e[f]=i-1,r[d]=i-1)}else a(u)}return n.filter(function(t){return t.geometry})}(this.features)),this.sortFeaturesByKey&&this.features.sort(function(t,e){return t.sortKey-e.sortKey})}},Ps.prototype.update=function(t,e,r){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(t,e,this.layers,r),this.icon.programConfigurations.updatePaintArrays(t,e,this.layers,r))},Ps.prototype.isEmpty=function(){return 0===this.symbolInstances.length},Ps.prototype.uploadPending=function(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload},Ps.prototype.upload=function(t){this.uploaded||(this.collisionBox.upload(t),this.collisionCircle.upload(t)),this.text.upload(t,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(t,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0},Ps.prototype.destroy=function(){this.text.destroy(),this.icon.destroy(),this.collisionBox.destroy(),this.collisionCircle.destroy()},Ps.prototype.addToLineVertexArray=function(t,e){var r=this.lineVertexArray.length;if(void 0!==t.segment){for(var n=t.dist(e[t.segment+1]),i=t.dist(e[t.segment]),a={},o=t.segment+1;o<e.length;o++)a[o]={x:e[o].x,y:e[o].y,tileUnitDistanceFromAnchor:n},o<e.length-1&&(n+=e[o+1].dist(e[o]));for(var s=t.segment||0;s>=0;s--)a[s]={x:e[s].x,y:e[s].y,tileUnitDistanceFromAnchor:i},s>0&&(i+=e[s-1].dist(e[s]));for(var l=0;l<e.length;l++){var u=a[l];this.lineVertexArray.emplaceBack(u.x,u.y,u.tileUnitDistanceFromAnchor)}}return{lineStartIndex:r,lineLength:this.lineVertexArray.length-r}},Ps.prototype.addSymbols=function(t,e,r,n,i,a,o,s,l,u){var c=this,p=t.indexArray,h=t.layoutVertexArray,f=t.dynamicLayoutVertexArray,d=t.segments.prepareSegment(4*e.length,t.layoutVertexArray,t.indexArray,a.sortKey),m=this.glyphOffsetArray.length,y=d.vertexLength,g=this.allowVerticalPlacement&&o===us.vertical?Math.PI/2:0,v=function(t){var e=t.tl,n=t.tr,i=t.bl,a=t.br,o=t.tex,l=d.vertexLength,u=t.glyphOffset[1];Ls(h,s.x,s.y,e.x,u+e.y,o.x,o.y,r),Ls(h,s.x,s.y,n.x,u+n.y,o.x+o.w,o.y,r),Ls(h,s.x,s.y,i.x,u+i.y,o.x,o.y+o.h,r),Ls(h,s.x,s.y,a.x,u+a.y,o.x+o.w,o.y+o.h,r),Cs(f,s,g),p.emplaceBack(l,l+1,l+2),p.emplaceBack(l+1,l+2,l+3),d.vertexLength+=4,d.primitiveLength+=2,c.glyphOffsetArray.emplaceBack(t.glyphOffset[0])};if(a.text&&a.text.sections){var _=a.text.sections;if(this.hasPaintOverrides){for(var x,b=function(e,r){void 0===x||x===e&&!r||t.programConfigurations.populatePaintArrays(t.layoutVertexArray.length,a,a.index,{},_[x]),x=e},w=0,k=e;w<k.length;w+=1){var T=k[w];b(T.sectionIndex,!1),v(T)}b(x,!0)}else{for(var A=0,M=e;A<M.length;A+=1)v(M[A]);t.programConfigurations.populatePaintArrays(t.layoutVertexArray.length,a,a.index,{},_[0])}}else{for(var S=0,L=e;S<L.length;S+=1)v(L[S]);t.programConfigurations.populatePaintArrays(t.layoutVertexArray.length,a,a.index,{})}t.placedSymbolArray.emplaceBack(s.x,s.y,m,this.glyphOffsetArray.length-m,y,l,u,s.segment,r?r[0]:0,r?r[1]:0,n[0],n[1],o,0,!1,0)},Ps.prototype._addCollisionDebugVertex=function(t,e,r,n,i,a){return e.emplaceBack(0,0),t.emplaceBack(r.x,r.y,n,i,Math.round(a.x),Math.round(a.y))},Ps.prototype.addCollisionDebugVertices=function(t,e,r,n,a,o,s,l){var u=a.segments.prepareSegment(4,a.layoutVertexArray,a.indexArray),c=u.vertexLength,p=a.layoutVertexArray,h=a.collisionVertexArray,f=s.anchorX,d=s.anchorY;if(this._addCollisionDebugVertex(p,h,o,f,d,new i(t,e)),this._addCollisionDebugVertex(p,h,o,f,d,new i(r,e)),this._addCollisionDebugVertex(p,h,o,f,d,new i(r,n)),this._addCollisionDebugVertex(p,h,o,f,d,new i(t,n)),u.vertexLength+=4,l){var m=a.indexArray;m.emplaceBack(c,c+1,c+2),m.emplaceBack(c,c+2,c+3),u.primitiveLength+=2}else{var y=a.indexArray;y.emplaceBack(c,c+1),y.emplaceBack(c+1,c+2),y.emplaceBack(c+2,c+3),y.emplaceBack(c+3,c),u.primitiveLength+=4}},Ps.prototype.addDebugCollisionBoxes=function(t,e,r){for(var n=t;n<e;n++){var i=this.collisionBoxArray.get(n),a=i.x1,o=i.y1,s=i.x2,l=i.y2,u=i.radius>0;this.addCollisionDebugVertices(a,o,s,l,u?this.collisionCircle:this.collisionBox,i.anchorPoint,r,u)}},Ps.prototype.generateCollisionDebugBuffers=function(){for(var t=0;t<this.symbolInstances.length;t++){var e=this.symbolInstances.get(t);this.addDebugCollisionBoxes(e.textBoxStartIndex,e.textBoxEndIndex,e),this.addDebugCollisionBoxes(e.verticalTextBoxStartIndex,e.verticalTextBoxEndIndex,e),this.addDebugCollisionBoxes(e.iconBoxStartIndex,e.iconBoxEndIndex,e)}},Ps.prototype._deserializeCollisionBoxesForSymbol=function(t,e,r,n,i,a,o){for(var s={},l=e;l<r;l++){var u=t.get(l);if(0===u.radius){s.textBox={x1:u.x1,y1:u.y1,x2:u.x2,y2:u.y2,anchorPointX:u.anchorPointX,anchorPointY:u.anchorPointY},s.textFeatureIndex=u.featureIndex;break}s.textCircles||(s.textCircles=[],s.textFeatureIndex=u.featureIndex),s.textCircles.push(u.anchorPointX,u.anchorPointY,u.radius,u.signedDistanceFromAnchor,1)}for(var c=n;c<i;c++){var p=t.get(c);if(0===p.radius){s.verticalTextBox={x1:p.x1,y1:p.y1,x2:p.x2,y2:p.y2,anchorPointX:p.anchorPointX,anchorPointY:p.anchorPointY},s.verticalTextFeatureIndex=p.featureIndex;break}}for(var h=a;h<o;h++){var f=t.get(h);if(0===f.radius){s.iconBox={x1:f.x1,y1:f.y1,x2:f.x2,y2:f.y2,anchorPointX:f.anchorPointX,anchorPointY:f.anchorPointY},s.iconFeatureIndex=f.featureIndex;break}}return s},Ps.prototype.deserializeCollisionBoxes=function(t){this.collisionArrays=[];for(var e=0;e<this.symbolInstances.length;e++){var r=this.symbolInstances.get(e);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(t,r.textBoxStartIndex,r.textBoxEndIndex,r.verticalTextBoxStartIndex,r.verticalTextBoxEndIndex,r.iconBoxStartIndex,r.iconBoxEndIndex))}},Ps.prototype.hasTextData=function(){return this.text.segments.get().length>0},Ps.prototype.hasIconData=function(){return this.icon.segments.get().length>0},Ps.prototype.hasCollisionBoxData=function(){return this.collisionBox.segments.get().length>0},Ps.prototype.hasCollisionCircleData=function(){return this.collisionCircle.segments.get().length>0},Ps.prototype.addIndicesForPlacedTextSymbol=function(t){for(var e=this.text.placedSymbolArray.get(t),r=e.vertexStartIndex+4*e.numGlyphs,n=e.vertexStartIndex;n<r;n+=4)this.text.indexArray.emplaceBack(n,n+1,n+2),this.text.indexArray.emplaceBack(n+1,n+2,n+3)},Ps.prototype.getSortedSymbolIndexes=function(t){if(this.sortedAngle===t&&void 0!==this.symbolInstanceIndexes)return this.symbolInstanceIndexes;for(var e=Math.sin(t),r=Math.cos(t),n=[],i=[],a=[],o=0;o<this.symbolInstances.length;++o){a.push(o);var s=this.symbolInstances.get(o);n.push(0|Math.round(e*s.anchorX+r*s.anchorY)),i.push(s.featureIndex)}return a.sort(function(t,e){return n[t]-n[e]||i[e]-i[t]}),a},Ps.prototype.sortFeatures=function(t){var e=this;if(this.sortFeaturesByY&&this.sortedAngle!==t&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var r=0,n=this.symbolInstanceIndexes;r<n.length;r+=1){var i=n[r],a=this.symbolInstances.get(i);this.featureSortOrder.push(a.featureIndex),[a.rightJustifiedTextSymbolIndex,a.centerJustifiedTextSymbolIndex,a.leftJustifiedTextSymbolIndex].forEach(function(t,r,n){t>=0&&n.indexOf(t)===r&&e.addIndicesForPlacedTextSymbol(t)}),a.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedTextSymbol(a.verticalPlacedTextSymbolIndex);var o=this.icon.placedSymbolArray.get(i);if(o.numGlyphs){var s=o.vertexStartIndex;this.icon.indexArray.emplaceBack(s,s+1,s+2),this.icon.indexArray.emplaceBack(s+1,s+2,s+3)}}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},dn("SymbolBucket",Ps,{omit:["layers","collisionBoxArray","features","compareText"]}),Ps.MAX_GLYPHS=65535,Ps.addDynamicAttributes=Cs;var Is=new Hn({"symbol-placement":new Un(Tt.layout_symbol["symbol-placement"]),"symbol-spacing":new Un(Tt.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Un(Tt.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new jn(Tt.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Un(Tt.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Un(Tt.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new Un(Tt.layout_symbol["icon-ignore-placement"]),"icon-optional":new Un(Tt.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Un(Tt.layout_symbol["icon-rotation-alignment"]),"icon-size":new jn(Tt.layout_symbol["icon-size"]),"icon-text-fit":new Un(Tt.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Un(Tt.layout_symbol["icon-text-fit-padding"]),"icon-image":new jn(Tt.layout_symbol["icon-image"]),"icon-rotate":new jn(Tt.layout_symbol["icon-rotate"]),"icon-padding":new Un(Tt.layout_symbol["icon-padding"]),"icon-keep-upright":new Un(Tt.layout_symbol["icon-keep-upright"]),"icon-offset":new jn(Tt.layout_symbol["icon-offset"]),"icon-anchor":new jn(Tt.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Un(Tt.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Un(Tt.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Un(Tt.layout_symbol["text-rotation-alignment"]),"text-field":new jn(Tt.layout_symbol["text-field"]),"text-font":new jn(Tt.layout_symbol["text-font"]),"text-size":new jn(Tt.layout_symbol["text-size"]),"text-max-width":new jn(Tt.layout_symbol["text-max-width"]),"text-line-height":new Un(Tt.layout_symbol["text-line-height"]),"text-letter-spacing":new jn(Tt.layout_symbol["text-letter-spacing"]),"text-justify":new jn(Tt.layout_symbol["text-justify"]),"text-radial-offset":new jn(Tt.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Un(Tt.layout_symbol["text-variable-anchor"]),"text-anchor":new jn(Tt.layout_symbol["text-anchor"]),"text-max-angle":new Un(Tt.layout_symbol["text-max-angle"]),"text-writing-mode":new Un(Tt.layout_symbol["text-writing-mode"]),"text-rotate":new jn(Tt.layout_symbol["text-rotate"]),"text-padding":new Un(Tt.layout_symbol["text-padding"]),"text-keep-upright":new Un(Tt.layout_symbol["text-keep-upright"]),"text-transform":new jn(Tt.layout_symbol["text-transform"]),"text-offset":new jn(Tt.layout_symbol["text-offset"]),"text-allow-overlap":new Un(Tt.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new Un(Tt.layout_symbol["text-ignore-placement"]),"text-optional":new Un(Tt.layout_symbol["text-optional"])}),Ds={paint:new Hn({"icon-opacity":new jn(Tt.paint_symbol["icon-opacity"]),"icon-color":new jn(Tt.paint_symbol["icon-color"]),"icon-halo-color":new jn(Tt.paint_symbol["icon-halo-color"]),"icon-halo-width":new jn(Tt.paint_symbol["icon-halo-width"]),"icon-halo-blur":new jn(Tt.paint_symbol["icon-halo-blur"]),"icon-translate":new Un(Tt.paint_symbol["icon-translate"]),"icon-translate-anchor":new Un(Tt.paint_symbol["icon-translate-anchor"]),"text-opacity":new jn(Tt.paint_symbol["text-opacity"]),"text-color":new jn(Tt.paint_symbol["text-color"],{runtimeType:Ft,getOverride:function(t){return t.textColor},hasOverride:function(t){return!!t.textColor}}),"text-halo-color":new jn(Tt.paint_symbol["text-halo-color"]),"text-halo-width":new jn(Tt.paint_symbol["text-halo-width"]),"text-halo-blur":new jn(Tt.paint_symbol["text-halo-blur"]),"text-translate":new Un(Tt.paint_symbol["text-translate"]),"text-translate-anchor":new Un(Tt.paint_symbol["text-translate-anchor"])}),layout:Is},Os=function(t){this.type=t.property.overrides?t.property.overrides.runtimeType:It,this.defaultValue=t};Os.prototype.evaluate=function(t){if(t.formattedSection){var e=this.defaultValue.property.overrides;if(e&&e.hasOverride(t.formattedSection))return e.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default},Os.prototype.eachChild=function(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)},Os.prototype.possibleOutputs=function(){return[void 0]},Os.prototype.serialize=function(){return null},dn("FormatSectionOverride",Os,{omit:["defaultValue"]});var Rs=function(t){function e(e){t.call(this,e,Ds)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.recalculate=function(e){if(t.prototype.recalculate.call(this,e),"auto"===this.layout.get("icon-rotation-alignment")&&("point"!==this.layout.get("symbol-placement")?this.layout._values["icon-rotation-alignment"]="map":this.layout._values["icon-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-rotation-alignment")&&("point"!==this.layout.get("symbol-placement")?this.layout._values["text-rotation-alignment"]="map":this.layout._values["text-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),"point"===this.layout.get("symbol-placement")){var r=this.layout.get("text-writing-mode");if(r){for(var n=[],i=0,a=r;i<a.length;i+=1){var o=a[i];n.indexOf(o)<0&&n.push(o)}this.layout._values["text-writing-mode"]=n}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()},e.prototype.getValueAndResolveTokens=function(t,e){var r=this.layout.get(t).evaluate(e,{}),n=this._unevaluatedLayout._values[t];return n.isDataDriven()||wr(n.value)?r:function(t,e){return r.replace(/{([^{}]+)}/g,function(e,r){return r in t?String(t[r]):""})}(e.properties)},e.prototype.createBucket=function(t){return new Ps(t)},e.prototype.queryRadius=function(){return 0},e.prototype.queryIntersectsFeature=function(){return!1},e.prototype._setPaintOverrides=function(){for(var t=0,r=Ds.paint.overridableProperties;t<r.length;t+=1){var n=r[t];if(e.hasPaintOverride(this.layout,n)){var i,a=this.paint.get(n),o=new Os(a),s=new br(o,a.property.specification);i="constant"===a.value.kind||"source"===a.value.kind?new Tr("source",s):new Ar("composite",s,a.value.zoomStops,a.value._interpolationType),this.paint._values[n]=new Bn(a.property,i,a.parameters)}}},e.prototype._handleOverridablePaintPropertyUpdate=function(t,r,n){return!(!this.layout||r.isDataDriven()||n.isDataDriven())&&e.hasPaintOverride(this.layout,t)},e.hasPaintOverride=function(t,e){var r=t.get("text-field"),n=Ds.paint.properties[e],i=!1,a=function(t){for(var e=0,r=t;e<r.length;e+=1){var a=r[e];if(n.overrides&&n.overrides.hasOverride(a))return void(i=!0)}};if("constant"===r.value.kind&&r.value.value instanceof Kt)a(r.value.value.sections);else if("source"===r.value.kind){var o=function(t){if(!i)if(t instanceof te&&$t(t.value)===jt){var e=t.value;a(e.sections)}else t instanceof ie?a(t.sections):t.eachChild(o)},s=r.value;s._styleExpression&&o(s._styleExpression.expression)}return i},e.hasPaintOverrides=function(t){for(var r=0,n=Ds.paint.overridableProperties;r<n.length;r+=1){var i=n[r];if(e.hasPaintOverride(t,i))return!0}return!1},e}(Zn),Fs={paint:new Hn({"background-color":new Un(Tt.paint_background["background-color"]),"background-pattern":new qn(Tt.paint_background["background-pattern"]),"background-opacity":new Un(Tt.paint_background["background-opacity"])})},Bs=function(t){function e(e){t.call(this,e,Fs)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Zn),Ns={paint:new Hn({"raster-opacity":new Un(Tt.paint_raster["raster-opacity"]),"raster-hue-rotate":new Un(Tt.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Un(Tt.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Un(Tt.paint_raster["raster-brightness-max"]),"raster-saturation":new Un(Tt.paint_raster["raster-saturation"]),"raster-contrast":new Un(Tt.paint_raster["raster-contrast"]),"raster-resampling":new Un(Tt.paint_raster["raster-resampling"]),"raster-fade-duration":new Un(Tt.paint_raster["raster-fade-duration"])})},Us=function(t){function e(e){t.call(this,e,Ns)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Zn),js=function(t){function e(e){t.call(this,e,{}),this.implementation=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.is3D=function(){return"3d"===this.implementation.renderingMode},e.prototype.hasOffscreenPass=function(){return void 0!==this.implementation.prerender},e.prototype.recalculate=function(){},e.prototype.updateTransitions=function(){},e.prototype.hasTransition=function(){},e.prototype.serialize=function(){},e.prototype.onAdd=function(t){this.implementation.onAdd&&this.implementation.onAdd(t,t.painter.context.gl)},e.prototype.onRemove=function(t){this.implementation.onRemove&&this.implementation.onRemove(t,t.painter.context.gl)},e}(Zn),Vs={circle:Aa,heatmap:Oa,hillshade:Fa,fill:To,"fill-extrusion":Vo,line:Qo,symbol:Rs,background:Bs,raster:Us};function qs(t){for(var e=0,r=0,n=0,i=t;n<i.length;n+=1){var a=i[n];e+=a.w*a.h,r=Math.max(r,a.w)}t.sort(function(t,e){return e.h-t.h});for(var o=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),r),h:1/0}],s=0,l=0,u=0,c=t;u<c.length;u+=1)for(var p=c[u],h=o.length-1;h>=0;h--){var f=o[h];if(!(p.w>f.w||p.h>f.h)){if(p.x=f.x,p.y=f.y,l=Math.max(l,p.y+p.h),s=Math.max(s,p.x+p.w),p.w===f.w&&p.h===f.h){var d=o.pop();h<o.length&&(o[h]=d)}else p.h===f.h?(f.x+=p.w,f.w-=p.w):p.w===f.w?(f.y+=p.h,f.h-=p.h):(o.push({x:f.x+p.w,y:f.y,w:f.w-p.w,h:p.h}),f.y+=p.h,f.h-=p.h);break}}return{w:s,h:l,fill:e/(s*l)||0}}var Gs=function(t,e){var r=e.pixelRatio,n=e.version;this.paddedRect=t,this.pixelRatio=r,this.version=n},Hs={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};Hs.tl.get=function(){return[this.paddedRect.x+1,this.paddedRect.y+1]},Hs.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},Hs.tlbr.get=function(){return this.tl.concat(this.br)},Hs.displaySize.get=function(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(Gs.prototype,Hs);var Zs=function(t,e){var r={},n={};this.haveRenderCallbacks=[];var i=[];this.addImages(t,r,i),this.addImages(e,n,i);var a=qs(i),o=a.w,s=a.h,l=new Pa({width:o||1,height:s||1});for(var u in t){var c=t[u],p=r[u].paddedRect;Pa.copy(c.data,l,{x:0,y:0},{x:p.x+1,y:p.y+1},c.data)}for(var h in e){var f=e[h],d=n[h].paddedRect,m=d.x+1,y=d.y+1,g=f.data.width,v=f.data.height;Pa.copy(f.data,l,{x:0,y:0},{x:m,y:y},f.data),Pa.copy(f.data,l,{x:0,y:v-1},{x:m,y:y-1},{width:g,height:1}),Pa.copy(f.data,l,{x:0,y:0},{x:m,y:y+v},{width:g,height:1}),Pa.copy(f.data,l,{x:g-1,y:0},{x:m-1,y:y},{width:1,height:v}),Pa.copy(f.data,l,{x:0,y:0},{x:m+g,y:y},{width:1,height:v})}this.image=l,this.iconPositions=r,this.patternPositions=n};Zs.prototype.addImages=function(t,e,r){for(var n in t){var i=t[n],a={x:0,y:0,w:i.data.width+2,h:i.data.height+2};r.push(a),e[n]=new Gs(a,i),i.hasRenderCallback&&this.haveRenderCallbacks.push(n)}},Zs.prototype.patchUpdatedImages=function(t,e){for(var r in t.dispatchRenderCallbacks(this.haveRenderCallbacks),t.updatedImages)this.patchUpdatedImage(this.iconPositions[r],t.getImage(r),e),this.patchUpdatedImage(this.patternPositions[r],t.getImage(r),e)},Zs.prototype.patchUpdatedImage=function(t,e,r){if(t&&e&&t.version!==e.version){t.version=e.version;var n=t.tl,i=n[0],a=n[1];r.update(e.data,void 0,{x:i,y:a})}},dn("ImagePosition",Gs),dn("ImageAtlas",Zs);var Xs=self.HTMLImageElement,Ws=self.HTMLCanvasElement,Ys=self.HTMLVideoElement,Ks=self.ImageData,Js=function(t,e,r,n){this.context=t,this.format=r,this.texture=t.gl.createTexture(),this.update(e,n)};Js.prototype.update=function(t,e,r){var n=t.width,i=t.height,a=!(this.size&&this.size[0]===n&&this.size[1]===i||r),o=this.context,s=o.gl;if(this.useMipmap=Boolean(e&&e.useMipmap),s.bindTexture(s.TEXTURE_2D,this.texture),o.pixelStoreUnpackFlipY.set(!1),o.pixelStoreUnpack.set(1),o.pixelStoreUnpackPremultiplyAlpha.set(this.format===s.RGBA&&(!e||!1!==e.premultiply)),a)this.size=[n,i],t instanceof Xs||t instanceof Ws||t instanceof Ys||t instanceof Ks?s.texImage2D(s.TEXTURE_2D,0,this.format,this.format,s.UNSIGNED_BYTE,t):s.texImage2D(s.TEXTURE_2D,0,this.format,n,i,0,this.format,s.UNSIGNED_BYTE,t.data);else{var l=r||{x:0,y:0},u=l.x,c=l.y;t instanceof Xs||t instanceof Ws||t instanceof Ys||t instanceof Ks?s.texSubImage2D(s.TEXTURE_2D,0,u,c,s.RGBA,s.UNSIGNED_BYTE,t):s.texSubImage2D(s.TEXTURE_2D,0,u,c,n,i,s.RGBA,s.UNSIGNED_BYTE,t.data)}this.useMipmap&&this.isSizePowerOfTwo()&&s.generateMipmap(s.TEXTURE_2D)},Js.prototype.bind=function(t,e,r){var n=this.context.gl;n.bindTexture(n.TEXTURE_2D,this.texture),r!==n.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(r=n.LINEAR),t!==this.filter&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,t),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,r||t),this.filter=t),e!==this.wrap&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,e),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,e),this.wrap=e)},Js.prototype.isSizePowerOfTwo=function(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0},Js.prototype.destroy=function(){this.context.gl.deleteTexture(this.texture),this.texture=null};var $s=function(t,e,r,n,i){var a,o,s=8*i-n-1,l=(1<<s)-1,u=l>>1,c=-7,p=r?i-1:0,h=r?-1:1,f=t[e+p];for(p+=h,a=f&(1<<-c)-1,f>>=-c,c+=s;c>0;a=256*a+t[e+p],p+=h,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=n;c>0;o=256*o+t[e+p],p+=h,c-=8);if(0===a)a=1-u;else{if(a===l)return o?NaN:1/0*(f?-1:1);o+=Math.pow(2,n),a-=u}return(f?-1:1)*o*Math.pow(2,a-n)},Qs=function(t,e,r,n,i,a){var o,s,l,u=8*a-i-1,c=(1<<u)-1,p=c>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:a-1,d=n?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=c):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),(e+=o+p>=1?h/l:h*Math.pow(2,1-p))*l>=2&&(o++,l/=2),o+p>=c?(s=0,o=c):o+p>=1?(s=(e*l-1)*Math.pow(2,i),o+=p):(s=e*Math.pow(2,p-1)*Math.pow(2,i),o=0));i>=8;t[r+f]=255&s,f+=d,s/=256,i-=8);for(o=o<<i|s,u+=i;u>0;t[r+f]=255&o,f+=d,o/=256,u-=8);t[r+f-d]|=128*m},tl=el;function el(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}function rl(t){return t.type===el.Bytes?t.readVarint()+t.pos:t.pos+1}function nl(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function il(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=t;i--)r.buf[i+n]=r.buf[i]}function al(t,e){for(var r=0;r<t.length;r++)e.writeVarint(t[r])}function ol(t,e){for(var r=0;r<t.length;r++)e.writeSVarint(t[r])}function sl(t,e){for(var r=0;r<t.length;r++)e.writeFloat(t[r])}function ll(t,e){for(var r=0;r<t.length;r++)e.writeDouble(t[r])}function ul(t,e){for(var r=0;r<t.length;r++)e.writeBoolean(t[r])}function cl(t,e){for(var r=0;r<t.length;r++)e.writeFixed32(t[r])}function pl(t,e){for(var r=0;r<t.length;r++)e.writeSFixed32(t[r])}function hl(t,e){for(var r=0;r<t.length;r++)e.writeFixed64(t[r])}function fl(t,e){for(var r=0;r<t.length;r++)e.writeSFixed64(t[r])}function dl(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function ml(t,e,r){t[r]=e,t[r+1]=e>>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function yl(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}el.Varint=0,el.Fixed64=1,el.Bytes=2,el.Fixed32=5,el.prototype={destroy:function(){this.buf=null},readFields:function(t,e,r){for(r=r||this.length;this.pos<r;){var n=this.readVarint(),i=n>>3,a=this.pos;this.type=7&n,t(i,e,this),this.pos===a&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=dl(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=yl(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=dl(this.buf,this.pos)+4294967296*dl(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=dl(this.buf,this.pos)+4294967296*yl(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=$s(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=$s(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,r,n=this.buf;return e=127&(r=n[this.pos++]),r<128?e:(e|=(127&(r=n[this.pos++]))<<7,r<128?e:(e|=(127&(r=n[this.pos++]))<<14,r<128?e:(e|=(127&(r=n[this.pos++]))<<21,r<128?e:function(t,e,r){var n,i,a=r.buf;if(n=(112&(i=a[r.pos++]))>>4,i<128)return nl(t,n,e);if(n|=(127&(i=a[r.pos++]))<<3,i<128)return nl(t,n,e);if(n|=(127&(i=a[r.pos++]))<<10,i<128)return nl(t,n,e);if(n|=(127&(i=a[r.pos++]))<<17,i<128)return nl(t,n,e);if(n|=(127&(i=a[r.pos++]))<<24,i<128)return nl(t,n,e);if(n|=(1&(i=a[r.pos++]))<<31,i<128)return nl(t,n,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(r=n[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=function(t,e,r){for(var n="",i=e;i<r;){var a,o,s,l=t[i],u=null,c=l>239?4:l>223?3:l>191?2:1;if(i+c>r)break;1===c?l<128&&(u=l):2===c?128==(192&(a=t[i+1]))&&(u=(31&l)<<6|63&a)<=127&&(u=null):3===c?(a=t[i+1],o=t[i+2],128==(192&a)&&128==(192&o)&&((u=(15&l)<<12|(63&a)<<6|63&o)<=2047||u>=55296&&u<=57343)&&(u=null)):4===c&&(a=t[i+1],o=t[i+2],s=t[i+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&((u=(15&l)<<18|(63&a)<<12|(63&o)<<6|63&s)<=65535||u>=1114112)&&(u=null)),null===u?(u=65533,c=1):u>65535&&(u-=65536,n+=String.fromCharCode(u>>>10&1023|55296),u=56320|1023&u),n+=String.fromCharCode(u),i+=c}return n}(this.buf,this.pos,t);return this.pos=t,e},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==el.Bytes)return t.push(this.readVarint(e));var r=rl(this);for(t=t||[];this.pos<r;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==el.Bytes)return t.push(this.readSVarint());var e=rl(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==el.Bytes)return t.push(this.readBoolean());var e=rl(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==el.Bytes)return t.push(this.readFloat());var e=rl(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==el.Bytes)return t.push(this.readDouble());var e=rl(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==el.Bytes)return t.push(this.readFixed32());var e=rl(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==el.Bytes)return t.push(this.readSFixed32());var e=rl(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==el.Bytes)return t.push(this.readFixed64());var e=rl(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==el.Bytes)return t.push(this.readSFixed64());var e=rl(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===el.Varint)for(;this.buf[this.pos++]>127;);else if(e===el.Bytes)this.pos=this.readVarint()+this.pos;else if(e===el.Fixed32)this.pos+=4;else{if(e!==el.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var r=new Uint8Array(e);r.set(this.buf),this.buf=r,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),ml(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),ml(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),ml(this.buf,-1&t,this.pos),ml(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),ml(this.buf,-1&t,this.pos),ml(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var r,n;if(t>=0?(r=t%4294967296|0,n=t/4294967296|0):(n=~(-t/4294967296),4294967295^(r=~(-t%4294967296))?r=r+1|0:(r=0,n=n+1|0)),t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,r){r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos]=127&t}(r,0,e),function(t,e){var r=(7&t)<<4;e.buf[e.pos++]|=r|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t)))))}(n,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,r){for(var n,i,a=0;a<e.length;a++){if((n=e.charCodeAt(a))>55295&&n<57344){if(!i){n>56319||a+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):i=n;continue}if(n<56320){t[r++]=239,t[r++]=191,t[r++]=189,i=n;continue}n=i-55296<<10|n-56320|65536,i=null}else i&&(t[r++]=239,t[r++]=191,t[r++]=189,i=null);n<128?t[r++]=n:(n<2048?t[r++]=n>>6|192:(n<65536?t[r++]=n>>12|224:(t[r++]=n>>18|240,t[r++]=n>>12&63|128),t[r++]=n>>6&63|128),t[r++]=63&n|128)}return r}(this.buf,t,this.pos);var r=this.pos-e;r>=128&&il(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),Qs(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),Qs(this.buf,t,this.pos,!0,52,8),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&&il(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,el.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,al,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,ol,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,ul,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,sl,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,ll,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,cl,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,pl,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,hl,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,fl,e)},writeBytesField:function(t,e){this.writeTag(t,el.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,el.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,el.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,el.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,el.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,el.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,el.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,el.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,el.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,el.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var gl=3;function vl(t,e,r){1===t&&r.readMessage(_l,e)}function _l(t,e,r){if(3===t){var n=r.readMessage(xl,{}),i=n.id,a=n.bitmap,o=n.width,s=n.height,l=n.left,u=n.top,c=n.advance;e.push({id:i,bitmap:new za({width:o+2*gl,height:s+2*gl},a),metrics:{width:o,height:s,left:l,top:u,advance:c}})}}function xl(t,e,r){1===t?e.id=r.readVarint():2===t?e.bitmap=r.readBytes():3===t?e.width=r.readVarint():4===t?e.height=r.readVarint():5===t?e.left=r.readSVarint():6===t?e.top=r.readSVarint():7===t&&(e.advance=r.readVarint())}var bl=gl,wl=function(t){var e=this;this._callback=t,this._triggered=!1,"undefined"!=typeof MessageChannel&&(this._channel=new MessageChannel,this._channel.port2.onmessage=function(){e._triggered=!1,e._callback()})};wl.prototype.trigger=function(){var t=this;this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(function(){t._triggered=!1,t._callback()},0))};var kl=function(t,e,r){this.target=t,this.parent=e,this.mapId=r,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},y(["receive","process"],this),this.invoker=new wl(this.process),this.target.addEventListener("message",this.receive,!1)};function Tl(t,e,r){var n=2*Math.PI*6378137/256/Math.pow(2,r);return[t*n-2*Math.PI*6378137/2,e*n-2*Math.PI*6378137/2]}kl.prototype.send=function(t,e,r,n){var i=this,a=Math.round(1e18*Math.random()).toString(36).substring(0,10);r&&(this.callbacks[a]=r);var o=[];return this.target.postMessage({id:a,type:t,hasCallback:!!r,targetMapId:n,sourceMapId:this.mapId,data:yn(e,o)},o),{cancel:function(){r&&delete i.callbacks[a],i.target.postMessage({id:a,type:"<cancel>",targetMapId:n,sourceMapId:i.mapId})}}},kl.prototype.receive=function(t){var e=t.data,r=e.id;if(r&&(!e.targetMapId||this.mapId===e.targetMapId))if("<cancel>"===e.type){delete this.tasks[r];var n=this.cancelCallbacks[r];delete this.cancelCallbacks[r],n&&n()}else this.tasks[r]=e,this.taskQueue.push(r),this.invoker.trigger()},kl.prototype.process=function(){var t=this;if(this.taskQueue.length){var e=this.taskQueue.shift(),r=this.tasks[e];if(delete this.tasks[e],this.taskQueue.length&&this.invoker.trigger(),r)if("<response>"===r.type){var n=this.callbacks[e];delete this.callbacks[e],n&&(r.error?n(gn(r.error)):n(null,gn(r.data)))}else{var i=!1,a=r.hasCallback?function(r,n){i=!0,delete t.cancelCallbacks[e];var a=[];t.target.postMessage({id:e,type:"<response>",sourceMapId:t.mapId,error:r?yn(r):null,data:yn(n,a)},a)}:function(t){i=!0},o=null,s=gn(r.data);if(this.parent[r.type])o=this.parent[r.type](r.sourceMapId,s,a);else if(this.parent.getWorkerSource){var l=r.type.split(".");o=this.parent.getWorkerSource(r.sourceMapId,l[0],s.source)[l[1]](s,a)}else a(new Error("Could not find function "+r.type));!i&&o&&o.cancel&&(this.cancelCallbacks[e]=o.cancel)}}},kl.prototype.remove=function(){this.target.removeEventListener("message",this.receive,!1)};var Al=function(t,e){t&&(e?this.setSouthWest(t).setNorthEast(e):4===t.length?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1]))};Al.prototype.setNorthEast=function(t){return this._ne=t instanceof Ml?new Ml(t.lng,t.lat):Ml.convert(t),this},Al.prototype.setSouthWest=function(t){return this._sw=t instanceof Ml?new Ml(t.lng,t.lat):Ml.convert(t),this},Al.prototype.extend=function(t){var e,r,n=this._sw,i=this._ne;if(t instanceof Ml)e=t,r=t;else{if(!(t instanceof Al))return Array.isArray(t)?t.every(Array.isArray)?this.extend(Al.convert(t)):this.extend(Ml.convert(t)):this;if(e=t._sw,r=t._ne,!e||!r)return this}return n||i?(n.lng=Math.min(e.lng,n.lng),n.lat=Math.min(e.lat,n.lat),i.lng=Math.max(r.lng,i.lng),i.lat=Math.max(r.lat,i.lat)):(this._sw=new Ml(e.lng,e.lat),this._ne=new Ml(r.lng,r.lat)),this},Al.prototype.getCenter=function(){return new Ml((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},Al.prototype.getSouthWest=function(){return this._sw},Al.prototype.getNorthEast=function(){return this._ne},Al.prototype.getNorthWest=function(){return new Ml(this.getWest(),this.getNorth())},Al.prototype.getSouthEast=function(){return new Ml(this.getEast(),this.getSouth())},Al.prototype.getWest=function(){return this._sw.lng},Al.prototype.getSouth=function(){return this._sw.lat},Al.prototype.getEast=function(){return this._ne.lng},Al.prototype.getNorth=function(){return this._ne.lat},Al.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},Al.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},Al.prototype.isEmpty=function(){return!(this._sw&&this._ne)},Al.convert=function(t){return!t||t instanceof Al?t:new Al(t)};var Ml=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid LngLat object: ("+t+", "+e+")");if(this.lng=+t,this.lat=+e,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};Ml.prototype.wrap=function(){return new Ml(c(this.lng,-180,180),this.lat)},Ml.prototype.toArray=function(){return[this.lng,this.lat]},Ml.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},Ml.prototype.toBounds=function(t){void 0===t&&(t=0);var e=360*t/40075017,r=e/Math.cos(Math.PI/180*this.lat);return new Al(new Ml(this.lng-r,this.lat-e),new Ml(this.lng+r,this.lat+e))},Ml.convert=function(t){if(t instanceof Ml)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new Ml(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new Ml(Number("lng"in t?t.lng:t.lon),Number(t.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")};var Sl=2*Math.PI*6378137;function Ll(t){return Sl*Math.cos(t*Math.PI/180)}function Cl(t){return(180+t)/360}function El(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function zl(t,e){return t/Ll(e)}function Pl(t){var e=180-360*t;return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90}var Il=function(t,e,r){void 0===r&&(r=0),this.x=+t,this.y=+e,this.z=+r};Il.fromLngLat=function(t,e){void 0===e&&(e=0);var r=Ml.convert(t);return new Il(Cl(r.lng),El(r.lat),zl(e,r.lat))},Il.prototype.toLngLat=function(){return new Ml(360*this.x-180,Pl(this.y))},Il.prototype.toAltitude=function(){return this.z*Ll(Pl(this.y))},Il.prototype.meterInMercatorCoordinateUnits=function(){return 1/Sl*(t=Pl(this.y),1/Math.cos(t*Math.PI/180));var t};var Dl=function(t,e,r){this.z=t,this.x=e,this.y=r,this.key=Fl(0,t,e,r)};Dl.prototype.equals=function(t){return this.z===t.z&&this.x===t.x&&this.y===t.y},Dl.prototype.url=function(t,e){var r,n,i,a,o,s=(r=this.x,n=this.y,i=this.z,a=Tl(256*r,256*(n=Math.pow(2,i)-n-1),i),o=Tl(256*(r+1),256*(n+1),i),a[0]+","+a[1]+","+o[0]+","+o[1]),l=function(t,e,r){for(var n,i="",a=t;a>0;a--)i+=(e&(n=1<<a-1)?1:0)+(r&n?2:0);return i}(this.z,this.x,this.y);return t[(this.x+this.y)%t.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace("{z}",String(this.z)).replace("{x}",String(this.x)).replace("{y}",String("tms"===e?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",l).replace("{bbox-epsg-3857}",s)},Dl.prototype.getTilePoint=function(t){var e=Math.pow(2,this.z);return new i((t.x*e-this.x)*ea,(t.y*e-this.y)*ea)};var Ol=function(t,e){this.wrap=t,this.canonical=e,this.key=Fl(t,e.z,e.x,e.y)},Rl=function(t,e,r,n,i){this.overscaledZ=t,this.wrap=e,this.canonical=new Dl(r,+n,+i),this.key=Fl(e,t,n,i)};function Fl(t,e,r,n){(t*=2)<0&&(t=-1*t-1);var i=1<<e;return 32*(i*i*t+i*n+r)+e}Rl.prototype.equals=function(t){return this.overscaledZ===t.overscaledZ&&this.wrap===t.wrap&&this.canonical.equals(t.canonical)},Rl.prototype.scaledTo=function(t){var e=this.canonical.z-t;return t>this.canonical.z?new Rl(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Rl(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)},Rl.prototype.isChildOf=function(t){if(t.wrap!==this.wrap)return!1;var e=this.canonical.z-t.canonical.z;return 0===t.overscaledZ||t.overscaledZ<this.overscaledZ&&t.canonical.x===this.canonical.x>>e&&t.canonical.y===this.canonical.y>>e},Rl.prototype.children=function(t){if(this.overscaledZ>=t)return[new Rl(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var e=this.canonical.z+1,r=2*this.canonical.x,n=2*this.canonical.y;return[new Rl(e,this.wrap,e,r,n),new Rl(e,this.wrap,e,r+1,n),new Rl(e,this.wrap,e,r,n+1),new Rl(e,this.wrap,e,r+1,n+1)]},Rl.prototype.isLessThan=function(t){return this.wrap<t.wrap||!(this.wrap>t.wrap)&&(this.overscaledZ<t.overscaledZ||!(this.overscaledZ>t.overscaledZ)&&(this.canonical.x<t.canonical.x||!(this.canonical.x>t.canonical.x)&&this.canonical.y<t.canonical.y))},Rl.prototype.wrapped=function(){return new Rl(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)},Rl.prototype.unwrapTo=function(t){return new Rl(this.overscaledZ,t,this.canonical.z,this.canonical.x,this.canonical.y)},Rl.prototype.overscaleFactor=function(){return Math.pow(2,this.overscaledZ-this.canonical.z)},Rl.prototype.toUnwrapped=function(){return new Ol(this.wrap,this.canonical)},Rl.prototype.toString=function(){return this.overscaledZ+"/"+this.canonical.x+"/"+this.canonical.y},Rl.prototype.getTilePoint=function(t){return this.canonical.getTilePoint(new Il(t.x-this.wrap,t.y))},dn("CanonicalTileID",Dl),dn("OverscaledTileID",Rl,{omit:["posMatrix"]});var Bl=function(t,e,r){if(this.uid=t,e.height!==e.width)throw new RangeError("DEM tiles must be square");if(r&&"mapbox"!==r&&"terrarium"!==r)return w('"'+r+'" is not a valid encoding type. Valid types include "mapbox" and "terrarium".');var n=this.dim=e.height;this.stride=this.dim+2,this.data=new Int32Array(this.stride*this.stride);for(var i=e.data,a="terrarium"===r?this._unpackTerrarium:this._unpackMapbox,o=0;o<n;o++)for(var s=0;s<n;s++){var l=4*(o*n+s);this.set(s,o,a(i[l],i[l+1],i[l+2]))}for(var u=0;u<n;u++)this.set(-1,u,this.get(0,u)),this.set(n,u,this.get(n-1,u)),this.set(u,-1,this.get(u,0)),this.set(u,n,this.get(u,n-1));this.set(-1,-1,this.get(0,0)),this.set(n,-1,this.get(n-1,0)),this.set(-1,n,this.get(0,n-1)),this.set(n,n,this.get(n-1,n-1))};Bl.prototype.set=function(t,e,r){this.data[this._idx(t,e)]=r+65536},Bl.prototype.get=function(t,e){return this.data[this._idx(t,e)]-65536},Bl.prototype._idx=function(t,e){if(t<-1||t>=this.dim+1||e<-1||e>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(e+1)*this.stride+(t+1)},Bl.prototype._unpackMapbox=function(t,e,r){return(256*t*256+256*e+r)/10-1e4},Bl.prototype._unpackTerrarium=function(t,e,r){return 256*t+e+r/256-32768},Bl.prototype.getPixels=function(){return new Pa({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},Bl.prototype.backfillBorder=function(t,e,r){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");var n=e*this.dim,i=e*this.dim+this.dim,a=r*this.dim,o=r*this.dim+this.dim;switch(e){case-1:n=i-1;break;case 1:i=n+1}switch(r){case-1:a=o-1;break;case 1:o=a+1}for(var s=-e*this.dim,l=-r*this.dim,u=a;u<o;u++)for(var c=n;c<i;c++)this.set(c,u,t.get(c+s,u+l))},dn("DEMData",Bl);var Nl=Kn([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),Ul=function(t){this._stringToNumber={},this._numberToString=[];for(var e=0;e<t.length;e++){var r=t[e];this._stringToNumber[r]=e,this._numberToString[e]=r}};Ul.prototype.encode=function(t){return this._stringToNumber[t]},Ul.prototype.decode=function(t){return this._numberToString[t]};var jl=function(t,e,r,n){this.type="Feature",this._vectorTileFeature=t,t._z=e,t._x=r,t._y=n,this.properties=t.properties,null!=t.id&&(this.id=t.id)},Vl={geometry:{configurable:!0}};Vl.geometry.get=function(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry},Vl.geometry.set=function(t){this._geometry=t},jl.prototype.toJSON=function(){var t={geometry:this.geometry};for(var e in this)"_geometry"!==e&&"_vectorTileFeature"!==e&&(t[e]=this[e]);return t},Object.defineProperties(jl.prototype,Vl);var ql=function(){this.state={},this.stateChanges={},this.deletedStates={}};ql.prototype.updateState=function(t,e,r){var n=String(e);if(this.stateChanges[t]=this.stateChanges[t]||{},this.stateChanges[t][n]=this.stateChanges[t][n]||{},p(this.stateChanges[t][n],r),null===this.deletedStates[t])for(var i in this.deletedStates[t]={},this.state[t])i!==n&&(this.deletedStates[t][i]=null);else if(this.deletedStates[t]&&null===this.deletedStates[t][n])for(var a in this.deletedStates[t][n]={},this.state[t][n])r[a]||(this.deletedStates[t][n][a]=null);else for(var o in r)this.deletedStates[t]&&this.deletedStates[t][n]&&null===this.deletedStates[t][n][o]&&delete this.deletedStates[t][n][o]},ql.prototype.removeFeatureState=function(t,e,r){if(null!==this.deletedStates[t]){var n=String(e);if(this.deletedStates[t]=this.deletedStates[t]||{},r&&void 0!==e&&e>=0)null!==this.deletedStates[t][n]&&(this.deletedStates[t][n]=this.deletedStates[t][n]||{},this.deletedStates[t][n][r]=null);else if(void 0!==e&&e>=0)if(this.stateChanges[t]&&this.stateChanges[t][n])for(r in this.deletedStates[t][n]={},this.stateChanges[t][n])this.deletedStates[t][n][r]=null;else this.deletedStates[t][n]=null;else this.deletedStates[t]=null}},ql.prototype.getState=function(t,e){var r=String(e),n=this.state[t]||{},i=this.stateChanges[t]||{},a=p({},n[r],i[r]);if(null===this.deletedStates[t])return{};if(this.deletedStates[t]){var o=this.deletedStates[t][e];if(null===o)return{};for(var s in o)delete a[s]}return a},ql.prototype.initializeTileState=function(t,e){t.setFeatureState(this.state,e)},ql.prototype.coalesceChanges=function(t,e){var r={};for(var n in this.stateChanges){this.state[n]=this.state[n]||{};var i={};for(var a in this.stateChanges[n])this.state[n][a]||(this.state[n][a]={}),p(this.state[n][a],this.stateChanges[n][a]),i[a]=this.state[n][a];r[n]=i}for(var o in this.deletedStates){this.state[o]=this.state[o]||{};var s={};if(null===this.deletedStates[o])for(var l in this.state[o])s[l]={},this.state[o][l]={};else for(var u in this.deletedStates[o]){if(null===this.deletedStates[o][u])this.state[o][u]={};else for(var c=0,h=Object.keys(this.deletedStates[o][u]);c<h.length;c+=1){var f=h[c];delete this.state[o][u][f]}s[u]=this.state[o][u]}r[o]=r[o]||{},p(r[o],s)}if(this.stateChanges={},this.deletedStates={},0!==Object.keys(r).length)for(var d in t)t[d].setFeatureState(r,e)};var Gl=function(t,e,r){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=e||new un(ea,16,0),this.grid3D=new un(ea,16,0),this.featureIndexArray=r||new Ei};function Hl(t){for(var e=1/0,r=1/0,n=-1/0,i=-1/0,a=0,o=t;a<o.length;a+=1){var s=o[a];e=Math.min(e,s.x),r=Math.min(r,s.y),n=Math.max(n,s.x),i=Math.max(i,s.y)}return{minX:e,minY:r,maxX:n,maxY:i}}function Zl(t,e){return e-t}Gl.prototype.insert=function(t,e,r,n,i,a){var o=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,n,i);for(var s=a?this.grid3D:this.grid,l=0;l<e.length;l++){for(var u=e[l],c=[1/0,1/0,-1/0,-1/0],p=0;p<u.length;p++){var h=u[p];c[0]=Math.min(c[0],h.x),c[1]=Math.min(c[1],h.y),c[2]=Math.max(c[2],h.x),c[3]=Math.max(c[3],h.y)}c[0]<ea&&c[1]<ea&&c[2]>=0&&c[3]>=0&&s.insert(o,c[0],c[1],c[2],c[3])}},Gl.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new Do.VectorTile(new tl(this.rawTileData)).layers,this.sourceLayerCoder=new Ul(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},Gl.prototype.query=function(t,e,r){var n=this;this.loadVTLayers();for(var a=t.params||{},o=ea/t.tileSize/t.scale,s=Rr(a.filter),l=t.queryGeometry,u=t.queryPadding*o,c=Hl(l),p=this.grid.query(c.minX-u,c.minY-u,c.maxX+u,c.maxY+u),h=Hl(t.cameraQueryGeometry),f=0,d=this.grid3D.query(h.minX-u,h.minY-u,h.maxX+u,h.maxY+u,function(e,r,n,a){return function(t,e,r,n,a){for(var o=0,s=t;o<s.length;o+=1){var l=s[o];if(e<=l.x&&r<=l.y&&n>=l.x&&a>=l.y)return!0}var u=[new i(e,r),new i(e,a),new i(n,a),new i(n,r)];if(t.length>2)for(var c=0,p=u;c<p.length;c+=1)if(ma(t,p[c]))return!0;for(var h=0;h<t.length-1;h++)if(ya(t[h],t[h+1],u))return!0;return!1}(t.cameraQueryGeometry,e-u,r-u,n+u,a+u)});f<d.length;f+=1){var m=d[f];p.push(m)}p.sort(Zl);for(var y,g={},v=function(i){var u=p[i];if(u!==y){y=u;var c=n.featureIndexArray.get(u),h=null;n.loadMatchingFeature(g,c.bucketIndex,c.sourceLayerIndex,c.featureIndex,s,a.layers,e,function(e,i){h||(h=na(e));var a={};return e.id&&(a=r.getState(i.sourceLayer||"_geojsonTileLayer",e.id)),i.queryIntersectsFeature(l,e,a,h,n.z,t.transform,o,t.pixelPosMatrix)})}},_=0;_<p.length;_++)v(_);return g},Gl.prototype.loadMatchingFeature=function(t,e,r,n,i,a,o,s){var l=this.bucketLayerIDs[e];if(!a||function(t,e){for(var r=0;r<t.length;r++)if(e.indexOf(t[r])>=0)return!0;return!1}(a,l)){var u=this.sourceLayerCoder.decode(r),c=this.vtLayers[u].feature(n);if(i(new zn(this.tileID.overscaledZ),c))for(var p=0;p<l.length;p++){var h=l[p];if(!(a&&a.indexOf(h)<0)){var f=o[h];if(f){var d=!s||s(c,f);if(d){var m=new jl(c,this.z,this.x,this.y);m.layer=f.serialize();var y=t[h];void 0===y&&(y=t[h]=[]),y.push({featureIndex:n,feature:m,intersectionZ:d})}}}}}},Gl.prototype.lookupSymbolFeatures=function(t,e,r,n,i,a){var o={};this.loadVTLayers();for(var s=Rr(n),l=0,u=t;l<u.length;l+=1){var c=u[l];this.loadMatchingFeature(o,e,r,c,s,i,a)}return o},Gl.prototype.hasLayer=function(t){for(var e=0,r=this.bucketLayerIDs;e<r.length;e+=1)for(var n=0,i=r[e];n<i.length;n+=1)if(t===i[n])return!0;return!1},dn("FeatureIndex",Gl,{omit:["rawTileData","sourceLayerCoder"]});var Xl=function(t,e){this.tileID=t,this.uid=f(),this.uses=0,this.tileSize=e,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.expiredRequestCount=0,this.state="loading"};function Wl(t,e,r,n,i){if(void 0===e.segment)return!0;for(var a=e,o=e.segment+1,s=0;s>-r/2;){if(--o<0)return!1;s-=t[o].dist(a),a=t[o]}s+=t[o].dist(t[o+1]),o++;for(var l=[],u=0;s<r/2;){var c=t[o-1],p=t[o],h=t[o+1];if(!h)return!1;var f=c.angleTo(p)-p.angleTo(h);for(f=Math.abs((f+3*Math.PI)%(2*Math.PI)-Math.PI),l.push({distance:s,angleDelta:f}),u+=f;s-l[0].distance>n;)u-=l.shift().angleDelta;if(u>i)return!1;o++,s+=p.dist(h)}return!0}function Yl(t){for(var e=0,r=0;r<t.length-1;r++)e+=t[r].dist(t[r+1]);return e}function Kl(t,e,r){return t?.6*e*r:0}function Jl(t,e){return Math.max(t?t.right-t.left:0,e?e.right-e.left:0)}function $l(t,e,r,n,i,a){for(var o=Kl(r,i,a),s=Jl(r,n)*a,l=0,u=Yl(t)/2,c=0;c<t.length-1;c++){var p=t[c],h=t[c+1],f=p.dist(h);if(l+f>u){var d=(u-l)/f,m=ve(p.x,h.x,d),y=ve(p.y,h.y,d),g=new xs(m,y,h.angleTo(p),c);return g._round(),!o||Wl(t,g,s,o,e)?g:void 0}l+=f}}function Ql(t,e,r,n,i,a,o,s,l){var u=Kl(n,a,o),c=Jl(n,i),p=c*o,h=0===t[0].x||t[0].x===l||0===t[0].y||t[0].y===l;return e-p<e/4&&(e=p+e/4),function t(e,r,n,i,a,o,s,l,u){for(var c=o/2,p=Yl(e),h=0,f=r-n,d=[],m=0;m<e.length-1;m++){for(var y=e[m],g=e[m+1],v=y.dist(g),_=g.angleTo(y);f+n<h+v;){var x=((f+=n)-h)/v,b=ve(y.x,g.x,x),w=ve(y.y,g.y,x);if(b>=0&&b<u&&w>=0&&w<u&&f-c>=0&&f+c<=p){var k=new xs(b,w,_,m);k._round(),i&&!Wl(e,k,o,i,a)||d.push(k)}}h+=v}return l||d.length||s||(d=t(e,h/2,n,i,a,o,s,!0,u)),d}(t,h?e/2*s%e:(c/2+2*a)*o*s%e,e,u,r,p,h,!1,l)}Xl.prototype.registerFadeDuration=function(t){var e=t+this.timeAdded;e<D.now()||this.fadeEndTime&&e<this.fadeEndTime||(this.fadeEndTime=e)},Xl.prototype.wasRequested=function(){return"errored"===this.state||"loaded"===this.state||"reloading"===this.state},Xl.prototype.loadVectorData=function(t,e,r){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",t){for(var n in t.featureIndex&&(this.latestFeatureIndex=t.featureIndex,t.rawTileData?(this.latestRawTileData=t.rawTileData,this.latestFeatureIndex.rawTileData=t.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=t.collisionBoxArray,this.buckets=function(t,e){var r={};if(!e)return r;for(var n=function(){var t=a[i],n=t.layerIds.map(function(t){return e.getLayer(t)}).filter(Boolean);if(0!==n.length){t.layers=n,t.stateDependentLayerIds&&(t.stateDependentLayers=t.stateDependentLayerIds.map(function(t){return n.filter(function(e){return e.id===t})[0]}));for(var o=0,s=n;o<s.length;o+=1){var l=s[o];r[l.id]=t}}},i=0,a=t;i<a.length;i+=1)n();return r}(t.buckets,e.style),this.hasSymbolBuckets=!1,this.buckets){var i=this.buckets[n];if(i instanceof Ps){if(this.hasSymbolBuckets=!0,!r)break;i.justReloaded=!0}}for(var a in this.queryPadding=0,this.buckets){var o=this.buckets[a];this.queryPadding=Math.max(this.queryPadding,e.style.getLayer(a).queryRadius(o))}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage)}else this.collisionBoxArray=new xi},Xl.prototype.unloadVectorData=function(){for(var t in this.buckets)this.buckets[t].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"},Xl.prototype.unloadDEMData=function(){this.dem=null,this.neighboringTiles=null,this.state="unloaded"},Xl.prototype.getBucket=function(t){return this.buckets[t.id]},Xl.prototype.upload=function(t){for(var e in this.buckets){var r=this.buckets[e];r.uploadPending()&&r.upload(t)}var n=t.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new Js(t,this.imageAtlas.image,n.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new Js(t,this.glyphAtlasImage,n.ALPHA),this.glyphAtlasImage=null)},Xl.prototype.prepare=function(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture)},Xl.prototype.queryRenderedFeatures=function(t,e,r,n,i,a,o,s,l){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:r,cameraQueryGeometry:n,scale:i,tileSize:this.tileSize,pixelPosMatrix:l,transform:o,params:a,queryPadding:this.queryPadding*s},t,e):{}},Xl.prototype.querySourceFeatures=function(t,e){if(this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData){var r=this.latestFeatureIndex.loadVTLayers(),n=e?e.sourceLayer:"",i=r._geojsonTileLayer||r[n];if(i)for(var a=Rr(e&&e.filter),o=this.tileID.canonical,s=o.z,l=o.x,u=o.y,c={z:s,x:l,y:u},p=0;p<i.length;p++){var h=i.feature(p);if(a(new zn(this.tileID.overscaledZ),h)){var f=new jl(h,s,l,u);f.tile=c,t.push(f)}}}},Xl.prototype.clearMask=function(){this.segments&&(this.segments.destroy(),delete this.segments),this.maskedBoundsBuffer&&(this.maskedBoundsBuffer.destroy(),delete this.maskedBoundsBuffer),this.maskedIndexBuffer&&(this.maskedIndexBuffer.destroy(),delete this.maskedIndexBuffer)},Xl.prototype.setMask=function(t,e){if(!o(this.mask,t)&&(this.mask=t,this.clearMask(),!o(t,{0:!0}))){var r=new Qn,n=new di;this.segments=new Pi,this.segments.prepareSegment(0,r,n);for(var a=Object.keys(t),s=0;s<a.length;s++){var l=t[+a[s]],u=ea>>l.z,c=new i(l.x*u,l.y*u),p=new i(c.x+u,c.y+u),h=this.segments.prepareSegment(4,r,n);r.emplaceBack(c.x,c.y,c.x,c.y),r.emplaceBack(p.x,c.y,p.x,c.y),r.emplaceBack(c.x,p.y,c.x,p.y),r.emplaceBack(p.x,p.y,p.x,p.y);var f=h.vertexLength;n.emplaceBack(f,f+1,f+2),n.emplaceBack(f+1,f+2,f+3),h.vertexLength+=4,h.primitiveLength+=2}this.maskedBoundsBuffer=e.createVertexBuffer(r,Nl.members),this.maskedIndexBuffer=e.createIndexBuffer(n)}},Xl.prototype.hasData=function(){return"loaded"===this.state||"reloading"===this.state||"expired"===this.state},Xl.prototype.patternsLoaded=function(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length},Xl.prototype.setExpiryData=function(t){var e=this.expirationTime;if(t.cacheControl){var r=A(t.cacheControl);r["max-age"]&&(this.expirationTime=Date.now()+1e3*r["max-age"])}else t.expires&&(this.expirationTime=new Date(t.expires).getTime());if(this.expirationTime){var n=Date.now(),i=!1;if(this.expirationTime>n)i=!1;else if(e)if(this.expirationTime<e)i=!0;else{var a=this.expirationTime-e;a?this.expirationTime=n+Math.max(a,3e4):i=!0}else i=!0;i?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}},Xl.prototype.getExpiryTimeout=function(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-(new Date).getTime(),Math.pow(2,31)-1)},Xl.prototype.setFeatureState=function(t,e){if(this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData&&0!==Object.keys(t).length){var r=this.latestFeatureIndex.loadVTLayers();for(var n in this.buckets){var i=this.buckets[n],a=i.layers[0].sourceLayer||"_geojsonTileLayer",o=r[a],s=t[a];o&&s&&0!==Object.keys(s).length&&(i.update(s,o,this.imageAtlas&&this.imageAtlas.patternPositions||{}),e&&e.style&&(this.queryPadding=Math.max(this.queryPadding,e.style.getLayer(n).queryRadius(i))))}}},Xl.prototype.holdingForFade=function(){return void 0!==this.symbolFadeHoldUntil},Xl.prototype.symbolFadeFinished=function(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<D.now()},Xl.prototype.clearFadeHold=function(){this.symbolFadeHoldUntil=void 0},Xl.prototype.setHoldDuration=function(t){this.symbolFadeHoldUntil=D.now()+t};var tu=function(t,e,r,n,a,o,s,l,u,c,p,h){var f=s.top*l-u,d=s.bottom*l+u,m=s.left*l-u,y=s.right*l+u;if(this.boxStartIndex=t.length,c){var g=d-f,v=y-m;g>0&&(g=Math.max(10*l,g),this._addLineCollisionCircles(t,e,r,r.segment,v,g,n,a,o,p))}else{if(h){var _=new i(m,f),x=new i(y,f),b=new i(m,d),w=new i(y,d),k=h*Math.PI/180;_._rotate(k),x._rotate(k),b._rotate(k),w._rotate(k),m=Math.min(_.x,x.x,b.x,w.x),y=Math.max(_.x,x.x,b.x,w.x),f=Math.min(_.y,x.y,b.y,w.y),d=Math.max(_.y,x.y,b.y,w.y)}t.emplaceBack(r.x,r.y,m,f,y,d,n,a,o,0,0)}this.boxEndIndex=t.length};tu.prototype._addLineCollisionCircles=function(t,e,r,n,i,a,o,s,l,u){var c=a/2,p=Math.floor(i/c)||1,h=1+.4*Math.log(u)/Math.LN2,f=Math.floor(p*h/2),d=-a/2,m=r,y=n+1,g=d,v=-i/2,_=v-i/4;do{if(--y<0){if(g>v)return;y=0;break}g-=e[y].dist(m),m=e[y]}while(g>_);for(var x=e[y].dist(e[y+1]),b=-f;b<p+f;b++){var w=b*c,k=v+w;if(w<0&&(k+=w),w>i&&(k+=w-i),!(k<g)){for(;g+x<k;){if(g+=x,++y+1>=e.length)return;x=e[y].dist(e[y+1])}var T=k-g,A=e[y],M=e[y+1].sub(A)._unit()._mult(T)._add(A)._round(),S=Math.abs(k-d)<c?0:.8*(k-d);t.emplaceBack(M.x,M.y,-a/2,-a/2,a/2,a/2,o,s,l,a/2,S)}}};var eu=function(t,e){if(void 0===t&&(t=[]),void 0===e&&(e=ru),this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(var r=(this.length>>1)-1;r>=0;r--)this._down(r)};function ru(t,e){return t<e?-1:t>e?1:0}function nu(t,e,r){void 0===e&&(e=1),void 0===r&&(r=!1);for(var n=1/0,a=1/0,o=-1/0,s=-1/0,l=t[0],u=0;u<l.length;u++){var c=l[u];(!u||c.x<n)&&(n=c.x),(!u||c.y<a)&&(a=c.y),(!u||c.x>o)&&(o=c.x),(!u||c.y>s)&&(s=c.y)}var p=o-n,h=s-a,f=Math.min(p,h),d=f/2,m=new eu([],iu);if(0===f)return new i(n,a);for(var y=n;y<o;y+=f)for(var g=a;g<s;g+=f)m.push(new au(y+d,g+d,d,t));for(var v=function(t){for(var e=0,r=0,n=0,i=t[0],a=0,o=i.length,s=o-1;a<o;s=a++){var l=i[a],u=i[s],c=l.x*u.y-u.x*l.y;r+=(l.x+u.x)*c,n+=(l.y+u.y)*c,e+=3*c}return new au(r/e,n/e,0,t)}(t),_=m.length;m.length;){var x=m.pop();(x.d>v.d||!v.d)&&(v=x,r&&console.log("found best %d after %d probes",Math.round(1e4*x.d)/1e4,_)),x.max-v.d<=e||(d=x.h/2,m.push(new au(x.p.x-d,x.p.y-d,d,t)),m.push(new au(x.p.x+d,x.p.y-d,d,t)),m.push(new au(x.p.x-d,x.p.y+d,d,t)),m.push(new au(x.p.x+d,x.p.y+d,d,t)),_+=4)}return r&&(console.log("num probes: "+_),console.log("best distance: "+v.d)),v.p}function iu(t,e){return e.max-t.max}function au(t,e,r,n){this.p=new i(t,e),this.h=r,this.d=function(t,e){for(var r=!1,n=1/0,i=0;i<e.length;i++)for(var a=e[i],o=0,s=a.length,l=s-1;o<s;l=o++){var u=a[o],c=a[l];u.y>t.y!=c.y>t.y&&t.x<(c.x-u.x)*(t.y-u.y)/(c.y-u.y)+u.x&&(r=!r),n=Math.min(n,fa(t,u,c))}return(r?1:-1)*Math.sqrt(n)}(this.p,n),this.max=this.d+this.h*Math.SQRT2}eu.prototype.push=function(t){this.data.push(t),this.length++,this._up(this.length-1)},eu.prototype.pop=function(){if(0!==this.length){var t=this.data[0],e=this.data.pop();return this.length--,this.length>0&&(this.data[0]=e,this._down(0)),t}},eu.prototype.peek=function(){return this.data[0]},eu.prototype._up=function(t){for(var e=this.data,r=this.compare,n=e[t];t>0;){var i=t-1>>1,a=e[i];if(r(n,a)>=0)break;e[t]=a,t=i}e[t]=n},eu.prototype._down=function(t){for(var e=this.data,r=this.compare,n=this.length>>1,i=e[t];t<n;){var a=1+(t<<1),o=e[a],s=a+1;if(s<this.length&&r(e[s],o)<0&&(a=s,o=e[s]),r(o,i)>=0)break;e[t]=o,t=a}e[t]=i};var ou=e(function(t){t.exports=function(t,e){var r,n,i,a,o,s,l,u;for(r=3&t.length,n=t.length-r,i=e,o=3432918353,s=461845907,u=0;u<n;)l=255&t.charCodeAt(u)|(255&t.charCodeAt(++u))<<8|(255&t.charCodeAt(++u))<<16|(255&t.charCodeAt(++u))<<24,++u,i=27492+(65535&(a=5*(65535&(i=(i^=l=(65535&(l=(l=(65535&l)*o+(((l>>>16)*o&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295)<<13|i>>>19))+((5*(i>>>16)&65535)<<16)&4294967295))+((58964+(a>>>16)&65535)<<16);switch(l=0,r){case 3:l^=(255&t.charCodeAt(u+2))<<16;case 2:l^=(255&t.charCodeAt(u+1))<<8;case 1:i^=l=(65535&(l=(l=(65535&(l^=255&t.charCodeAt(u)))*o+(((l>>>16)*o&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295}return i^=t.length,i=2246822507*(65535&(i^=i>>>16))+((2246822507*(i>>>16)&65535)<<16)&4294967295,i=3266489909*(65535&(i^=i>>>13))+((3266489909*(i>>>16)&65535)<<16)&4294967295,(i^=i>>>16)>>>0}}),su=e(function(t){t.exports=function(t,e){for(var r,n=t.length,i=e^n,a=0;n>=4;)r=1540483477*(65535&(r=255&t.charCodeAt(a)|(255&t.charCodeAt(++a))<<8|(255&t.charCodeAt(++a))<<16|(255&t.charCodeAt(++a))<<24))+((1540483477*(r>>>16)&65535)<<16),i=1540483477*(65535&i)+((1540483477*(i>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),n-=4,++a;switch(n){case 3:i^=(255&t.charCodeAt(a+2))<<16;case 2:i^=(255&t.charCodeAt(a+1))<<8;case 1:i=1540483477*(65535&(i^=255&t.charCodeAt(a)))+((1540483477*(i>>>16)&65535)<<16)}return i=1540483477*(65535&(i^=i>>>13))+((1540483477*(i>>>16)&65535)<<16),(i^=i>>>15)>>>0}}),lu=ou,uu=ou,cu=su;lu.murmur3=uu,lu.murmur2=cu;var pu=7;function hu(t,e){var r=0,n=0,i=e/Math.sqrt(2);switch(t){case"top-right":case"top-left":n=i-pu;break;case"bottom-right":case"bottom-left":n=-i+pu;break;case"bottom":n=-e+pu;break;case"top":n=e-pu}switch(t){case"top-right":case"bottom-right":r=-i;break;case"top-left":case"bottom-left":r=i;break;case"left":r=e;break;case"right":r=-e}return[r,n]}function fu(t){switch(t){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}var du=65535;function mu(t,e,r,n,a,o,s,l,u,c,p,h,f){var d=function(t,e,r,n,a,o,s,l){for(var u=n.layout.get("text-rotate").evaluate(o,{})*Math.PI/180,c=e.positionedGlyphs,p=[],h=0;h<c.length;h++){var f=c[h],d=s[f.fontStack],m=d&&d[f.glyph];if(m){var y=m.rect;if(y){var g=bl+1,v=m.metrics.advance*f.scale/2,_=a?[f.x+v,f.y]:[0,0],x=a?[0,0]:[f.x+v+r[0],f.y+r[1]],b=(a||l)&&f.vertical,w=[0,0];b&&(w=x,x=[0,0]);var k=(m.metrics.left-g)*f.scale-v+x[0],T=(-m.metrics.top-g)*f.scale+x[1],A=k+y.w*f.scale,M=T+y.h*f.scale,S=new i(k,T),L=new i(A,T),C=new i(k,M),E=new i(A,M);if(b){var z=new i(-v,v-e.yOffset),P=-Math.PI/2,I=ls/2-v,D=new i(5-e.yOffset-I,0),O=new(Function.prototype.bind.apply(i,[null].concat(w)));S._rotateAround(P,z)._add(D)._add(O),L._rotateAround(P,z)._add(D)._add(O),C._rotateAround(P,z)._add(D)._add(O),E._rotateAround(P,z)._add(D)._add(O)}if(u){var R=Math.sin(u),F=Math.cos(u),B=[F,-R,R,F];S._matMult(B),L._matMult(B),C._matMult(B),E._matMult(B)}p.push({tl:S,tr:L,bl:C,br:E,tex:y,writingMode:e.writingMode,glyphOffset:_,sectionIndex:f.sectionIndex})}}}return p}(0,r,s,n,a,o,h,t.allowVerticalPlacement),m=t.textSizeData,y=null;"source"===m.kind?(y=[bs*n.layout.get("text-size").evaluate(o,{})])[0]>du&&w(t.layerIds[0]+': Value for "text-size" is >= 256. Reduce your "text-size".'):"composite"===m.kind&&((y=[bs*f.compositeTextSizes[0].evaluate(o,{}),bs*f.compositeTextSizes[1].evaluate(o,{})])[0]>du||y[1]>du)&&w(t.layerIds[0]+': Value for "text-size" is >= 256. Reduce your "text-size".'),t.addSymbols(t.text,d,y,s,a,o,u,e,l.lineStartIndex,l.lineLength);for(var g=0,v=c;g<v.length;g+=1)p[v[g]]=t.text.placedSymbolArray.length-1;return 4*d.length}function yu(t){for(var e in t)return t[e];return null}function gu(t,e,r,n){var i=t.compareText;if(e in i){for(var a=i[e],o=a.length-1;o>=0;o--)if(n.dist(a[o])<r)return!0}else i[e]=[];return i[e].push(n),!1}t.Actor=kl,t.AlphaImage=za,t.CanonicalTileID=Dl,t.CollisionBoxArray=xi,t.Color=Xt,t.DEMData=Bl,t.DataConstantProperty=Un,t.DictionaryCoder=Ul,t.EXTENT=ea,t.ErrorEvent=wt,t.EvaluationParameters=zn,t.Event=bt,t.Evented=kt,t.FeatureIndex=Gl,t.FillBucket=bo,t.FillExtrusionBucket=Bo,t.ImageAtlas=Zs,t.ImagePosition=Gs,t.LineBucket=Yo,t.LngLat=Ml,t.LngLatBounds=Al,t.MercatorCoordinate=Il,t.ONE_EM=ls,t.OverscaledTileID=Rl,t.Point=i,t.Point$1=i,t.ProgramConfiguration=Ji,t.Properties=Hn,t.Protobuf=tl,t.RGBAImage=Pa,t.RequestManager=j,t.ResourceType=lt,t.SegmentVector=Pi,t.SourceFeatureState=ql,t.StructArrayLayout1ui2=yi,t.StructArrayLayout2i4=$n,t.StructArrayLayout2ui4=mi,t.StructArrayLayout3ui6=di,t.StructArrayLayout4i8=Qn,t.SymbolBucket=Ps,t.Texture=Js,t.Tile=Xl,t.Transitionable=Dn,t.Uniform1f=Bi,t.Uniform1i=Fi,t.Uniform2f=Ni,t.Uniform3f=Ui,t.Uniform4f=ji,t.UniformColor=Vi,t.UniformMatrix4f=Gi,t.UnwrappedTileID=Ol,t.ValidationError=At,t.WritingMode=us,t.ZoomHistory=vn,t.addDynamicAttributes=Cs,t.asyncAll=function(t,e,r){if(!t.length)return r(null,[]);var n=t.length,i=new Array(t.length),a=null;t.forEach(function(t,o){e(t,function(t,e){t&&(a=t),i[o]=e,0==--n&&r(a,i)})})},t.bezier=s,t.bindAll=y,t.browser=D,t.cacheEntryPossiblyAdded=function(t){++st>it&&(t.getActor().send("enforceCacheSizeLimit",nt),st=0)},t.clamp=u,t.clearTileCache=function(t){var e=self.caches.delete(rt);t&&e.catch(t).then(function(){return t()})},t.clone=function(t){var e=new ka(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},t.clone$1=x,t.config=O,t.create=function(){var t=new ka(16);return ka!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t},t.create$1=function(){var t=new ka(9);return ka!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t},t.create$2=function(){var t=new ka(4);return ka!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t},t.createCommonjsModule=e,t.createExpression=kr,t.createLayout=Kn,t.createStyleLayer=function(t){return"custom"===t.type?new js(t):new Vs[t.type](t)},t.deepEqual=o,t.ease=l,t.emitValidationErrors=ln,t.endsWith=g,t.enforceCacheSizeLimit=function(t){self.caches&&self.caches.open(rt).then(function(e){e.keys().then(function(r){for(var n=0;n<r.length-t;n++)e.delete(r[n])})})},t.evaluateRadialOffset=hu,t.evaluateSizeForFeature=ks,t.evaluateSizeForZoom=Ts,t.evented=Cn,t.extend=p,t.featureFilter=Rr,t.filterObject=_,t.fromRotation=function(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=0,t[3]=-r,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},t.getAnchorAlignment=vs,t.getAnchorJustification=fu,t.getArrayBuffer=yt,t.getImage=vt,t.getJSON=function(t,e){return mt(p(t,{type:"json"}),e)},t.getReferrer=pt,t.getVideo=function(t,e){var r,n,i=self.document.createElement("video");i.muted=!0,i.onloadstart=function(){e(null,i)};for(var a=0;a<t.length;a++){var o=self.document.createElement("source");r=t[a],n=void 0,(n=self.document.createElement("a")).href=r,(n.protocol!==self.document.location.protocol||n.host!==self.document.location.host)&&(i.crossOrigin="Anonymous"),o.src=t[a],i.appendChild(o)}return{cancel:function(){}}},t.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},t.invert=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8],p=e[9],h=e[10],f=e[11],d=e[12],m=e[13],y=e[14],g=e[15],v=r*s-n*o,_=r*l-i*o,x=r*u-a*o,b=n*l-i*s,w=n*u-a*s,k=i*u-a*l,T=c*m-p*d,A=c*y-h*d,M=c*g-f*d,S=p*y-h*m,L=p*g-f*m,C=h*g-f*y,E=v*C-_*L+x*S+b*M-w*A+k*T;return E?(E=1/E,t[0]=(s*C-l*L+u*S)*E,t[1]=(i*L-n*C-a*S)*E,t[2]=(m*k-y*w+g*b)*E,t[3]=(h*w-p*k-f*b)*E,t[4]=(l*M-o*C-u*A)*E,t[5]=(r*C-i*M+a*A)*E,t[6]=(y*x-d*k-g*_)*E,t[7]=(c*k-h*x+f*_)*E,t[8]=(o*L-s*M+u*T)*E,t[9]=(n*M-r*L-a*T)*E,t[10]=(d*w-m*x+g*v)*E,t[11]=(p*x-c*w-f*v)*E,t[12]=(s*A-o*S-l*T)*E,t[13]=(r*S-n*A+i*T)*E,t[14]=(m*_-d*b-y*v)*E,t[15]=(c*b-p*_+h*v)*E,t):null},t.isChar=_n,t.isMapboxURL=V,t.keysDifference=function(t,e){var r=[];for(var n in t)n in e||r.push(n);return r},t.makeRequest=mt,t.mapObject=v,t.mercatorXfromLng=Cl,t.mercatorYfromLat=El,t.mercatorZfromAltitude=zl,t.multiply=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=e[6],c=e[7],p=e[8],h=e[9],f=e[10],d=e[11],m=e[12],y=e[13],g=e[14],v=e[15],_=r[0],x=r[1],b=r[2],w=r[3];return t[0]=_*n+x*s+b*p+w*m,t[1]=_*i+x*l+b*h+w*y,t[2]=_*a+x*u+b*f+w*g,t[3]=_*o+x*c+b*d+w*v,_=r[4],x=r[5],b=r[6],w=r[7],t[4]=_*n+x*s+b*p+w*m,t[5]=_*i+x*l+b*h+w*y,t[6]=_*a+x*u+b*f+w*g,t[7]=_*o+x*c+b*d+w*v,_=r[8],x=r[9],b=r[10],w=r[11],t[8]=_*n+x*s+b*p+w*m,t[9]=_*i+x*l+b*h+w*y,t[10]=_*a+x*u+b*f+w*g,t[11]=_*o+x*c+b*d+w*v,_=r[12],x=r[13],b=r[14],w=r[15],t[12]=_*n+x*s+b*p+w*m,t[13]=_*i+x*l+b*h+w*y,t[14]=_*a+x*u+b*f+w*g,t[15]=_*o+x*c+b*d+w*v,t},t.mvt=Do,t.number=ve,t.ortho=function(t,e,r,n,i,a,o){var s=1/(e-r),l=1/(n-i),u=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*u,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*l,t[14]=(o+a)*u,t[15]=1,t},t.parseGlyphPBF=function(t){return new tl(t).readFields(vl,[])},t.pbf=tl,t.performSymbolLayout=function(t,e,r,n,a,o){t.createArrays();var s=512*t.overscaling;t.tilePixelRatio=ea/s,t.compareText={},t.iconsNeedLinear=!1;var l=t.layers[0].layout,u=t.layers[0]._unevaluatedLayout._values,c={};if("composite"===t.textSizeData.kind){var p=t.textSizeData,h=p.minZoom,f=p.maxZoom;c.compositeTextSizes=[u["text-size"].possiblyEvaluate(new zn(h)),u["text-size"].possiblyEvaluate(new zn(f))]}if("composite"===t.iconSizeData.kind){var d=t.iconSizeData,m=d.minZoom,y=d.maxZoom;c.compositeIconSizes=[u["icon-size"].possiblyEvaluate(new zn(m)),u["icon-size"].possiblyEvaluate(new zn(y))]}c.layoutTextSize=u["text-size"].possiblyEvaluate(new zn(t.zoom+1)),c.layoutIconSize=u["icon-size"].possiblyEvaluate(new zn(t.zoom+1)),c.textMaxSize=u["text-size"].possiblyEvaluate(new zn(18));for(var g=l.get("text-line-height")*ls,v="map"===l.get("text-rotation-alignment")&&"point"!==l.get("symbol-placement"),_=l.get("text-keep-upright"),x=function(){var o=k[b],s=l.get("text-font").evaluate(o,{}).join(","),u=r,p={horizontal:{},vertical:void 0},h=o.text,f=[0,0];if(h){var d=h.toString(),m=l.get("text-letter-spacing").evaluate(o,{})*ls,y=function(t){for(var e=0,r=d;e<r.length;e+=1)if(!bn(r[e].charCodeAt(0)))return!1;return!0}()?m:0,x=l.get("text-anchor").evaluate(o,{}),T=l.get("text-variable-anchor"),A=l.get("text-radial-offset").evaluate(o,{});T||(f=A?hu(x,A*ls):l.get("text-offset").evaluate(o,{}).map(function(t){return t*ls}));var M=v?"center":l.get("text-justify").evaluate(o,{}),S="point"===l.get("symbol-placement")?l.get("text-max-width").evaluate(o,{})*ls:0,L=function(){t.allowVerticalPlacement&&xn(d)&&(p.vertical=ps(h,e,s,S,g,x,"left",y,f,us.vertical,!0))};if(!v&&T){for(var C="auto"===M?T.map(function(t){return fu(t)}):[M],E=!1,z=0;z<C.length;z++){var P=C[z];if(!p.horizontal[P])if(E)p.horizontal[P]=p.horizontal[0];else{var I=ps(h,e,s,S,g,"center",P,y,f,us.horizontal,!1);I&&(p.horizontal[P]=I,E=1===I.lineCount)}}L()}else{"auto"===M&&(M=fu(x));var D=ps(h,e,s,S,g,x,M,y,f,us.horizontal,!1);D&&(p.horizontal[M]=D),L(),xn(d)&&v&&_&&(p.vertical=ps(h,e,s,S,g,x,M,y,f,us.vertical,!1))}}var O=void 0;if(o.icon){var R=n[o.icon];R&&(O=function(t,e,r){var n=vs(r),i=n.horizontalAlign,a=n.verticalAlign,o=e[0],s=e[1],l=o-t.displaySize[0]*i,u=l+t.displaySize[0],c=s-t.displaySize[1]*a;return{image:t,top:c,bottom:c+t.displaySize[1],left:l,right:u}}(a[o.icon],l.get("icon-offset").evaluate(o,{}),l.get("icon-anchor").evaluate(o,{})),void 0===t.sdfIcons?t.sdfIcons=R.sdf:t.sdfIcons!==R.sdf&&w("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),R.pixelRatio!==t.pixelRatio?t.iconsNeedLinear=!0:0!==l.get("icon-rotate").constantOr(1)&&(t.iconsNeedLinear=!0))}(Object.keys(p.horizontal).length||O)&&function(t,e,r,n,a,o,s){var l=o.layoutTextSize.evaluate(e,{}),u=o.layoutIconSize.evaluate(e,{}),c=o.textMaxSize.evaluate(e,{});void 0===c&&(c=l);var p=t.layers[0].layout,h=p.get("icon-offset").evaluate(e,{}),f=yu(r.horizontal),d=l/24,m=t.tilePixelRatio*d,y=t.tilePixelRatio*c/24,g=t.tilePixelRatio*u,v=t.tilePixelRatio*p.get("symbol-spacing"),_=p.get("text-padding")*t.tilePixelRatio,x=p.get("icon-padding")*t.tilePixelRatio,b=p.get("text-max-angle")/180*Math.PI,k="map"===p.get("text-rotation-alignment")&&"point"!==p.get("symbol-placement"),T="map"===p.get("icon-rotation-alignment")&&"point"!==p.get("symbol-placement"),A=p.get("symbol-placement"),M=v/2,S=function(l,u){u.x<0||u.x>=ea||u.y<0||u.y>=ea||function(t,e,r,n,a,o,s,l,u,c,p,h,f,d,m,y,g,v,_,x,b){var k,T,A,M=t.addToLineVertexArray(e,r),S=0,L=0,C=0,E={},z=lu(""),P=(o.layout.get("text-radial-offset").evaluate(_,{})||0)*ls;if(t.allowVerticalPlacement&&n.vertical){var I=o.layout.get("text-rotate").evaluate(_,{})+90,D=n.vertical;A=new tu(s,r,e,l,u,c,D,p,h,f,t.overscaling,I)}for(var O in n.horizontal){var R=n.horizontal[O];if(!k){z=lu(R.text);var F=o.layout.get("text-rotate").evaluate(_,{});k=new tu(s,r,e,l,u,c,R,p,h,f,t.overscaling,F)}var B=1===R.lineCount;if(L+=mu(t,e,R,o,f,_,d,M,n.vertical?us.horizontal:us.horizontalOnly,B?Object.keys(n.horizontal):[O],E,x,b),B)break}n.vertical&&(C+=mu(t,e,n.vertical,o,f,_,d,M,us.vertical,["vertical"],E,x,b));var N=k?k.boxStartIndex:t.collisionBoxArray.length,U=k?k.boxEndIndex:t.collisionBoxArray.length,j=A?A.boxStartIndex:t.collisionBoxArray.length,V=A?A.boxEndIndex:t.collisionBoxArray.length;if(a){var q=function(t,e,r,n,a,o){var s,l,u,c,p=e.image,h=r.layout,f=e.top-1/p.pixelRatio,d=e.left-1/p.pixelRatio,m=e.bottom+1/p.pixelRatio,y=e.right+1/p.pixelRatio;if("none"!==h.get("icon-text-fit")&&a){var g=y-d,v=m-f,_=h.get("text-size").evaluate(o,{})/24,x=a.left*_,b=a.right*_,w=a.top*_,k=b-x,T=a.bottom*_-w,A=h.get("icon-text-fit-padding")[0],M=h.get("icon-text-fit-padding")[1],S=h.get("icon-text-fit-padding")[2],L=h.get("icon-text-fit-padding")[3],C="width"===h.get("icon-text-fit")?.5*(T-v):0,E="height"===h.get("icon-text-fit")?.5*(k-g):0,z="width"===h.get("icon-text-fit")||"both"===h.get("icon-text-fit")?k:g,P="height"===h.get("icon-text-fit")||"both"===h.get("icon-text-fit")?T:v;s=new i(x+E-L,w+C-A),l=new i(x+E+M+z,w+C-A),u=new i(x+E+M+z,w+C+S+P),c=new i(x+E-L,w+C+S+P)}else s=new i(d,f),l=new i(y,f),u=new i(y,m),c=new i(d,m);var I=r.layout.get("icon-rotate").evaluate(o,{})*Math.PI/180;if(I){var D=Math.sin(I),O=Math.cos(I),R=[O,-D,D,O];s._matMult(R),l._matMult(R),c._matMult(R),u._matMult(R)}return[{tl:s,tr:l,bl:c,br:u,tex:p.paddedRect,writingMode:void 0,glyphOffset:[0,0],sectionIndex:0}]}(0,a,o,0,yu(n.horizontal),_),G=o.layout.get("icon-rotate").evaluate(_,{});T=new tu(s,r,e,l,u,c,a,m,y,!1,t.overscaling,G),S=4*q.length;var H=t.iconSizeData,Z=null;"source"===H.kind?(Z=[bs*o.layout.get("icon-size").evaluate(_,{})])[0]>du&&w(t.layerIds[0]+': Value for "icon-size" is >= 256. Reduce your "icon-size".'):"composite"===H.kind&&((Z=[bs*b.compositeIconSizes[0].evaluate(_,{}),bs*b.compositeIconSizes[1].evaluate(_,{})])[0]>du||Z[1]>du)&&w(t.layerIds[0]+': Value for "icon-size" is >= 256. Reduce your "icon-size".'),t.addSymbols(t.icon,q,Z,v,g,_,!1,e,M.lineStartIndex,M.lineLength)}var X=T?T.boxStartIndex:t.collisionBoxArray.length,W=T?T.boxEndIndex:t.collisionBoxArray.length;t.glyphOffsetArray.length>=Ps.MAX_GLYPHS&&w("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),t.symbolInstances.emplaceBack(e.x,e.y,E.right>=0?E.right:-1,E.center>=0?E.center:-1,E.left>=0?E.left:-1,E.vertical||-1,z,N,U,j,V,X,W,l,L,C,S,0,p,P)}(t,u,l,r,n,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,m,_,k,s,g,x,T,h,e,a,o)};if("line"===A)for(var L=0,C=function(t,e,r,n,a){for(var o=[],s=0;s<t.length;s++)for(var l=t[s],u=void 0,c=0;c<l.length-1;c++){var p=l[c],h=l[c+1];p.x<0&&h.x<0||(p.x<0?p=new i(0,p.y+(h.y-p.y)*((0-p.x)/(h.x-p.x)))._round():h.x<0&&(h=new i(0,p.y+(h.y-p.y)*((0-p.x)/(h.x-p.x)))._round()),p.y<0&&h.y<0||(p.y<0?p=new i(p.x+(h.x-p.x)*((0-p.y)/(h.y-p.y)),0)._round():h.y<0&&(h=new i(p.x+(h.x-p.x)*((0-p.y)/(h.y-p.y)),0)._round()),p.x>=n&&h.x>=n||(p.x>=n?p=new i(n,p.y+(h.y-p.y)*((n-p.x)/(h.x-p.x)))._round():h.x>=n&&(h=new i(n,p.y+(h.y-p.y)*((n-p.x)/(h.x-p.x)))._round()),p.y>=a&&h.y>=a||(p.y>=a?p=new i(p.x+(h.x-p.x)*((a-p.y)/(h.y-p.y)),a)._round():h.y>=a&&(h=new i(p.x+(h.x-p.x)*((a-p.y)/(h.y-p.y)),a)._round()),u&&p.equals(u[u.length-1])||(u=[p],o.push(u)),u.push(h)))))}return o}(e.geometry,0,0,ea,ea);L<C.length;L+=1)for(var E=C[L],z=0,P=Ql(E,v,b,r.vertical||f,n,24,y,t.overscaling,ea);z<P.length;z+=1){var I=P[z];f&&gu(t,f.text,M,I)||S(E,I)}else if("line-center"===A)for(var D=0,O=e.geometry;D<O.length;D+=1){var R=O[D];if(R.length>1){var F=$l(R,b,r.vertical||f,n,24,y);F&&S(R,F)}}else if("Polygon"===e.type)for(var B=0,N=go(e.geometry,0);B<N.length;B+=1){var U=N[B],j=nu(U,16);S(U[0],new xs(j.x,j.y,0))}else if("LineString"===e.type)for(var V=0,q=e.geometry;V<q.length;V+=1){var G=q[V];S(G,new xs(G[0].x,G[0].y,0))}else if("Point"===e.type)for(var H=0,Z=e.geometry;H<Z.length;H+=1)for(var X=0,W=Z[H];X<W.length;X+=1){var Y=W[X];S([Y],new xs(Y.x,Y.y,0))}}(t,o,p,O,u,c,f)},b=0,k=t.features;b<k.length;b+=1)x();o&&t.generateCollisionDebugBuffers()},t.perspective=function(t,e,r,n,i){var a,o=1/Math.tan(e/2);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[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(a=1/(n-i),t[10]=(i+n)*a,t[14]=2*i*n*a):(t[10]=-1,t[14]=-2*n),t},t.pick=function(t,e){for(var r={},n=0;n<e.length;n++){var i=e[n];i in t&&(r[i]=t[i])}return r},t.plugin=En,t.polygonIntersectsPolygon=oa,t.postMapLoadEvent=et,t.postTurnstileEvent=Q,t.potpack=qs,t.rasterBoundsAttributes=Nl,t.refProperties=["type","source","source-layer","minzoom","maxzoom","filter","layout"],t.register=dn,t.registerForPluginAvailability=function(t){return Sn?t({pluginURL:Sn,completionCallback:An}):Cn.once("pluginAvailable",t),t},t.rotate=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(r),l=Math.cos(r);return t[0]=n*l+a*s,t[1]=i*l+o*s,t[2]=n*-s+a*l,t[3]=i*-s+o*l,t},t.rotateX=function(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[4],o=e[5],s=e[6],l=e[7],u=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]=a*i+u*n,t[5]=o*i+c*n,t[6]=s*i+p*n,t[7]=l*i+h*n,t[8]=u*i-a*n,t[9]=c*i-o*n,t[10]=p*i-s*n,t[11]=h*i-l*n,t},t.rotateZ=function(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[0],o=e[1],s=e[2],l=e[3],u=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]=a*i+u*n,t[1]=o*i+c*n,t[2]=s*i+p*n,t[3]=l*i+h*n,t[4]=u*i-a*n,t[5]=c*i-o*n,t[6]=p*i-s*n,t[7]=h*i-l*n,t},t.scale=function(t,e,r){var n=r[0],i=r[1],a=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]*a,t[9]=e[9]*a,t[10]=e[10]*a,t[11]=e[11]*a,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},t.setCacheLimits=function(t,e){nt=t,it=e},t.setRTLTextPlugin=function(t,e){if(Mn)throw new Error("setRTLTextPlugin cannot be called multiple times.");Mn=!0,Sn=D.resolveURL(t),An=function(t){t?(Mn=!1,Sn=null,e&&e(t)):Ln=!0},Cn.fire(new bt("pluginAvailable",{pluginURL:Sn,completionCallback:An}))},t.sphericalToCartesian=function(t){var e=t[0],r=t[1],n=t[2];return r+=90,r*=Math.PI/180,n*=Math.PI/180,{x:e*Math.cos(r)*Math.sin(n),y:e*Math.sin(r)*Math.sin(n),z:e*Math.cos(n)}},t.styleSpec=Tt,t.symbolSize=As,t.transformMat3=function(t,e,r){var n=e[0],i=e[1],a=e[2];return t[0]=n*r[0]+i*r[3]+a*r[6],t[1]=n*r[1]+i*r[4]+a*r[7],t[2]=n*r[2]+i*r[5]+a*r[8],t},t.transformMat4=Ta,t.translate=function(t,e,r){var n,i,a,o,s,l,u,c,p,h,f,d,m=r[0],y=r[1],g=r[2];return e===t?(t[12]=e[0]*m+e[4]*y+e[8]*g+e[12],t[13]=e[1]*m+e[5]*y+e[9]*g+e[13],t[14]=e[2]*m+e[6]*y+e[10]*g+e[14],t[15]=e[3]*m+e[7]*y+e[11]*g+e[15]):(n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=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]=a,t[3]=o,t[4]=s,t[5]=l,t[6]=u,t[7]=c,t[8]=p,t[9]=h,t[10]=f,t[11]=d,t[12]=n*m+s*y+p*g+e[12],t[13]=i*m+l*y+h*g+e[13],t[14]=a*m+u*y+f*g+e[14],t[15]=o*m+c*y+d*g+e[15]),t},t.uniqueId=f,t.validateCustomStyleLayer=function(t){var e=[],r=t.id;return void 0===r&&e.push({message:"layers."+r+': missing required property "id"'}),void 0===t.render&&e.push({message:"layers."+r+': missing required method "render"'}),t.renderingMode&&"2d"!==t.renderingMode&&"3d"!==t.renderingMode&&e.push({message:"layers."+r+': property "renderingMode" must be either "2d" or "3d"'}),e},t.validateLight=an,t.validateStyle=nn,t.values=function(t){var e=[];for(var r in t)e.push(t[r]);return e},t.vectorTile=Do,t.version="1.3.2",t.warnOnce=w,t.webpSupported=R,t.window=self,t.wrap=c}),n(0,function(t){function e(t){var r=typeof t;if("number"===r||"boolean"===r||"string"===r||null==t)return JSON.stringify(t);if(Array.isArray(t)){for(var n="[",i=0,a=t;i<a.length;i+=1)n+=e(a[i])+",";return n+"]"}for(var o=Object.keys(t).sort(),s="{",l=0;l<o.length;l++)s+=JSON.stringify(o[l])+":"+e(t[o[l]])+",";return s+"}"}function r(r){for(var n="",i=0,a=t.refProperties;i<a.length;i+=1)n+="/"+e(r[a[i]]);return n}var n=function(t){this.keyCache={},t&&this.replace(t)};n.prototype.replace=function(t){this._layerConfigs={},this._layers={},this.update(t,[])},n.prototype.update=function(e,n){for(var i=this,a=0,o=e;a<o.length;a+=1){var s=o[a];this._layerConfigs[s.id]=s;var l=this._layers[s.id]=t.createStyleLayer(s);l._featureFilter=t.featureFilter(l.filter),this.keyCache[s.id]&&delete this.keyCache[s.id]}for(var u=0,c=n;u<c.length;u+=1){var p=c[u];delete this.keyCache[p],delete this._layerConfigs[p],delete this._layers[p]}this.familiesBySource={};for(var h=0,f=function(t,e){for(var n={},i=0;i<t.length;i++){var a=e&&e[t[i].id]||r(t[i]);e&&(e[t[i].id]=a);var o=n[a];o||(o=n[a]=[]),o.push(t[i])}var s=[];for(var l in n)s.push(n[l]);return s}(t.values(this._layerConfigs),this.keyCache);h<f.length;h+=1){var d=f[h].map(function(t){return i._layers[t.id]}),m=d[0];if("none"!==m.visibility){var y=m.source||"",g=this.familiesBySource[y];g||(g=this.familiesBySource[y]={});var v=m.sourceLayer||"_geojsonTileLayer",_=g[v];_||(_=g[v]=[]),_.push(d)}}};var i=function(e){var r={},n=[];for(var i in e){var a=e[i],o=r[i]={};for(var s in a){var l=a[+s];if(l&&0!==l.bitmap.width&&0!==l.bitmap.height){var u={x:0,y:0,w:l.bitmap.width+2,h:l.bitmap.height+2};n.push(u),o[s]={rect:u,metrics:l.metrics}}}}var c=t.potpack(n),p=c.w,h=c.h,f=new t.AlphaImage({width:p||1,height:h||1});for(var d in e){var m=e[d];for(var y in m){var g=m[+y];if(g&&0!==g.bitmap.width&&0!==g.bitmap.height){var v=r[d][y].rect;t.AlphaImage.copy(g.bitmap,f,{x:0,y:0},{x:v.x+1,y:v.y+1},g.bitmap)}}}this.image=f,this.positions=r};t.register("GlyphAtlas",i);var a=function(e){this.tileID=new t.OverscaledTileID(e.tileID.overscaledZ,e.tileID.wrap,e.tileID.canonical.z,e.tileID.canonical.x,e.tileID.canonical.y),this.uid=e.uid,this.zoom=e.zoom,this.pixelRatio=e.pixelRatio,this.tileSize=e.tileSize,this.source=e.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=e.showCollisionBoxes,this.collectResourceTiming=!!e.collectResourceTiming,this.returnDependencies=!!e.returnDependencies};function o(e,r){for(var n=new t.EvaluationParameters(r),i=0,a=e;i<a.length;i+=1)a[i].recalculate(n)}a.prototype.parse=function(e,r,n,a){var s=this;this.status="parsing",this.data=e,this.collisionBoxArray=new t.CollisionBoxArray;var l=new t.DictionaryCoder(Object.keys(e.layers).sort()),u=new t.FeatureIndex(this.tileID);u.bucketLayerIDs=[];var c,p,h,f,d={},m={featureIndex:u,iconDependencies:{},patternDependencies:{},glyphDependencies:{}},y=r.familiesBySource[this.source];for(var g in y){var v=e.layers[g];if(v){1===v.version&&t.warnOnce('Vector tile source "'+this.source+'" layer "'+g+'" does not use vector tile spec v2 and therefore may have some rendering errors.');for(var _=l.encode(g),x=[],b=0;b<v.length;b++){var w=v.feature(b);x.push({feature:w,index:b,sourceLayerIndex:_})}for(var k=0,T=y[g];k<T.length;k+=1){var A=T[k],M=A[0];M.minzoom&&this.zoom<Math.floor(M.minzoom)||M.maxzoom&&this.zoom>=M.maxzoom||"none"!==M.visibility&&(o(A,this.zoom),(d[M.id]=M.createBucket({index:u.bucketLayerIDs.length,layers:A,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:_,sourceID:this.source})).populate(x,m),u.bucketLayerIDs.push(A.map(function(t){return t.id})))}}}var S=t.mapObject(m.glyphDependencies,function(t){return Object.keys(t).map(Number)});Object.keys(S).length?n.send("getGlyphs",{uid:this.uid,stacks:S},function(t,e){c||(c=t,p=e,E.call(s))}):p={};var L=Object.keys(m.iconDependencies);L.length?n.send("getImages",{icons:L},function(t,e){c||(c=t,h=e,E.call(s))}):h={};var C=Object.keys(m.patternDependencies);function E(){if(c)return a(c);if(p&&h&&f){var e=new i(p),r=new t.ImageAtlas(h,f);for(var n in d){var s=d[n];s instanceof t.SymbolBucket?(o(s.layers,this.zoom),t.performSymbolLayout(s,p,e.positions,h,r.iconPositions,this.showCollisionBoxes)):s.hasPattern&&(s instanceof t.LineBucket||s instanceof t.FillBucket||s instanceof t.FillExtrusionBucket)&&(o(s.layers,this.zoom),s.addFeatures(m,r.patternPositions))}this.status="done",a(null,{buckets:t.values(d).filter(function(t){return!t.isEmpty()}),featureIndex:u,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:e.image,imageAtlas:r,glyphMap:this.returnDependencies?p:null,iconMap:this.returnDependencies?h:null,glyphPositions:this.returnDependencies?e.positions:null})}}C.length?n.send("getImages",{icons:C},function(t,e){c||(c=t,f=e,E.call(s))}):f={},E.call(this)};var s="undefined"!=typeof performance,l={getEntriesByName:function(t){return!!(s&&performance&&performance.getEntriesByName)&&performance.getEntriesByName(t)},mark:function(t){return!!(s&&performance&&performance.mark)&&performance.mark(t)},measure:function(t,e,r){return!!(s&&performance&&performance.measure)&&performance.measure(t,e,r)},clearMarks:function(t){return!!(s&&performance&&performance.clearMarks)&&performance.clearMarks(t)},clearMeasures:function(t){return!!(s&&performance&&performance.clearMeasures)&&performance.clearMeasures(t)}},u=function(t){this._marks={start:[t.url,"start"].join("#"),end:[t.url,"end"].join("#"),measure:t.url.toString()},l.mark(this._marks.start)};function c(e,r){var n=t.getArrayBuffer(e.request,function(e,n,i,a){e?r(e):n&&r(null,{vectorTile:new t.vectorTile.VectorTile(new t.pbf(n)),rawData:n,cacheControl:i,expires:a})});return function(){n.cancel(),r()}}u.prototype.finish=function(){l.mark(this._marks.end);var t=l.getEntriesByName(this._marks.measure);return 0===t.length&&(l.measure(this._marks.measure,this._marks.start,this._marks.end),t=l.getEntriesByName(this._marks.measure),l.clearMarks(this._marks.start),l.clearMarks(this._marks.end),l.clearMeasures(this._marks.measure)),t},l.Performance=u;var p=function(t,e,r){this.actor=t,this.layerIndex=e,this.loadVectorData=r||c,this.loading={},this.loaded={}};p.prototype.loadTile=function(e,r){var n=this,i=e.uid;this.loading||(this.loading={});var o=!!(e&&e.request&&e.request.collectResourceTiming)&&new l.Performance(e.request),s=this.loading[i]=new a(e);s.abort=this.loadVectorData(e,function(e,a){if(delete n.loading[i],e||!a)return s.status="done",n.loaded[i]=s,r(e);var l=a.rawData,u={};a.expires&&(u.expires=a.expires),a.cacheControl&&(u.cacheControl=a.cacheControl);var c={};if(o){var p=o.finish();p&&(c.resourceTiming=JSON.parse(JSON.stringify(p)))}s.vectorTile=a.vectorTile,s.parse(a.vectorTile,n.layerIndex,n.actor,function(e,n){if(e||!n)return r(e);r(null,t.extend({rawTileData:l.slice(0)},n,u,c))}),n.loaded=n.loaded||{},n.loaded[i]=s})},p.prototype.reloadTile=function(t,e){var r=this.loaded,n=t.uid,i=this;if(r&&r[n]){var a=r[n];a.showCollisionBoxes=t.showCollisionBoxes;var o=function(t,r){var n=a.reloadCallback;n&&(delete a.reloadCallback,a.parse(a.vectorTile,i.layerIndex,i.actor,n)),e(t,r)};"parsing"===a.status?a.reloadCallback=o:"done"===a.status&&(a.vectorTile?a.parse(a.vectorTile,this.layerIndex,this.actor,o):o())}},p.prototype.abortTile=function(t,e){var r=this.loading,n=t.uid;r&&r[n]&&r[n].abort&&(r[n].abort(),delete r[n]),e()},p.prototype.removeTile=function(t,e){var r=this.loaded,n=t.uid;r&&r[n]&&delete r[n],e()};var h=function(){this.loaded={}};h.prototype.loadTile=function(e,r){var n=e.uid,i=e.encoding,a=e.rawImageData,o=new t.DEMData(n,a,i);this.loaded=this.loaded||{},this.loaded[n]=o,r(null,o)},h.prototype.removeTile=function(t){var e=this.loaded,r=t.uid;e&&e[r]&&delete e[r]};var f={RADIUS:6378137,FLATTENING:1/298.257223563,POLAR_RADIUS:6356752.3142};function d(t){var e=0;if(t&&t.length>0){e+=Math.abs(m(t[0]));for(var r=1;r<t.length;r++)e-=Math.abs(m(t[r]))}return e}function m(t){var e,r,n,i,a,o,s=0,l=t.length;if(l>2){for(o=0;o<l;o++)o===l-2?(n=l-2,i=l-1,a=0):o===l-1?(n=l-1,i=0,a=1):(n=o,i=o+1,a=o+2),e=t[n],r=t[i],s+=(y(t[a][0])-y(e[0]))*Math.sin(y(r[1]));s=s*f.RADIUS*f.RADIUS/2}return s}function y(t){return t*Math.PI/180}var g={geometry:function t(e){var r,n=0;switch(e.type){case"Polygon":return d(e.coordinates);case"MultiPolygon":for(r=0;r<e.coordinates.length;r++)n+=d(e.coordinates[r]);return n;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0;case"GeometryCollection":for(r=0;r<e.geometries.length;r++)n+=t(e.geometries[r]);return n}},ring:m};function v(t,e){return function(r){return t(r,e)}}function _(t,e){e=!!e,t[0]=x(t[0],e);for(var r=1;r<t.length;r++)t[r]=x(t[r],!e);return t}function x(t,e){return function(t){return g.ring(t)>=0}(t)===e?t:t.reverse()}var b=t.vectorTile.VectorTileFeature.prototype.toGeoJSON,w=function(e){this._feature=e,this.extent=t.EXTENT,this.type=e.type,this.properties=e.tags,"id"in e&&!isNaN(e.id)&&(this.id=parseInt(e.id,10))};w.prototype.loadGeometry=function(){if(1===this._feature.type){for(var e=[],r=0,n=this._feature.geometry;r<n.length;r+=1){var i=n[r];e.push([new t.Point$1(i[0],i[1])])}return e}for(var a=[],o=0,s=this._feature.geometry;o<s.length;o+=1){for(var l=[],u=0,c=s[o];u<c.length;u+=1){var p=c[u];l.push(new t.Point$1(p[0],p[1]))}a.push(l)}return a},w.prototype.toGeoJSON=function(t,e,r){return b.call(this,t,e,r)};var k=function(e){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=t.EXTENT,this.length=e.length,this._features=e};k.prototype.feature=function(t){return new w(this._features[t])};var T=t.vectorTile.VectorTileFeature,A=M;function M(t,e){this.options=e||{},this.features=t,this.length=t.length}function S(t,e){this.id="number"==typeof t.id?t.id:void 0,this.type=t.type,this.rawGeometry=1===t.type?[t.geometry]:t.geometry,this.properties=t.tags,this.extent=e||4096}M.prototype.feature=function(t){return new S(this.features[t],this.options.extent)},S.prototype.loadGeometry=function(){var e=this.rawGeometry;this.geometry=[];for(var r=0;r<e.length;r++){for(var n=e[r],i=[],a=0;a<n.length;a++)i.push(new t.Point$1(n[a][0],n[a][1]));this.geometry.push(i)}return this.geometry},S.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var t=this.geometry,e=1/0,r=-1/0,n=1/0,i=-1/0,a=0;a<t.length;a++)for(var o=t[a],s=0;s<o.length;s++){var l=o[s];e=Math.min(e,l.x),r=Math.max(r,l.x),n=Math.min(n,l.y),i=Math.max(i,l.y)}return[e,n,r,i]},S.prototype.toGeoJSON=T.prototype.toGeoJSON;var L=z,C=z,E=A;function z(e){var r=new t.pbf;return function(t,e){for(var r in t.layers)e.writeMessage(3,P,t.layers[r])}(e,r),r.finish()}function P(t,e){var r;e.writeVarintField(15,t.version||1),e.writeStringField(1,t.name||""),e.writeVarintField(5,t.extent||4096);var n={keys:[],values:[],keycache:{},valuecache:{}};for(r=0;r<t.length;r++)n.feature=t.feature(r),e.writeMessage(2,I,n);var i=n.keys;for(r=0;r<i.length;r++)e.writeStringField(3,i[r]);var a=n.values;for(r=0;r<a.length;r++)e.writeMessage(4,B,a[r])}function I(t,e){var r=t.feature;void 0!==r.id&&e.writeVarintField(1,r.id),e.writeMessage(2,D,t),e.writeVarintField(3,r.type),e.writeMessage(4,F,r)}function D(t,e){var r=t.feature,n=t.keys,i=t.values,a=t.keycache,o=t.valuecache;for(var s in r.properties){var l=a[s];void 0===l&&(n.push(s),l=n.length-1,a[s]=l),e.writeVarint(l);var u=r.properties[s],c=typeof u;"string"!==c&&"boolean"!==c&&"number"!==c&&(u=JSON.stringify(u));var p=c+":"+u,h=o[p];void 0===h&&(i.push(u),h=i.length-1,o[p]=h),e.writeVarint(h)}}function O(t,e){return(e<<3)+(7&t)}function R(t){return t<<1^t>>31}function F(t,e){for(var r=t.loadGeometry(),n=t.type,i=0,a=0,o=r.length,s=0;s<o;s++){var l=r[s],u=1;1===n&&(u=l.length),e.writeVarint(O(1,u));for(var c=3===n?l.length-1:l.length,p=0;p<c;p++){1===p&&1!==n&&e.writeVarint(O(2,c-1));var h=l[p].x-i,f=l[p].y-a;e.writeVarint(R(h)),e.writeVarint(R(f)),i+=h,a+=f}3===n&&e.writeVarint(O(7,1))}}function B(t,e){var r=typeof t;"string"===r?e.writeStringField(1,t):"boolean"===r?e.writeBooleanField(7,t):"number"===r&&(t%1!=0?e.writeDoubleField(3,t):t<0?e.writeSVarintField(6,t):e.writeVarintField(5,t))}function N(t,e,r,n){U(t,r,n),U(e,2*r,2*n),U(e,2*r+1,2*n+1)}function U(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function j(t,e,r,n){var i=t-r,a=e-n;return i*i+a*a}L.fromVectorTileJs=C,L.fromGeojsonVt=function(t,e){e=e||{};var r={};for(var n in t)r[n]=new A(t[n].features,e),r[n].name=n,r[n].version=e.version,r[n].extent=e.extent;return z({layers:r})},L.GeoJSONWrapper=E;var V=function(t){return t[0]},q=function(t){return t[1]},G=function(t,e,r,n,i){void 0===e&&(e=V),void 0===r&&(r=q),void 0===n&&(n=64),void 0===i&&(i=Float64Array),this.nodeSize=n,this.points=t;for(var a=t.length<65536?Uint16Array:Uint32Array,o=this.ids=new a(t.length),s=this.coords=new i(2*t.length),l=0;l<t.length;l++)o[l]=l,s[2*l]=e(t[l]),s[2*l+1]=r(t[l]);!function t(e,r,n,i,a,o){if(!(a-i<=n)){var s=i+a>>1;!function t(e,r,n,i,a,o){for(;a>i;){if(a-i>600){var s=a-i+1,l=n-i+1,u=Math.log(s),c=.5*Math.exp(2*u/3),p=.5*Math.sqrt(u*c*(s-c)/s)*(l-s/2<0?-1:1);t(e,r,n,Math.max(i,Math.floor(n-l*c/s+p)),Math.min(a,Math.floor(n+(s-l)*c/s+p)),o)}var h=r[2*n+o],f=i,d=a;for(N(e,r,i,n),r[2*a+o]>h&&N(e,r,i,a);f<d;){for(N(e,r,f,d),f++,d--;r[2*f+o]<h;)f++;for(;r[2*d+o]>h;)d--}r[2*i+o]===h?N(e,r,i,d):N(e,r,++d,a),d<=n&&(i=d+1),n<=d&&(a=d-1)}}(e,r,s,i,a,o%2),t(e,r,n,i,s-1,o+1),t(e,r,n,s+1,a,o+1)}}(o,s,n,0,o.length-1,0)};G.prototype.range=function(t,e,r,n){return function(t,e,r,n,i,a,o){for(var s,l,u=[0,t.length-1,0],c=[];u.length;){var p=u.pop(),h=u.pop(),f=u.pop();if(h-f<=o)for(var d=f;d<=h;d++)s=e[2*d],l=e[2*d+1],s>=r&&s<=i&&l>=n&&l<=a&&c.push(t[d]);else{var m=Math.floor((f+h)/2);s=e[2*m],l=e[2*m+1],s>=r&&s<=i&&l>=n&&l<=a&&c.push(t[m]);var y=(p+1)%2;(0===p?r<=s:n<=l)&&(u.push(f),u.push(m-1),u.push(y)),(0===p?i>=s:a>=l)&&(u.push(m+1),u.push(h),u.push(y))}}return c}(this.ids,this.coords,t,e,r,n,this.nodeSize)},G.prototype.within=function(t,e,r){return function(t,e,r,n,i,a){for(var o=[0,t.length-1,0],s=[],l=i*i;o.length;){var u=o.pop(),c=o.pop(),p=o.pop();if(c-p<=a)for(var h=p;h<=c;h++)j(e[2*h],e[2*h+1],r,n)<=l&&s.push(t[h]);else{var f=Math.floor((p+c)/2),d=e[2*f],m=e[2*f+1];j(d,m,r,n)<=l&&s.push(t[f]);var y=(u+1)%2;(0===u?r-i<=d:n-i<=m)&&(o.push(p),o.push(f-1),o.push(y)),(0===u?r+i>=d:n+i>=m)&&(o.push(f+1),o.push(c),o.push(y))}}return s}(this.ids,this.coords,t,e,r,this.nodeSize)};var H={minZoom:0,maxZoom:16,radius:40,extent:512,nodeSize:64,log:!1,reduce:null,map:function(t){return t}},Z=function(t){this.options=Q(Object.create(H),t),this.trees=new Array(this.options.maxZoom+1)};function X(t,e,r,n,i){return{x:t,y:e,zoom:1/0,id:r,parentId:-1,numPoints:n,properties:i}}function W(t,e){var r=t.geometry.coordinates,n=r[0],i=r[1];return{x:J(n),y:$(i),zoom:1/0,index:e,parentId:-1}}function Y(t){return{type:"Feature",id:t.id,properties:K(t),geometry:{type:"Point",coordinates:[(n=t.x,360*(n-.5)),(e=t.y,r=(180-360*e)*Math.PI/180,360*Math.atan(Math.exp(r))/Math.PI-90)]}};var e,r,n}function K(t){var e=t.numPoints,r=e>=1e4?Math.round(e/1e3)+"k":e>=1e3?Math.round(e/100)/10+"k":e;return Q(Q({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:r})}function J(t){return t/360+.5}function $(t){var e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function Q(t,e){for(var r in e)t[r]=e[r];return t}function tt(t){return t.x}function et(t){return t.y}function rt(t,e,r,n,i,a){var o=i-r,s=a-n;if(0!==o||0!==s){var l=((t-r)*o+(e-n)*s)/(o*o+s*s);l>1?(r=i,n=a):l>0&&(r+=o*l,n+=s*l)}return(o=t-r)*o+(s=e-n)*s}function nt(t,e,r,n){var i={id:void 0===t?null:t,type:e,geometry:r,tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(t){var e=t.geometry,r=t.type;if("Point"===r||"MultiPoint"===r||"LineString"===r)it(t,e);else if("Polygon"===r||"MultiLineString"===r)for(var n=0;n<e.length;n++)it(t,e[n]);else if("MultiPolygon"===r)for(n=0;n<e.length;n++)for(var i=0;i<e[n].length;i++)it(t,e[n][i])}(i),i}function it(t,e){for(var r=0;r<e.length;r+=3)t.minX=Math.min(t.minX,e[r]),t.minY=Math.min(t.minY,e[r+1]),t.maxX=Math.max(t.maxX,e[r]),t.maxY=Math.max(t.maxY,e[r+1])}function at(t,e,r,n){if(e.geometry){var i=e.geometry.coordinates,a=e.geometry.type,o=Math.pow(r.tolerance/((1<<r.maxZoom)*r.extent),2),s=[],l=e.id;if(r.promoteId?l=e.properties[r.promoteId]:r.generateId&&(l=n||0),"Point"===a)ot(i,s);else if("MultiPoint"===a)for(var u=0;u<i.length;u++)ot(i[u],s);else if("LineString"===a)st(i,s,o,!1);else if("MultiLineString"===a){if(r.lineMetrics){for(u=0;u<i.length;u++)s=[],st(i[u],s,o,!1),t.push(nt(l,"LineString",s,e.properties));return}lt(i,s,o,!1)}else if("Polygon"===a)lt(i,s,o,!0);else{if("MultiPolygon"!==a){if("GeometryCollection"===a){for(u=0;u<e.geometry.geometries.length;u++)at(t,{id:l,geometry:e.geometry.geometries[u],properties:e.properties},r,n);return}throw new Error("Input data is not a valid GeoJSON object.")}for(u=0;u<i.length;u++){var c=[];lt(i[u],c,o,!0),s.push(c)}}t.push(nt(l,a,s,e.properties))}}function ot(t,e){e.push(ut(t[0])),e.push(ct(t[1])),e.push(0)}function st(t,e,r,n){for(var i,a,o=0,s=0;s<t.length;s++){var l=ut(t[s][0]),u=ct(t[s][1]);e.push(l),e.push(u),e.push(0),s>0&&(o+=n?(i*u-l*a)/2:Math.sqrt(Math.pow(l-i,2)+Math.pow(u-a,2))),i=l,a=u}var c=e.length-3;e[2]=1,function t(e,r,n,i){for(var a,o=i,s=n-r>>1,l=n-r,u=e[r],c=e[r+1],p=e[n],h=e[n+1],f=r+3;f<n;f+=3){var d=rt(e[f],e[f+1],u,c,p,h);if(d>o)a=f,o=d;else if(d===o){var m=Math.abs(f-s);m<l&&(a=f,l=m)}}o>i&&(a-r>3&&t(e,r,a,i),e[a+2]=o,n-a>3&&t(e,a,n,i))}(e,0,c,r),e[c+2]=1,e.size=Math.abs(o),e.start=0,e.end=e.size}function lt(t,e,r,n){for(var i=0;i<t.length;i++){var a=[];st(t[i],a,r,n),e.push(a)}}function ut(t){return t/360+.5}function ct(t){var e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function pt(t,e,r,n,i,a,o,s){if(n/=e,a>=(r/=e)&&o<n)return t;if(o<r||a>=n)return null;for(var l=[],u=0;u<t.length;u++){var c=t[u],p=c.geometry,h=c.type,f=0===i?c.minX:c.minY,d=0===i?c.maxX:c.maxY;if(f>=r&&d<n)l.push(c);else if(!(d<r||f>=n)){var m=[];if("Point"===h||"MultiPoint"===h)ht(p,m,r,n,i);else if("LineString"===h)ft(p,m,r,n,i,!1,s.lineMetrics);else if("MultiLineString"===h)mt(p,m,r,n,i,!1);else if("Polygon"===h)mt(p,m,r,n,i,!0);else if("MultiPolygon"===h)for(var y=0;y<p.length;y++){var g=[];mt(p[y],g,r,n,i,!0),g.length&&m.push(g)}if(m.length){if(s.lineMetrics&&"LineString"===h){for(y=0;y<m.length;y++)l.push(nt(c.id,h,m[y],c.tags));continue}"LineString"!==h&&"MultiLineString"!==h||(1===m.length?(h="LineString",m=m[0]):h="MultiLineString"),"Point"!==h&&"MultiPoint"!==h||(h=3===m.length?"Point":"MultiPoint"),l.push(nt(c.id,h,m,c.tags))}}}return l.length?l:null}function ht(t,e,r,n,i){for(var a=0;a<t.length;a+=3){var o=t[a+i];o>=r&&o<=n&&(e.push(t[a]),e.push(t[a+1]),e.push(t[a+2]))}}function ft(t,e,r,n,i,a,o){for(var s,l,u=dt(t),c=0===i?gt:vt,p=t.start,h=0;h<t.length-3;h+=3){var f=t[h],d=t[h+1],m=t[h+2],y=t[h+3],g=t[h+4],v=0===i?f:d,_=0===i?y:g,x=!1;o&&(s=Math.sqrt(Math.pow(f-y,2)+Math.pow(d-g,2))),v<r?_>r&&(l=c(u,f,d,y,g,r),o&&(u.start=p+s*l)):v>n?_<n&&(l=c(u,f,d,y,g,n),o&&(u.start=p+s*l)):yt(u,f,d,m),_<r&&v>=r&&(l=c(u,f,d,y,g,r),x=!0),_>n&&v<=n&&(l=c(u,f,d,y,g,n),x=!0),!a&&x&&(o&&(u.end=p+s*l),e.push(u),u=dt(t)),o&&(p+=s)}var b=t.length-3;f=t[b],d=t[b+1],m=t[b+2],(v=0===i?f:d)>=r&&v<=n&&yt(u,f,d,m),b=u.length-3,a&&b>=3&&(u[b]!==u[0]||u[b+1]!==u[1])&&yt(u,u[0],u[1],u[2]),u.length&&e.push(u)}function dt(t){var e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function mt(t,e,r,n,i,a){for(var o=0;o<t.length;o++)ft(t[o],e,r,n,i,a,!1)}function yt(t,e,r,n){t.push(e),t.push(r),t.push(n)}function gt(t,e,r,n,i,a){var o=(a-e)/(n-e);return t.push(a),t.push(r+(i-r)*o),t.push(1),o}function vt(t,e,r,n,i,a){var o=(a-r)/(i-r);return t.push(e+(n-e)*o),t.push(a),t.push(1),o}function _t(t,e){for(var r=[],n=0;n<t.length;n++){var i,a=t[n],o=a.type;if("Point"===o||"MultiPoint"===o||"LineString"===o)i=xt(a.geometry,e);else if("MultiLineString"===o||"Polygon"===o){i=[];for(var s=0;s<a.geometry.length;s++)i.push(xt(a.geometry[s],e))}else if("MultiPolygon"===o)for(i=[],s=0;s<a.geometry.length;s++){for(var l=[],u=0;u<a.geometry[s].length;u++)l.push(xt(a.geometry[s][u],e));i.push(l)}r.push(nt(a.id,o,i,a.tags))}return r}function xt(t,e){var r=[];r.size=t.size,void 0!==t.start&&(r.start=t.start,r.end=t.end);for(var n=0;n<t.length;n+=3)r.push(t[n]+e,t[n+1],t[n+2]);return r}function bt(t,e){if(t.transformed)return t;var r,n,i,a=1<<t.z,o=t.x,s=t.y;for(r=0;r<t.features.length;r++){var l=t.features[r],u=l.geometry,c=l.type;if(l.geometry=[],1===c)for(n=0;n<u.length;n+=2)l.geometry.push(wt(u[n],u[n+1],e,a,o,s));else for(n=0;n<u.length;n++){var p=[];for(i=0;i<u[n].length;i+=2)p.push(wt(u[n][i],u[n][i+1],e,a,o,s));l.geometry.push(p)}}return t.transformed=!0,t}function wt(t,e,r,n,i,a){return[Math.round(r*(t*n-i)),Math.round(r*(e*n-a))]}function kt(t,e,r,n,i){for(var a=e===i.maxZoom?0:i.tolerance/((1<<e)*i.extent),o={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:r,y:n,z:e,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},s=0;s<t.length;s++){o.numFeatures++,Tt(o,t[s],a,i);var l=t[s].minX,u=t[s].minY,c=t[s].maxX,p=t[s].maxY;l<o.minX&&(o.minX=l),u<o.minY&&(o.minY=u),c>o.maxX&&(o.maxX=c),p>o.maxY&&(o.maxY=p)}return o}function Tt(t,e,r,n){var i=e.geometry,a=e.type,o=[];if("Point"===a||"MultiPoint"===a)for(var s=0;s<i.length;s+=3)o.push(i[s]),o.push(i[s+1]),t.numPoints++,t.numSimplified++;else if("LineString"===a)At(o,i,t,r,!1,!1);else if("MultiLineString"===a||"Polygon"===a)for(s=0;s<i.length;s++)At(o,i[s],t,r,"Polygon"===a,0===s);else if("MultiPolygon"===a)for(var l=0;l<i.length;l++){var u=i[l];for(s=0;s<u.length;s++)At(o,u[s],t,r,!0,0===s)}if(o.length){var c=e.tags||null;if("LineString"===a&&n.lineMetrics){for(var p in c={},e.tags)c[p]=e.tags[p];c.mapbox_clip_start=i.start/i.size,c.mapbox_clip_end=i.end/i.size}var h={geometry:o,type:"Polygon"===a||"MultiPolygon"===a?3:"LineString"===a||"MultiLineString"===a?2:1,tags:c};null!==e.id&&(h.id=e.id),t.features.push(h)}}function At(t,e,r,n,i,a){var o=n*n;if(n>0&&e.size<(i?o:n))r.numPoints+=e.length/3;else{for(var s=[],l=0;l<e.length;l+=3)(0===n||e[l+2]>o)&&(r.numSimplified++,s.push(e[l]),s.push(e[l+1])),r.numPoints++;i&&function(t,e){for(var r=0,n=0,i=t.length,a=i-2;n<i;a=n,n+=2)r+=(t[n]-t[a])*(t[n+1]+t[a+1]);if(r>0===e)for(n=0,i=t.length;n<i/2;n+=2){var o=t[n],s=t[n+1];t[n]=t[i-2-n],t[n+1]=t[i-1-n],t[i-2-n]=o,t[i-1-n]=s}}(s,a),t.push(s)}}function Mt(t,e){var r=(e=this.options=function(t,e){for(var r in e)t[r]=e[r];return t}(Object.create(this.options),e)).debug;if(r&&console.time("preprocess data"),e.maxZoom<0||e.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(e.promoteId&&e.generateId)throw new Error("promoteId and generateId cannot be used together.");var n=function(t,e){var r=[];if("FeatureCollection"===t.type)for(var n=0;n<t.features.length;n++)at(r,t.features[n],e,n);else"Feature"===t.type?at(r,t,e):at(r,{geometry:t},e);return r}(t,e);this.tiles={},this.tileCoords=[],r&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",e.indexMaxZoom,e.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),(n=function(t,e){var r=e.buffer/e.extent,n=t,i=pt(t,1,-1-r,r,0,-1,2,e),a=pt(t,1,1-r,2+r,0,-1,2,e);return(i||a)&&(n=pt(t,1,-r,1+r,0,-1,2,e)||[],i&&(n=_t(i,1).concat(n)),a&&(n=n.concat(_t(a,-1)))),n}(n,e)).length&&this.splitTile(n,0,0,0),r&&(n.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}function St(t,e,r){return 32*((1<<t)*r+e)+t}function Lt(t,e){var r=t.tileID.canonical;if(!this._geoJSONIndex)return e(null,null);var n=this._geoJSONIndex.getTile(r.z,r.x,r.y);if(!n)return e(null,null);var i=new k(n.features),a=L(i);0===a.byteOffset&&a.byteLength===a.buffer.byteLength||(a=new Uint8Array(a)),e(null,{vectorTile:i,rawData:a.buffer})}Z.prototype.load=function(t){var e=this.options,r=e.log,n=e.minZoom,i=e.maxZoom,a=e.nodeSize;r&&console.time("total time");var o="prepare "+t.length+" points";r&&console.time(o),this.points=t;for(var s=[],l=0;l<t.length;l++)t[l].geometry&&s.push(W(t[l],l));this.trees[i+1]=new G(s,tt,et,a,Float32Array),r&&console.timeEnd(o);for(var u=i;u>=n;u--){var c=+Date.now();s=this._cluster(s,u),this.trees[u]=new G(s,tt,et,a,Float32Array),r&&console.log("z%d: %d clusters in %dms",u,s.length,+Date.now()-c)}return r&&console.timeEnd("total time"),this},Z.prototype.getClusters=function(t,e){var r=((t[0]+180)%360+360)%360-180,n=Math.max(-90,Math.min(90,t[1])),i=180===t[2]?180:((t[2]+180)%360+360)%360-180,a=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)r=-180,i=180;else if(r>i){var o=this.getClusters([r,n,180,a],e),s=this.getClusters([-180,n,i,a],e);return o.concat(s)}for(var l=this.trees[this._limitZoom(e)],u=[],c=0,p=l.range(J(r),$(a),J(i),$(n));c<p.length;c+=1){var h=p[c],f=l.points[h];u.push(f.numPoints?Y(f):this.points[f.index])}return u},Z.prototype.getChildren=function(t){var e=t>>5,r=t%32,n="No cluster with the specified id.",i=this.trees[r];if(!i)throw new Error(n);var a=i.points[e];if(!a)throw new Error(n);for(var o=this.options.radius/(this.options.extent*Math.pow(2,r-1)),s=[],l=0,u=i.within(a.x,a.y,o);l<u.length;l+=1){var c=u[l],p=i.points[c];p.parentId===t&&s.push(p.numPoints?Y(p):this.points[p.index])}if(0===s.length)throw new Error(n);return s},Z.prototype.getLeaves=function(t,e,r){e=e||10,r=r||0;var n=[];return this._appendLeaves(n,t,e,r,0),n},Z.prototype.getTile=function(t,e,r){var n=this.trees[this._limitZoom(t)],i=Math.pow(2,t),a=this.options,o=a.extent,s=a.radius/o,l=(r-s)/i,u=(r+1+s)/i,c={features:[]};return this._addTileFeatures(n.range((e-s)/i,l,(e+1+s)/i,u),n.points,e,r,i,c),0===e&&this._addTileFeatures(n.range(1-s/i,l,1,u),n.points,i,r,i,c),e===i-1&&this._addTileFeatures(n.range(0,l,s/i,u),n.points,-1,r,i,c),c.features.length?c:null},Z.prototype.getClusterExpansionZoom=function(t){for(var e=t%32-1;e<=this.options.maxZoom;){var r=this.getChildren(t);if(e++,1!==r.length)break;t=r[0].properties.cluster_id}return e},Z.prototype._appendLeaves=function(t,e,r,n,i){for(var a=0,o=this.getChildren(e);a<o.length;a+=1){var s=o[a],l=s.properties;if(l&&l.cluster?i+l.point_count<=n?i+=l.point_count:i=this._appendLeaves(t,l.cluster_id,r,n,i):i<n?i++:t.push(s),t.length===r)break}return i},Z.prototype._addTileFeatures=function(t,e,r,n,i,a){for(var o=0,s=t;o<s.length;o+=1){var l=e[s[o]],u={type:1,geometry:[[Math.round(this.options.extent*(l.x*i-r)),Math.round(this.options.extent*(l.y*i-n))]],tags:l.numPoints?K(l):this.points[l.index].properties},c=l.numPoints?l.id:this.points[l.index].id;void 0!==c&&(u.id=c),a.features.push(u)}},Z.prototype._limitZoom=function(t){return Math.max(this.options.minZoom,Math.min(t,this.options.maxZoom+1))},Z.prototype._cluster=function(t,e){for(var r=[],n=this.options,i=n.radius,a=n.extent,o=n.reduce,s=i/(a*Math.pow(2,e)),l=0;l<t.length;l++){var u=t[l];if(!(u.zoom<=e)){u.zoom=e;for(var c=this.trees[e+1],p=c.within(u.x,u.y,s),h=u.numPoints||1,f=u.x*h,d=u.y*h,m=o&&h>1?this._map(u,!0):null,y=(l<<5)+(e+1),g=0,v=p;g<v.length;g+=1){var _=v[g],x=c.points[_];if(!(x.zoom<=e)){x.zoom=e;var b=x.numPoints||1;f+=x.x*b,d+=x.y*b,h+=b,x.parentId=y,o&&(m||(m=this._map(u,!0)),o(m,this._map(x)))}}1===h?r.push(u):(u.parentId=y,r.push(X(f/h,d/h,y,h,m)))}}return r},Z.prototype._map=function(t,e){if(t.numPoints)return e?Q({},t.properties):t.properties;var r=this.points[t.index].properties,n=this.options.map(r);return e&&n===r?Q({},n):n},Mt.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},Mt.prototype.splitTile=function(t,e,r,n,i,a,o){for(var s=[t,e,r,n],l=this.options,u=l.debug;s.length;){n=s.pop(),r=s.pop(),e=s.pop(),t=s.pop();var c=1<<e,p=St(e,r,n),h=this.tiles[p];if(!h&&(u>1&&console.time("creation"),h=this.tiles[p]=kt(t,e,r,n,l),this.tileCoords.push({z:e,x:r,y:n}),u)){u>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,r,n,h.numFeatures,h.numPoints,h.numSimplified),console.timeEnd("creation"));var f="z"+e;this.stats[f]=(this.stats[f]||0)+1,this.total++}if(h.source=t,i){if(e===l.maxZoom||e===i)continue;var d=1<<i-e;if(r!==Math.floor(a/d)||n!==Math.floor(o/d))continue}else if(e===l.indexMaxZoom||h.numPoints<=l.indexMaxPoints)continue;if(h.source=null,0!==t.length){u>1&&console.time("clipping");var m,y,g,v,_,x,b=.5*l.buffer/l.extent,w=.5-b,k=.5+b,T=1+b;m=y=g=v=null,_=pt(t,c,r-b,r+k,0,h.minX,h.maxX,l),x=pt(t,c,r+w,r+T,0,h.minX,h.maxX,l),t=null,_&&(m=pt(_,c,n-b,n+k,1,h.minY,h.maxY,l),y=pt(_,c,n+w,n+T,1,h.minY,h.maxY,l),_=null),x&&(g=pt(x,c,n-b,n+k,1,h.minY,h.maxY,l),v=pt(x,c,n+w,n+T,1,h.minY,h.maxY,l),x=null),u>1&&console.timeEnd("clipping"),s.push(m||[],e+1,2*r,2*n),s.push(y||[],e+1,2*r,2*n+1),s.push(g||[],e+1,2*r+1,2*n),s.push(v||[],e+1,2*r+1,2*n+1)}}},Mt.prototype.getTile=function(t,e,r){var n=this.options,i=n.extent,a=n.debug;if(t<0||t>24)return null;var o=1<<t,s=St(t,e=(e%o+o)%o,r);if(this.tiles[s])return bt(this.tiles[s],i);a>1&&console.log("drilling down to z%d-%d-%d",t,e,r);for(var l,u=t,c=e,p=r;!l&&u>0;)u--,c=Math.floor(c/2),p=Math.floor(p/2),l=this.tiles[St(u,c,p)];return l&&l.source?(a>1&&console.log("found parent tile z%d-%d-%d",u,c,p),a>1&&console.time("drilling down"),this.splitTile(l.source,u,c,p,t,e,r),a>1&&console.timeEnd("drilling down"),this.tiles[s]?bt(this.tiles[s],i):null):null};var Ct=function(e){function r(t,r,n){e.call(this,t,r,Lt),n&&(this.loadGeoJSON=n)}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.loadData=function(t,e){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=e,this._pendingLoadDataParams=t,this._state&&"Idle"!==this._state?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())},r.prototype._loadData=function(){var e=this;if(this._pendingCallback&&this._pendingLoadDataParams){var r=this._pendingCallback,n=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var i=!!(n&&n.request&&n.request.collectResourceTiming)&&new l.Performance(n.request);this.loadGeoJSON(n,function(a,o){if(a||!o)return r(a);if("object"!=typeof o)return r(new Error("Input data given to '"+n.source+"' is not a valid GeoJSON object."));!function t(e,r){switch(e&&e.type||null){case"FeatureCollection":return e.features=e.features.map(v(t,r)),e;case"GeometryCollection":return e.geometries=e.geometries.map(v(t,r)),e;case"Feature":return e.geometry=t(e.geometry,r),e;case"Polygon":case"MultiPolygon":return function(t,e){return"Polygon"===t.type?t.coordinates=_(t.coordinates,e):"MultiPolygon"===t.type&&(t.coordinates=t.coordinates.map(v(_,e))),t}(e,r);default:return e}}(o,!0);try{e._geoJSONIndex=n.cluster?new Z(function(e){var r=e.superclusterOptions,n=e.clusterProperties;if(!n||!r)return r;for(var i={},a={},o={accumulated:null,zoom:0},s={properties:null},l=Object.keys(n),u=0,c=l;u<c.length;u+=1){var p=c[u],h=n[p],f=h[0],d=h[1],m=t.createExpression(d),y=t.createExpression("string"==typeof f?[f,["accumulated"],["get",p]]:f);i[p]=m.value,a[p]=y.value}return r.map=function(t){s.properties=t;for(var e={},r=0,n=l;r<n.length;r+=1){var a=n[r];e[a]=i[a].evaluate(o,s)}return e},r.reduce=function(t,e){s.properties=e;for(var r=0,n=l;r<n.length;r+=1){var i=n[r];o.accumulated=t[i],t[i]=a[i].evaluate(o,s)}},r}(n)).load(o.features):new Mt(o,n.geojsonVtOptions)}catch(a){return r(a)}e.loaded={};var s={};if(i){var l=i.finish();l&&(s.resourceTiming={},s.resourceTiming[n.source]=JSON.parse(JSON.stringify(l)))}r(null,s)})}},r.prototype.coalesce=function(){"Coalescing"===this._state?this._state="Idle":"NeedsLoadData"===this._state&&(this._state="Coalescing",this._loadData())},r.prototype.reloadTile=function(t,r){var n=this.loaded,i=t.uid;return n&&n[i]?e.prototype.reloadTile.call(this,t,r):this.loadTile(t,r)},r.prototype.loadGeoJSON=function(e,r){if(e.request)t.getJSON(e.request,r);else{if("string"!=typeof e.data)return r(new Error("Input data given to '"+e.source+"' is not a valid GeoJSON object."));try{return r(null,JSON.parse(e.data))}catch(t){return r(new Error("Input data given to '"+e.source+"' is not a valid GeoJSON object."))}}},r.prototype.removeSource=function(t,e){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),e()},r.prototype.getClusterExpansionZoom=function(t,e){e(null,this._geoJSONIndex.getClusterExpansionZoom(t.clusterId))},r.prototype.getClusterChildren=function(t,e){e(null,this._geoJSONIndex.getChildren(t.clusterId))},r.prototype.getClusterLeaves=function(t,e){e(null,this._geoJSONIndex.getLeaves(t.clusterId,t.limit,t.offset))},r}(p),Et=function(e){var r=this;this.self=e,this.actor=new t.Actor(e,this),this.layerIndexes={},this.workerSourceTypes={vector:p,geojson:Ct},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=function(t,e){if(r.workerSourceTypes[t])throw new Error('Worker source with name "'+t+'" already registered.');r.workerSourceTypes[t]=e},this.self.registerRTLTextPlugin=function(e){if(t.plugin.isLoaded())throw new Error("RTL text plugin already registered.");t.plugin.applyArabicShaping=e.applyArabicShaping,t.plugin.processBidirectionalText=e.processBidirectionalText,t.plugin.processStyledBidirectionalText=e.processStyledBidirectionalText}};return Et.prototype.setReferrer=function(t,e){this.referrer=e},Et.prototype.setLayers=function(t,e,r){this.getLayerIndex(t).replace(e),r()},Et.prototype.updateLayers=function(t,e,r){this.getLayerIndex(t).update(e.layers,e.removedIds),r()},Et.prototype.loadTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).loadTile(e,r)},Et.prototype.loadDEMTile=function(t,e,r){this.getDEMWorkerSource(t,e.source).loadTile(e,r)},Et.prototype.reloadTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).reloadTile(e,r)},Et.prototype.abortTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).abortTile(e,r)},Et.prototype.removeTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).removeTile(e,r)},Et.prototype.removeDEMTile=function(t,e){this.getDEMWorkerSource(t,e.source).removeTile(e)},Et.prototype.removeSource=function(t,e,r){if(this.workerSources[t]&&this.workerSources[t][e.type]&&this.workerSources[t][e.type][e.source]){var n=this.workerSources[t][e.type][e.source];delete this.workerSources[t][e.type][e.source],void 0!==n.removeSource?n.removeSource(e,r):r()}},Et.prototype.loadWorkerSource=function(t,e,r){try{this.self.importScripts(e.url),r()}catch(t){r(t.toString())}},Et.prototype.loadRTLTextPlugin=function(e,r,n){try{t.plugin.isLoaded()||(this.self.importScripts(r),n(t.plugin.isLoaded()?null:new Error("RTL Text Plugin failed to import scripts from "+r)))}catch(t){n(t.toString())}},Et.prototype.getLayerIndex=function(t){var e=this.layerIndexes[t];return e||(e=this.layerIndexes[t]=new n),e},Et.prototype.getWorkerSource=function(t,e,r){var n=this;if(this.workerSources[t]||(this.workerSources[t]={}),this.workerSources[t][e]||(this.workerSources[t][e]={}),!this.workerSources[t][e][r]){var i={send:function(e,r,i){n.actor.send(e,r,i,t)}};this.workerSources[t][e][r]=new this.workerSourceTypes[e](i,this.getLayerIndex(t))}return this.workerSources[t][e][r]},Et.prototype.getDEMWorkerSource=function(t,e){return this.demWorkerSources[t]||(this.demWorkerSources[t]={}),this.demWorkerSources[t][e]||(this.demWorkerSources[t][e]=new h),this.demWorkerSources[t][e]},Et.prototype.enforceCacheSizeLimit=function(e,r){t.enforceCacheSizeLimit(r)},"undefined"!=typeof WorkerGlobalScope&&void 0!==t.window&&t.window instanceof WorkerGlobalScope&&(t.window.worker=new Et(t.window)),Et}),n(0,function(t){var e=t.createCommonjsModule(function(t){function e(t){return!!("undefined"!=typeof window&&"undefined"!=typeof document&&Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray&&Function.prototype&&Function.prototype.bind&&Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions&&"JSON"in window&&"parse"in JSON&&"stringify"in JSON&&function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var t,e,r=new Blob([""],{type:"text/javascript"}),n=URL.createObjectURL(r);try{e=new Worker(n),t=!0}catch(e){t=!1}return e&&e.terminate(),URL.revokeObjectURL(n),t}()&&"Uint8ClampedArray"in window&&ArrayBuffer.isView&&function(t){return void 0===r[t]&&(r[t]=function(t){var r=document.createElement("canvas"),n=Object.create(e.webGLContextAttributes);return n.failIfMajorPerformanceCaveat=t,r.probablySupportsContext?r.probablySupportsContext("webgl",n)||r.probablySupportsContext("experimental-webgl",n):r.supportsContext?r.supportsContext("webgl",n)||r.supportsContext("experimental-webgl",n):r.getContext("webgl",n)||r.getContext("experimental-webgl",n)}(t)),r[t]}(t&&t.failIfMajorPerformanceCaveat))}t.exports?t.exports=e:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=e);var r={};e.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}}),r={create:function(e,r,n){var i=t.window.document.createElement(e);return void 0!==r&&(i.className=r),n&&n.appendChild(i),i},createNS:function(e,r){return t.window.document.createElementNS(e,r)}},n=t.window.document.documentElement.style;function i(t){if(!n)return t[0];for(var e=0;e<t.length;e++)if(t[e]in n)return t[e];return t[0]}var a,o=i(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]);r.disableDrag=function(){n&&o&&(a=n[o],n[o]="none")},r.enableDrag=function(){n&&o&&(n[o]=a)};var s=i(["transform","WebkitTransform"]);r.setTransform=function(t,e){t.style[s]=e};var l=!1;try{var u=Object.defineProperty({},"passive",{get:function(){l=!0}});t.window.addEventListener("test",u,u),t.window.removeEventListener("test",u,u)}catch(t){l=!1}r.addEventListener=function(t,e,r,n){void 0===n&&(n={}),"passive"in n&&l?t.addEventListener(e,r,n):t.addEventListener(e,r,n.capture)},r.removeEventListener=function(t,e,r,n){void 0===n&&(n={}),"passive"in n&&l?t.removeEventListener(e,r,n):t.removeEventListener(e,r,n.capture)};var c=function(e){e.preventDefault(),e.stopPropagation(),t.window.removeEventListener("click",c,!0)};function p(t){var e=t.userImage;return!!(e&&e.render&&e.render())&&(t.data.replace(new Uint8Array(e.data.buffer)),!0)}r.suppressClick=function(){t.window.addEventListener("click",c,!0),t.window.setTimeout(function(){t.window.removeEventListener("click",c,!0)},0)},r.mousePos=function(e,r){var n=e.getBoundingClientRect(),i=t.window.TouchEvent&&r instanceof t.window.TouchEvent?r.touches[0]:r;return new t.Point(i.clientX-n.left-e.clientLeft,i.clientY-n.top-e.clientTop)},r.touchPos=function(e,r){for(var n=e.getBoundingClientRect(),i=[],a="touchend"===r.type?r.changedTouches:r.touches,o=0;o<a.length;o++)i.push(new t.Point(a[o].clientX-n.left-e.clientLeft,a[o].clientY-n.top-e.clientTop));return i},r.mouseButton=function(e){return void 0!==t.window.InstallTrigger&&2===e.button&&e.ctrlKey&&t.window.navigator.platform.toUpperCase().indexOf("MAC")>=0?0:e.button},r.remove=function(t){t.parentNode&&t.parentNode.removeChild(t)};var h=function(e){function r(){e.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new t.RGBAImage({width:1,height:1}),this.dirty=!0}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.isLoaded=function(){return this.loaded},r.prototype.setLoaded=function(t){if(this.loaded!==t&&(this.loaded=t,t)){for(var e=0,r=this.requestors;e<r.length;e+=1){var n=r[e],i=n.ids,a=n.callback;this._notify(i,a)}this.requestors=[]}},r.prototype.getImage=function(t){return this.images[t]},r.prototype.addImage=function(t,e){this.images[t]=e},r.prototype.updateImage=function(t,e){var r=this.images[t];e.version=r.version+1,this.images[t]=e,this.updatedImages[t]=!0},r.prototype.removeImage=function(t){var e=this.images[t];delete this.images[t],delete this.patterns[t],e.userImage&&e.userImage.onRemove&&e.userImage.onRemove()},r.prototype.listImages=function(){return Object.keys(this.images)},r.prototype.getImages=function(t,e){var r=!0;if(!this.isLoaded())for(var n=0,i=t;n<i.length;n+=1){var a=i[n];this.images[a]||(r=!1)}this.isLoaded()||r?this._notify(t,e):this.requestors.push({ids:t,callback:e})},r.prototype._notify=function(e,r){for(var n={},i=0,a=e;i<a.length;i+=1){var o=a[i];this.images[o]||this.fire(new t.Event("styleimagemissing",{id:o}));var s=this.images[o];s?n[o]={data:s.data.clone(),pixelRatio:s.pixelRatio,sdf:s.sdf,version:s.version,hasRenderCallback:Boolean(s.userImage&&s.userImage.render)}:t.warnOnce('Image "'+o+'" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.')}r(null,n)},r.prototype.getPixelSize=function(){var t=this.atlasImage;return{width:t.width,height:t.height}},r.prototype.getPattern=function(e){var r=this.patterns[e],n=this.getImage(e);if(!n)return null;if(r&&r.position.version===n.version)return r.position;if(r)r.position.version=n.version;else{var i={w:n.data.width+2,h:n.data.height+2,x:0,y:0},a=new t.ImagePosition(i,n);this.patterns[e]={bin:i,position:a}}return this._updatePatternAtlas(),this.patterns[e].position},r.prototype.bind=function(e){var r=e.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new t.Texture(e,this.atlasImage,r.RGBA),this.atlasTexture.bind(r.LINEAR,r.CLAMP_TO_EDGE)},r.prototype._updatePatternAtlas=function(){var e=[];for(var r in this.patterns)e.push(this.patterns[r].bin);var n=t.potpack(e),i=n.w,a=n.h,o=this.atlasImage;for(var s in o.resize({width:i||1,height:a||1}),this.patterns){var l=this.patterns[s].bin,u=l.x+1,c=l.y+1,p=this.images[s].data,h=p.width,f=p.height;t.RGBAImage.copy(p,o,{x:0,y:0},{x:u,y:c},{width:h,height:f}),t.RGBAImage.copy(p,o,{x:0,y:f-1},{x:u,y:c-1},{width:h,height:1}),t.RGBAImage.copy(p,o,{x:0,y:0},{x:u,y:c+f},{width:h,height:1}),t.RGBAImage.copy(p,o,{x:h-1,y:0},{x:u-1,y:c},{width:1,height:f}),t.RGBAImage.copy(p,o,{x:0,y:0},{x:u+h,y:c},{width:1,height:f})}this.dirty=!0},r.prototype.beginFrame=function(){this.callbackDispatchedThisFrame={}},r.prototype.dispatchRenderCallbacks=function(t){for(var e=0,r=t;e<r.length;e+=1){var n=r[e];if(!this.callbackDispatchedThisFrame[n]){this.callbackDispatchedThisFrame[n]=!0;var i=this.images[n];p(i)&&this.updateImage(n,i)}}},r}(t.Evented),f=y,d=y,m=1e20;function y(t,e,r,n,i,a){this.fontSize=t||24,this.buffer=void 0===e?3:e,this.cutoff=n||.25,this.fontFamily=i||"sans-serif",this.fontWeight=a||"normal",this.radius=r||8;var o=this.size=this.fontSize+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=o,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textBaseline="middle",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(o*o),this.gridInner=new Float64Array(o*o),this.f=new Float64Array(o),this.d=new Float64Array(o),this.z=new Float64Array(o+1),this.v=new Int16Array(o),this.middle=Math.round(o/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function g(t,e,r,n,i,a,o){for(var s=0;s<e;s++){for(var l=0;l<r;l++)n[l]=t[l*e+s];for(v(n,i,a,o,r),l=0;l<r;l++)t[l*e+s]=i[l]}for(l=0;l<r;l++){for(s=0;s<e;s++)n[s]=t[l*e+s];for(v(n,i,a,o,e),s=0;s<e;s++)t[l*e+s]=Math.sqrt(i[s])}}function v(t,e,r,n,i){r[0]=0,n[0]=-m,n[1]=+m;for(var a=1,o=0;a<i;a++){for(var s=(t[a]+a*a-(t[r[o]]+r[o]*r[o]))/(2*a-2*r[o]);s<=n[o];)o--,s=(t[a]+a*a-(t[r[o]]+r[o]*r[o]))/(2*a-2*r[o]);r[++o]=a,n[o]=s,n[o+1]=+m}for(a=0,o=0;a<i;a++){for(;n[o+1]<a;)o++;e[a]=(a-r[o])*(a-r[o])+t[r[o]]}}y.prototype.draw=function(t){this.ctx.clearRect(0,0,this.size,this.size),this.ctx.fillText(t,this.buffer,this.middle);for(var e=this.ctx.getImageData(0,0,this.size,this.size),r=new Uint8ClampedArray(this.size*this.size),n=0;n<this.size*this.size;n++){var i=e.data[4*n+3]/255;this.gridOuter[n]=1===i?0:0===i?m:Math.pow(Math.max(0,.5-i),2),this.gridInner[n]=1===i?m:0===i?0:Math.pow(Math.max(0,i-.5),2)}for(g(this.gridOuter,this.size,this.size,this.f,this.d,this.v,this.z),g(this.gridInner,this.size,this.size,this.f,this.d,this.v,this.z),n=0;n<this.size*this.size;n++){var a=this.gridOuter[n]-this.gridInner[n];r[n]=Math.max(0,Math.min(255,Math.round(255-255*(a/this.radius+this.cutoff))))}return r},f.default=d;var _=function(t,e){this.requestManager=t,this.localIdeographFontFamily=e,this.entries={}};_.prototype.setURL=function(t){this.url=t},_.prototype.getGlyphs=function(e,r){var n=this,i=[];for(var a in e)for(var o=0,s=e[a];o<s.length;o+=1){var l=s[o];i.push({stack:a,id:l})}t.asyncAll(i,function(t,e){var r=t.stack,i=t.id,a=n.entries[r];a||(a=n.entries[r]={glyphs:{},requests:{}});var o=a.glyphs[i];if(void 0===o){if(o=n._tinySDF(a,r,i))return a.glyphs[i]=o,void e(null,{stack:r,id:i,glyph:o});var s=Math.floor(i/256);if(256*s>65535)e(new Error("glyphs > 65535 not supported"));else{var l=a.requests[s];l||(l=a.requests[s]=[],_.loadGlyphRange(r,s,n.url,n.requestManager,function(t,e){if(e)for(var r in e)n._doesCharSupportLocalGlyph(+r)||(a.glyphs[+r]=e[+r]);for(var i=0,o=l;i<o.length;i+=1)(0,o[i])(t,e);delete a.requests[s]})),l.push(function(t,n){t?e(t):n&&e(null,{stack:r,id:i,glyph:n[i]||null})})}}else e(null,{stack:r,id:i,glyph:o})},function(t,e){if(t)r(t);else if(e){for(var n={},i=0,a=e;i<a.length;i+=1){var o=a[i],s=o.stack,l=o.id,u=o.glyph;(n[s]||(n[s]={}))[l]=u&&{id:u.id,bitmap:u.bitmap.clone(),metrics:u.metrics}}r(null,n)}})},_.prototype._doesCharSupportLocalGlyph=function(e){return!!this.localIdeographFontFamily&&(t.isChar["CJK Unified Ideographs"](e)||t.isChar["Hangul Syllables"](e)||t.isChar.Hiragana(e)||t.isChar.Katakana(e))},_.prototype._tinySDF=function(e,r,n){var i=this.localIdeographFontFamily;if(i&&this._doesCharSupportLocalGlyph(n)){var a=e.tinySDF;if(!a){var o="400";/bold/i.test(r)?o="900":/medium/i.test(r)?o="500":/light/i.test(r)&&(o="200"),a=e.tinySDF=new _.TinySDF(24,3,8,.25,i,o)}return{id:n,bitmap:new t.AlphaImage({width:30,height:30},a.draw(String.fromCharCode(n))),metrics:{width:24,height:24,left:0,top:-8,advance:24}}}},_.loadGlyphRange=function(e,r,n,i,a){var o=256*r,s=o+255,l=i.transformRequest(i.normalizeGlyphsURL(n).replace("{fontstack}",e).replace("{range}",o+"-"+s),t.ResourceType.Glyphs);t.getArrayBuffer(l,function(e,r){if(e)a(e);else if(r){for(var n={},i=0,o=t.parseGlyphPBF(r);i<o.length;i+=1){var s=o[i];n[s.id]=s}a(null,n)}})},_.TinySDF=f;var x=function(){this.specification=t.styleSpec.light.position};x.prototype.possiblyEvaluate=function(e,r){return t.sphericalToCartesian(e.expression.evaluate(r))},x.prototype.interpolate=function(e,r,n){return{x:t.number(e.x,r.x,n),y:t.number(e.y,r.y,n),z:t.number(e.z,r.z,n)}};var b=new t.Properties({anchor:new t.DataConstantProperty(t.styleSpec.light.anchor),position:new x,color:new t.DataConstantProperty(t.styleSpec.light.color),intensity:new t.DataConstantProperty(t.styleSpec.light.intensity)}),w=function(e){function r(r){e.call(this),this._transitionable=new t.Transitionable(b),this.setLight(r),this._transitioning=this._transitionable.untransitioned()}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.getLight=function(){return this._transitionable.serialize()},r.prototype.setLight=function(e,r){if(void 0===r&&(r={}),!this._validate(t.validateLight,e,r))for(var n in e){var i=e[n];t.endsWith(n,"-transition")?this._transitionable.setTransition(n.slice(0,-"-transition".length),i):this._transitionable.setValue(n,i)}},r.prototype.updateTransitions=function(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)},r.prototype.hasTransition=function(){return this._transitioning.hasTransition()},r.prototype.recalculate=function(t){this.properties=this._transitioning.possiblyEvaluate(t)},r.prototype._validate=function(e,r,n){return(!n||!1!==n.validate)&&t.emitValidationErrors(this,e.call(t.validateStyle,t.extend({value:r,style:{glyphs:!0,sprite:!0},styleSpec:t.styleSpec})))},r}(t.Evented),k=function(t,e){this.width=t,this.height=e,this.nextRow=0,this.bytes=4,this.data=new Uint8Array(this.width*this.height*this.bytes),this.positions={}};k.prototype.getDash=function(t,e){var r=t.join(",")+String(e);return this.positions[r]||(this.positions[r]=this.addDash(t,e)),this.positions[r]},k.prototype.addDash=function(e,r){var n=r?7:0,i=2*n+1;if(this.nextRow+i>this.height)return t.warnOnce("LineAtlas out of space"),null;for(var a=0,o=0;o<e.length;o++)a+=e[o];for(var s=this.width/a,l=s/2,u=e.length%2==1,c=-n;c<=n;c++)for(var p=this.nextRow+n+c,h=this.width*p,f=u?-e[e.length-1]:0,d=e[0],m=1,y=0;y<this.width;y++){for(;d<y/s;)f=d,d+=e[m],u&&m===e.length-1&&(d+=e[0]),m++;var g=Math.abs(y-f*s),v=Math.abs(y-d*s),_=Math.min(g,v),x=m%2==1,b=void 0;if(r){var w=n?c/n*(l+1):0;if(x){var k=l-Math.abs(w);b=Math.sqrt(_*_+k*k)}else b=l-Math.sqrt(_*_+w*w)}else b=(x?1:-1)*_;this.data[3+4*(h+y)]=Math.max(0,Math.min(255,b+128))}var T={y:(this.nextRow+n+.5)/this.height,height:2*n/this.height,width:a};return this.nextRow+=i,this.dirty=!0,T},k.prototype.bind=function(t){var e=t.gl;this.texture?(e.bindTexture(e.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,e.texSubImage2D(e.TEXTURE_2D,0,0,0,this.width,this.height,e.RGBA,e.UNSIGNED_BYTE,this.data))):(this.texture=e.createTexture(),e.bindTexture(e.TEXTURE_2D,this.texture),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,this.width,this.height,0,e.RGBA,e.UNSIGNED_BYTE,this.data))};var T=function e(r,n){this.workerPool=r,this.actors=[],this.currentActor=0,this.id=t.uniqueId();for(var i=this.workerPool.acquire(this.id),a=0;a<i.length;a++){var o=i[a],s=new e.Actor(o,n,this.id);s.name="Worker "+a,this.actors.push(s)}};function A(e,r,n){var i=function(i,a){if(i)return n(i);if(a){var o=t.pick(t.extend(a,e),["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","scheme","tileSize","encoding"]);a.vector_layers&&(o.vectorLayers=a.vector_layers,o.vectorLayerIds=o.vectorLayers.map(function(t){return t.id})),e.url&&(o.tiles=r.canonicalizeTileset(o,e.url)),n(null,o)}};return e.url?t.getJSON(r.transformRequest(r.normalizeSourceURL(e.url),t.ResourceType.Source),i):t.browser.frame(function(){return i(null,e)})}T.prototype.broadcast=function(e,r,n){n=n||function(){},t.asyncAll(this.actors,function(t,n){t.send(e,r,n)},n)},T.prototype.getActor=function(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]},T.prototype.remove=function(){this.actors.forEach(function(t){t.remove()}),this.actors=[],this.workerPool.release(this.id)},T.Actor=t.Actor;var M=function(e,r,n){this.bounds=t.LngLatBounds.convert(this.validateBounds(e)),this.minzoom=r||0,this.maxzoom=n||24};M.prototype.validateBounds=function(t){return Array.isArray(t)&&4===t.length?[Math.max(-180,t[0]),Math.max(-90,t[1]),Math.min(180,t[2]),Math.min(90,t[3])]:[-180,-90,180,90]},M.prototype.contains=function(e){var r=Math.pow(2,e.z),n=Math.floor(t.mercatorXfromLng(this.bounds.getWest())*r),i=Math.floor(t.mercatorYfromLat(this.bounds.getNorth())*r),a=Math.ceil(t.mercatorXfromLng(this.bounds.getEast())*r),o=Math.ceil(t.mercatorYfromLat(this.bounds.getSouth())*r);return e.x>=n&&e.x<a&&e.y>=i&&e.y<o};var S=function(e){function r(r,n,i,a){if(e.call(this),this.id=r,this.dispatcher=i,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,t.extend(this,t.pick(n,["url","scheme","tileSize"])),this._options=t.extend({type:"vector"},n),this._collectResourceTiming=n.collectResourceTiming,512!==this.tileSize)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(a)}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.load=function(){var e=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=A(this._options,this.map._requestManager,function(r,n){e._tileJSONRequest=null,e._loaded=!0,r?e.fire(new t.ErrorEvent(r)):n&&(t.extend(e,n),n.bounds&&(e.tileBounds=new M(n.bounds,e.minzoom,e.maxzoom)),t.postTurnstileEvent(n.tiles,e.map._requestManager._customAccessToken),t.postMapLoadEvent(n.tiles,e.map._getMapId(),e.map._requestManager._skuToken,e.map._requestManager._customAccessToken),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})))})},r.prototype.loaded=function(){return this._loaded},r.prototype.hasTile=function(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)},r.prototype.onAdd=function(t){this.map=t,this.load()},r.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},r.prototype.serialize=function(){return t.extend({},this._options)},r.prototype.loadTile=function(e,r){var n=this.map._requestManager.normalizeTileURL(e.tileID.canonical.url(this.tiles,this.scheme),this.url,null),i={request:this.map._requestManager.transformRequest(n,t.ResourceType.Tile),uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,tileSize:this.tileSize*e.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:t.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes};function a(n,i){return delete e.request,e.aborted?r(null):n&&404!==n.status?r(n):(i&&i.resourceTiming&&(e.resourceTiming=i.resourceTiming),this.map._refreshExpiredTiles&&i&&e.setExpiryData(i),e.loadVectorData(i,this.map.painter),t.cacheEntryPossiblyAdded(this.dispatcher),r(null),void(e.reloadCallback&&(this.loadTile(e,e.reloadCallback),e.reloadCallback=null)))}i.request.collectResourceTiming=this._collectResourceTiming,e.actor&&"expired"!==e.state?"loading"===e.state?e.reloadCallback=r:e.request=e.actor.send("reloadTile",i,a.bind(this)):(e.actor=this.dispatcher.getActor(),e.request=e.actor.send("loadTile",i,a.bind(this)))},r.prototype.abortTile=function(t){t.request&&(t.request.cancel(),delete t.request),t.actor&&t.actor.send("abortTile",{uid:t.uid,type:this.type,source:this.id},void 0)},r.prototype.unloadTile=function(t){t.unloadVectorData(),t.actor&&t.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id},void 0)},r.prototype.hasTransition=function(){return!1},r}(t.Evented),L=function(e){function r(r,n,i,a){e.call(this),this.id=r,this.dispatcher=i,this.setEventedParent(a),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=t.extend({type:"raster"},n),t.extend(this,t.pick(n,["url","scheme","tileSize"]))}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.load=function(){var e=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=A(this._options,this.map._requestManager,function(r,n){e._tileJSONRequest=null,e._loaded=!0,r?e.fire(new t.ErrorEvent(r)):n&&(t.extend(e,n),n.bounds&&(e.tileBounds=new M(n.bounds,e.minzoom,e.maxzoom)),t.postTurnstileEvent(n.tiles),t.postMapLoadEvent(n.tiles,e.map._getMapId(),e.map._requestManager._skuToken),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})))})},r.prototype.loaded=function(){return this._loaded},r.prototype.onAdd=function(t){this.map=t,this.load()},r.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},r.prototype.serialize=function(){return t.extend({},this._options)},r.prototype.hasTile=function(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)},r.prototype.loadTile=function(e,r){var n=this,i=this.map._requestManager.normalizeTileURL(e.tileID.canonical.url(this.tiles,this.scheme),this.url,this.tileSize);e.request=t.getImage(this.map._requestManager.transformRequest(i,t.ResourceType.Tile),function(i,a){if(delete e.request,e.aborted)e.state="unloaded",r(null);else if(i)e.state="errored",r(i);else if(a){n.map._refreshExpiredTiles&&e.setExpiryData(a),delete a.cacheControl,delete a.expires;var o=n.map.painter.context,s=o.gl;e.texture=n.map.painter.getTileTexture(a.width),e.texture?e.texture.update(a,{useMipmap:!0}):(e.texture=new t.Texture(o,a,s.RGBA,{useMipmap:!0}),e.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE,s.LINEAR_MIPMAP_NEAREST),o.extTextureFilterAnisotropic&&s.texParameterf(s.TEXTURE_2D,o.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,o.extTextureFilterAnisotropicMax)),e.state="loaded",t.cacheEntryPossiblyAdded(n.dispatcher),r(null)}})},r.prototype.abortTile=function(t,e){t.request&&(t.request.cancel(),delete t.request),e()},r.prototype.unloadTile=function(t,e){t.texture&&this.map.painter.saveTileTexture(t.texture),e()},r.prototype.hasTransition=function(){return!1},r}(t.Evented),C=function(e){function r(r,n,i,a){e.call(this,r,n,i,a),this.type="raster-dem",this.maxzoom=22,this._options=t.extend({type:"raster-dem"},n),this.encoding=n.encoding||"mapbox"}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.serialize=function(){return{type:"raster-dem",url:this.url,tileSize:this.tileSize,tiles:this.tiles,bounds:this.bounds,encoding:this.encoding}},r.prototype.loadTile=function(e,r){var n=this.map._requestManager.normalizeTileURL(e.tileID.canonical.url(this.tiles,this.scheme),this.url,this.tileSize);e.request=t.getImage(this.map._requestManager.transformRequest(n,t.ResourceType.Tile),function(n,i){if(delete e.request,e.aborted)e.state="unloaded",r(null);else if(n)e.state="errored",r(n);else if(i){this.map._refreshExpiredTiles&&e.setExpiryData(i),delete i.cacheControl,delete i.expires;var a=t.browser.getImageData(i),o={uid:e.uid,coord:e.tileID,source:this.id,rawImageData:a,encoding:this.encoding};e.actor&&"expired"!==e.state||(e.actor=this.dispatcher.getActor(),e.actor.send("loadDEMTile",o,function(t,n){t&&(e.state="errored",r(t)),n&&(e.dem=n,e.needsHillshadePrepare=!0,e.state="loaded",r(null))}.bind(this)))}}.bind(this)),e.neighboringTiles=this._getNeighboringTiles(e.tileID)},r.prototype._getNeighboringTiles=function(e){var r=e.canonical,n=Math.pow(2,r.z),i=(r.x-1+n)%n,a=0===r.x?e.wrap-1:e.wrap,o=(r.x+1+n)%n,s=r.x+1===n?e.wrap+1:e.wrap,l={};return l[new t.OverscaledTileID(e.overscaledZ,a,r.z,i,r.y).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,s,r.z,o,r.y).key]={backfilled:!1},r.y>0&&(l[new t.OverscaledTileID(e.overscaledZ,a,r.z,i,r.y-1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,e.wrap,r.z,r.x,r.y-1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,s,r.z,o,r.y-1).key]={backfilled:!1}),r.y+1<n&&(l[new t.OverscaledTileID(e.overscaledZ,a,r.z,i,r.y+1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,e.wrap,r.z,r.x,r.y+1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,s,r.z,o,r.y+1).key]={backfilled:!1}),l},r.prototype.unloadTile=function(t){t.demTexture&&this.map.painter.saveTileTexture(t.demTexture),t.fbo&&(t.fbo.destroy(),delete t.fbo),t.dem&&delete t.dem,delete t.neighboringTiles,t.state="unloaded",t.actor&&t.actor.send("removeDEMTile",{uid:t.uid,source:this.id})},r}(L),E=function(e){function r(r,n,i,a){e.call(this),this.id=r,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._loaded=!1,this.actor=i.getActor(),this.setEventedParent(a),this._data=n.data,this._options=t.extend({},n),this._collectResourceTiming=n.collectResourceTiming,this._resourceTiming=[],void 0!==n.maxzoom&&(this.maxzoom=n.maxzoom),n.type&&(this.type=n.type),n.attribution&&(this.attribution=n.attribution);var o=t.EXTENT/this.tileSize;this.workerOptions=t.extend({source:this.id,cluster:n.cluster||!1,geojsonVtOptions:{buffer:(void 0!==n.buffer?n.buffer:128)*o,tolerance:(void 0!==n.tolerance?n.tolerance:.375)*o,extent:t.EXTENT,maxZoom:this.maxzoom,lineMetrics:n.lineMetrics||!1,generateId:n.generateId||!1},superclusterOptions:{maxZoom:void 0!==n.clusterMaxZoom?Math.min(n.clusterMaxZoom,this.maxzoom-1):this.maxzoom-1,extent:t.EXTENT,radius:(n.clusterRadius||50)*o,log:!1},clusterProperties:n.clusterProperties},n.workerOptions)}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.load=function(){var e=this;this.fire(new t.Event("dataloading",{dataType:"source"})),this._updateWorkerData(function(r){if(r)e.fire(new t.ErrorEvent(r));else{var n={dataType:"source",sourceDataType:"metadata"};e._collectResourceTiming&&e._resourceTiming&&e._resourceTiming.length>0&&(n.resourceTiming=e._resourceTiming,e._resourceTiming=[]),e.fire(new t.Event("data",n))}})},r.prototype.onAdd=function(t){this.map=t,this.load()},r.prototype.setData=function(e){var r=this;return this._data=e,this.fire(new t.Event("dataloading",{dataType:"source"})),this._updateWorkerData(function(e){if(e)r.fire(new t.ErrorEvent(e));else{var n={dataType:"source",sourceDataType:"content"};r._collectResourceTiming&&r._resourceTiming&&r._resourceTiming.length>0&&(n.resourceTiming=r._resourceTiming,r._resourceTiming=[]),r.fire(new t.Event("data",n))}}),this},r.prototype.getClusterExpansionZoom=function(t,e){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:t,source:this.id},e),this},r.prototype.getClusterChildren=function(t,e){return this.actor.send("geojson.getClusterChildren",{clusterId:t,source:this.id},e),this},r.prototype.getClusterLeaves=function(t,e,r,n){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:t,limit:e,offset:r},n),this},r.prototype._updateWorkerData=function(e){var r=this;this._loaded=!1;var n=t.extend({},this.workerOptions),i=this._data;"string"==typeof i?(n.request=this.map._requestManager.transformRequest(t.browser.resolveURL(i),t.ResourceType.Source),n.request.collectResourceTiming=this._collectResourceTiming):n.data=JSON.stringify(i),this.actor.send(this.type+".loadData",n,function(t,i){r._removed||i&&i.abandoned||(r._loaded=!0,i&&i.resourceTiming&&i.resourceTiming[r.id]&&(r._resourceTiming=i.resourceTiming[r.id].slice(0)),r.actor.send(r.type+".coalesce",{source:n.source},null),e(t))})},r.prototype.loaded=function(){return this._loaded},r.prototype.loadTile=function(e,r){var n=this,i=e.actor?"reloadTile":"loadTile";e.actor=this.actor;var a={type:this.type,uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:t.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes};e.request=this.actor.send(i,a,function(t,a){return delete e.request,e.unloadVectorData(),e.aborted?r(null):t?r(t):(e.loadVectorData(a,n.map.painter,"reloadTile"===i),r(null))})},r.prototype.abortTile=function(t){t.request&&(t.request.cancel(),delete t.request),t.aborted=!0},r.prototype.unloadTile=function(t){t.unloadVectorData(),this.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id})},r.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},r.prototype.serialize=function(){return t.extend({},this._options,{type:this.type,data:this._data})},r.prototype.hasTransition=function(){return!1},r}(t.Evented),z=function(e){function r(t,r,n,i){e.call(this),this.id=t,this.dispatcher=n,this.coordinates=r.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(i),this.options=r}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.load=function(e,r){var n=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this.url=this.options.url,t.getImage(this.map._requestManager.transformRequest(this.url,t.ResourceType.Image),function(i,a){n._loaded=!0,i?n.fire(new t.ErrorEvent(i)):a&&(n.image=a,e&&(n.coordinates=e),r&&r(),n._finishLoading())})},r.prototype.loaded=function(){return this._loaded},r.prototype.updateImage=function(t){var e=this;return this.image&&t.url?(this.options.url=t.url,this.load(t.coordinates,function(){e.texture=null}),this):this},r.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})))},r.prototype.onAdd=function(t){this.map=t,this.load()},r.prototype.setCoordinates=function(e){var r=this;this.coordinates=e;var n=e.map(t.MercatorCoordinate.fromLngLat);this.tileID=function(e){for(var r=1/0,n=1/0,i=-1/0,a=-1/0,o=0,s=e;o<s.length;o+=1){var l=s[o];r=Math.min(r,l.x),n=Math.min(n,l.y),i=Math.max(i,l.x),a=Math.max(a,l.y)}var u=i-r,c=a-n,p=Math.max(u,c),h=Math.max(0,Math.floor(-Math.log(p)/Math.LN2)),f=Math.pow(2,h);return new t.CanonicalTileID(h,Math.floor((r+i)/2*f),Math.floor((n+a)/2*f))}(n),this.minzoom=this.maxzoom=this.tileID.z;var i=n.map(function(t){return r.tileID.getTilePoint(t)._round()});return this._boundsArray=new t.StructArrayLayout4i8,this._boundsArray.emplaceBack(i[0].x,i[0].y,0,0),this._boundsArray.emplaceBack(i[1].x,i[1].y,t.EXTENT,0),this._boundsArray.emplaceBack(i[3].x,i[3].y,0,t.EXTENT),this._boundsArray.emplaceBack(i[2].x,i[2].y,t.EXTENT,t.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})),this},r.prototype.prepare=function(){if(0!==Object.keys(this.tiles).length&&this.image){var e=this.map.painter.context,r=e.gl;for(var n in this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,t.rasterBoundsAttributes.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new t.Texture(e,this.image,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE)),this.tiles){var i=this.tiles[n];"loaded"!==i.state&&(i.state="loaded",i.texture=this.texture)}}},r.prototype.loadTile=function(t,e){this.tileID&&this.tileID.equals(t.tileID.canonical)?(this.tiles[String(t.tileID.wrap)]=t,t.buckets={},e(null)):(t.state="errored",e(null))},r.prototype.serialize=function(){return{type:"image",url:this.options.url,coordinates:this.coordinates}},r.prototype.hasTransition=function(){return!1},r}(t.Evented),P=function(e){function r(t,r,n,i){e.call(this,t,r,n,i),this.roundZoom=!0,this.type="video",this.options=r}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.load=function(){var e=this;this._loaded=!1;var r=this.options;this.urls=[];for(var n=0,i=r.urls;n<i.length;n+=1){var a=i[n];this.urls.push(this.map._requestManager.transformRequest(a,t.ResourceType.Source).url)}t.getVideo(this.urls,function(r,n){e._loaded=!0,r?e.fire(new t.ErrorEvent(r)):n&&(e.video=n,e.video.loop=!0,e.video.addEventListener("playing",function(){e.map.triggerRepaint()}),e.map&&e.video.play(),e._finishLoading())})},r.prototype.pause=function(){this.video&&this.video.pause()},r.prototype.play=function(){this.video&&this.video.play()},r.prototype.seek=function(e){if(this.video){var r=this.video.seekable;e<r.start(0)||e>r.end(0)?this.fire(new t.ErrorEvent(new t.ValidationError("Playback for this video can be set only between the "+r.start(0)+" and "+r.end(0)+"-second mark."))):this.video.currentTime=e}},r.prototype.getVideo=function(){return this.video},r.prototype.onAdd=function(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},r.prototype.prepare=function(){if(!(0===Object.keys(this.tiles).length||this.video.readyState<2)){var e=this.map.painter.context,r=e.gl;for(var n in this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,t.rasterBoundsAttributes.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE),r.texSubImage2D(r.TEXTURE_2D,0,0,0,r.RGBA,r.UNSIGNED_BYTE,this.video)):(this.texture=new t.Texture(e,this.video,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE)),this.tiles){var i=this.tiles[n];"loaded"!==i.state&&(i.state="loaded",i.texture=this.texture)}}},r.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},r.prototype.hasTransition=function(){return this.video&&!this.video.paused},r}(z),I=function(e){function r(r,n,i,a){e.call(this,r,n,i,a),n.coordinates?Array.isArray(n.coordinates)&&4===n.coordinates.length&&!n.coordinates.some(function(t){return!Array.isArray(t)||2!==t.length||t.some(function(t){return"number"!=typeof t})})||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'missing required property "coordinates"'))),n.animate&&"boolean"!=typeof n.animate&&this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'optional "animate" property must be a boolean value'))),n.canvas?"string"==typeof n.canvas||n.canvas instanceof t.window.HTMLCanvasElement||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'missing required property "canvas"'))),this.options=n,this.animate=void 0===n.animate||n.animate}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.load=function(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof t.window.HTMLCanvasElement?this.options.canvas:t.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new t.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())},r.prototype.getCanvas=function(){return this.canvas},r.prototype.onAdd=function(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()},r.prototype.onRemove=function(){this.pause()},r.prototype.prepare=function(){var e=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,e=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,e=!0),!this._hasInvalidDimensions()&&0!==Object.keys(this.tiles).length){var r=this.map.painter.context,n=r.gl;for(var i in this.boundsBuffer||(this.boundsBuffer=r.createVertexBuffer(this._boundsArray,t.rasterBoundsAttributes.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(e||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new t.Texture(r,this.canvas,n.RGBA,{premultiply:!0}),this.tiles){var a=this.tiles[i];"loaded"!==a.state&&(a.state="loaded",a.texture=this.texture)}}},r.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},r.prototype.hasTransition=function(){return this._playing},r.prototype._hasInvalidDimensions=function(){for(var t=0,e=[this.canvas.width,this.canvas.height];t<e.length;t+=1){var r=e[t];if(isNaN(r)||r<=0)return!0}return!1},r}(z),D={vector:S,raster:L,"raster-dem":C,geojson:E,video:P,image:z,canvas:I},O=function(e,r,n,i){var a=new D[r.type](e,r,n,i);if(a.id!==e)throw new Error("Expected Source id to be "+e+" instead of "+a.id);return t.bindAll(["load","abort","unload","serialize","prepare"],a),a};function R(e,r){var n=t.identity([]);return t.translate(n,n,[1,1,0]),t.scale(n,n,[.5*e.width,.5*e.height,1]),t.multiply(n,n,e.calculatePosMatrix(r.toUnwrapped()))}function F(t,e,r,n,i){var a=function(t,e,r){if(t)for(var n=0,i=t;n<i.length;n+=1){var a=e[i[n]];if(a&&a.source===r&&"fill-extrusion"===a.type)return!0}else for(var o in e){var s=e[o];if(s.source===r&&"fill-extrusion"===s.type)return!0}return!1}(n&&n.layers,e,t.id),o=i.maxPitchScaleFactor(),s=t.tilesIn(r,o,a);s.sort(B);for(var l=[],u=0,c=s;u<c.length;u+=1){var p=c[u];l.push({wrappedTileID:p.tileID.wrapped().key,queryResults:p.tile.queryRenderedFeatures(e,t._state,p.queryGeometry,p.cameraQueryGeometry,p.scale,n,i,o,R(t.transform,p.tileID))})}var h=function(t){for(var e={},r={},n=0,i=t;n<i.length;n+=1){var a=i[n],o=a.queryResults,s=a.wrappedTileID,l=r[s]=r[s]||{};for(var u in o)for(var c=o[u],p=l[u]=l[u]||{},h=e[u]=e[u]||[],f=0,d=c;f<d.length;f+=1){var m=d[f];p[m.featureIndex]||(p[m.featureIndex]=!0,h.push(m))}}return e}(l);for(var f in h)h[f].forEach(function(e){var r=e.feature,n=t.getFeatureState(r.layer["source-layer"],r.id);r.source=r.layer.source,r.layer["source-layer"]&&(r.sourceLayer=r.layer["source-layer"]),r.state=n});return h}function B(t,e){var r=t.tileID,n=e.tileID;return r.overscaledZ-n.overscaledZ||r.canonical.y-n.canonical.y||r.wrap-n.wrap||r.canonical.x-n.canonical.x}var N=function(t,e){this.max=t,this.onRemove=e,this.reset()};N.prototype.reset=function(){for(var t in this.data)for(var e=0,r=this.data[t];e<r.length;e+=1){var n=r[e];n.timeout&&clearTimeout(n.timeout),this.onRemove(n.value)}return this.data={},this.order=[],this},N.prototype.add=function(t,e,r){var n=this,i=t.wrapped().key;void 0===this.data[i]&&(this.data[i]=[]);var a={value:e,timeout:void 0};if(void 0!==r&&(a.timeout=setTimeout(function(){n.remove(t,a)},r)),this.data[i].push(a),this.order.push(i),this.order.length>this.max){var o=this._getAndRemoveByKey(this.order[0]);o&&this.onRemove(o)}return this},N.prototype.has=function(t){return t.wrapped().key in this.data},N.prototype.getAndRemove=function(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null},N.prototype._getAndRemoveByKey=function(t){var e=this.data[t].shift();return e.timeout&&clearTimeout(e.timeout),0===this.data[t].length&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),e.value},N.prototype.get=function(t){return this.has(t)?this.data[t.wrapped().key][0].value:null},N.prototype.remove=function(t,e){if(!this.has(t))return this;var r=t.wrapped().key,n=void 0===e?0:this.data[r].indexOf(e),i=this.data[r][n];return this.data[r].splice(n,1),i.timeout&&clearTimeout(i.timeout),0===this.data[r].length&&delete this.data[r],this.onRemove(i.value),this.order.splice(this.order.indexOf(r),1),this},N.prototype.setMaxSize=function(t){for(this.max=t;this.order.length>this.max;){var e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}return this};var U=function(t,e,r){this.context=t;var n=t.gl;this.buffer=n.createBuffer(),this.dynamicDraw=Boolean(r),this.context.unbindVAO(),t.bindElementBuffer.set(this.buffer),n.bufferData(n.ELEMENT_ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?n.DYNAMIC_DRAW:n.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer};U.prototype.bind=function(){this.context.bindElementBuffer.set(this.buffer)},U.prototype.updateData=function(t){var e=this.context.gl;this.context.unbindVAO(),this.bind(),e.bufferSubData(e.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer)},U.prototype.destroy=function(){var t=this.context.gl;this.buffer&&(t.deleteBuffer(this.buffer),delete this.buffer)};var j={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"},V=function(t,e,r,n){this.length=e.length,this.attributes=r,this.itemSize=e.bytesPerElement,this.dynamicDraw=n,this.context=t;var i=t.gl;this.buffer=i.createBuffer(),t.bindVertexBuffer.set(this.buffer),i.bufferData(i.ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?i.DYNAMIC_DRAW:i.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer};V.prototype.bind=function(){this.context.bindVertexBuffer.set(this.buffer)},V.prototype.updateData=function(t){var e=this.context.gl;this.bind(),e.bufferSubData(e.ARRAY_BUFFER,0,t.arrayBuffer)},V.prototype.enableAttributes=function(t,e){for(var r=0;r<this.attributes.length;r++){var n=this.attributes[r],i=e.attributes[n.name];void 0!==i&&t.enableVertexAttribArray(i)}},V.prototype.setVertexAttribPointers=function(t,e,r){for(var n=0;n<this.attributes.length;n++){var i=this.attributes[n],a=e.attributes[i.name];void 0!==a&&t.vertexAttribPointer(a,i.components,t[j[i.type]],!1,this.itemSize,i.offset+this.itemSize*(r||0))}},V.prototype.destroy=function(){var t=this.context.gl;this.buffer&&(t.deleteBuffer(this.buffer),delete this.buffer)};var q=function(t){this.gl=t.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1};q.prototype.get=function(){return this.current},q.prototype.set=function(t){},q.prototype.getDefault=function(){return this.default},q.prototype.setDefault=function(){this.set(this.default)};var G=function(e){function r(){e.apply(this,arguments)}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.getDefault=function(){return t.Color.transparent},r.prototype.set=function(t){var e=this.current;(t.r!==e.r||t.g!==e.g||t.b!==e.b||t.a!==e.a||this.dirty)&&(this.gl.clearColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)},r}(q),H=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return 1},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.clearDepth(t),this.current=t,this.dirty=!1)},e}(q),Z=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return 0},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.clearStencil(t),this.current=t,this.dirty=!1)},e}(q),X=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return[!0,!0,!0,!0]},e.prototype.set=function(t){var e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||t[3]!==e[3]||this.dirty)&&(this.gl.colorMask(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)},e}(q),W=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return!0},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.depthMask(t),this.current=t,this.dirty=!1)},e}(q),Y=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return 255},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.stencilMask(t),this.current=t,this.dirty=!1)},e}(q),K=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return{func:this.gl.ALWAYS,ref:0,mask:255}},e.prototype.set=function(t){var e=this.current;(t.func!==e.func||t.ref!==e.ref||t.mask!==e.mask||this.dirty)&&(this.gl.stencilFunc(t.func,t.ref,t.mask),this.current=t,this.dirty=!1)},e}(q),J=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){var t=this.gl;return[t.KEEP,t.KEEP,t.KEEP]},e.prototype.set=function(t){var e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||this.dirty)&&(this.gl.stencilOp(t[0],t[1],t[2]),this.current=t,this.dirty=!1)},e}(q),$=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;t?e.enable(e.STENCIL_TEST):e.disable(e.STENCIL_TEST),this.current=t,this.dirty=!1}},e}(q),Q=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return[0,1]},e.prototype.set=function(t){var e=this.current;(t[0]!==e[0]||t[1]!==e[1]||this.dirty)&&(this.gl.depthRange(t[0],t[1]),this.current=t,this.dirty=!1)},e}(q),tt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;t?e.enable(e.DEPTH_TEST):e.disable(e.DEPTH_TEST),this.current=t,this.dirty=!1}},e}(q),et=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return this.gl.LESS},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.depthFunc(t),this.current=t,this.dirty=!1)},e}(q),rt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;t?e.enable(e.BLEND):e.disable(e.BLEND),this.current=t,this.dirty=!1}},e}(q),nt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){var t=this.gl;return[t.ONE,t.ZERO]},e.prototype.set=function(t){var e=this.current;(t[0]!==e[0]||t[1]!==e[1]||this.dirty)&&(this.gl.blendFunc(t[0],t[1]),this.current=t,this.dirty=!1)},e}(q),it=function(e){function r(){e.apply(this,arguments)}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.getDefault=function(){return t.Color.transparent},r.prototype.set=function(t){var e=this.current;(t.r!==e.r||t.g!==e.g||t.b!==e.b||t.a!==e.a||this.dirty)&&(this.gl.blendColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)},r}(q),at=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return this.gl.FUNC_ADD},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.blendEquation(t),this.current=t,this.dirty=!1)},e}(q),ot=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;t?e.enable(e.CULL_FACE):e.disable(e.CULL_FACE),this.current=t,this.dirty=!1}},e}(q),st=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return this.gl.BACK},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.cullFace(t),this.current=t,this.dirty=!1)},e}(q),lt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return this.gl.CCW},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.frontFace(t),this.current=t,this.dirty=!1)},e}(q),ut=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.useProgram(t),this.current=t,this.dirty=!1)},e}(q),ct=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return this.gl.TEXTURE0},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.activeTexture(t),this.current=t,this.dirty=!1)},e}(q),pt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){var t=this.gl;return[0,0,t.drawingBufferWidth,t.drawingBufferHeight]},e.prototype.set=function(t){var e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||t[3]!==e[3]||this.dirty)&&(this.gl.viewport(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)},e}(q),ht=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.bindFramebuffer(e.FRAMEBUFFER,t),this.current=t,this.dirty=!1}},e}(q),ft=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.bindRenderbuffer(e.RENDERBUFFER,t),this.current=t,this.dirty=!1}},e}(q),dt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.bindTexture(e.TEXTURE_2D,t),this.current=t,this.dirty=!1}},e}(q),mt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.bindBuffer(e.ARRAY_BUFFER,t),this.current=t,this.dirty=!1}},e}(q),yt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){var e=this.gl;e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t),this.current=t,this.dirty=!1},e}(q),gt=function(t){function e(e){t.call(this,e),this.vao=e.extVertexArrayObject}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){this.vao&&(t!==this.current||this.dirty)&&(this.vao.bindVertexArrayOES(t),this.current=t,this.dirty=!1)},e}(q),vt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return 4},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.pixelStorei(e.UNPACK_ALIGNMENT,t),this.current=t,this.dirty=!1}},e}(q),_t=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t),this.current=t,this.dirty=!1}},e}(q),xt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,t),this.current=t,this.dirty=!1}},e}(q),bt=function(t){function e(e,r){t.call(this,e),this.context=e,this.parent=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDefault=function(){return null},e}(q),wt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setDirty=function(){this.dirty=!0},e.prototype.set=function(t){if(t!==this.current||this.dirty){this.context.bindFramebuffer.set(this.parent);var e=this.gl;e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0),this.current=t,this.dirty=!1}},e}(bt),kt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){if(t!==this.current||this.dirty){this.context.bindFramebuffer.set(this.parent);var e=this.gl;e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,t),this.current=t,this.dirty=!1}},e}(bt),Tt=function(t,e,r){this.context=t,this.width=e,this.height=r;var n=t.gl,i=this.framebuffer=n.createFramebuffer();this.colorAttachment=new wt(t,i),this.depthAttachment=new kt(t,i)};Tt.prototype.destroy=function(){var t=this.context.gl,e=this.colorAttachment.get();e&&t.deleteTexture(e);var r=this.depthAttachment.get();r&&t.deleteRenderbuffer(r),t.deleteFramebuffer(this.framebuffer)};var At=function(t,e,r){this.func=t,this.mask=e,this.range=r};At.ReadOnly=!1,At.ReadWrite=!0,At.disabled=new At(519,At.ReadOnly,[0,1]);var Mt=function(t,e,r,n,i,a){this.test=t,this.ref=e,this.mask=r,this.fail=n,this.depthFail=i,this.pass=a};Mt.disabled=new Mt({func:519,mask:0},0,0,7680,7680,7680);var St=function(t,e,r){this.blendFunction=t,this.blendColor=e,this.mask=r};St.disabled=new St(St.Replace=[1,0],t.Color.transparent,[!1,!1,!1,!1]),St.unblended=new St(St.Replace,t.Color.transparent,[!0,!0,!0,!0]),St.alphaBlended=new St([1,771],t.Color.transparent,[!0,!0,!0,!0]);var Lt=function(t,e,r){this.enable=t,this.mode=e,this.frontFace=r};Lt.disabled=new Lt(!1,1029,2305),Lt.backCCW=new Lt(!0,1029,2305);var Ct=function(t){this.gl=t,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),this.clearColor=new G(this),this.clearDepth=new H(this),this.clearStencil=new Z(this),this.colorMask=new X(this),this.depthMask=new W(this),this.stencilMask=new Y(this),this.stencilFunc=new K(this),this.stencilOp=new J(this),this.stencilTest=new $(this),this.depthRange=new Q(this),this.depthTest=new tt(this),this.depthFunc=new et(this),this.blend=new rt(this),this.blendFunc=new nt(this),this.blendColor=new it(this),this.blendEquation=new at(this),this.cullFace=new ot(this),this.cullFaceSide=new st(this),this.frontFace=new lt(this),this.program=new ut(this),this.activeTexture=new ct(this),this.viewport=new pt(this),this.bindFramebuffer=new ht(this),this.bindRenderbuffer=new ft(this),this.bindTexture=new dt(this),this.bindVertexBuffer=new mt(this),this.bindElementBuffer=new yt(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new gt(this),this.pixelStoreUnpack=new vt(this),this.pixelStoreUnpackPremultiplyAlpha=new _t(this),this.pixelStoreUnpackFlipY=new xt(this),this.extTextureFilterAnisotropic=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=t.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.extTextureHalfFloat=t.getExtension("OES_texture_half_float"),this.extTextureHalfFloat&&t.getExtension("OES_texture_half_float_linear")};Ct.prototype.setDefault=function(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()},Ct.prototype.setDirty=function(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.extVertexArrayObject&&(this.bindVertexArrayOES.dirty=!0),this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0},Ct.prototype.createIndexBuffer=function(t,e){return new U(this,t,e)},Ct.prototype.createVertexBuffer=function(t,e,r){return new V(this,t,e,r)},Ct.prototype.createRenderbuffer=function(t,e,r){var n=this.gl,i=n.createRenderbuffer();return this.bindRenderbuffer.set(i),n.renderbufferStorage(n.RENDERBUFFER,t,e,r),this.bindRenderbuffer.set(null),i},Ct.prototype.createFramebuffer=function(t,e){return new Tt(this,t,e)},Ct.prototype.clear=function(t){var e=t.color,r=t.depth,n=this.gl,i=0;e&&(i|=n.COLOR_BUFFER_BIT,this.clearColor.set(e),this.colorMask.set([!0,!0,!0,!0])),void 0!==r&&(i|=n.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(r),this.depthMask.set(!0)),n.clear(i)},Ct.prototype.setCullFace=function(t){!1===t.enable?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(t.mode),this.frontFace.set(t.frontFace))},Ct.prototype.setDepthMode=function(t){t.func!==this.gl.ALWAYS||t.mask?(this.depthTest.set(!0),this.depthFunc.set(t.func),this.depthMask.set(t.mask),this.depthRange.set(t.range)):this.depthTest.set(!1)},Ct.prototype.setStencilMode=function(t){t.test.func!==this.gl.ALWAYS||t.mask?(this.stencilTest.set(!0),this.stencilMask.set(t.mask),this.stencilOp.set([t.fail,t.depthFail,t.pass]),this.stencilFunc.set({func:t.test.func,ref:t.ref,mask:t.test.mask})):this.stencilTest.set(!1)},Ct.prototype.setColorMode=function(e){t.deepEqual(e.blendFunction,St.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(e.blendFunction),this.blendColor.set(e.blendColor)),this.colorMask.set(e.mask)},Ct.prototype.unbindVAO=function(){this.extVertexArrayObject&&this.bindVertexArrayOES.set(null)};var Et=function(e){function r(r,n,i){var a=this;e.call(this),this.id=r,this.dispatcher=i,this.on("data",function(t){"source"===t.dataType&&"metadata"===t.sourceDataType&&(a._sourceLoaded=!0),a._sourceLoaded&&!a._paused&&"source"===t.dataType&&"content"===t.sourceDataType&&(a.reload(),a.transform&&a.update(a.transform))}),this.on("error",function(){a._sourceErrored=!0}),this._source=O(r,n,i,this),this._tiles={},this._cache=new N(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._coveredTiles={},this._state=new t.SourceFeatureState}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.onAdd=function(t){this.map=t,this._maxTileCacheSize=t?t._maxTileCacheSize:null,this._source&&this._source.onAdd&&this._source.onAdd(t)},r.prototype.onRemove=function(t){this._source&&this._source.onRemove&&this._source.onRemove(t)},r.prototype.loaded=function(){if(this._sourceErrored)return!0;if(!this._sourceLoaded)return!1;if(!this._source.loaded())return!1;for(var t in this._tiles){var e=this._tiles[t];if("loaded"!==e.state&&"errored"!==e.state)return!1}return!0},r.prototype.getSource=function(){return this._source},r.prototype.pause=function(){this._paused=!0},r.prototype.resume=function(){if(this._paused){var t=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,t&&this.reload(),this.transform&&this.update(this.transform)}},r.prototype._loadTile=function(t,e){return this._source.loadTile(t,e)},r.prototype._unloadTile=function(t){if(this._source.unloadTile)return this._source.unloadTile(t,function(){})},r.prototype._abortTile=function(t){if(this._source.abortTile)return this._source.abortTile(t,function(){})},r.prototype.serialize=function(){return this._source.serialize()},r.prototype.prepare=function(t){for(var e in this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null),this._tiles){var r=this._tiles[e];r.upload(t),r.prepare(this.map.style.imageManager)}},r.prototype.getIds=function(){return Object.keys(this._tiles).map(Number).sort(zt)},r.prototype.getRenderableIds=function(e){var r=this,n=[];for(var i in this._tiles)this._isIdRenderable(+i,e)&&n.push(+i);return e?n.sort(function(e,n){var i=r._tiles[e].tileID,a=r._tiles[n].tileID,o=new t.Point(i.canonical.x,i.canonical.y)._rotate(r.transform.angle),s=new t.Point(a.canonical.x,a.canonical.y)._rotate(r.transform.angle);return i.overscaledZ-a.overscaledZ||s.y-o.y||s.x-o.x}):n.sort(zt)},r.prototype.hasRenderableParent=function(t){var e=this.findLoadedParent(t,0);return!!e&&this._isIdRenderable(e.tileID.key)},r.prototype._isIdRenderable=function(t,e){return this._tiles[t]&&this._tiles[t].hasData()&&!this._coveredTiles[t]&&(e||!this._tiles[t].holdingForFade())},r.prototype.reload=function(){if(this._paused)this._shouldReloadOnResume=!0;else for(var t in this._cache.reset(),this._tiles)"errored"!==this._tiles[t].state&&this._reloadTile(t,"reloading")},r.prototype._reloadTile=function(t,e){var r=this._tiles[t];r&&("loading"!==r.state&&(r.state=e),this._loadTile(r,this._tileLoaded.bind(this,r,t,e)))},r.prototype._tileLoaded=function(e,r,n,i){if(i)return e.state="errored",void(404!==i.status?this._source.fire(new t.ErrorEvent(i,{tile:e})):this.update(this.transform));e.timeAdded=t.browser.now(),"expired"===n&&(e.refreshedUponExpiration=!0),this._setTileReloadTimer(r,e),"raster-dem"===this.getSource().type&&e.dem&&this._backfillDEM(e),this._state.initializeTileState(e,this.map?this.map.painter:null),this._source.fire(new t.Event("data",{dataType:"source",tile:e,coord:e.tileID}))},r.prototype._backfillDEM=function(t){for(var e=this.getRenderableIds(),r=0;r<e.length;r++){var n=e[r];if(t.neighboringTiles&&t.neighboringTiles[n]){var i=this.getTileByID(n);a(t,i),a(i,t)}}function a(t,e){t.needsHillshadePrepare=!0;var r=e.tileID.canonical.x-t.tileID.canonical.x,n=e.tileID.canonical.y-t.tileID.canonical.y,i=Math.pow(2,t.tileID.canonical.z),a=e.tileID.key;0===r&&0===n||Math.abs(n)>1||(Math.abs(r)>1&&(1===Math.abs(r+i)?r+=i:1===Math.abs(r-i)&&(r-=i)),e.dem&&t.dem&&(t.dem.backfillBorder(e.dem,r,n),t.neighboringTiles&&t.neighboringTiles[a]&&(t.neighboringTiles[a].backfilled=!0)))}},r.prototype.getTile=function(t){return this.getTileByID(t.key)},r.prototype.getTileByID=function(t){return this._tiles[t]},r.prototype.getZoom=function(t){return t.zoom+t.scaleZoom(t.tileSize/this._source.tileSize)},r.prototype._retainLoadedChildren=function(t,e,r,n){for(var i in this._tiles){var a=this._tiles[i];if(!(n[i]||!a.hasData()||a.tileID.overscaledZ<=e||a.tileID.overscaledZ>r)){for(var o=a.tileID;a&&a.tileID.overscaledZ>e+1;){var s=a.tileID.scaledTo(a.tileID.overscaledZ-1);(a=this._tiles[s.key])&&a.hasData()&&(o=s)}for(var l=o;l.overscaledZ>e;)if(t[(l=l.scaledTo(l.overscaledZ-1)).key]){n[o.key]=o;break}}}},r.prototype.findLoadedParent=function(t,e){for(var r=t.overscaledZ-1;r>=e;r--){var n=t.scaledTo(r);if(!n)return;var i=String(n.key),a=this._tiles[i];if(a&&a.hasData())return a;if(this._cache.has(n))return this._cache.get(n)}},r.prototype.updateCacheSize=function(t){var e=(Math.ceil(t.width/this._source.tileSize)+1)*(Math.ceil(t.height/this._source.tileSize)+1),r=Math.floor(5*e),n="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,r):r;this._cache.setMaxSize(n)},r.prototype.handleWrapJump=function(t){var e=(t-(void 0===this._prevLng?t:this._prevLng))/360,r=Math.round(e);if(this._prevLng=t,r){var n={};for(var i in this._tiles){var a=this._tiles[i];a.tileID=a.tileID.unwrapTo(a.tileID.wrap+r),n[a.tileID.key]=a}for(var o in this._tiles=n,this._timers)clearTimeout(this._timers[o]),delete this._timers[o];for(var s in this._tiles){var l=this._tiles[s];this._setTileReloadTimer(s,l)}}},r.prototype.update=function(e){var n=this;if(this.transform=e,this._sourceLoaded&&!this._paused){var i;this.updateCacheSize(e),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?i=e.getVisibleUnwrappedCoordinates(this._source.tileID).map(function(e){return new t.OverscaledTileID(e.canonical.z,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y)}):(i=e.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(i=i.filter(function(t){return n._source.hasTile(t)}))):i=[];var a=(this._source.roundZoom?Math.round:Math.floor)(this.getZoom(e)),o=Math.max(a-r.maxOverzooming,this._source.minzoom),s=Math.max(a+r.maxUnderzooming,this._source.minzoom),l=this._updateRetainedTiles(i,a);if(Pt(this._source.type)){for(var u={},c={},p=0,h=Object.keys(l);p<h.length;p+=1){var f=h[p],d=l[f],m=this._tiles[f];if(m&&!(m.fadeEndTime&&m.fadeEndTime<=t.browser.now())){var y=this.findLoadedParent(d,o);y&&(this._addTile(y.tileID),u[y.tileID.key]=y.tileID),c[f]=d}}for(var g in this._retainLoadedChildren(c,a,s,l),u)l[g]||(this._coveredTiles[g]=!0,l[g]=u[g])}for(var v in l)this._tiles[v].clearFadeHold();for(var _=0,x=t.keysDifference(this._tiles,l);_<x.length;_+=1){var b=x[_],w=this._tiles[b];w.hasSymbolBuckets&&!w.holdingForFade()?w.setHoldDuration(this.map._fadeDuration):w.hasSymbolBuckets&&!w.symbolFadeFinished()||this._removeTile(b)}}},r.prototype.releaseSymbolFadeTiles=function(){for(var t in this._tiles)this._tiles[t].holdingForFade()&&this._removeTile(t)},r.prototype._updateRetainedTiles=function(t,e){for(var n={},i={},a=Math.max(e-r.maxOverzooming,this._source.minzoom),o=Math.max(e+r.maxUnderzooming,this._source.minzoom),s={},l=0,u=t;l<u.length;l+=1){var c=u[l],p=this._addTile(c);n[c.key]=c,p.hasData()||e<this._source.maxzoom&&(s[c.key]=c)}this._retainLoadedChildren(s,e,o,n);for(var h=0,f=t;h<f.length;h+=1){var d=f[h],m=this._tiles[d.key];if(!m.hasData()){if(e+1>this._source.maxzoom){var y=d.children(this._source.maxzoom)[0],g=this.getTile(y);if(g&&g.hasData()){n[y.key]=y;continue}}else{var v=d.children(this._source.maxzoom);if(n[v[0].key]&&n[v[1].key]&&n[v[2].key]&&n[v[3].key])continue}for(var _=m.wasRequested(),x=d.overscaledZ-1;x>=a;--x){var b=d.scaledTo(x);if(i[b.key])break;if(i[b.key]=!0,!(m=this.getTile(b))&&_&&(m=this._addTile(b)),m&&(n[b.key]=b,_=m.wasRequested(),m.hasData()))break}}}return n},r.prototype._addTile=function(e){var r=this._tiles[e.key];if(r)return r;(r=this._cache.getAndRemove(e))&&(this._setTileReloadTimer(e.key,r),r.tileID=e,this._state.initializeTileState(r,this.map?this.map.painter:null),this._cacheTimers[e.key]&&(clearTimeout(this._cacheTimers[e.key]),delete this._cacheTimers[e.key],this._setTileReloadTimer(e.key,r)));var n=Boolean(r);return n||(r=new t.Tile(e,this._source.tileSize*e.overscaleFactor()),this._loadTile(r,this._tileLoaded.bind(this,r,e.key,r.state))),r?(r.uses++,this._tiles[e.key]=r,n||this._source.fire(new t.Event("dataloading",{tile:r,coord:r.tileID,dataType:"source"})),r):null},r.prototype._setTileReloadTimer=function(t,e){var r=this;t in this._timers&&(clearTimeout(this._timers[t]),delete this._timers[t]);var n=e.getExpiryTimeout();n&&(this._timers[t]=setTimeout(function(){r._reloadTile(t,"expired"),delete r._timers[t]},n))},r.prototype._removeTile=function(t){var e=this._tiles[t];e&&(e.uses--,delete this._tiles[t],this._timers[t]&&(clearTimeout(this._timers[t]),delete this._timers[t]),e.uses>0||(e.hasData()&&"reloading"!==e.state?this._cache.add(e.tileID,e,e.getExpiryTimeout()):(e.aborted=!0,this._abortTile(e),this._unloadTile(e))))},r.prototype.clearTiles=function(){for(var t in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(t);this._cache.reset()},r.prototype.tilesIn=function(e,r,n){var i=this,a=[],o=this.transform;if(!o)return a;for(var s=n?o.getCameraQueryGeometry(e):e,l=e.map(function(t){return o.pointCoordinate(t)}),u=s.map(function(t){return o.pointCoordinate(t)}),c=this.getIds(),p=1/0,h=1/0,f=-1/0,d=-1/0,m=0,y=u;m<y.length;m+=1){var g=y[m];p=Math.min(p,g.x),h=Math.min(h,g.y),f=Math.max(f,g.x),d=Math.max(d,g.y)}for(var v=function(e){var n=i._tiles[c[e]];if(!n.holdingForFade()){var s=n.tileID,m=Math.pow(2,o.zoom-n.tileID.overscaledZ),y=r*n.queryPadding*t.EXTENT/n.tileSize/m,g=[s.getTilePoint(new t.MercatorCoordinate(p,h)),s.getTilePoint(new t.MercatorCoordinate(f,d))];if(g[0].x-y<t.EXTENT&&g[0].y-y<t.EXTENT&&g[1].x+y>=0&&g[1].y+y>=0){var v=l.map(function(t){return s.getTilePoint(t)}),_=u.map(function(t){return s.getTilePoint(t)});a.push({tile:n,tileID:s,queryGeometry:v,cameraQueryGeometry:_,scale:m})}}},_=0;_<c.length;_++)v(_);return a},r.prototype.getVisibleCoordinates=function(t){for(var e=this,r=this.getRenderableIds(t).map(function(t){return e._tiles[t].tileID}),n=0,i=r;n<i.length;n+=1){var a=i[n];a.posMatrix=this.transform.calculatePosMatrix(a.toUnwrapped())}return r},r.prototype.hasTransition=function(){if(this._source.hasTransition())return!0;if(Pt(this._source.type))for(var e in this._tiles){var r=this._tiles[e];if(void 0!==r.fadeEndTime&&r.fadeEndTime>=t.browser.now())return!0}return!1},r.prototype.setFeatureState=function(t,e,r){t=t||"_geojsonTileLayer",this._state.updateState(t,e,r)},r.prototype.removeFeatureState=function(t,e,r){t=t||"_geojsonTileLayer",this._state.removeFeatureState(t,e,r)},r.prototype.getFeatureState=function(t,e){return t=t||"_geojsonTileLayer",this._state.getState(t,e)},r}(t.Evented);function zt(t,e){return t%32-e%32||e-t}function Pt(t){return"raster"===t||"image"===t||"video"===t}function It(){return new t.window.Worker(Qn.workerUrl)}Et.maxOverzooming=10,Et.maxUnderzooming=3;var Dt=function(){this.active={}};Dt.prototype.acquire=function(t){if(!this.workers)for(this.workers=[];this.workers.length<Dt.workerCount;)this.workers.push(new It);return this.active[t]=!0,this.workers.slice()},Dt.prototype.release=function(t){delete this.active[t],0===Object.keys(this.active).length&&(this.workers.forEach(function(t){t.terminate()}),this.workers=null)};var Ot,Rt=Math.floor(t.browser.hardwareConcurrency/2);function Ft(e,r){var n={};for(var i in e)"ref"!==i&&(n[i]=e[i]);return t.refProperties.forEach(function(t){t in r&&(n[t]=r[t])}),n}function Bt(t){t=t.slice();for(var e=Object.create(null),r=0;r<t.length;r++)e[t[r].id]=t[r];for(var n=0;n<t.length;n++)"ref"in t[n]&&(t[n]=Ft(t[n],e[t[n].ref]));return t}Dt.workerCount=Math.max(Math.min(Rt,6),1);var Nt={setStyle:"setStyle",addLayer:"addLayer",removeLayer:"removeLayer",setPaintProperty:"setPaintProperty",setLayoutProperty:"setLayoutProperty",setFilter:"setFilter",addSource:"addSource",removeSource:"removeSource",setGeoJSONSourceData:"setGeoJSONSourceData",setLayerZoomRange:"setLayerZoomRange",setLayerProperty:"setLayerProperty",setCenter:"setCenter",setZoom:"setZoom",setBearing:"setBearing",setPitch:"setPitch",setSprite:"setSprite",setGlyphs:"setGlyphs",setTransition:"setTransition",setLight:"setLight"};function Ut(t,e,r){r.push({command:Nt.addSource,args:[t,e[t]]})}function jt(t,e,r){e.push({command:Nt.removeSource,args:[t]}),r[t]=!0}function Vt(t,e,r,n){jt(t,r,n),Ut(t,e,r)}function qt(e,r,n){var i;for(i in e[n])if(e[n].hasOwnProperty(i)&&"data"!==i&&!t.deepEqual(e[n][i],r[n][i]))return!1;for(i in r[n])if(r[n].hasOwnProperty(i)&&"data"!==i&&!t.deepEqual(e[n][i],r[n][i]))return!1;return!0}function Gt(e,r,n,i,a,o){var s;for(s in r=r||{},e=e||{})e.hasOwnProperty(s)&&(t.deepEqual(e[s],r[s])||n.push({command:o,args:[i,s,r[s],a]}));for(s in r)r.hasOwnProperty(s)&&!e.hasOwnProperty(s)&&(t.deepEqual(e[s],r[s])||n.push({command:o,args:[i,s,r[s],a]}))}function Ht(t){return t.id}function Zt(t,e){return t[e.id]=e,t}var Xt=function(t,e,r){var n=this.boxCells=[],i=this.circleCells=[];this.xCellCount=Math.ceil(t/r),this.yCellCount=Math.ceil(e/r);for(var a=0;a<this.xCellCount*this.yCellCount;a++)n.push([]),i.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=t,this.height=e,this.xScale=this.xCellCount/t,this.yScale=this.yCellCount/e,this.boxUid=0,this.circleUid=0};function Wt(e,r,n,i,a){var o=t.create();return r?(t.scale(o,o,[1/a,1/a,1]),n||t.rotateZ(o,o,i.angle)):t.multiply(o,i.labelPlaneMatrix,e),o}function Yt(e,r,n,i,a){if(r){var o=t.clone(e);return t.scale(o,o,[a,a,1]),n||t.rotateZ(o,o,-i.angle),o}return i.glCoordMatrix}function Kt(e,r){var n=[e.x,e.y,0,1];oe(n,n,r);var i=n[3];return{point:new t.Point(n[0]/i,n[1]/i),signedDistanceFromCamera:i}}function Jt(t,e){var r=t[0]/t[3],n=t[1]/t[3];return r>=-e[0]&&r<=e[0]&&n>=-e[1]&&n<=e[1]}function $t(e,r,n,i,a,o,s,l){var u=i?e.textSizeData:e.iconSizeData,c=t.evaluateSizeForZoom(u,n.transform.zoom),p=[256/n.width*2+1,256/n.height*2+1],h=i?e.text.dynamicLayoutVertexArray:e.icon.dynamicLayoutVertexArray;h.clear();for(var f=e.lineVertexArray,d=i?e.text.placedSymbolArray:e.icon.placedSymbolArray,m=n.transform.width/n.transform.height,y=!1,g=0;g<d.length;g++){var v=d.get(g);if(v.hidden||v.writingMode===t.WritingMode.vertical&&!y)ae(v.numGlyphs,h);else{y=!1;var _=[v.anchorX,v.anchorY,0,1];if(t.transformMat4(_,_,r),Jt(_,p)){var x=.5+_[3]/n.transform.cameraToCenterDistance*.5,b=t.evaluateSizeForFeature(u,c,v),w=s?b*x:b/x,k=new t.Point(v.anchorX,v.anchorY),T=Kt(k,a).point,A={},M=ee(v,w,!1,l,r,a,o,e.glyphOffsetArray,f,h,T,k,A,m);y=M.useVertical,(M.notEnoughRoom||y||M.needsFlipping&&ee(v,w,!0,l,r,a,o,e.glyphOffsetArray,f,h,T,k,A,m).notEnoughRoom)&&ae(v.numGlyphs,h)}else ae(v.numGlyphs,h)}}i?e.text.dynamicLayoutVertexBuffer.updateData(h):e.icon.dynamicLayoutVertexBuffer.updateData(h)}function Qt(t,e,r,n,i,a,o,s,l,u,c,p){var h=s.glyphStartIndex+s.numGlyphs,f=s.lineStartIndex,d=s.lineStartIndex+s.lineLength,m=e.getoffsetX(s.glyphStartIndex),y=e.getoffsetX(h-1),g=ne(t*m,r,n,i,a,o,s.segment,f,d,l,u,c,p);if(!g)return null;var v=ne(t*y,r,n,i,a,o,s.segment,f,d,l,u,c,p);return v?{first:g,last:v}:null}function te(e,r,n,i){return e===t.WritingMode.horizontal&&Math.abs(n.y-r.y)>Math.abs(n.x-r.x)*i?{useVertical:!0}:(e===t.WritingMode.vertical?r.y<n.y:r.x>n.x)?{needsFlipping:!0}:null}function ee(e,r,n,i,a,o,s,l,u,c,p,h,f,d){var m,y=r/24,g=e.lineOffsetX*y,v=e.lineOffsetY*y;if(e.numGlyphs>1){var _=e.glyphStartIndex+e.numGlyphs,x=e.lineStartIndex,b=e.lineStartIndex+e.lineLength,w=Qt(y,l,g,v,n,p,h,e,u,o,f,!1);if(!w)return{notEnoughRoom:!0};var k=Kt(w.first.point,s).point,T=Kt(w.last.point,s).point;if(i&&!n){var A=te(e.writingMode,k,T,d);if(A)return A}m=[w.first];for(var M=e.glyphStartIndex+1;M<_-1;M++)m.push(ne(y*l.getoffsetX(M),g,v,n,p,h,e.segment,x,b,u,o,f,!1));m.push(w.last)}else{if(i&&!n){var S=Kt(h,a).point,L=e.lineStartIndex+e.segment+1,C=new t.Point(u.getx(L),u.gety(L)),E=Kt(C,a),z=E.signedDistanceFromCamera>0?E.point:re(h,C,S,1,a),P=te(e.writingMode,S,z,d);if(P)return P}var I=ne(y*l.getoffsetX(e.glyphStartIndex),g,v,n,p,h,e.segment,e.lineStartIndex,e.lineStartIndex+e.lineLength,u,o,f,!1);if(!I)return{notEnoughRoom:!0};m=[I]}for(var D=0,O=m;D<O.length;D+=1){var R=O[D];t.addDynamicAttributes(c,R.point,R.angle)}return{}}function re(t,e,r,n,i){var a=Kt(t.add(t.sub(e)._unit()),i).point,o=r.sub(a);return r.add(o._mult(n/o.mag()))}function ne(e,r,n,i,a,o,s,l,u,c,p,h,f){var d=i?e-r:e+r,m=d>0?1:-1,y=0;i&&(m*=-1,y=Math.PI),m<0&&(y+=Math.PI);for(var g=m>0?l+s:l+s+1,v=g,_=a,x=a,b=0,w=0,k=Math.abs(d);b+w<=k;){if((g+=m)<l||g>=u)return null;if(x=_,void 0===(_=h[g])){var T=new t.Point(c.getx(g),c.gety(g)),A=Kt(T,p);if(A.signedDistanceFromCamera>0)_=h[g]=A.point;else{var M=g-m;_=re(0===b?o:new t.Point(c.getx(M),c.gety(M)),T,x,k-b+1,p)}}b+=w,w=x.dist(_)}var S=(k-b)/w,L=_.sub(x),C=L.mult(S)._add(x);return C._add(L._unit()._perp()._mult(n*m)),{point:C,angle:y+Math.atan2(_.y-x.y,_.x-x.x),tileDistance:f?{prevTileDistance:g-m===v?0:c.gettileUnitDistanceFromAnchor(g-m),lastSegmentViewportDistance:k-b}:null}}Xt.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},Xt.prototype.insert=function(t,e,r,n,i){this._forEachCell(e,r,n,i,this._insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(e),this.bboxes.push(r),this.bboxes.push(n),this.bboxes.push(i)},Xt.prototype.insertCircle=function(t,e,r,n){this._forEachCell(e-n,r-n,e+n,r+n,this._insertCircleCell,this.circleUid++),this.circleKeys.push(t),this.circles.push(e),this.circles.push(r),this.circles.push(n)},Xt.prototype._insertBoxCell=function(t,e,r,n,i,a){this.boxCells[i].push(a)},Xt.prototype._insertCircleCell=function(t,e,r,n,i,a){this.circleCells[i].push(a)},Xt.prototype._query=function(t,e,r,n,i,a){if(r<0||t>this.width||n<0||e>this.height)return!i&&[];var o=[];if(t<=0&&e<=0&&this.width<=r&&this.height<=n){if(i)return!0;for(var s=0;s<this.boxKeys.length;s++)o.push({key:this.boxKeys[s],x1:this.bboxes[4*s],y1:this.bboxes[4*s+1],x2:this.bboxes[4*s+2],y2:this.bboxes[4*s+3]});for(var l=0;l<this.circleKeys.length;l++){var u=this.circles[3*l],c=this.circles[3*l+1],p=this.circles[3*l+2];o.push({key:this.circleKeys[l],x1:u-p,y1:c-p,x2:u+p,y2:c+p})}return a?o.filter(a):o}var h={hitTest:i,seenUids:{box:{},circle:{}}};return this._forEachCell(t,e,r,n,this._queryCell,o,h,a),i?o.length>0:o},Xt.prototype._queryCircle=function(t,e,r,n,i){var a=t-r,o=t+r,s=e-r,l=e+r;if(o<0||a>this.width||l<0||s>this.height)return!n&&[];var u=[],c={hitTest:n,circle:{x:t,y:e,radius:r},seenUids:{box:{},circle:{}}};return this._forEachCell(a,s,o,l,this._queryCellCircle,u,c,i),n?u.length>0:u},Xt.prototype.query=function(t,e,r,n,i){return this._query(t,e,r,n,!1,i)},Xt.prototype.hitTest=function(t,e,r,n,i){return this._query(t,e,r,n,!0,i)},Xt.prototype.hitTestCircle=function(t,e,r,n){return this._queryCircle(t,e,r,!0,n)},Xt.prototype._queryCell=function(t,e,r,n,i,a,o,s){var l=o.seenUids,u=this.boxCells[i];if(null!==u)for(var c=this.bboxes,p=0,h=u;p<h.length;p+=1){var f=h[p];if(!l.box[f]){l.box[f]=!0;var d=4*f;if(t<=c[d+2]&&e<=c[d+3]&&r>=c[d+0]&&n>=c[d+1]&&(!s||s(this.boxKeys[f]))){if(o.hitTest)return a.push(!0),!0;a.push({key:this.boxKeys[f],x1:c[d],y1:c[d+1],x2:c[d+2],y2:c[d+3]})}}}var m=this.circleCells[i];if(null!==m)for(var y=this.circles,g=0,v=m;g<v.length;g+=1){var _=v[g];if(!l.circle[_]){l.circle[_]=!0;var x=3*_;if(this._circleAndRectCollide(y[x],y[x+1],y[x+2],t,e,r,n)&&(!s||s(this.circleKeys[_]))){if(o.hitTest)return a.push(!0),!0;var b=y[x],w=y[x+1],k=y[x+2];a.push({key:this.circleKeys[_],x1:b-k,y1:w-k,x2:b+k,y2:w+k})}}}},Xt.prototype._queryCellCircle=function(t,e,r,n,i,a,o,s){var l=o.circle,u=o.seenUids,c=this.boxCells[i];if(null!==c)for(var p=this.bboxes,h=0,f=c;h<f.length;h+=1){var d=f[h];if(!u.box[d]){u.box[d]=!0;var m=4*d;if(this._circleAndRectCollide(l.x,l.y,l.radius,p[m+0],p[m+1],p[m+2],p[m+3])&&(!s||s(this.boxKeys[d])))return a.push(!0),!0}}var y=this.circleCells[i];if(null!==y)for(var g=this.circles,v=0,_=y;v<_.length;v+=1){var x=_[v];if(!u.circle[x]){u.circle[x]=!0;var b=3*x;if(this._circlesCollide(g[b],g[b+1],g[b+2],l.x,l.y,l.radius)&&(!s||s(this.circleKeys[x])))return a.push(!0),!0}}},Xt.prototype._forEachCell=function(t,e,r,n,i,a,o,s){for(var l=this._convertToXCellCoord(t),u=this._convertToYCellCoord(e),c=this._convertToXCellCoord(r),p=this._convertToYCellCoord(n),h=l;h<=c;h++)for(var f=u;f<=p;f++){var d=this.xCellCount*f+h;if(i.call(this,t,e,r,n,d,a,o,s))return}},Xt.prototype._convertToXCellCoord=function(t){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(t*this.xScale)))},Xt.prototype._convertToYCellCoord=function(t){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(t*this.yScale)))},Xt.prototype._circlesCollide=function(t,e,r,n,i,a){var o=n-t,s=i-e,l=r+a;return l*l>o*o+s*s},Xt.prototype._circleAndRectCollide=function(t,e,r,n,i,a,o){var s=(a-n)/2,l=Math.abs(t-(n+s));if(l>s+r)return!1;var u=(o-i)/2,c=Math.abs(e-(i+u));if(c>u+r)return!1;if(l<=s||c<=u)return!0;var p=l-s,h=c-u;return p*p+h*h<=r*r};var ie=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function ae(t,e){for(var r=0;r<t;r++){var n=e.length;e.resize(n+4),e.float32.set(ie,3*n)}}function oe(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[4]*i+r[12],t[1]=r[1]*n+r[5]*i+r[13],t[3]=r[3]*n+r[7]*i+r[15],t}var se=function(t,e,r){void 0===e&&(e=new Xt(t.width+200,t.height+200,25)),void 0===r&&(r=new Xt(t.width+200,t.height+200,25)),this.transform=t,this.grid=e,this.ignoredGrid=r,this.pitchfactor=Math.cos(t._pitch)*t.cameraToCenterDistance,this.screenRightBoundary=t.width+100,this.screenBottomBoundary=t.height+100,this.gridRightBoundary=t.width+200,this.gridBottomBoundary=t.height+200};function le(t,e,r){t[e+4]=r?1:0}function ue(e,r,n){return r*(t.EXTENT/(e.tileSize*Math.pow(2,n-e.tileID.overscaledZ)))}se.prototype.placeCollisionBox=function(t,e,r,n,i){var a=this.projectAndGetPerspectiveRatio(n,t.anchorPointX,t.anchorPointY),o=r*a.perspectiveRatio,s=t.x1*o+a.point.x,l=t.y1*o+a.point.y,u=t.x2*o+a.point.x,c=t.y2*o+a.point.y;return!this.isInsideGrid(s,l,u,c)||!e&&this.grid.hitTest(s,l,u,c,i)?{box:[],offscreen:!1}:{box:[s,l,u,c],offscreen:this.isOffscreen(s,l,u,c)}},se.prototype.approximateTileDistance=function(t,e,r,n,i){var a=i?1:n/this.pitchfactor,o=t.lastSegmentViewportDistance*r;return t.prevTileDistance+o+(a-1)*o*Math.abs(Math.sin(e))},se.prototype.placeCollisionCircles=function(e,r,n,i,a,o,s,l,u,c,p,h,f){var d=[],m=this.projectAnchor(u,a.anchorX,a.anchorY),y=l/24,g=a.lineOffsetX*l,v=a.lineOffsetY*l,_=new t.Point(a.anchorX,a.anchorY),x=Qt(y,s,g,v,!1,Kt(_,c).point,_,a,o,c,{},!0),b=!1,w=!1,k=!0,T=m.perspectiveRatio*i,A=1/(i*n),M=0,S=0;x&&(M=this.approximateTileDistance(x.first.tileDistance,x.first.angle,A,m.cameraDistance,h),S=this.approximateTileDistance(x.last.tileDistance,x.last.angle,A,m.cameraDistance,h));for(var L=0;L<e.length;L+=5){var C=e[L],E=e[L+1],z=e[L+2],P=e[L+3];if(!x||P<-M||P>S)le(e,L,!1);else{var I=this.projectPoint(u,C,E),D=z*T;if(d.length>0){var O=I.x-d[d.length-4],R=I.y-d[d.length-3];if(D*D*2>O*O+R*R&&L+8<e.length){var F=e[L+8];if(F>-M&&F<S){le(e,L,!1);continue}}}var B=L/5;d.push(I.x,I.y,D,B),le(e,L,!0);var N=I.x-D,U=I.y-D,j=I.x+D,V=I.y+D;if(k=k&&this.isOffscreen(N,U,j,V),w=w||this.isInsideGrid(N,U,j,V),!r&&this.grid.hitTestCircle(I.x,I.y,D,f)){if(!p)return{circles:[],offscreen:!1};b=!0}}}return{circles:b||!w?[]:d,offscreen:k}},se.prototype.queryRenderedSymbols=function(e){if(0===e.length||0===this.grid.keysLength()&&0===this.ignoredGrid.keysLength())return{};for(var r=[],n=1/0,i=1/0,a=-1/0,o=-1/0,s=0,l=e;s<l.length;s+=1){var u=l[s],c=new t.Point(u.x+100,u.y+100);n=Math.min(n,c.x),i=Math.min(i,c.y),a=Math.max(a,c.x),o=Math.max(o,c.y),r.push(c)}for(var p={},h={},f=0,d=this.grid.query(n,i,a,o).concat(this.ignoredGrid.query(n,i,a,o));f<d.length;f+=1){var m=d[f],y=m.key;if(void 0===p[y.bucketInstanceId]&&(p[y.bucketInstanceId]={}),!p[y.bucketInstanceId][y.featureIndex]){var g=[new t.Point(m.x1,m.y1),new t.Point(m.x2,m.y1),new t.Point(m.x2,m.y2),new t.Point(m.x1,m.y2)];t.polygonIntersectsPolygon(r,g)&&(p[y.bucketInstanceId][y.featureIndex]=!0,void 0===h[y.bucketInstanceId]&&(h[y.bucketInstanceId]=[]),h[y.bucketInstanceId].push(y.featureIndex))}}return h},se.prototype.insertCollisionBox=function(t,e,r,n,i){var a={bucketInstanceId:r,featureIndex:n,collisionGroupID:i};(e?this.ignoredGrid:this.grid).insert(a,t[0],t[1],t[2],t[3])},se.prototype.insertCollisionCircles=function(t,e,r,n,i){for(var a=e?this.ignoredGrid:this.grid,o={bucketInstanceId:r,featureIndex:n,collisionGroupID:i},s=0;s<t.length;s+=4)a.insertCircle(o,t[s],t[s+1],t[s+2])},se.prototype.projectAnchor=function(t,e,r){var n=[e,r,0,1];return oe(n,n,t),{perspectiveRatio:.5+this.transform.cameraToCenterDistance/n[3]*.5,cameraDistance:n[3]}},se.prototype.projectPoint=function(e,r,n){var i=[r,n,0,1];return oe(i,i,e),new t.Point((i[0]/i[3]+1)/2*this.transform.width+100,(-i[1]/i[3]+1)/2*this.transform.height+100)},se.prototype.projectAndGetPerspectiveRatio=function(e,r,n){var i=[r,n,0,1];return oe(i,i,e),{point:new t.Point((i[0]/i[3]+1)/2*this.transform.width+100,(-i[1]/i[3]+1)/2*this.transform.height+100),perspectiveRatio:.5+this.transform.cameraToCenterDistance/i[3]*.5}},se.prototype.isOffscreen=function(t,e,r,n){return r<100||t>=this.screenRightBoundary||n<100||e>this.screenBottomBoundary},se.prototype.isInsideGrid=function(t,e,r,n){return r>=0&&t<this.gridRightBoundary&&n>=0&&e<this.gridBottomBoundary};var ce=function(t,e,r,n){this.opacity=t?Math.max(0,Math.min(1,t.opacity+(t.placed?e:-e))):n&&r?1:0,this.placed=r};ce.prototype.isHidden=function(){return 0===this.opacity&&!this.placed};var pe=function(t,e,r,n,i){this.text=new ce(t?t.text:null,e,r,i),this.icon=new ce(t?t.icon:null,e,n,i)};pe.prototype.isHidden=function(){return this.text.isHidden()&&this.icon.isHidden()};var he=function(t,e,r){this.text=t,this.icon=e,this.skipFade=r},fe=function(t,e,r,n,i){this.bucketInstanceId=t,this.featureIndex=e,this.sourceLayerIndex=r,this.bucketIndex=n,this.tileID=i},de=function(t){this.crossSourceCollisions=t,this.maxGroupID=0,this.collisionGroups={}};function me(e,r,n,i,a){var o=t.getAnchorAlignment(e),s=-(o.horizontalAlign-.5)*r,l=-(o.verticalAlign-.5)*n,u=t.evaluateRadialOffset(e,i);return new t.Point(s+u[0]*a,l+u[1]*a)}de.prototype.get=function(t){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[t]){var e=++this.maxGroupID;this.collisionGroups[t]={ID:e,predicate:function(t){return t.collisionGroupID===e}}}return this.collisionGroups[t]};var ye=function(t,e,r,n){this.transform=t.clone(),this.collisionIndex=new se(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=e,this.retainedQueryData={},this.collisionGroups=new de(r),this.prevPlacement=n,n&&(n.prevPlacement=void 0),this.placedOrientations={}};function ge(t,e,r,n,i){t.emplaceBack(e?1:0,r?1:0,n||0,i||0),t.emplaceBack(e?1:0,r?1:0,n||0,i||0),t.emplaceBack(e?1:0,r?1:0,n||0,i||0),t.emplaceBack(e?1:0,r?1:0,n||0,i||0)}ye.prototype.placeLayerTile=function(e,r,n,i){var a=r.getBucket(e),o=r.latestFeatureIndex;if(a&&o&&e.id===a.layerIds[0]){var s=r.collisionBoxArray,l=a.layers[0].layout,u=Math.pow(2,this.transform.zoom-r.tileID.overscaledZ),c=r.tileSize/t.EXTENT,p=this.transform.calculatePosMatrix(r.tileID.toUnwrapped()),h=Wt(p,"map"===l.get("text-pitch-alignment"),"map"===l.get("text-rotation-alignment"),this.transform,ue(r,1,this.transform.zoom)),f=Wt(p,"map"===l.get("icon-pitch-alignment"),"map"===l.get("icon-rotation-alignment"),this.transform,ue(r,1,this.transform.zoom));this.retainedQueryData[a.bucketInstanceId]=new fe(a.bucketInstanceId,o,a.sourceLayerIndex,a.index,r.tileID),this.placeLayerBucket(a,p,h,f,u,c,n,r.holdingForFade(),i,s)}},ye.prototype.attemptAnchorPlacement=function(e,r,n,i,a,o,s,l,u,c,p,h,f,d,m){var y,g=me(e,n,i,a,o),v=this.collisionIndex.placeCollisionBox(function(e,r,n,i,a,o){var s=e.x1,l=e.x2,u=e.y1,c=e.y2,p=e.anchorPointX,h=e.anchorPointY,f=new t.Point(r,n);return i&&f._rotate(a?o:-o),{x1:s+f.x,y1:u+f.y,x2:l+f.x,y2:c+f.y,anchorPointX:p,anchorPointY:h}}(r,g.x,g.y,s,l,this.transform.angle),h,u,c,p.predicate);if(v.box.length>0)return this.prevPlacement&&this.prevPlacement.variableOffsets[f.crossTileID]&&this.prevPlacement.placements[f.crossTileID]&&this.prevPlacement.placements[f.crossTileID].text&&(y=this.prevPlacement.variableOffsets[f.crossTileID].anchor),this.variableOffsets[f.crossTileID]={radialOffset:a,width:n,height:i,anchor:e,textBoxScale:o,prevAnchor:y},this.markUsedJustification(d,e,f,m),d.allowVerticalPlacement&&(this.markUsedOrientation(d,m,f),this.placedOrientations[f.crossTileID]=m),v},ye.prototype.placeLayerBucket=function(e,r,n,i,a,o,s,l,u,c){var p=this,h=e.layers[0].layout,f=t.evaluateSizeForZoom(e.textSizeData,this.transform.zoom),d=h.get("text-optional"),m=h.get("icon-optional"),y=h.get("text-allow-overlap"),g=h.get("icon-allow-overlap"),v=y&&(g||!e.hasIconData()||m),_=g&&(y||!e.hasTextData()||d),x=this.collisionGroups.get(e.sourceID),b="map"===h.get("text-rotation-alignment"),w="map"===h.get("text-pitch-alignment"),k="viewport-y"===h.get("symbol-z-order");!e.collisionArrays&&c&&e.deserializeCollisionBoxes(c);var T=function(i,c){if(!u[i.crossTileID])if(l)p.placements[i.crossTileID]=new he(!1,!1,!1);else{var g,k=!1,T=!1,A=!0,M={box:null,offscreen:null},S={box:null,offscreen:null},L=null,C=null,E=0,z=0,P=0;c.textFeatureIndex&&(E=c.textFeatureIndex),c.verticalTextFeatureIndex&&(z=c.verticalTextFeatureIndex);var I=c.textBox;if(I){var D=function(r){var n=t.WritingMode.horizontal;if(e.allowVerticalPlacement&&!r&&p.prevPlacement){var a=p.prevPlacement.placedOrientations[i.crossTileID];a&&(p.placedOrientations[i.crossTileID]=a,n=a,p.markUsedOrientation(e,n,i))}return n},O=function(r,n){if(e.allowVerticalPlacement&&i.numVerticalGlyphVertices>0&&c.verticalTextBox)for(var a=0,o=e.writingModes;a<o.length&&(o[a]===t.WritingMode.vertical?(M=n(),S=M):M=r(),!(M&&M.box&&M.box.length));a+=1);else M=r()};if(h.get("text-variable-anchor")){var R=h.get("text-variable-anchor");if(p.prevPlacement&&p.prevPlacement.variableOffsets[i.crossTileID]){var F=p.prevPlacement.variableOffsets[i.crossTileID];R.indexOf(F.anchor)>0&&(R=R.filter(function(t){return t!==F.anchor})).unshift(F.anchor)}var B=function(t,n){for(var a=t.x2-t.x1,s=t.y2-t.y1,l=i.textBoxScale,u={box:[],offscreen:!1},c=y?2*R.length:R.length,h=0;h<c;++h){var f=R[h%R.length],d=h>=R.length;if((u=p.attemptAnchorPlacement(f,t,a,s,i.radialTextOffset,l,b,w,o,r,x,d,i,e,n))&&u.box&&u.box.length){k=!0;break}}return u};O(function(){return B(I,t.WritingMode.horizontal)},function(){var r=c.verticalTextBox,n=M&&M.box&&M.box.length;return e.allowVerticalPlacement&&!n&&i.numVerticalGlyphVertices>0&&r?B(r,t.WritingMode.vertical):{box:null,offscreen:null}}),M&&(k=M.box,A=M.offscreen);var N=D(M&&M.box);if(!k&&p.prevPlacement){var U=p.prevPlacement.variableOffsets[i.crossTileID];U&&(p.variableOffsets[i.crossTileID]=U,p.markUsedJustification(e,U.anchor,i,N))}}else{var j=function(t,n){var a=p.collisionIndex.placeCollisionBox(t,h.get("text-allow-overlap"),o,r,x.predicate);return a&&a.box&&a.box.length&&(p.markUsedOrientation(e,n,i),p.placedOrientations[i.crossTileID]=n),a};O(function(){return j(I,t.WritingMode.horizontal)},function(){var r=c.verticalTextBox;return e.allowVerticalPlacement&&i.numVerticalGlyphVertices>0&&r?j(r,t.WritingMode.vertical):{box:null,offscreen:null}}),D(M&&M.box&&M.box.length)}}k=(g=M)&&g.box&&g.box.length>0,A=g&&g.offscreen;var V=c.textCircles;if(V){var q=e.text.placedSymbolArray.get(i.centerJustifiedTextSymbolIndex),G=t.evaluateSizeForFeature(e.textSizeData,f,q);L=p.collisionIndex.placeCollisionCircles(V,h.get("text-allow-overlap"),a,o,q,e.lineVertexArray,e.glyphOffsetArray,G,r,n,s,w,x.predicate),k=h.get("text-allow-overlap")||L.circles.length>0,A=A&&L.offscreen}c.iconFeatureIndex&&(P=c.iconFeatureIndex),c.iconBox&&(T=(C=p.collisionIndex.placeCollisionBox(c.iconBox,h.get("icon-allow-overlap"),o,r,x.predicate)).box.length>0,A=A&&C.offscreen);var H=d||0===i.numHorizontalGlyphVertices&&0===i.numVerticalGlyphVertices,Z=m||0===i.numIconVertices;H||Z?Z?H||(T=T&&k):k=T&&k:T=k=T&&k,k&&g&&g.box&&(S&&S.box&&z?p.collisionIndex.insertCollisionBox(g.box,h.get("text-ignore-placement"),e.bucketInstanceId,z,x.ID):p.collisionIndex.insertCollisionBox(g.box,h.get("text-ignore-placement"),e.bucketInstanceId,E,x.ID)),T&&C&&p.collisionIndex.insertCollisionBox(C.box,h.get("icon-ignore-placement"),e.bucketInstanceId,P,x.ID),k&&L&&p.collisionIndex.insertCollisionCircles(L.circles,h.get("text-ignore-placement"),e.bucketInstanceId,E,x.ID),p.placements[i.crossTileID]=new he(k||v,T||_,A||e.justReloaded),u[i.crossTileID]=!0}};if(k)for(var A=e.getSortedSymbolIndexes(this.transform.angle),M=A.length-1;M>=0;--M){var S=A[M];T(e.symbolInstances.get(S),e.collisionArrays[S])}else for(var L=0;L<e.symbolInstances.length;++L)T(e.symbolInstances.get(L),e.collisionArrays[L]);e.justReloaded=!1},ye.prototype.markUsedJustification=function(e,r,n,i){var a,o={left:n.leftJustifiedTextSymbolIndex,center:n.centerJustifiedTextSymbolIndex,right:n.rightJustifiedTextSymbolIndex};a=i===t.WritingMode.vertical?n.verticalPlacedTextSymbolIndex:o[t.getAnchorJustification(r)];for(var s=0,l=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex,n.verticalPlacedTextSymbolIndex];s<l.length;s+=1){var u=l[s];u>=0&&(e.text.placedSymbolArray.get(u).crossTileID=a>=0&&u!==a?0:n.crossTileID)}},ye.prototype.markUsedOrientation=function(e,r,n){for(var i=r===t.WritingMode.horizontal||r===t.WritingMode.horizontalOnly?r:0,a=r===t.WritingMode.vertical?r:0,o=0,s=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex];o<s.length;o+=1){var l=s[o];e.text.placedSymbolArray.get(l).placedOrientation=i}n.verticalPlacedTextSymbolIndex&&(e.text.placedSymbolArray.get(n.verticalPlacedTextSymbolIndex).placedOrientation=a)},ye.prototype.commit=function(t){this.commitTime=t;var e=this.prevPlacement,r=!1,n=e&&0!==this.fadeDuration?(this.commitTime-e.commitTime)/this.fadeDuration:1,i=e?e.opacities:{},a=e?e.variableOffsets:{},o=e?e.placedOrientations:{};for(var s in this.placements){var l=this.placements[s],u=i[s];u?(this.opacities[s]=new pe(u,n,l.text,l.icon),r=r||l.text!==u.text.placed||l.icon!==u.icon.placed):(this.opacities[s]=new pe(null,n,l.text,l.icon,l.skipFade),r=r||l.text||l.icon)}for(var c in i){var p=i[c];if(!this.opacities[c]){var h=new pe(p,n,!1,!1);h.isHidden()||(this.opacities[c]=h,r=r||p.text.placed||p.icon.placed)}}for(var f in a)this.variableOffsets[f]||!this.opacities[f]||this.opacities[f].isHidden()||(this.variableOffsets[f]=a[f]);for(var d in o)this.placedOrientations[d]||!this.opacities[d]||this.opacities[d].isHidden()||(this.placedOrientations[d]=o[d]);r?this.lastPlacementChangeTime=t:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=e?e.lastPlacementChangeTime:t)},ye.prototype.updateLayerOpacities=function(t,e){for(var r={},n=0,i=e;n<i.length;n+=1){var a=i[n],o=a.getBucket(t);o&&a.latestFeatureIndex&&t.id===o.layerIds[0]&&this.updateBucketOpacities(o,r,a.collisionBoxArray)}},ye.prototype.updateBucketOpacities=function(e,r,n){e.hasTextData()&&e.text.opacityVertexArray.clear(),e.hasIconData()&&e.icon.opacityVertexArray.clear(),e.hasCollisionBoxData()&&e.collisionBox.collisionVertexArray.clear(),e.hasCollisionCircleData()&&e.collisionCircle.collisionVertexArray.clear();var i=e.layers[0].layout,a=new pe(null,0,!1,!1,!0),o=i.get("text-allow-overlap"),s=i.get("icon-allow-overlap"),l=i.get("text-variable-anchor"),u="map"===i.get("text-rotation-alignment"),c="map"===i.get("text-pitch-alignment"),p=new pe(null,0,o&&(s||!e.hasIconData()||i.get("icon-optional")),s&&(o||!e.hasTextData()||i.get("text-optional")),!0);!e.collisionArrays&&n&&(e.hasCollisionBoxData()||e.hasCollisionCircleData())&&e.deserializeCollisionBoxes(n);for(var h=0;h<e.symbolInstances.length;h++){var f=e.symbolInstances.get(h),d=f.numHorizontalGlyphVertices,m=f.numVerticalGlyphVertices,y=f.crossTileID,g=r[y],v=this.opacities[y];g?v=a:v||(v=p,this.opacities[y]=v),r[y]=!0;var _=d>0||m>0,x=f.numIconVertices>0;if(_){for(var b=Ae(v.text),w=(d+m)/4,k=0;k<w;k++)e.text.opacityVertexArray.emplaceBack(b);var T=v.text.isHidden()?1:0,A=this.placedOrientations[f.crossTileID],M=A===t.WritingMode.horizontal||A===t.WritingMode.horizontalOnly?1:0,S=A===t.WritingMode.vertical?1:0;[f.rightJustifiedTextSymbolIndex,f.centerJustifiedTextSymbolIndex,f.leftJustifiedTextSymbolIndex].forEach(function(t){t>=0&&(e.text.placedSymbolArray.get(t).hidden=T||S)}),f.verticalPlacedTextSymbolIndex>=0&&(e.text.placedSymbolArray.get(f.verticalPlacedTextSymbolIndex).hidden=T||M);var L=this.variableOffsets[f.crossTileID];L&&this.markUsedJustification(e,L.anchor,f,A);var C=this.placedOrientations[f.crossTileID];C&&(this.markUsedJustification(e,"left",f,C),this.markUsedOrientation(e,C,f))}if(x){for(var E=Ae(v.icon),z=0;z<f.numIconVertices/4;z++)e.icon.opacityVertexArray.emplaceBack(E);e.icon.placedSymbolArray.get(h).hidden=v.icon.isHidden()}if(e.hasCollisionBoxData()||e.hasCollisionCircleData()){var P=e.collisionArrays[h];if(P){if(P.textBox){var I=new t.Point(0,0),D=!0;if(l){var O=this.variableOffsets[y];O?(I=me(O.anchor,O.width,O.height,O.radialOffset,O.textBoxScale),u&&I._rotate(c?this.transform.angle:-this.transform.angle)):D=!1}ge(e.collisionBox.collisionVertexArray,v.text.placed,!D,I.x,I.y)}P.iconBox&&ge(e.collisionBox.collisionVertexArray,v.icon.placed,!1);var R=P.textCircles;if(R&&e.hasCollisionCircleData())for(var F=0;F<R.length;F+=5){var B=g||0===R[F+4];ge(e.collisionCircle.collisionVertexArray,v.text.placed,B)}}}}e.sortFeatures(this.transform.angle),this.retainedQueryData[e.bucketInstanceId]&&(this.retainedQueryData[e.bucketInstanceId].featureSortOrder=e.featureSortOrder),e.hasTextData()&&e.text.opacityVertexBuffer&&e.text.opacityVertexBuffer.updateData(e.text.opacityVertexArray),e.hasIconData()&&e.icon.opacityVertexBuffer&&e.icon.opacityVertexBuffer.updateData(e.icon.opacityVertexArray),e.hasCollisionBoxData()&&e.collisionBox.collisionVertexBuffer&&e.collisionBox.collisionVertexBuffer.updateData(e.collisionBox.collisionVertexArray),e.hasCollisionCircleData()&&e.collisionCircle.collisionVertexBuffer&&e.collisionCircle.collisionVertexBuffer.updateData(e.collisionCircle.collisionVertexArray)},ye.prototype.symbolFadeChange=function(t){return 0===this.fadeDuration?1:(t-this.commitTime)/this.fadeDuration},ye.prototype.hasTransitions=function(t){return this.stale||t-this.lastPlacementChangeTime<this.fadeDuration},ye.prototype.stillRecent=function(t){return this.commitTime+this.fadeDuration>t},ye.prototype.setStale=function(){this.stale=!0};var ve=Math.pow(2,25),_e=Math.pow(2,24),xe=Math.pow(2,17),be=Math.pow(2,16),we=Math.pow(2,9),ke=Math.pow(2,8),Te=Math.pow(2,1);function Ae(t){if(0===t.opacity&&!t.placed)return 0;if(1===t.opacity&&t.placed)return 4294967295;var e=t.placed?1:0,r=Math.floor(127*t.opacity);return r*ve+e*_e+r*xe+e*be+r*we+e*ke+r*Te+e}var Me=function(){this._currentTileIndex=0,this._seenCrossTileIDs={}};Me.prototype.continuePlacement=function(t,e,r,n,i){for(;this._currentTileIndex<t.length;){var a=t[this._currentTileIndex];if(e.placeLayerTile(n,a,r,this._seenCrossTileIDs),this._currentTileIndex++,i())return!0}};var Se=function(t,e,r,n,i,a,o){this.placement=new ye(t,i,a,o),this._currentPlacementIndex=e.length-1,this._forceFullPlacement=r,this._showCollisionBoxes=n,this._done=!1};Se.prototype.isDone=function(){return this._done},Se.prototype.continuePlacement=function(e,r,n){for(var i=this,a=t.browser.now(),o=function(){var e=t.browser.now()-a;return!i._forceFullPlacement&&e>2};this._currentPlacementIndex>=0;){var s=r[e[this._currentPlacementIndex]],l=this.placement.collisionIndex.transform.zoom;if("symbol"===s.type&&(!s.minzoom||s.minzoom<=l)&&(!s.maxzoom||s.maxzoom>l)){if(this._inProgressLayer||(this._inProgressLayer=new Me),this._inProgressLayer.continuePlacement(n[s.source],this.placement,this._showCollisionBoxes,s,o))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},Se.prototype.commit=function(t){return this.placement.commit(t),this.placement};var Le=512/t.EXTENT/2,Ce=function(t,e,r){this.tileID=t,this.indexedSymbolInstances={},this.bucketInstanceId=r;for(var n=0;n<e.length;n++){var i=e.get(n),a=i.key;this.indexedSymbolInstances[a]||(this.indexedSymbolInstances[a]=[]),this.indexedSymbolInstances[a].push({crossTileID:i.crossTileID,coord:this.getScaledCoordinates(i,t)})}};Ce.prototype.getScaledCoordinates=function(e,r){var n=r.canonical.z-this.tileID.canonical.z,i=Le/Math.pow(2,n);return{x:Math.floor((r.canonical.x*t.EXTENT+e.anchorX)*i),y:Math.floor((r.canonical.y*t.EXTENT+e.anchorY)*i)}},Ce.prototype.findMatches=function(t,e,r){for(var n=this.tileID.canonical.z<e.canonical.z?1:Math.pow(2,this.tileID.canonical.z-e.canonical.z),i=0;i<t.length;i++){var a=t.get(i);if(!a.crossTileID){var o=this.indexedSymbolInstances[a.key];if(o)for(var s=this.getScaledCoordinates(a,e),l=0,u=o;l<u.length;l+=1){var c=u[l];if(Math.abs(c.coord.x-s.x)<=n&&Math.abs(c.coord.y-s.y)<=n&&!r[c.crossTileID]){r[c.crossTileID]=!0,a.crossTileID=c.crossTileID;break}}}}};var Ee=function(){this.maxCrossTileID=0};Ee.prototype.generate=function(){return++this.maxCrossTileID};var ze=function(){this.indexes={},this.usedCrossTileIDs={},this.lng=0};ze.prototype.handleWrapJump=function(t){var e=Math.round((t-this.lng)/360);if(0!==e)for(var r in this.indexes){var n=this.indexes[r],i={};for(var a in n){var o=n[a];o.tileID=o.tileID.unwrapTo(o.tileID.wrap+e),i[o.tileID.key]=o}this.indexes[r]=i}this.lng=t},ze.prototype.addBucket=function(t,e,r){if(this.indexes[t.overscaledZ]&&this.indexes[t.overscaledZ][t.key]){if(this.indexes[t.overscaledZ][t.key].bucketInstanceId===e.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(t.overscaledZ,this.indexes[t.overscaledZ][t.key])}for(var n=0;n<e.symbolInstances.length;n++)e.symbolInstances.get(n).crossTileID=0;this.usedCrossTileIDs[t.overscaledZ]||(this.usedCrossTileIDs[t.overscaledZ]={});var i=this.usedCrossTileIDs[t.overscaledZ];for(var a in this.indexes){var o=this.indexes[a];if(Number(a)>t.overscaledZ)for(var s in o){var l=o[s];l.tileID.isChildOf(t)&&l.findMatches(e.symbolInstances,t,i)}else{var u=o[t.scaledTo(Number(a)).key];u&&u.findMatches(e.symbolInstances,t,i)}}for(var c=0;c<e.symbolInstances.length;c++){var p=e.symbolInstances.get(c);p.crossTileID||(p.crossTileID=r.generate(),i[p.crossTileID]=!0)}return void 0===this.indexes[t.overscaledZ]&&(this.indexes[t.overscaledZ]={}),this.indexes[t.overscaledZ][t.key]=new Ce(t,e.symbolInstances,e.bucketInstanceId),!0},ze.prototype.removeBucketCrossTileIDs=function(t,e){for(var r in e.indexedSymbolInstances)for(var n=0,i=e.indexedSymbolInstances[r];n<i.length;n+=1){var a=i[n];delete this.usedCrossTileIDs[t][a.crossTileID]}},ze.prototype.removeStaleBuckets=function(t){var e=!1;for(var r in this.indexes){var n=this.indexes[r];for(var i in n)t[n[i].bucketInstanceId]||(this.removeBucketCrossTileIDs(r,n[i]),delete n[i],e=!0)}return e};var Pe=function(){this.layerIndexes={},this.crossTileIDs=new Ee,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}};Pe.prototype.addLayer=function(t,e,r){var n=this.layerIndexes[t.id];void 0===n&&(n=this.layerIndexes[t.id]=new ze);var i=!1,a={};n.handleWrapJump(r);for(var o=0,s=e;o<s.length;o+=1){var l=s[o],u=l.getBucket(t);u&&t.id===u.layerIds[0]&&(u.bucketInstanceId||(u.bucketInstanceId=++this.maxBucketInstanceId),n.addBucket(l.tileID,u,this.crossTileIDs)&&(i=!0),a[u.bucketInstanceId]=!0)}return n.removeStaleBuckets(a)&&(i=!0),i},Pe.prototype.pruneUnusedLayers=function(t){var e={};for(var r in t.forEach(function(t){e[t]=!0}),this.layerIndexes)e[r]||delete this.layerIndexes[r]};var Ie=function(e,r){return t.emitValidationErrors(e,r&&r.filter(function(t){return"source.canvas"!==t.identifier}))},De=t.pick(Nt,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData"]),Oe=t.pick(Nt,["setCenter","setZoom","setBearing","setPitch"]),Re=function(e){function r(n,i){var a=this;void 0===i&&(i={}),e.call(this),this.map=n,this.dispatcher=new T((Ot||(Ot=new Dt),Ot),this),this.imageManager=new h,this.imageManager.setEventedParent(this),this.glyphManager=new _(n._requestManager,i.localIdeographFontFamily),this.lineAtlas=new k(256,512),this.crossTileSymbolIndex=new Pe,this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new t.ZoomHistory,this._loaded=!1,this._resetUpdates(),this.dispatcher.broadcast("setReferrer",t.getReferrer());var o=this;this._rtlTextPluginCallback=r.registerForPluginAvailability(function(t){for(var e in o.dispatcher.broadcast("loadRTLTextPlugin",t.pluginURL,t.completionCallback),o.sourceCaches)o.sourceCaches[e].reload()}),this.on("data",function(t){if("source"===t.dataType&&"metadata"===t.sourceDataType){var e=a.sourceCaches[t.sourceId];if(e){var r=e.getSource();if(r&&r.vectorLayerIds)for(var n in a._layers){var i=a._layers[n];i.source===r.id&&a._validateLayer(i)}}}})}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.loadURL=function(e,r){var n=this;void 0===r&&(r={}),this.fire(new t.Event("dataloading",{dataType:"style"}));var i="boolean"==typeof r.validate?r.validate:!t.isMapboxURL(e);e=this.map._requestManager.normalizeStyleURL(e,r.accessToken);var a=this.map._requestManager.transformRequest(e,t.ResourceType.Style);this._request=t.getJSON(a,function(e,r){n._request=null,e?n.fire(new t.ErrorEvent(e)):r&&n._load(r,i)})},r.prototype.loadJSON=function(e,r){var n=this;void 0===r&&(r={}),this.fire(new t.Event("dataloading",{dataType:"style"})),this._request=t.browser.frame(function(){n._request=null,n._load(e,!1!==r.validate)})},r.prototype._load=function(e,r){var n=this;if(!r||!Ie(this,t.validateStyle(e))){for(var i in this._loaded=!0,this.stylesheet=e,e.sources)this.addSource(i,e.sources[i],{validate:!1});e.sprite?this._spriteRequest=function(e,r,n){var i,a,o,s=t.browser.devicePixelRatio>1?"@2x":"",l=t.getJSON(r.transformRequest(r.normalizeSpriteURL(e,s,".json"),t.ResourceType.SpriteJSON),function(t,e){l=null,o||(o=t,i=e,c())}),u=t.getImage(r.transformRequest(r.normalizeSpriteURL(e,s,".png"),t.ResourceType.SpriteImage),function(t,e){u=null,o||(o=t,a=e,c())});function c(){if(o)n(o);else if(i&&a){var e=t.browser.getImageData(a),r={};for(var s in i){var l=i[s],u=l.width,c=l.height,p=l.x,h=l.y,f=l.sdf,d=l.pixelRatio,m=new t.RGBAImage({width:u,height:c});t.RGBAImage.copy(e,m,{x:p,y:h},{x:0,y:0},{width:u,height:c}),r[s]={data:m,pixelRatio:d,sdf:f}}n(null,r)}}return{cancel:function(){l&&(l.cancel(),l=null),u&&(u.cancel(),u=null)}}}(e.sprite,this.map._requestManager,function(e,r){if(n._spriteRequest=null,e)n.fire(new t.ErrorEvent(e));else if(r)for(var i in r)n.imageManager.addImage(i,r[i]);n.imageManager.setLoaded(!0),n.fire(new t.Event("data",{dataType:"style"}))}):this.imageManager.setLoaded(!0),this.glyphManager.setURL(e.glyphs);var a=Bt(this.stylesheet.layers);this._order=a.map(function(t){return t.id}),this._layers={};for(var o=0,s=a;o<s.length;o+=1){var l=s[o];(l=t.createStyleLayer(l)).setEventedParent(this,{layer:{id:l.id}}),this._layers[l.id]=l}this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new w(this.stylesheet.light),this.fire(new t.Event("data",{dataType:"style"})),this.fire(new t.Event("style.load"))}},r.prototype._validateLayer=function(e){var r=this.sourceCaches[e.source];if(r){var n=e.sourceLayer;if(n){var i=r.getSource();("geojson"===i.type||i.vectorLayerIds&&-1===i.vectorLayerIds.indexOf(n))&&this.fire(new t.ErrorEvent(new Error('Source layer "'+n+'" does not exist on source "'+i.id+'" as specified by style layer "'+e.id+'"')))}}},r.prototype.loaded=function(){if(!this._loaded)return!1;if(Object.keys(this._updatedSources).length)return!1;for(var t in this.sourceCaches)if(!this.sourceCaches[t].loaded())return!1;return!!this.imageManager.isLoaded()},r.prototype._serializeLayers=function(t){for(var e=[],r=0,n=t;r<n.length;r+=1){var i=n[r],a=this._layers[i];"custom"!==a.type&&e.push(a.serialize())}return e},r.prototype.hasTransitions=function(){if(this.light&&this.light.hasTransition())return!0;for(var t in this.sourceCaches)if(this.sourceCaches[t].hasTransition())return!0;for(var e in this._layers)if(this._layers[e].hasTransition())return!0;return!1},r.prototype._checkLoaded=function(){if(!this._loaded)throw new Error("Style is not done loading")},r.prototype.update=function(e){if(this._loaded){var r=this._changed;if(this._changed){var n=Object.keys(this._updatedLayers),i=Object.keys(this._removedLayers);for(var a in(n.length||i.length)&&this._updateWorkerLayers(n,i),this._updatedSources){var o=this._updatedSources[a];"reload"===o?this._reloadSource(a):"clear"===o&&this._clearSource(a)}for(var s in this._updatedPaintProps)this._layers[s].updateTransitions(e);this.light.updateTransitions(e),this._resetUpdates()}for(var l in this.sourceCaches)this.sourceCaches[l].used=!1;for(var u=0,c=this._order;u<c.length;u+=1){var p=c[u],h=this._layers[p];h.recalculate(e),!h.isHidden(e.zoom)&&h.source&&(this.sourceCaches[h.source].used=!0)}this.light.recalculate(e),this.z=e.zoom,r&&this.fire(new t.Event("data",{dataType:"style"}))}},r.prototype._updateWorkerLayers=function(t,e){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(t),removedIds:e})},r.prototype._resetUpdates=function(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={}},r.prototype.setState=function(e){var r=this;if(this._checkLoaded(),Ie(this,t.validateStyle(e)))return!1;(e=t.clone$1(e)).layers=Bt(e.layers);var n=function(e,r){if(!e)return[{command:Nt.setStyle,args:[r]}];var n=[];try{if(!t.deepEqual(e.version,r.version))return[{command:Nt.setStyle,args:[r]}];t.deepEqual(e.center,r.center)||n.push({command:Nt.setCenter,args:[r.center]}),t.deepEqual(e.zoom,r.zoom)||n.push({command:Nt.setZoom,args:[r.zoom]}),t.deepEqual(e.bearing,r.bearing)||n.push({command:Nt.setBearing,args:[r.bearing]}),t.deepEqual(e.pitch,r.pitch)||n.push({command:Nt.setPitch,args:[r.pitch]}),t.deepEqual(e.sprite,r.sprite)||n.push({command:Nt.setSprite,args:[r.sprite]}),t.deepEqual(e.glyphs,r.glyphs)||n.push({command:Nt.setGlyphs,args:[r.glyphs]}),t.deepEqual(e.transition,r.transition)||n.push({command:Nt.setTransition,args:[r.transition]}),t.deepEqual(e.light,r.light)||n.push({command:Nt.setLight,args:[r.light]});var i={},a=[];!function(e,r,n,i){var a;for(a in r=r||{},e=e||{})e.hasOwnProperty(a)&&(r.hasOwnProperty(a)||jt(a,n,i));for(a in r)r.hasOwnProperty(a)&&(e.hasOwnProperty(a)?t.deepEqual(e[a],r[a])||("geojson"===e[a].type&&"geojson"===r[a].type&&qt(e,r,a)?n.push({command:Nt.setGeoJSONSourceData,args:[a,r[a].data]}):Vt(a,r,n,i)):Ut(a,r,n))}(e.sources,r.sources,a,i);var o=[];e.layers&&e.layers.forEach(function(t){i[t.source]?n.push({command:Nt.removeLayer,args:[t.id]}):o.push(t)}),n=n.concat(a),function(e,r,n){r=r||[];var i,a,o,s,l,u,c,p=(e=e||[]).map(Ht),h=r.map(Ht),f=e.reduce(Zt,{}),d=r.reduce(Zt,{}),m=p.slice(),y=Object.create(null);for(i=0,a=0;i<p.length;i++)o=p[i],d.hasOwnProperty(o)?a++:(n.push({command:Nt.removeLayer,args:[o]}),m.splice(m.indexOf(o,a),1));for(i=0,a=0;i<h.length;i++)o=h[h.length-1-i],m[m.length-1-i]!==o&&(f.hasOwnProperty(o)?(n.push({command:Nt.removeLayer,args:[o]}),m.splice(m.lastIndexOf(o,m.length-a),1)):a++,u=m[m.length-i],n.push({command:Nt.addLayer,args:[d[o],u]}),m.splice(m.length-i,0,o),y[o]=!0);for(i=0;i<h.length;i++)if(s=f[o=h[i]],l=d[o],!y[o]&&!t.deepEqual(s,l))if(t.deepEqual(s.source,l.source)&&t.deepEqual(s["source-layer"],l["source-layer"])&&t.deepEqual(s.type,l.type)){for(c in Gt(s.layout,l.layout,n,o,null,Nt.setLayoutProperty),Gt(s.paint,l.paint,n,o,null,Nt.setPaintProperty),t.deepEqual(s.filter,l.filter)||n.push({command:Nt.setFilter,args:[o,l.filter]}),t.deepEqual(s.minzoom,l.minzoom)&&t.deepEqual(s.maxzoom,l.maxzoom)||n.push({command:Nt.setLayerZoomRange,args:[o,l.minzoom,l.maxzoom]}),s)s.hasOwnProperty(c)&&"layout"!==c&&"paint"!==c&&"filter"!==c&&"metadata"!==c&&"minzoom"!==c&&"maxzoom"!==c&&(0===c.indexOf("paint.")?Gt(s[c],l[c],n,o,c.slice(6),Nt.setPaintProperty):t.deepEqual(s[c],l[c])||n.push({command:Nt.setLayerProperty,args:[o,c,l[c]]}));for(c in l)l.hasOwnProperty(c)&&!s.hasOwnProperty(c)&&"layout"!==c&&"paint"!==c&&"filter"!==c&&"metadata"!==c&&"minzoom"!==c&&"maxzoom"!==c&&(0===c.indexOf("paint.")?Gt(s[c],l[c],n,o,c.slice(6),Nt.setPaintProperty):t.deepEqual(s[c],l[c])||n.push({command:Nt.setLayerProperty,args:[o,c,l[c]]}))}else n.push({command:Nt.removeLayer,args:[o]}),u=m[m.lastIndexOf(o)+1],n.push({command:Nt.addLayer,args:[l,u]})}(o,r.layers,n)}catch(t){console.warn("Unable to compute style diff:",t),n=[{command:Nt.setStyle,args:[r]}]}return n}(this.serialize(),e).filter(function(t){return!(t.command in Oe)});if(0===n.length)return!1;var i=n.filter(function(t){return!(t.command in De)});if(i.length>0)throw new Error("Unimplemented: "+i.map(function(t){return t.command}).join(", ")+".");return n.forEach(function(t){"setTransition"!==t.command&&r[t.command].apply(r,t.args)}),this.stylesheet=e,!0},r.prototype.addImage=function(e,r){if(this.getImage(e))return this.fire(new t.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(e,r),this.fire(new t.Event("data",{dataType:"style"}))},r.prototype.updateImage=function(t,e){this.imageManager.updateImage(t,e)},r.prototype.getImage=function(t){return this.imageManager.getImage(t)},r.prototype.removeImage=function(e){if(!this.getImage(e))return this.fire(new t.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(e),this.fire(new t.Event("data",{dataType:"style"}))},r.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},r.prototype.addSource=function(e,r,n){var i=this;if(void 0===n&&(n={}),this._checkLoaded(),void 0!==this.sourceCaches[e])throw new Error("There is already a source with this ID");if(!r.type)throw new Error("The type property must be defined, but the only the following properties were given: "+Object.keys(r).join(", ")+".");if(!(["vector","raster","geojson","video","image"].indexOf(r.type)>=0&&this._validate(t.validateStyle.source,"sources."+e,r,null,n))){this.map&&this.map._collectResourceTiming&&(r.collectResourceTiming=!0);var a=this.sourceCaches[e]=new Et(e,r,this.dispatcher);a.style=this,a.setEventedParent(this,function(){return{isSourceLoaded:i.loaded(),source:a.serialize(),sourceId:e}}),a.onAdd(this.map),this._changed=!0}},r.prototype.removeSource=function(e){if(this._checkLoaded(),void 0===this.sourceCaches[e])throw new Error("There is no source with this ID");for(var r in this._layers)if(this._layers[r].source===e)return this.fire(new t.ErrorEvent(new Error('Source "'+e+'" cannot be removed while layer "'+r+'" is using it.')));var n=this.sourceCaches[e];delete this.sourceCaches[e],delete this._updatedSources[e],n.fire(new t.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:e})),n.setEventedParent(null),n.clearTiles(),n.onRemove&&n.onRemove(this.map),this._changed=!0},r.prototype.setGeoJSONSourceData=function(t,e){this._checkLoaded(),this.sourceCaches[t].getSource().setData(e),this._changed=!0},r.prototype.getSource=function(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()},r.prototype.addLayer=function(e,r,n){void 0===n&&(n={}),this._checkLoaded();var i=e.id;if(this.getLayer(i))this.fire(new t.ErrorEvent(new Error('Layer with id "'+i+'" already exists on this map')));else{var a;if("custom"===e.type){if(Ie(this,t.validateCustomStyleLayer(e)))return;a=t.createStyleLayer(e)}else{if("object"==typeof e.source&&(this.addSource(i,e.source),e=t.clone$1(e),e=t.extend(e,{source:i})),this._validate(t.validateStyle.layer,"layers."+i,e,{arrayIndex:-1},n))return;a=t.createStyleLayer(e),this._validateLayer(a),a.setEventedParent(this,{layer:{id:i}})}var o=r?this._order.indexOf(r):this._order.length;if(r&&-1===o)this.fire(new t.ErrorEvent(new Error('Layer with id "'+r+'" does not exist on this map.')));else{if(this._order.splice(o,0,i),this._layerOrderChanged=!0,this._layers[i]=a,this._removedLayers[i]&&a.source&&"custom"!==a.type){var s=this._removedLayers[i];delete this._removedLayers[i],s.type!==a.type?this._updatedSources[a.source]="clear":(this._updatedSources[a.source]="reload",this.sourceCaches[a.source].pause())}this._updateLayer(a),a.onAdd&&a.onAdd(this.map)}}},r.prototype.moveLayer=function(e,r){if(this._checkLoaded(),this._changed=!0,this._layers[e]){if(e!==r){var n=this._order.indexOf(e);this._order.splice(n,1);var i=r?this._order.indexOf(r):this._order.length;r&&-1===i?this.fire(new t.ErrorEvent(new Error('Layer with id "'+r+'" does not exist on this map.'))):(this._order.splice(i,0,e),this._layerOrderChanged=!0)}}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be moved.")))},r.prototype.removeLayer=function(e){this._checkLoaded();var r=this._layers[e];if(r){r.setEventedParent(null);var n=this._order.indexOf(e);this._order.splice(n,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[e]=r,delete this._layers[e],delete this._updatedLayers[e],delete this._updatedPaintProps[e],r.onRemove&&r.onRemove(this.map)}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be removed.")))},r.prototype.getLayer=function(t){return this._layers[t]},r.prototype.setLayerZoomRange=function(e,r,n){this._checkLoaded();var i=this.getLayer(e);i?i.minzoom===r&&i.maxzoom===n||(null!=r&&(i.minzoom=r),null!=n&&(i.maxzoom=n),this._updateLayer(i)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot have zoom extent.")))},r.prototype.setFilter=function(e,r,n){void 0===n&&(n={}),this._checkLoaded();var i=this.getLayer(e);if(i){if(!t.deepEqual(i.filter,r))return null==r?(i.filter=void 0,void this._updateLayer(i)):void(this._validate(t.validateStyle.filter,"layers."+i.id+".filter",r,null,n)||(i.filter=t.clone$1(r),this._updateLayer(i)))}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be filtered.")))},r.prototype.getFilter=function(e){return t.clone$1(this.getLayer(e).filter)},r.prototype.setLayoutProperty=function(e,r,n,i){void 0===i&&(i={}),this._checkLoaded();var a=this.getLayer(e);a?t.deepEqual(a.getLayoutProperty(r),n)||(a.setLayoutProperty(r,n,i),this._updateLayer(a)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")))},r.prototype.getLayoutProperty=function(e,r){var n=this.getLayer(e);if(n)return n.getLayoutProperty(r);this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style.")))},r.prototype.setPaintProperty=function(e,r,n,i){void 0===i&&(i={}),this._checkLoaded();var a=this.getLayer(e);a?t.deepEqual(a.getPaintProperty(r),n)||(a.setPaintProperty(r,n,i)&&this._updateLayer(a),this._changed=!0,this._updatedPaintProps[e]=!0):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")))},r.prototype.getPaintProperty=function(t,e){return this.getLayer(t).getPaintProperty(e)},r.prototype.setFeatureState=function(e,r){this._checkLoaded();var n=e.source,i=e.sourceLayer,a=this.sourceCaches[n],o=parseInt(e.id,10);if(void 0!==a){var s=a.getSource().type;"geojson"===s&&i?this.fire(new t.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==s||i?isNaN(o)||o<0?this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided and non-negative."))):a.setFeatureState(i,o,r):this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+n+"' does not exist in the map's style.")))},r.prototype.removeFeatureState=function(e,r){this._checkLoaded();var n=e.source,i=this.sourceCaches[n];if(void 0!==i){var a=i.getSource().type,o="vector"===a?e.sourceLayer:void 0,s=parseInt(e.id,10);"vector"!==a||o?void 0!==e.id&&isNaN(s)||s<0?this.fire(new t.ErrorEvent(new Error("The feature id parameter must be non-negative."))):r&&"string"!=typeof e.id&&"number"!=typeof e.id?this.fire(new t.ErrorEvent(new Error("A feature id is requred to remove its specific state property."))):i.removeFeatureState(o,s,r):this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+n+"' does not exist in the map's style.")))},r.prototype.getFeatureState=function(e){this._checkLoaded();var r=e.source,n=e.sourceLayer,i=this.sourceCaches[r],a=parseInt(e.id,10);if(void 0!==i)if("vector"!==i.getSource().type||n){if(!(isNaN(a)||a<0))return i.getFeatureState(n,a);this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided and non-negative.")))}else this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));else this.fire(new t.ErrorEvent(new Error("The source '"+r+"' does not exist in the map's style.")))},r.prototype.getTransition=function(){return t.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},r.prototype.serialize=function(){return t.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:t.mapObject(this.sourceCaches,function(t){return t.serialize()}),layers:this._serializeLayers(this._order)},function(t){return void 0!==t})},r.prototype._updateLayer=function(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&(this._updatedSources[t.source]="reload",this.sourceCaches[t.source].pause()),this._changed=!0},r.prototype._flattenAndSortRenderedFeatures=function(t){for(var e=this,r=function(t){return"fill-extrusion"===e._layers[t].type},n={},i=[],a=this._order.length-1;a>=0;a--){var o=this._order[a];if(r(o)){n[o]=a;for(var s=0,l=t;s<l.length;s+=1){var u=l[s][o];if(u)for(var c=0,p=u;c<p.length;c+=1){var h=p[c];i.push(h)}}}}i.sort(function(t,e){return e.intersectionZ-t.intersectionZ});for(var f=[],d=this._order.length-1;d>=0;d--){var m=this._order[d];if(r(m))for(var y=i.length-1;y>=0;y--){var g=i[y].feature;if(n[g.layer.id]<d)break;f.push(g),i.pop()}else for(var v=0,_=t;v<_.length;v+=1){var x=_[v][m];if(x)for(var b=0,w=x;b<w.length;b+=1){var k=w[b];f.push(k.feature)}}}return f},r.prototype.queryRenderedFeatures=function(e,r,n){r&&r.filter&&this._validate(t.validateStyle.filter,"queryRenderedFeatures.filter",r.filter,null,r);var i={};if(r&&r.layers){if(!Array.isArray(r.layers))return this.fire(new t.ErrorEvent(new Error("parameters.layers must be an Array."))),[];for(var a=0,o=r.layers;a<o.length;a+=1){var s=o[a],l=this._layers[s];if(!l)return this.fire(new t.ErrorEvent(new Error("The layer '"+s+"' does not exist in the map's style and cannot be queried for features."))),[];i[l.source]=!0}}var u=[];for(var c in this.sourceCaches)r.layers&&!i[c]||u.push(F(this.sourceCaches[c],this._layers,e,r,n));return this.placement&&u.push(function(t,e,r,n,i,a){for(var o={},s=i.queryRenderedSymbols(r),l=[],u=0,c=Object.keys(s).map(Number);u<c.length;u+=1){var p=c[u];l.push(a[p])}l.sort(B);for(var h=function(){var e=d[f],r=e.featureIndex.lookupSymbolFeatures(s[e.bucketInstanceId],e.bucketIndex,e.sourceLayerIndex,n.filter,n.layers,t);for(var i in r){var a=o[i]=o[i]||[],l=r[i];l.sort(function(t,r){var n=e.featureSortOrder;if(n){var i=n.indexOf(t.featureIndex);return n.indexOf(r.featureIndex)-i}return r.featureIndex-t.featureIndex});for(var u=0,c=l;u<c.length;u+=1){var p=c[u];a.push(p)}}},f=0,d=l;f<d.length;f+=1)h();var m=function(r){o[r].forEach(function(n){var i=n.feature,a=t[r],o=e[a.source].getFeatureState(i.layer["source-layer"],i.id);i.source=i.layer.source,i.layer["source-layer"]&&(i.sourceLayer=i.layer["source-layer"]),i.state=o})};for(var y in o)m(y);return o}(this._layers,this.sourceCaches,e,r,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(u)},r.prototype.querySourceFeatures=function(e,r){r&&r.filter&&this._validate(t.validateStyle.filter,"querySourceFeatures.filter",r.filter,null,r);var n=this.sourceCaches[e];return n?function(t,e){for(var r=t.getRenderableIds().map(function(e){return t.getTileByID(e)}),n=[],i={},a=0;a<r.length;a++){var o=r[a],s=o.tileID.canonical.key;i[s]||(i[s]=!0,o.querySourceFeatures(n,e))}return n}(n,r):[]},r.prototype.addSourceType=function(t,e,n){return r.getSourceType(t)?n(new Error('A source type called "'+t+'" already exists.')):(r.setSourceType(t,e),e.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:t,url:e.workerSourceURL},n):n(null,null))},r.prototype.getLight=function(){return this.light.getLight()},r.prototype.setLight=function(e,r){void 0===r&&(r={}),this._checkLoaded();var n=this.light.getLight(),i=!1;for(var a in e)if(!t.deepEqual(e[a],n[a])){i=!0;break}if(i){var o={now:t.browser.now(),transition:t.extend({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(e,r),this.light.updateTransitions(o)}},r.prototype._validate=function(e,r,n,i,a){return void 0===a&&(a={}),(!a||!1!==a.validate)&&Ie(this,e.call(t.validateStyle,t.extend({key:r,style:this.serialize(),value:n,styleSpec:t.styleSpec},i)))},r.prototype._remove=function(){for(var e in this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),t.evented.off("pluginAvailable",this._rtlTextPluginCallback),this.sourceCaches)this.sourceCaches[e].clearTiles();this.dispatcher.remove()},r.prototype._clearSource=function(t){this.sourceCaches[t].clearTiles()},r.prototype._reloadSource=function(t){this.sourceCaches[t].resume(),this.sourceCaches[t].reload()},r.prototype._updateSources=function(t){for(var e in this.sourceCaches)this.sourceCaches[e].update(t)},r.prototype._generateCollisionBoxes=function(){for(var t in this.sourceCaches)this._reloadSource(t)},r.prototype._updatePlacement=function(e,r,n,i){for(var a=!1,o=!1,s={},l=0,u=this._order;l<u.length;l+=1){var c=u[l],p=this._layers[c];if("symbol"===p.type){if(!s[p.source]){var h=this.sourceCaches[p.source];s[p.source]=h.getRenderableIds(!0).map(function(t){return h.getTileByID(t)}).sort(function(t,e){return e.tileID.overscaledZ-t.tileID.overscaledZ||(t.tileID.isLessThan(e.tileID)?-1:1)})}var f=this.crossTileSymbolIndex.addLayer(p,s[p.source],e.center.lng);a=a||f}}this.crossTileSymbolIndex.pruneUnusedLayers(this._order);var d=this._layerOrderChanged||0===n;if((d||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(t.browser.now()))&&(this.pauseablePlacement=new Se(e,this._order,d,r,n,i,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,s),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(t.browser.now()),o=!0),a&&this.pauseablePlacement.placement.setStale()),o||a)for(var m=0,y=this._order;m<y.length;m+=1){var g=y[m],v=this._layers[g];"symbol"===v.type&&this.placement.updateLayerOpacities(v,s[v.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(t.browser.now())},r.prototype._releaseSymbolFadeTiles=function(){for(var t in this.sourceCaches)this.sourceCaches[t].releaseSymbolFadeTiles()},r.prototype.getImages=function(t,e,r){this.imageManager.getImages(e.icons,r)},r.prototype.getGlyphs=function(t,e,r){this.glyphManager.getGlyphs(e.stacks,r)},r.prototype.getResource=function(e,r,n){return t.makeRequest(r,n)},r}(t.Evented);Re.getSourceType=function(t){return D[t]},Re.setSourceType=function(t,e){D[t]=e},Re.registerForPluginAvailability=t.registerForPluginAvailability;var Fe=t.createLayout([{name:"a_pos",type:"Int16",components:2}]),Be=ur("#ifdef GL_ES\nprecision mediump float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif","#ifdef GL_ES\nprecision highp float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif\nvec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0\n);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}"),Ne=ur("uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),Ue=ur("uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),je=ur("varying vec3 v_data;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=v_data.xy;float extrude_length=length(extrude);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));gl_FragColor=opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main(void) {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,0,1);} else {gl_Position=u_matrix*vec4(circle_center,0,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);}"),Ve=ur("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),qe=ur("uniform highp float u_intensity;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#define GAUSS_COEF 0.3989422804014327\nvoid main() {\n#pragma mapbox: initialize highp float weight\nfloat d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#pragma mapbox: define mediump float radius\nconst highp float ZERO=1.0/255.0/16.0;\n#define GAUSS_COEF 0.3989422804014327\nvoid main(void) {\n#pragma mapbox: initialize highp float weight\n#pragma mapbox: initialize mediump float radius\nvec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,0,1);gl_Position=u_matrix*pos;}"),Ge=ur("uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(0.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),He=ur("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,0.0,1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),Ze=ur("uniform float u_overscale_factor;varying float v_placed;varying float v_notUsed;varying float v_radius;varying vec2 v_extrude;varying vec2 v_extrude_scale;void main() {float alpha=0.5;vec4 color=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {color=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {color*=.2;}float extrude_scale_length=length(v_extrude_scale);float extrude_length=length(v_extrude)*extrude_scale_length;float stroke_width=15.0*extrude_scale_length/u_overscale_factor;float radius=v_radius*extrude_scale_length;float distance_to_edge=abs(extrude_length-radius);float opacity_t=smoothstep(-stroke_width,0.0,-distance_to_edge);gl_FragColor=opacity_t*color;}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;varying float v_radius;varying vec2 v_extrude;varying vec2 v_extrude_scale;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,0.0,1.0);highp float padding_factor=1.2;gl_Position.xy+=a_extrude*u_extrude_scale*padding_factor*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;v_radius=abs(a_extrude.y);v_extrude=a_extrude*padding_factor;v_extrude_scale=u_extrude_scale*u_camera_to_center_distance*collision_perspective_ratio;}"),Xe=ur("uniform highp vec4 u_color;void main() {gl_FragColor=u_color;}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),We=ur("#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_FragColor=color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);}"),Ye=ur("varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),Ke=ur("uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec4 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float pixelRatio=u_scale.x;float tileRatio=u_scale.y;float fromScale=u_scale.z;float toScale=u_scale.w;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=vec2((pattern_br_a.x-pattern_tl_a.x)/pixelRatio,(pattern_br_a.y-pattern_tl_a.y)/pixelRatio);vec2 display_size_b=vec2((pattern_br_b.x-pattern_tl_b.x)/pixelRatio,(pattern_br_b.y-pattern_tl_b.y)/pixelRatio);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),Je=ur("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec4 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float pixelRatio=u_scale.x;float tileZoomRatio=u_scale.y;float fromScale=u_scale.z;float toScale=u_scale.w;vec2 display_size_a=vec2((pattern_br_a.x-pattern_tl_a.x)/pixelRatio,(pattern_br_a.y-pattern_tl_a.y)/pixelRatio);vec2 display_size_b=vec2((pattern_br_b.x-pattern_tl_b.x)/pixelRatio,(pattern_br_b.y-pattern_tl_b.y)/pixelRatio);gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}"),$e=ur("varying vec4 v_color;void main() {gl_FragColor=v_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec4 v_color;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec3 normal=a_normal_ed.xyz;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}"),Qe=ur("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec4 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float pixelRatio=u_scale.x;float tileRatio=u_scale.y;float fromScale=u_scale.z;float toScale=u_scale.w;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=vec2((pattern_br_a.x-pattern_tl_a.x)/pixelRatio,(pattern_br_a.y-pattern_tl_a.y)/pixelRatio);vec2 display_size_b=vec2((pattern_br_b.x-pattern_tl_b.x)/pixelRatio,(pattern_br_b.y-pattern_tl_b.y)/pixelRatio);base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0\n? a_pos\n: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}"),tr=ur("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform float u_maxzoom;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;return (data.r+data.g*256.0+data.b*256.0*256.0)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggeration=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/ pow(2.0,(u_zoom-u_maxzoom)*exaggeration+19.2562-u_zoom);gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),er=ur("uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;\n#define PI 3.141592653589793\nvoid main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),rr=ur("uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;\n#pragma mapbox: define highp 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#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp 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#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}"),nr=ur("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp float v_lineprogress;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,vec2(v_lineprogress,0.5));gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define MAX_LINE_DISTANCE 32767.0\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_lineprogress;\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#pragma mapbox: define mediump float width\nvoid main() {\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#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_lineprogress=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0/MAX_LINE_DISTANCE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}"),ir=ur("uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec4 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float pixelRatio=u_scale.x;float tileZoomRatio=u_scale.y;float fromScale=u_scale.z;float toScale=u_scale.w;vec2 display_size_a=vec2((pattern_br_a.x-pattern_tl_a.x)/pixelRatio,(pattern_br_a.y-pattern_tl_a.y)/pixelRatio);vec2 display_size_b=vec2((pattern_br_b.x-pattern_tl_b.x)/pixelRatio,(pattern_br_b.y-pattern_tl_b.y)/pixelRatio);vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x,1.0);float x_b=mod(v_linesofar/pattern_size_b.x,1.0);float y_a=0.5+(v_normal.y*clamp(v_width2.s,0.0,(pattern_size_a.y+2.0)/2.0)/pattern_size_a.y);float y_b=0.5+(v_normal.y*clamp(v_width2.s,0.0,(pattern_size_b.y+2.0)/2.0)/pattern_size_b.y);vec2 pos_a=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,vec2(x_a,y_a));vec2 pos_b=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,vec2(x_b,y_b));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_linesofar=a_linesofar;v_width2=vec2(outset,inset);}"),ar=ur("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp 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#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp 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#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}"),or=ur("uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),sr=ur("uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size[0],a_size[1],u_size_t)/256.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size[0]/256.0;} else if (!u_is_size_zoom_constant && u_is_size_feature_constant) {size=u_size;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;v_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));}"),lr=ur("#define SDF_PX 8.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size[0],a_size[1],u_size_t)/256.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size[0]/256.0;} else if (!u_is_size_zoom_constant && u_is_size_feature_constant) {size=u_size;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);float gamma_scale=gl_Position.w;vec2 tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0=vec2(tex.x,tex.y);v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}");function ur(t,e){var r=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,n={};return{fragmentSource:t=t.replace(r,function(t,e,r,i,a){return n[a]=!0,"define"===e?"\n#ifndef HAS_UNIFORM_u_"+a+"\nvarying "+r+" "+i+" "+a+";\n#else\nuniform "+r+" "+i+" u_"+a+";\n#endif\n":"\n#ifdef HAS_UNIFORM_u_"+a+"\n "+r+" "+i+" "+a+" = u_"+a+";\n#endif\n"}),vertexSource:e=e.replace(r,function(t,e,r,i,a){var o="float"===i?"vec2":"vec4",s=a.match(/color/)?"color":o;return n[a]?"define"===e?"\n#ifndef HAS_UNIFORM_u_"+a+"\nuniform lowp float u_"+a+"_t;\nattribute "+r+" "+o+" a_"+a+";\nvarying "+r+" "+i+" "+a+";\n#else\nuniform "+r+" "+i+" u_"+a+";\n#endif\n":"vec4"===s?"\n#ifndef HAS_UNIFORM_u_"+a+"\n "+a+" = a_"+a+";\n#else\n "+r+" "+i+" "+a+" = u_"+a+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+a+"\n "+a+" = unpack_mix_"+s+"(a_"+a+", u_"+a+"_t);\n#else\n "+r+" "+i+" "+a+" = u_"+a+";\n#endif\n":"define"===e?"\n#ifndef HAS_UNIFORM_u_"+a+"\nuniform lowp float u_"+a+"_t;\nattribute "+r+" "+o+" a_"+a+";\n#else\nuniform "+r+" "+i+" u_"+a+";\n#endif\n":"vec4"===s?"\n#ifndef HAS_UNIFORM_u_"+a+"\n "+r+" "+i+" "+a+" = a_"+a+";\n#else\n "+r+" "+i+" "+a+" = u_"+a+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+a+"\n "+r+" "+i+" "+a+" = unpack_mix_"+s+"(a_"+a+", u_"+a+"_t);\n#else\n "+r+" "+i+" "+a+" = u_"+a+";\n#endif\n"})}}var cr=Object.freeze({prelude:Be,background:Ne,backgroundPattern:Ue,circle:je,clippingMask:Ve,heatmap:qe,heatmapTexture:Ge,collisionBox:He,collisionCircle:Ze,debug:Xe,fill:We,fillOutline:Ye,fillOutlinePattern:Ke,fillPattern:Je,fillExtrusion:$e,fillExtrusionPattern:Qe,hillshadePrepare:tr,hillshade:er,line:rr,lineGradient:nr,linePattern:ir,lineSDF:ar,raster:or,symbolIcon:sr,symbolSDF:lr}),pr=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};pr.prototype.bind=function(t,e,r,n,i,a,o,s){this.context=t;for(var l=this.boundPaintVertexBuffers.length!==n.length,u=0;!l&&u<n.length;u++)this.boundPaintVertexBuffers[u]!==n[u]&&(l=!0);var c=!this.vao||this.boundProgram!==e||this.boundLayoutVertexBuffer!==r||l||this.boundIndexBuffer!==i||this.boundVertexOffset!==a||this.boundDynamicVertexBuffer!==o||this.boundDynamicVertexBuffer2!==s;!t.extVertexArrayObject||c?this.freshBind(e,r,n,i,a,o,s):(t.bindVertexArrayOES.set(this.vao),o&&o.bind(),i&&i.dynamicDraw&&i.bind(),s&&s.bind())},pr.prototype.freshBind=function(t,e,r,n,i,a,o){var s,l=t.numAttributes,u=this.context,c=u.gl;if(u.extVertexArrayObject)this.vao&&this.destroy(),this.vao=u.extVertexArrayObject.createVertexArrayOES(),u.bindVertexArrayOES.set(this.vao),s=0,this.boundProgram=t,this.boundLayoutVertexBuffer=e,this.boundPaintVertexBuffers=r,this.boundIndexBuffer=n,this.boundVertexOffset=i,this.boundDynamicVertexBuffer=a,this.boundDynamicVertexBuffer2=o;else{s=u.currentNumAttributes||0;for(var p=l;p<s;p++)c.disableVertexAttribArray(p)}e.enableAttributes(c,t);for(var h=0,f=r;h<f.length;h+=1)f[h].enableAttributes(c,t);a&&a.enableAttributes(c,t),o&&o.enableAttributes(c,t),e.bind(),e.setVertexAttribPointers(c,t,i);for(var d=0,m=r;d<m.length;d+=1){var y=m[d];y.bind(),y.setVertexAttribPointers(c,t,i)}a&&(a.bind(),a.setVertexAttribPointers(c,t,i)),n&&n.bind(),o&&(o.bind(),o.setVertexAttribPointers(c,t,i)),u.currentNumAttributes=l},pr.prototype.destroy=function(){this.vao&&(this.context.extVertexArrayObject.deleteVertexArrayOES(this.vao),this.vao=null)};var hr=function(t,e,r,n,i){var a=t.gl;this.program=a.createProgram();var o=r.defines();i&&o.push("#define OVERDRAW_INSPECTOR;");var s=o.concat(Be.fragmentSource,e.fragmentSource).join("\n"),l=o.concat(Be.vertexSource,e.vertexSource).join("\n"),u=a.createShader(a.FRAGMENT_SHADER);a.shaderSource(u,s),a.compileShader(u),a.attachShader(this.program,u);var c=a.createShader(a.VERTEX_SHADER);a.shaderSource(c,l),a.compileShader(c),a.attachShader(this.program,c);for(var p=r.layoutAttributes||[],h=0;h<p.length;h++)a.bindAttribLocation(this.program,h,p[h].name);a.linkProgram(this.program),this.numAttributes=a.getProgramParameter(this.program,a.ACTIVE_ATTRIBUTES),this.attributes={};for(var f={},d=0;d<this.numAttributes;d++){var m=a.getActiveAttrib(this.program,d);m&&(this.attributes[m.name]=a.getAttribLocation(this.program,m.name))}for(var y=a.getProgramParameter(this.program,a.ACTIVE_UNIFORMS),g=0;g<y;g++){var v=a.getActiveUniform(this.program,g);v&&(f[v.name]=a.getUniformLocation(this.program,v.name))}this.fixedUniforms=n(t,f),this.binderUniforms=r.getUniforms(t,f)};function fr(e,r,n){var i=1/ue(n,1,r.transform.tileZoom),a=Math.pow(2,n.tileID.overscaledZ),o=n.tileSize*Math.pow(2,r.transform.tileZoom)/a,s=o*(n.tileID.canonical.x+n.tileID.wrap*a),l=o*n.tileID.canonical.y;return{u_image:0,u_texsize:n.imageAtlasTexture.size,u_scale:[t.browser.devicePixelRatio,i,e.fromScale,e.toScale],u_fade:e.t,u_pixel_coord_upper:[s>>16,l>>16],u_pixel_coord_lower:[65535&s,65535&l]}}hr.prototype.draw=function(t,e,r,n,i,a,o,s,l,u,c,p,h,f,d,m){var y,g=t.gl;for(var v in t.program.set(this.program),t.setDepthMode(r),t.setStencilMode(n),t.setColorMode(i),t.setCullFace(a),this.fixedUniforms)this.fixedUniforms[v].set(o[v]);f&&f.setUniforms(t,this.binderUniforms,p,{zoom:h});for(var _=(y={},y[g.LINES]=2,y[g.TRIANGLES]=3,y[g.LINE_STRIP]=1,y)[e],x=0,b=c.get();x<b.length;x+=1){var w=b[x],k=w.vaos||(w.vaos={});(k[s]||(k[s]=new pr)).bind(t,this,l,f?f.getPaintVertexBuffers():[],u,w.vertexOffset,d,m),g.drawElements(e,w.primitiveLength*_,g.UNSIGNED_SHORT,w.primitiveOffset*_*2)}};var dr=function(e,r,n,i){var a=r.style.light,o=a.properties.get("position"),s=[o.x,o.y,o.z],l=t.create$1();"viewport"===a.properties.get("anchor")&&t.fromRotation(l,-r.transform.angle),t.transformMat3(s,s,l);var u=a.properties.get("color");return{u_matrix:e,u_lightpos:s,u_lightintensity:a.properties.get("intensity"),u_lightcolor:[u.r,u.g,u.b],u_vertical_gradient:+n,u_opacity:i}},mr=function(e,r,n,i,a,o,s){return t.extend(dr(e,r,n,i),fr(o,r,s),{u_height_factor:-Math.pow(2,a.overscaledZ)/s.tileSize/8})},yr=function(t){return{u_matrix:t}},gr=function(e,r,n,i){return t.extend(yr(e),fr(n,r,i))},vr=function(t,e){return{u_matrix:t,u_world:e}},_r=function(e,r,n,i,a){return t.extend(gr(e,r,n,i),{u_world:a})},xr=function(e,r,n,i){var a,o,s=e.transform;if("map"===i.paint.get("circle-pitch-alignment")){var l=ue(n,1,s.zoom);a=!0,o=[l,l]}else a=!1,o=s.pixelsToGLUnits;return{u_camera_to_center_distance:s.cameraToCenterDistance,u_scale_with_map:+("map"===i.paint.get("circle-pitch-scale")),u_matrix:e.translatePosMatrix(r.posMatrix,n,i.paint.get("circle-translate"),i.paint.get("circle-translate-anchor")),u_pitch_with_map:+a,u_device_pixel_ratio:t.browser.devicePixelRatio,u_extrude_scale:o}},br=function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pixels_to_tile_units:new t.Uniform1f(e,r.u_pixels_to_tile_units),u_extrude_scale:new t.Uniform2f(e,r.u_extrude_scale),u_overscale_factor:new t.Uniform1f(e,r.u_overscale_factor)}},wr=function(t,e,r){var n=ue(r,1,e.zoom),i=Math.pow(2,e.zoom-r.tileID.overscaledZ),a=r.tileID.overscaleFactor();return{u_matrix:t,u_camera_to_center_distance:e.cameraToCenterDistance,u_pixels_to_tile_units:n,u_extrude_scale:[e.pixelsToGLUnits[0]/(n*i),e.pixelsToGLUnits[1]/(n*i)],u_overscale_factor:a}},kr=function(t,e){return{u_matrix:t,u_color:e}},Tr=function(t){return{u_matrix:t}},Ar=function(t,e,r,n){return{u_matrix:t,u_extrude_scale:ue(e,1,r),u_intensity:n}},Mr=function(t,e,r){var n=r.paint.get("hillshade-shadow-color"),i=r.paint.get("hillshade-highlight-color"),a=r.paint.get("hillshade-accent-color"),o=r.paint.get("hillshade-illumination-direction")*(Math.PI/180);"viewport"===r.paint.get("hillshade-illumination-anchor")&&(o-=t.transform.angle);var s=!t.options.moving;return{u_matrix:t.transform.calculatePosMatrix(e.tileID.toUnwrapped(),s),u_image:0,u_latrange:Lr(t,e.tileID),u_light:[r.paint.get("hillshade-exaggeration"),o],u_shadow:n,u_highlight:i,u_accent:a}},Sr=function(e,r){var n=e.dem.stride,i=t.create();return t.ortho(i,0,t.EXTENT,-t.EXTENT,0,0,1),t.translate(i,i,[0,-t.EXTENT,0]),{u_matrix:i,u_image:1,u_dimension:[n,n],u_zoom:e.tileID.overscaledZ,u_maxzoom:r}};function Lr(e,r){var n=Math.pow(2,r.canonical.z),i=r.canonical.y;return[new t.MercatorCoordinate(0,i/n).toLngLat().lat,new t.MercatorCoordinate(0,(i+1)/n).toLngLat().lat]}var Cr=function(e,r,n){var i=e.transform;return{u_matrix:Dr(e,r,n),u_ratio:1/ue(r,1,i.zoom),u_device_pixel_ratio:t.browser.devicePixelRatio,u_units_to_pixels:[1/i.pixelsToGLUnits[0],1/i.pixelsToGLUnits[1]]}},Er=function(e,r,n){return t.extend(Cr(e,r,n),{u_image:0})},zr=function(e,r,n,i){var a=e.transform,o=Ir(r,a);return{u_matrix:Dr(e,r,n),u_texsize:r.imageAtlasTexture.size,u_ratio:1/ue(r,1,a.zoom),u_device_pixel_ratio:t.browser.devicePixelRatio,u_image:0,u_scale:[t.browser.devicePixelRatio,o,i.fromScale,i.toScale],u_fade:i.t,u_units_to_pixels:[1/a.pixelsToGLUnits[0],1/a.pixelsToGLUnits[1]]}},Pr=function(e,r,n,i,a){var o=e.transform,s=e.lineAtlas,l=Ir(r,o),u="round"===n.layout.get("line-cap"),c=s.getDash(i.from,u),p=s.getDash(i.to,u),h=c.width*a.fromScale,f=p.width*a.toScale;return t.extend(Cr(e,r,n),{u_patternscale_a:[l/h,-c.height/2],u_patternscale_b:[l/f,-p.height/2],u_sdfgamma:s.width/(256*Math.min(h,f)*t.browser.devicePixelRatio)/2,u_image:0,u_tex_y_a:c.y,u_tex_y_b:p.y,u_mix:a.t})};function Ir(t,e){return 1/ue(t,1,e.tileZoom)}function Dr(t,e,r){return t.translatePosMatrix(e.tileID.posMatrix,e,r.paint.get("line-translate"),r.paint.get("line-translate-anchor"))}var Or=function(t,e,r,n,i){return{u_matrix:t,u_tl_parent:e,u_scale_parent:r,u_buffer_scale:1,u_fade_t:n.mix,u_opacity:n.opacity*i.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:i.paint.get("raster-brightness-min"),u_brightness_high:i.paint.get("raster-brightness-max"),u_saturation_factor:(o=i.paint.get("raster-saturation"),o>0?1-1/(1.001-o):-o),u_contrast_factor:(a=i.paint.get("raster-contrast"),a>0?1/(1-a):1+a),u_spin_weights:Rr(i.paint.get("raster-hue-rotate"))};var a,o};function Rr(t){t*=Math.PI/180;var e=Math.sin(t),r=Math.cos(t);return[(2*r+1)/3,(-Math.sqrt(3)*e-r+1)/3,(Math.sqrt(3)*e-r+1)/3]}var Fr=function(t,e,r,n,i,a,o,s,l,u){var c=i.transform;return{u_is_size_zoom_constant:+("constant"===t||"source"===t),u_is_size_feature_constant:+("constant"===t||"camera"===t),u_size_t:e?e.uSizeT:0,u_size:e?e.uSize:0,u_camera_to_center_distance:c.cameraToCenterDistance,u_pitch:c.pitch/360*2*Math.PI,u_rotate_symbol:+r,u_aspect_ratio:c.width/c.height,u_fade_change:i.options.fadeDuration?i.symbolFadeChange:1,u_matrix:a,u_label_plane_matrix:o,u_coord_matrix:s,u_is_text:+l,u_pitch_with_map:+n,u_texsize:u,u_texture:0}},Br=function(e,r,n,i,a,o,s,l,u,c,p){var h=a.transform;return t.extend(Fr(e,r,n,i,a,o,s,l,u,c),{u_gamma_scale:i?Math.cos(h._pitch)*h.cameraToCenterDistance:1,u_device_pixel_ratio:t.browser.devicePixelRatio,u_is_halo:+p})},Nr=function(t,e,r){return{u_matrix:t,u_opacity:e,u_color:r}},Ur=function(e,r,n,i,a,o){return t.extend(function(t,e,r,n){var i=r.imageManager.getPattern(t.from),a=r.imageManager.getPattern(t.to),o=r.imageManager.getPixelSize(),s=o.width,l=o.height,u=Math.pow(2,n.tileID.overscaledZ),c=n.tileSize*Math.pow(2,r.transform.tileZoom)/u,p=c*(n.tileID.canonical.x+n.tileID.wrap*u),h=c*n.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:i.tl,u_pattern_br_a:i.br,u_pattern_tl_b:a.tl,u_pattern_br_b:a.br,u_texsize:[s,l],u_mix:e.t,u_pattern_size_a:i.displaySize,u_pattern_size_b:a.displaySize,u_scale_a:e.fromScale,u_scale_b:e.toScale,u_tile_units_to_pixels:1/ue(n,1,r.transform.tileZoom),u_pixel_coord_upper:[p>>16,h>>16],u_pixel_coord_lower:[65535&p,65535&h]}}(i,o,n,a),{u_matrix:e,u_opacity:r})},jr={fillExtrusion:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_lightpos:new t.Uniform3f(e,r.u_lightpos),u_lightintensity:new t.Uniform1f(e,r.u_lightintensity),u_lightcolor:new t.Uniform3f(e,r.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,r.u_vertical_gradient),u_opacity:new t.Uniform1f(e,r.u_opacity)}},fillExtrusionPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_lightpos:new t.Uniform3f(e,r.u_lightpos),u_lightintensity:new t.Uniform1f(e,r.u_lightintensity),u_lightcolor:new t.Uniform3f(e,r.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,r.u_vertical_gradient),u_height_factor:new t.Uniform1f(e,r.u_height_factor),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform4f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade),u_opacity:new t.Uniform1f(e,r.u_opacity)}},fill:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},fillPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform4f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},fillOutline:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world)}},fillOutlinePattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform4f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},circle:function(e,r){return{u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_scale_with_map:new t.Uniform1i(e,r.u_scale_with_map),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_extrude_scale:new t.Uniform2f(e,r.u_extrude_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},collisionBox:br,collisionCircle:br,debug:function(e,r){return{u_color:new t.UniformColor(e,r.u_color),u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},clippingMask:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},heatmap:function(e,r){return{u_extrude_scale:new t.Uniform1f(e,r.u_extrude_scale),u_intensity:new t.Uniform1f(e,r.u_intensity),u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},heatmapTexture:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world),u_image:new t.Uniform1i(e,r.u_image),u_color_ramp:new t.Uniform1i(e,r.u_color_ramp),u_opacity:new t.Uniform1f(e,r.u_opacity)}},hillshade:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_latrange:new t.Uniform2f(e,r.u_latrange),u_light:new t.Uniform2f(e,r.u_light),u_shadow:new t.UniformColor(e,r.u_shadow),u_highlight:new t.UniformColor(e,r.u_highlight),u_accent:new t.UniformColor(e,r.u_accent)}},hillshadePrepare:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_dimension:new t.Uniform2f(e,r.u_dimension),u_zoom:new t.Uniform1f(e,r.u_zoom),u_maxzoom:new t.Uniform1f(e,r.u_maxzoom)}},line:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels)}},lineGradient:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_image:new t.Uniform1i(e,r.u_image)}},linePattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_texsize:new t.Uniform2f(e,r.u_texsize),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_image:new t.Uniform1i(e,r.u_image),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_scale:new t.Uniform4f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},lineSDF:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_patternscale_a:new t.Uniform2f(e,r.u_patternscale_a),u_patternscale_b:new t.Uniform2f(e,r.u_patternscale_b),u_sdfgamma:new t.Uniform1f(e,r.u_sdfgamma),u_image:new t.Uniform1i(e,r.u_image),u_tex_y_a:new t.Uniform1f(e,r.u_tex_y_a),u_tex_y_b:new t.Uniform1f(e,r.u_tex_y_b),u_mix:new t.Uniform1f(e,r.u_mix)}},raster:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_tl_parent:new t.Uniform2f(e,r.u_tl_parent),u_scale_parent:new t.Uniform1f(e,r.u_scale_parent),u_buffer_scale:new t.Uniform1f(e,r.u_buffer_scale),u_fade_t:new t.Uniform1f(e,r.u_fade_t),u_opacity:new t.Uniform1f(e,r.u_opacity),u_image0:new t.Uniform1i(e,r.u_image0),u_image1:new t.Uniform1i(e,r.u_image1),u_brightness_low:new t.Uniform1f(e,r.u_brightness_low),u_brightness_high:new t.Uniform1f(e,r.u_brightness_high),u_saturation_factor:new t.Uniform1f(e,r.u_saturation_factor),u_contrast_factor:new t.Uniform1f(e,r.u_contrast_factor),u_spin_weights:new t.Uniform3f(e,r.u_spin_weights)}},symbolIcon:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1f(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texture:new t.Uniform1i(e,r.u_texture)}},symbolSDF:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1f(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texture:new t.Uniform1i(e,r.u_texture),u_gamma_scale:new t.Uniform1f(e,r.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_is_halo:new t.Uniform1f(e,r.u_is_halo)}},background:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_opacity:new t.Uniform1f(e,r.u_opacity),u_color:new t.UniformColor(e,r.u_color)}},backgroundPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_opacity:new t.Uniform1f(e,r.u_opacity),u_image:new t.Uniform1i(e,r.u_image),u_pattern_tl_a:new t.Uniform2f(e,r.u_pattern_tl_a),u_pattern_br_a:new t.Uniform2f(e,r.u_pattern_br_a),u_pattern_tl_b:new t.Uniform2f(e,r.u_pattern_tl_b),u_pattern_br_b:new t.Uniform2f(e,r.u_pattern_br_b),u_texsize:new t.Uniform2f(e,r.u_texsize),u_mix:new t.Uniform1f(e,r.u_mix),u_pattern_size_a:new t.Uniform2f(e,r.u_pattern_size_a),u_pattern_size_b:new t.Uniform2f(e,r.u_pattern_size_b),u_scale_a:new t.Uniform1f(e,r.u_scale_a),u_scale_b:new t.Uniform1f(e,r.u_scale_b),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_tile_units_to_pixels:new t.Uniform1f(e,r.u_tile_units_to_pixels)}}};function Vr(e,r){for(var n=e.sort(function(t,e){return t.tileID.isLessThan(e.tileID)?-1:e.tileID.isLessThan(t.tileID)?1:0}),i=0;i<n.length;i++){var a={},o=n[i],s=n.slice(i+1);qr(o.tileID.wrapped(),o.tileID,s,new t.OverscaledTileID(0,o.tileID.wrap+1,0,0,0),a),o.setMask(a,r)}}function qr(e,r,n,i,a){for(var o=0;o<n.length;o++){var s=n[o];if(i.isLessThan(s.tileID))break;if(r.key===s.tileID.key)return;if(s.tileID.isChildOf(r)){for(var l=r.children(1/0),u=0;u<l.length;u++)qr(e,l[u],n.slice(o),i,a);return}}var c=r.overscaledZ-e.overscaledZ,p=new t.CanonicalTileID(c,r.canonical.x-(e.canonical.x<<c),r.canonical.y-(e.canonical.y<<c));a[p.key]=a[p.key]||p}function Gr(t,e,r,n,i){for(var a=t.context,o=a.gl,s=i?t.useProgram("collisionCircle"):t.useProgram("collisionBox"),l=0;l<n.length;l++){var u=n[l],c=e.getTile(u),p=c.getBucket(r);if(p){var h=i?p.collisionCircle:p.collisionBox;h&&s.draw(a,i?o.TRIANGLES:o.LINES,At.disabled,Mt.disabled,t.colorModeForRenderPass(),Lt.disabled,wr(u.posMatrix,t.transform,c),r.id,h.layoutVertexBuffer,h.indexBuffer,h.segments,null,t.transform.zoom,null,null,h.collisionVertexBuffer)}}}var Hr=t.identity(new Float32Array(16));function Zr(e,r,n,i,a,o){var s=t.getAnchorAlignment(e),l=-(s.horizontalAlign-.5)*r,u=-(s.verticalAlign-.5)*n,c=t.evaluateRadialOffset(e,i);return new t.Point((l/a+c[0])*o,(u/a+c[1])*o)}function Xr(e,r,n,i,a,o,s,l,u,c){var p=e.text.placedSymbolArray,h=e.text.dynamicLayoutVertexArray;h.clear();for(var f=0;f<p.length;f++){var d=p.get(f),m=e.allowVerticalPlacement&&!d.placedOrientation,y=d.hidden||!d.crossTileID||m?null:i[d.crossTileID];if(y){var g=new t.Point(d.anchorX,d.anchorY),v=Kt(g,n?l:s),_=.5+o.cameraToCenterDistance/v.signedDistanceFromCamera*.5,x=a.evaluateSizeForFeature(e.textSizeData,c,d)*_/t.ONE_EM;n&&(x*=e.tilePixelRatio/u);for(var b=y.width,w=y.height,k=y.radialOffset,T=y.textBoxScale,A=Zr(y.anchor,b,w,k,T,x),M=n?Kt(g.add(A),s).point:v.point.add(r?A.rotate(-o.angle):A),S=e.allowVerticalPlacement&&d.placedOrientation===t.WritingMode.vertical?Math.PI/2:0,L=0;L<d.numGlyphs;L++)t.addDynamicAttributes(h,M,S)}else ae(d.numGlyphs,h)}e.text.dynamicLayoutVertexBuffer.updateData(h)}function Wr(e){var r=e.text.placedSymbolArray,n=e.text.dynamicLayoutVertexArray;n.clear();for(var i=0;i<r.length;i++){var a=r.get(i);if(a.hidden||!a.placedOrientation)ae(a.numGlyphs,n);else for(var o=new t.Point(a.anchorX,a.anchorY),s=e.allowVerticalPlacement&&a.placedOrientation===t.WritingMode.vertical?Math.PI/2:0,l=0;l<a.numGlyphs;l++)t.addDynamicAttributes(n,o,s)}e.text.dynamicLayoutVertexBuffer.updateData(n)}function Yr(e,r,n,i,a,o,s,l,u,c,p,h,f){for(var d,m,y=e.context,g=y.gl,v=e.transform,_="map"===l,x="map"===u,b=_&&"point"!==n.layout.get("symbol-placement"),w=_&&!x&&!b,k=void 0!==n.layout.get("symbol-sort-key").constantOr(1),T=e.depthModeForSublayer(0,At.ReadOnly),A=n.layout.get("text-variable-anchor"),M=[],S=0,L=i;S<L.length;S+=1){var C=L[S],E=r.getTile(C),z=E.getBucket(n);if(z){var P=a?z.text:z.icon;if(P&&P.segments.get().length){var I=P.programConfigurations.get(n.id),D=a||z.sdfIcons,O=a?z.textSizeData:z.iconSizeData;d||(d=e.useProgram(D?"symbolSDF":"symbolIcon",I),m=t.evaluateSizeForZoom(O,v.zoom)),y.activeTexture.set(g.TEXTURE0);var R=void 0,F=void 0,B=void 0;if(a)F=E.glyphAtlasTexture,B=g.LINEAR,R=E.glyphAtlasTexture.size;else{var N=1!==n.layout.get("icon-size").constantOr(0)||z.iconsNeedLinear,U=x||0!==v.pitch;F=E.imageAtlasTexture,B=D||e.options.rotating||e.options.zooming||N||U?g.LINEAR:g.NEAREST,R=E.imageAtlasTexture.size}var j=ue(E,1,e.transform.zoom),V=Wt(C.posMatrix,x,_,e.transform,j),q=Yt(C.posMatrix,x,_,e.transform,j);if(b)$t(z,C.posMatrix,e,a,V,q,x,c);else if(a&&m&&A){var G=Math.pow(2,v.zoom-E.tileID.overscaledZ);Xr(z,_,x,f,t.symbolSize,v,V,C.posMatrix,G,m)}else a&&m&&z.allowVerticalPlacement&&Wr(z);var H=e.translatePosMatrix(C.posMatrix,E,o,s),Z=b||a&&A?Hr:V,X=e.translatePosMatrix(q,E,o,s,!0),W=D&&0!==n.paint.get(a?"text-halo-width":"icon-halo-width").constantOr(1),Y={program:d,buffers:P,uniformValues:D?Br(O.kind,m,w,x,e,H,Z,X,a,R,!0):Fr(O.kind,m,w,x,e,H,Z,X,a,R),atlasTexture:F,atlasInterpolation:B,isSDF:D,hasHalo:W};if(k)for(var K=0,J=P.segments.get();K<J.length;K+=1){var $=J[K];M.push({segments:new t.SegmentVector([$]),sortKey:$.sortKey,state:Y})}else M.push({segments:P.segments,sortKey:0,state:Y})}}}k&&M.sort(function(t,e){return t.sortKey-e.sortKey});for(var Q=0,tt=M;Q<tt.length;Q+=1){var et=tt[Q],rt=et.state;if(rt.atlasTexture.bind(rt.atlasInterpolation,g.CLAMP_TO_EDGE),rt.isSDF){var nt=rt.uniformValues;rt.hasHalo&&(nt.u_is_halo=1,Kr(rt.buffers,et.segments,n,e,rt.program,T,p,h,nt)),nt.u_is_halo=0}Kr(rt.buffers,et.segments,n,e,rt.program,T,p,h,rt.uniformValues)}}function Kr(t,e,r,n,i,a,o,s,l){var u=n.context,c=u.gl;i.draw(u,c.TRIANGLES,a,o,s,Lt.disabled,l,r.id,t.layoutVertexBuffer,t.indexBuffer,e,r.paint,n.transform.zoom,t.programConfigurations.get(r.id),t.dynamicLayoutVertexBuffer,t.opacityVertexBuffer)}function Jr(t,e,r,n,i,a,o){var s,l,u,c,p,h=t.context.gl,f=r.paint.get("fill-pattern"),d=f&&f.constantOr(1),m=r.getCrossfadeParameters();o?(l=d&&!r.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",s=h.LINES):(l=d?"fillPattern":"fill",s=h.TRIANGLES);for(var y=0,g=n;y<g.length;y+=1){var v=g[y],_=e.getTile(v);if(!d||_.patternsLoaded()){var x=_.getBucket(r);if(x){var b=x.programConfigurations.get(r.id),w=t.useProgram(l,b);d&&(t.context.activeTexture.set(h.TEXTURE0),_.imageAtlasTexture.bind(h.LINEAR,h.CLAMP_TO_EDGE),b.updatePatternPaintBuffers(m));var k=f.constantOr(null);if(k&&_.imageAtlas){var T=_.imageAtlas.patternPositions[k.to],A=_.imageAtlas.patternPositions[k.from];T&&A&&b.setConstantPatternPositions(T,A)}var M=t.translatePosMatrix(v.posMatrix,_,r.paint.get("fill-translate"),r.paint.get("fill-translate-anchor"));if(o){c=x.indexBuffer2,p=x.segments2;var S=[h.drawingBufferWidth,h.drawingBufferHeight];u="fillOutlinePattern"===l&&d?_r(M,t,m,_,S):vr(M,S)}else c=x.indexBuffer,p=x.segments,u=d?gr(M,t,m,_):yr(M);w.draw(t.context,s,i,t.stencilModeForClipping(v),a,Lt.disabled,u,r.id,x.layoutVertexBuffer,c,p,r.paint,t.transform.zoom,b)}}}}function $r(t,e,r,n,i,a,o){for(var s=t.context,l=s.gl,u=r.paint.get("fill-extrusion-pattern"),c=u.constantOr(1),p=r.getCrossfadeParameters(),h=r.paint.get("fill-extrusion-opacity"),f=0,d=n;f<d.length;f+=1){var m=d[f],y=e.getTile(m),g=y.getBucket(r);if(g){var v=g.programConfigurations.get(r.id),_=t.useProgram(c?"fillExtrusionPattern":"fillExtrusion",v);c&&(t.context.activeTexture.set(l.TEXTURE0),y.imageAtlasTexture.bind(l.LINEAR,l.CLAMP_TO_EDGE),v.updatePatternPaintBuffers(p));var x=u.constantOr(null);if(x&&y.imageAtlas){var b=y.imageAtlas.patternPositions[x.to],w=y.imageAtlas.patternPositions[x.from];b&&w&&v.setConstantPatternPositions(b,w)}var k=t.translatePosMatrix(m.posMatrix,y,r.paint.get("fill-extrusion-translate"),r.paint.get("fill-extrusion-translate-anchor")),T=r.paint.get("fill-extrusion-vertical-gradient"),A=c?mr(k,t,T,h,m,p,y):dr(k,t,T,h);_.draw(s,s.gl.TRIANGLES,i,a,o,Lt.backCCW,A,r.id,g.layoutVertexBuffer,g.indexBuffer,g.segments,r.paint,t.transform.zoom,v)}}}function Qr(t,e,r,n,i,a){var o=t.context,s=o.gl,l=e.fbo;if(l){var u=t.useProgram("hillshade");o.activeTexture.set(s.TEXTURE0),s.bindTexture(s.TEXTURE_2D,l.colorAttachment.get());var c=Mr(t,e,r);e.maskedBoundsBuffer&&e.maskedIndexBuffer&&e.segments?u.draw(o,s.TRIANGLES,n,i,a,Lt.disabled,c,r.id,e.maskedBoundsBuffer,e.maskedIndexBuffer,e.segments):u.draw(o,s.TRIANGLES,n,i,a,Lt.disabled,c,r.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments)}}function tn(e,r,n,i,a,o,s){var l=e.context,u=l.gl;if(r.dem&&r.dem.data){var c=r.dem.dim,p=r.dem.stride,h=r.dem.getPixels();if(l.activeTexture.set(u.TEXTURE1),l.pixelStoreUnpackPremultiplyAlpha.set(!1),r.demTexture=r.demTexture||e.getTileTexture(p),r.demTexture){var f=r.demTexture;f.update(h,{premultiply:!1}),f.bind(u.NEAREST,u.CLAMP_TO_EDGE)}else r.demTexture=new t.Texture(l,h,u.RGBA,{premultiply:!1}),r.demTexture.bind(u.NEAREST,u.CLAMP_TO_EDGE);l.activeTexture.set(u.TEXTURE0);var d=r.fbo;if(!d){var m=new t.Texture(l,{width:c,height:c,data:null},u.RGBA);m.bind(u.LINEAR,u.CLAMP_TO_EDGE),(d=r.fbo=l.createFramebuffer(c,c)).colorAttachment.set(m.texture)}l.bindFramebuffer.set(d.framebuffer),l.viewport.set([0,0,c,c]),e.useProgram("hillshadePrepare").draw(l,u.TRIANGLES,a,o,s,Lt.disabled,Sr(r,i),n.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments),r.needsHillshadePrepare=!1}}function en(e,r,n,i,a){var o=i.paint.get("raster-fade-duration");if(o>0){var s=t.browser.now(),l=(s-e.timeAdded)/o,u=r?(s-r.timeAdded)/o:-1,c=n.getSource(),p=a.coveringZoomLevel({tileSize:c.tileSize,roundZoom:c.roundZoom}),h=!r||Math.abs(r.tileID.overscaledZ-p)>Math.abs(e.tileID.overscaledZ-p),f=h&&e.refreshedUponExpiration?1:t.clamp(h?l:1-u,0,1);return e.refreshedUponExpiration&&l>=1&&(e.refreshedUponExpiration=!1),r?{opacity:1,mix:1-f}:{opacity:f,mix:0}}return{opacity:1,mix:0}}function rn(e,r,n){var i=e.context,a=i.gl,o=n.posMatrix,s=e.useProgram("debug"),l=At.disabled,u=Mt.disabled,c=e.colorModeForRenderPass(),p="$debug";s.draw(i,a.LINE_STRIP,l,u,c,Lt.disabled,kr(o,t.Color.red),p,e.debugBuffer,e.tileBorderIndexBuffer,e.debugSegments);for(var h=r.getTileByID(n.key).latestRawTileData,f=h&&h.byteLength||0,d=Math.floor(f/1024),m=r.getTile(n).tileSize,y=512/Math.min(m,512),g=function(t,e,r,n){n=n||1;var i,a,o,s,l,u,c,p,h=[];for(i=0,a=t.length;i<a;i++)if(l=nn[t[i]]){for(p=null,o=0,s=l[1].length;o<s;o+=2)-1===l[1][o]&&-1===l[1][o+1]?p=null:(u=e+l[1][o]*n,c=r-l[1][o+1]*n,p&&h.push(p.x,p.y,u,c),p={x:u,y:c});e+=l[0]*n}return h}(n.toString()+" "+d+"kb",50,200*y,5*y),v=new t.StructArrayLayout2i4,_=new t.StructArrayLayout2ui4,x=0;x<g.length;x+=2)v.emplaceBack(g[x],g[x+1]),_.emplaceBack(x,x+1);for(var b=i.createVertexBuffer(v,Fe.members),w=i.createIndexBuffer(_),k=t.SegmentVector.simpleSegment(0,0,v.length/2,v.length/2),T=t.EXTENT/(Math.pow(2,e.transform.zoom-n.overscaledZ)*m*y),A=[],M=-1;M<=1;M++)for(var S=-1;S<=1&&(0!==M||0!==S);S++)A.push([M,S]);for(var L=0;L<A.length;L++){var C=A[L];s.draw(i,a.LINES,l,u,c,Lt.disabled,kr(t.translate([],o,[T*C[0],T*C[1],0]),t.Color.white),p,b,w,k)}s.draw(i,a.LINES,l,u,c,Lt.disabled,kr(o,t.Color.black),p,b,w,k)}var nn={" ":[16,[]],"!":[10,[5,21,5,7,-1,-1,5,2,4,1,5,0,6,1,5,2]],'"':[16,[4,21,4,14,-1,-1,12,21,12,14]],"#":[21,[11,25,4,-7,-1,-1,17,25,10,-7,-1,-1,4,12,18,12,-1,-1,3,6,17,6]],$:[20,[8,25,8,-4,-1,-1,12,25,12,-4,-1,-1,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]],"%":[24,[21,21,3,0,-1,-1,8,21,10,19,10,17,9,15,7,14,5,14,3,16,3,18,4,20,6,21,8,21,10,20,13,19,16,19,19,20,21,21,-1,-1,17,7,15,6,14,4,14,2,16,0,18,0,20,1,21,3,21,5,19,7,17,7]],"&":[26,[23,12,23,13,22,14,21,14,20,13,19,11,17,6,15,3,13,1,11,0,7,0,5,1,4,2,3,4,3,6,4,8,5,9,12,13,13,14,14,16,14,18,13,20,11,21,9,20,8,18,8,16,9,13,11,10,16,3,18,1,20,0,22,0,23,1,23,2]],"'":[10,[5,19,4,20,5,21,6,20,6,18,5,16,4,15]],"(":[14,[11,25,9,23,7,20,5,16,4,11,4,7,5,2,7,-2,9,-5,11,-7]],")":[14,[3,25,5,23,7,20,9,16,10,11,10,7,9,2,7,-2,5,-5,3,-7]],"*":[16,[8,21,8,9,-1,-1,3,18,13,12,-1,-1,13,18,3,12]],"+":[26,[13,18,13,0,-1,-1,4,9,22,9]],",":[10,[6,1,5,0,4,1,5,2,6,1,6,-1,5,-3,4,-4]],"-":[26,[4,9,22,9]],".":[10,[5,2,4,1,5,0,6,1,5,2]],"/":[22,[20,25,2,-7]],0:[20,[9,21,6,20,4,17,3,12,3,9,4,4,6,1,9,0,11,0,14,1,16,4,17,9,17,12,16,17,14,20,11,21,9,21]],1:[20,[6,17,8,18,11,21,11,0]],2:[20,[4,16,4,17,5,19,6,20,8,21,12,21,14,20,15,19,16,17,16,15,15,13,13,10,3,0,17,0]],3:[20,[5,21,16,21,10,13,13,13,15,12,16,11,17,8,17,6,16,3,14,1,11,0,8,0,5,1,4,2,3,4]],4:[20,[13,21,3,7,18,7,-1,-1,13,21,13,0]],5:[20,[15,21,5,21,4,12,5,13,8,14,11,14,14,13,16,11,17,8,17,6,16,3,14,1,11,0,8,0,5,1,4,2,3,4]],6:[20,[16,18,15,20,12,21,10,21,7,20,5,17,4,12,4,7,5,3,7,1,10,0,11,0,14,1,16,3,17,6,17,7,16,10,14,12,11,13,10,13,7,12,5,10,4,7]],7:[20,[17,21,7,0,-1,-1,3,21,17,21]],8:[20,[8,21,5,20,4,18,4,16,5,14,7,13,11,12,14,11,16,9,17,7,17,4,16,2,15,1,12,0,8,0,5,1,4,2,3,4,3,7,4,9,6,11,9,12,13,13,15,14,16,16,16,18,15,20,12,21,8,21]],9:[20,[16,14,15,11,13,9,10,8,9,8,6,9,4,11,3,14,3,15,4,18,6,20,9,21,10,21,13,20,15,18,16,14,16,9,15,4,13,1,10,0,8,0,5,1,4,3]],":":[10,[5,14,4,13,5,12,6,13,5,14,-1,-1,5,2,4,1,5,0,6,1,5,2]],";":[10,[5,14,4,13,5,12,6,13,5,14,-1,-1,6,1,5,0,4,1,5,2,6,1,6,-1,5,-3,4,-4]],"<":[24,[20,18,4,9,20,0]],"=":[26,[4,12,22,12,-1,-1,4,6,22,6]],">":[24,[4,18,20,9,4,0]],"?":[18,[3,16,3,17,4,19,5,20,7,21,11,21,13,20,14,19,15,17,15,15,14,13,13,12,9,10,9,7,-1,-1,9,2,8,1,9,0,10,1,9,2]],"@":[27,[18,13,17,15,15,16,12,16,10,15,9,14,8,11,8,8,9,6,11,5,14,5,16,6,17,8,-1,-1,12,16,10,14,9,11,9,8,10,6,11,5,-1,-1,18,16,17,8,17,6,19,5,21,5,23,7,24,10,24,12,23,15,22,17,20,19,18,20,15,21,12,21,9,20,7,19,5,17,4,15,3,12,3,9,4,6,5,4,7,2,9,1,12,0,15,0,18,1,20,2,21,3,-1,-1,19,16,18,8,18,6,19,5]],A:[18,[9,21,1,0,-1,-1,9,21,17,0,-1,-1,4,7,14,7]],B:[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,-1,-1,4,11,13,11,16,10,17,9,18,7,18,4,17,2,16,1,13,0,4,0]],C:[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]],D:[21,[4,21,4,0,-1,-1,4,21,11,21,14,20,16,18,17,16,18,13,18,8,17,5,16,3,14,1,11,0,4,0]],E:[19,[4,21,4,0,-1,-1,4,21,17,21,-1,-1,4,11,12,11,-1,-1,4,0,17,0]],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]]},an={symbol:function(t,e,r,n,i){if("translucent"===t.renderPass){var a=Mt.disabled,o=t.colorModeForRenderPass();0!==r.paint.get("icon-opacity").constantOr(1)&&Yr(t,e,r,n,!1,r.paint.get("icon-translate"),r.paint.get("icon-translate-anchor"),r.layout.get("icon-rotation-alignment"),r.layout.get("icon-pitch-alignment"),r.layout.get("icon-keep-upright"),a,o,i),0!==r.paint.get("text-opacity").constantOr(1)&&Yr(t,e,r,n,!0,r.paint.get("text-translate"),r.paint.get("text-translate-anchor"),r.layout.get("text-rotation-alignment"),r.layout.get("text-pitch-alignment"),r.layout.get("text-keep-upright"),a,o,i),e.map.showCollisionBoxes&&function(t,e,r,n){Gr(t,e,r,n,!1),Gr(t,e,r,n,!0)}(t,e,r,n)}},circle:function(e,r,n,i){if("translucent"===e.renderPass){var a=n.paint.get("circle-opacity"),o=n.paint.get("circle-stroke-width"),s=n.paint.get("circle-stroke-opacity"),l=void 0!==n.layout.get("circle-sort-key").constantOr(1);if(0!==a.constantOr(1)||0!==o.constantOr(1)&&0!==s.constantOr(1)){for(var u=e.context,c=u.gl,p=e.depthModeForSublayer(0,At.ReadOnly),h=Mt.disabled,f=e.colorModeForRenderPass(),d=[],m=0;m<i.length;m++){var y=i[m],g=r.getTile(y),v=g.getBucket(n);if(v){var _=v.programConfigurations.get(n.id),x={programConfiguration:_,program:e.useProgram("circle",_),layoutVertexBuffer:v.layoutVertexBuffer,indexBuffer:v.indexBuffer,uniformValues:xr(e,y,g,n)};if(l)for(var b=0,w=v.segments.get();b<w.length;b+=1){var k=w[b];d.push({segments:new t.SegmentVector([k]),sortKey:k.sortKey,state:x})}else d.push({segments:v.segments,sortKey:0,state:x})}}l&&d.sort(function(t,e){return t.sortKey-e.sortKey});for(var T=0,A=d;T<A.length;T+=1){var M=A[T],S=M.state,L=S.programConfiguration,C=S.program,E=S.layoutVertexBuffer,z=S.indexBuffer,P=S.uniformValues,I=M.segments;C.draw(u,c.TRIANGLES,p,h,f,Lt.disabled,P,n.id,E,z,I,n.paint,e.transform.zoom,L)}}}},heatmap:function(e,r,n,i){if(0!==n.paint.get("heatmap-opacity"))if("offscreen"===e.renderPass){var a=e.context,o=a.gl,s=e.depthModeForSublayer(0,At.ReadOnly),l=Mt.disabled,u=new St([o.ONE,o.ONE],t.Color.transparent,[!0,!0,!0,!0]);!function(t,e,r){var n=t.gl;t.activeTexture.set(n.TEXTURE1),t.viewport.set([0,0,e.width/4,e.height/4]);var i=r.heatmapFbo;if(i)n.bindTexture(n.TEXTURE_2D,i.colorAttachment.get()),t.bindFramebuffer.set(i.framebuffer);else{var a=n.createTexture();n.bindTexture(n.TEXTURE_2D,a),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.LINEAR),i=r.heatmapFbo=t.createFramebuffer(e.width/4,e.height/4),function t(e,r,n,i){var a=e.gl;a.texImage2D(a.TEXTURE_2D,0,a.RGBA,r.width/4,r.height/4,0,a.RGBA,e.extTextureHalfFloat?e.extTextureHalfFloat.HALF_FLOAT_OES:a.UNSIGNED_BYTE,null),i.colorAttachment.set(n),e.extTextureHalfFloat&&a.checkFramebufferStatus(a.FRAMEBUFFER)!==a.FRAMEBUFFER_COMPLETE&&(e.extTextureHalfFloat=null,i.colorAttachment.setDirty(),t(e,r,n,i))}(t,e,a,i)}}(a,e,n),a.clear({color:t.Color.transparent});for(var c=0;c<i.length;c++){var p=i[c];if(!r.hasRenderableParent(p)){var h=r.getTile(p),f=h.getBucket(n);if(f){var d=f.programConfigurations.get(n.id),m=e.useProgram("heatmap",d),y=e.transform.zoom;m.draw(a,o.TRIANGLES,s,l,u,Lt.disabled,Ar(p.posMatrix,h,y,n.paint.get("heatmap-intensity")),n.id,f.layoutVertexBuffer,f.indexBuffer,f.segments,n.paint,e.transform.zoom,d)}}}a.viewport.set([0,0,e.width,e.height])}else"translucent"===e.renderPass&&(e.context.setColorMode(e.colorModeForRenderPass()),function(e,r){var n=e.context,i=n.gl,a=r.heatmapFbo;if(a){n.activeTexture.set(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,a.colorAttachment.get()),n.activeTexture.set(i.TEXTURE1);var o=r.colorRampTexture;o||(o=r.colorRampTexture=new t.Texture(n,r.colorRamp,i.RGBA)),o.bind(i.LINEAR,i.CLAMP_TO_EDGE),e.useProgram("heatmapTexture").draw(n,i.TRIANGLES,At.disabled,Mt.disabled,e.colorModeForRenderPass(),Lt.disabled,function(e,r,n,i){var a=t.create();t.ortho(a,0,e.width,e.height,0,0,1);var o=e.context.gl;return{u_matrix:a,u_world:[o.drawingBufferWidth,o.drawingBufferHeight],u_image:n,u_color_ramp:i,u_opacity:r.paint.get("heatmap-opacity")}}(e,r,0,1),r.id,e.viewportBuffer,e.quadTriangleIndexBuffer,e.viewportSegments,r.paint,e.transform.zoom)}}(e,n))},line:function(e,r,n,i){if("translucent"===e.renderPass){var a=n.paint.get("line-opacity"),o=n.paint.get("line-width");if(0!==a.constantOr(1)&&0!==o.constantOr(1)){var s=e.depthModeForSublayer(0,At.ReadOnly),l=e.colorModeForRenderPass(),u=n.paint.get("line-dasharray"),c=n.paint.get("line-pattern"),p=c.constantOr(1),h=n.paint.get("line-gradient"),f=n.getCrossfadeParameters(),d=u?"lineSDF":p?"linePattern":h?"lineGradient":"line",m=e.context,y=m.gl,g=!0;if(h){m.activeTexture.set(y.TEXTURE0);var v=n.gradientTexture;if(!n.gradient)return;v||(v=n.gradientTexture=new t.Texture(m,n.gradient,y.RGBA)),v.bind(y.LINEAR,y.CLAMP_TO_EDGE)}for(var _=0,x=i;_<x.length;_+=1){var b=x[_],w=r.getTile(b);if(!p||w.patternsLoaded()){var k=w.getBucket(n);if(k){var T=k.programConfigurations.get(n.id),A=e.context.program.get(),M=e.useProgram(d,T),S=g||M.program!==A,L=c.constantOr(null);if(L&&w.imageAtlas){var C=w.imageAtlas.patternPositions[L.to],E=w.imageAtlas.patternPositions[L.from];C&&E&&T.setConstantPatternPositions(C,E)}var z=u?Pr(e,w,n,u,f):p?zr(e,w,n,f):h?Er(e,w,n):Cr(e,w,n);u&&(S||e.lineAtlas.dirty)?(m.activeTexture.set(y.TEXTURE0),e.lineAtlas.bind(m)):p&&(m.activeTexture.set(y.TEXTURE0),w.imageAtlasTexture.bind(y.LINEAR,y.CLAMP_TO_EDGE),T.updatePatternPaintBuffers(f)),M.draw(m,y.TRIANGLES,s,e.stencilModeForClipping(b),l,Lt.disabled,z,n.id,k.layoutVertexBuffer,k.indexBuffer,k.segments,n.paint,e.transform.zoom,T),g=!1}}}}}},fill:function(e,r,n,i){var a=n.paint.get("fill-color"),o=n.paint.get("fill-opacity");if(0!==o.constantOr(1)){var s=e.colorModeForRenderPass(),l=n.paint.get("fill-pattern"),u=e.opaquePassEnabledForLayer()&&!l.constantOr(1)&&1===a.constantOr(t.Color.transparent).a&&1===o.constantOr(0)?"opaque":"translucent";if(e.renderPass===u){var c=e.depthModeForSublayer(1,"opaque"===e.renderPass?At.ReadWrite:At.ReadOnly);Jr(e,r,n,i,c,s,!1)}if("translucent"===e.renderPass&&n.paint.get("fill-antialias")){var p=e.depthModeForSublayer(n.getPaintProperty("fill-outline-color")?2:0,At.ReadOnly);Jr(e,r,n,i,p,s,!0)}}},"fill-extrusion":function(t,e,r,n){var i=r.paint.get("fill-extrusion-opacity");if(0!==i&&"translucent"===t.renderPass){var a=new At(t.context.gl.LEQUAL,At.ReadWrite,t.depthRangeFor3D);if(1!==i||r.paint.get("fill-extrusion-pattern").constantOr(1))$r(t,e,r,n,a,Mt.disabled,St.disabled),$r(t,e,r,n,a,t.stencilModeFor3D(),t.colorModeForRenderPass());else{var o=t.colorModeForRenderPass();$r(t,e,r,n,a,Mt.disabled,o)}}},hillshade:function(t,e,r,n){if("offscreen"===t.renderPass||"translucent"===t.renderPass){for(var i=t.context,a=e.getSource().maxzoom,o=t.depthModeForSublayer(0,At.ReadOnly),s=Mt.disabled,l=t.colorModeForRenderPass(),u=0,c=n;u<c.length;u+=1){var p=c[u],h=e.getTile(p);h.needsHillshadePrepare&&"offscreen"===t.renderPass?tn(t,h,r,a,o,s,l):"translucent"===t.renderPass&&Qr(t,h,r,o,s,l)}i.viewport.set([0,0,t.width,t.height])}},raster:function(t,e,r,n){if("translucent"===t.renderPass&&0!==r.paint.get("raster-opacity"))for(var i=t.context,a=i.gl,o=e.getSource(),s=t.useProgram("raster"),l=Mt.disabled,u=t.colorModeForRenderPass(),c=n.length&&n[0].overscaledZ,p=!t.options.moving,h=0,f=n;h<f.length;h+=1){var d=f[h],m=t.depthModeForSublayer(d.overscaledZ-c,1===r.paint.get("raster-opacity")?At.ReadWrite:At.ReadOnly,a.LESS),y=e.getTile(d),g=t.transform.calculatePosMatrix(d.toUnwrapped(),p);y.registerFadeDuration(r.paint.get("raster-fade-duration"));var v=e.findLoadedParent(d,0),_=en(y,v,e,r,t.transform),x=void 0,b=void 0,w="nearest"===r.paint.get("raster-resampling")?a.NEAREST:a.LINEAR;i.activeTexture.set(a.TEXTURE0),y.texture.bind(w,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST),i.activeTexture.set(a.TEXTURE1),v?(v.texture.bind(w,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST),x=Math.pow(2,v.tileID.overscaledZ-y.tileID.overscaledZ),b=[y.tileID.canonical.x*x%1,y.tileID.canonical.y*x%1]):y.texture.bind(w,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST);var k=Or(g,b||[0,0],x||1,_,r);o instanceof z?s.draw(i,a.TRIANGLES,m,l,u,Lt.disabled,k,r.id,o.boundsBuffer,t.quadTriangleIndexBuffer,o.boundsSegments):y.maskedBoundsBuffer&&y.maskedIndexBuffer&&y.segments?s.draw(i,a.TRIANGLES,m,l,u,Lt.disabled,k,r.id,y.maskedBoundsBuffer,y.maskedIndexBuffer,y.segments,r.paint,t.transform.zoom):s.draw(i,a.TRIANGLES,m,l,u,Lt.disabled,k,r.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments)}},background:function(t,e,r){var n=r.paint.get("background-color"),i=r.paint.get("background-opacity");if(0!==i){var a=t.context,o=a.gl,s=t.transform,l=s.tileSize,u=r.paint.get("background-pattern");if(!t.isPatternMissing(u)){var c=!u&&1===n.a&&1===i&&t.opaquePassEnabledForLayer()?"opaque":"translucent";if(t.renderPass===c){var p=Mt.disabled,h=t.depthModeForSublayer(0,"opaque"===c?At.ReadWrite:At.ReadOnly),f=t.colorModeForRenderPass(),d=t.useProgram(u?"backgroundPattern":"background"),m=s.coveringTiles({tileSize:l});u&&(a.activeTexture.set(o.TEXTURE0),t.imageManager.bind(t.context));for(var y=r.getCrossfadeParameters(),g=0,v=m;g<v.length;g+=1){var _=v[g],x=t.transform.calculatePosMatrix(_.toUnwrapped()),b=u?Ur(x,i,t,u,{tileID:_,tileSize:l},y):Nr(x,i,n);d.draw(a,o.TRIANGLES,h,p,f,Lt.disabled,b,r.id,t.tileExtentBuffer,t.quadTriangleIndexBuffer,t.tileExtentSegments)}}}}},debug:function(t,e,r){for(var n=0;n<r.length;n++)rn(t,e,r[n])},custom:function(t,e,r){var n=t.context,i=r.implementation;if("offscreen"===t.renderPass){var a=i.prerender;a&&(t.setCustomLayerDefaults(),n.setColorMode(t.colorModeForRenderPass()),a.call(i,n.gl,t.transform.customLayerMatrix()),n.setDirty(),t.setBaseState())}else if("translucent"===t.renderPass){t.setCustomLayerDefaults(),n.setColorMode(t.colorModeForRenderPass()),n.setStencilMode(Mt.disabled);var o="3d"===i.renderingMode?new At(t.context.gl.LEQUAL,At.ReadWrite,t.depthRangeFor3D):t.depthModeForSublayer(0,At.ReadOnly);n.setDepthMode(o),i.render(n.gl,t.transform.customLayerMatrix()),n.setDirty(),t.setBaseState(),n.bindFramebuffer.set(null)}}},on=function(e,r){this.context=new Ct(e),this.transform=r,this._tileTextures={},this.setup(),this.numSublayers=Et.maxUnderzooming+Et.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.depthRboNeedsClear=!0,this.emptyProgramConfiguration=new t.ProgramConfiguration,this.crossTileSymbolIndex=new Pe};function sn(t,e){if(t.y>e.y){var r=t;t=e,e=r}return{x0:t.x,y0:t.y,x1:e.x,y1:e.y,dx:e.x-t.x,dy:e.y-t.y}}function ln(t,e,r,n,i){var a=Math.max(r,Math.floor(e.y0)),o=Math.min(n,Math.ceil(e.y1));if(t.x0===e.x0&&t.y0===e.y0?t.x0+e.dy/t.dy*t.dx<e.x1:t.x1-e.dy/t.dy*t.dx<e.x0){var s=t;t=e,e=s}for(var l=t.dx/t.dy,u=e.dx/e.dy,c=t.dx>0,p=e.dx<0,h=a;h<o;h++){var f=l*Math.max(0,Math.min(t.dy,h+c-t.y0))+t.x0,d=u*Math.max(0,Math.min(e.dy,h+p-e.y0))+e.x0;i(Math.floor(d),Math.ceil(f),h)}}function un(t,e,r,n,i,a){var o,s=sn(t,e),l=sn(e,r),u=sn(r,t);s.dy>l.dy&&(o=s,s=l,l=o),s.dy>u.dy&&(o=s,s=u,u=o),l.dy>u.dy&&(o=l,l=u,u=o),s.dy&&ln(u,s,n,i,a),l.dy&&ln(u,l,n,i,a)}on.prototype.resize=function(e,r){var n=this.context.gl;if(this.width=e*t.browser.devicePixelRatio,this.height=r*t.browser.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(var i=0,a=this.style._order;i<a.length;i+=1){var o=a[i];this.style._layers[o].resize()}this.depthRbo&&(n.deleteRenderbuffer(this.depthRbo),this.depthRbo=null)},on.prototype.setup=function(){var e=this.context,r=new t.StructArrayLayout2i4;r.emplaceBack(0,0),r.emplaceBack(t.EXTENT,0),r.emplaceBack(0,t.EXTENT),r.emplaceBack(t.EXTENT,t.EXTENT),this.tileExtentBuffer=e.createVertexBuffer(r,Fe.members),this.tileExtentSegments=t.SegmentVector.simpleSegment(0,0,4,2);var n=new t.StructArrayLayout2i4;n.emplaceBack(0,0),n.emplaceBack(t.EXTENT,0),n.emplaceBack(0,t.EXTENT),n.emplaceBack(t.EXTENT,t.EXTENT),this.debugBuffer=e.createVertexBuffer(n,Fe.members),this.debugSegments=t.SegmentVector.simpleSegment(0,0,4,5);var i=new t.StructArrayLayout4i8;i.emplaceBack(0,0,0,0),i.emplaceBack(t.EXTENT,0,t.EXTENT,0),i.emplaceBack(0,t.EXTENT,0,t.EXTENT),i.emplaceBack(t.EXTENT,t.EXTENT,t.EXTENT,t.EXTENT),this.rasterBoundsBuffer=e.createVertexBuffer(i,t.rasterBoundsAttributes.members),this.rasterBoundsSegments=t.SegmentVector.simpleSegment(0,0,4,2);var a=new t.StructArrayLayout2i4;a.emplaceBack(0,0),a.emplaceBack(1,0),a.emplaceBack(0,1),a.emplaceBack(1,1),this.viewportBuffer=e.createVertexBuffer(a,Fe.members),this.viewportSegments=t.SegmentVector.simpleSegment(0,0,4,2);var o=new t.StructArrayLayout1ui2;o.emplaceBack(0),o.emplaceBack(1),o.emplaceBack(3),o.emplaceBack(2),o.emplaceBack(0),this.tileBorderIndexBuffer=e.createIndexBuffer(o);var s=new t.StructArrayLayout3ui6;s.emplaceBack(0,1,2),s.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=e.createIndexBuffer(s);var l=this.context.gl;this.stencilClearMode=new Mt({func:l.ALWAYS,mask:0},0,255,l.ZERO,l.ZERO,l.ZERO)},on.prototype.clearStencil=function(){var e=this.context,r=e.gl;this.nextStencilID=1,this.currentStencilSource=void 0;var n=t.create();t.ortho(n,0,this.width,this.height,0,0,1),t.scale(n,n,[r.drawingBufferWidth,r.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(e,r.TRIANGLES,At.disabled,this.stencilClearMode,St.disabled,Lt.disabled,Tr(n),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)},on.prototype._renderTileClippingMasks=function(t,e){if(this.currentStencilSource!==t.source&&t.isTileClipped()&&e&&e.length){this.currentStencilSource=t.source;var r=this.context,n=r.gl;this.nextStencilID+e.length>256&&this.clearStencil(),r.setColorMode(St.disabled),r.setDepthMode(At.disabled);var i=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var a=0,o=e;a<o.length;a+=1){var s=o[a],l=this._tileClippingMaskIDs[s.key]=this.nextStencilID++;i.draw(r,n.TRIANGLES,At.disabled,new Mt({func:n.ALWAYS,mask:0},l,255,n.KEEP,n.KEEP,n.REPLACE),St.disabled,Lt.disabled,Tr(s.posMatrix),"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}},on.prototype.stencilModeFor3D=function(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();var t=this.nextStencilID++,e=this.context.gl;return new Mt({func:e.NOTEQUAL,mask:255},t,255,e.KEEP,e.KEEP,e.REPLACE)},on.prototype.stencilModeForClipping=function(t){var e=this.context.gl;return new Mt({func:e.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,e.KEEP,e.KEEP,e.REPLACE)},on.prototype.colorModeForRenderPass=function(){var e=this.context.gl;return this._showOverdrawInspector?new St([e.CONSTANT_COLOR,e.ONE],new t.Color(1/8,1/8,1/8,0),[!0,!0,!0,!0]):"opaque"===this.renderPass?St.unblended:St.alphaBlended},on.prototype.depthModeForSublayer=function(t,e,r){if(!this.opaquePassEnabledForLayer())return At.disabled;var n=1-((1+this.currentLayer)*this.numSublayers+t)*this.depthEpsilon;return new At(r||this.context.gl.LEQUAL,e,[n,n])},on.prototype.opaquePassEnabledForLayer=function(){return this.currentLayer<this.opaquePassCutoff},on.prototype.render=function(e,r){this.style=e,this.options=r,this.lineAtlas=e.lineAtlas,this.imageManager=e.imageManager,this.glyphManager=e.glyphManager,this.symbolFadeChange=e.placement.symbolFadeChange(t.browser.now()),this.imageManager.beginFrame();var n=this.style._order,i=this.style.sourceCaches;for(var a in i){var o=i[a];o.used&&o.prepare(this.context)}var s={},l={},u={};for(var c in i){var p=i[c];s[c]=p.getVisibleCoordinates(),l[c]=s[c].slice().reverse(),u[c]=p.getVisibleCoordinates(!0).reverse()}for(var h in i){var f=i[h],d=f.getSource();if("raster"===d.type||"raster-dem"===d.type){for(var m=[],y=0,g=s[h];y<g.length;y+=1){var v=g[y];m.push(f.getTile(v))}Vr(m,this.context)}}this.opaquePassCutoff=1/0;for(var _=0;_<n.length;_++){var x=n[_];if(this.style._layers[x].is3D()){this.opaquePassCutoff=_;break}}this.renderPass="offscreen",this.depthRboNeedsClear=!0;for(var b=0,w=n;b<w.length;b+=1){var k=w[b],T=this.style._layers[k];if(T.hasOffscreenPass()&&!T.isHidden(this.transform.zoom)){var A=l[T.source];("custom"===T.type||A.length)&&this.renderLayer(this,i[T.source],T,A)}}for(this.context.bindFramebuffer.set(null),this.context.clear({color:r.showOverdrawInspector?t.Color.black:t.Color.transparent,depth:1}),this.clearStencil(),this._showOverdrawInspector=r.showOverdrawInspector,this.depthRangeFor3D=[0,1-(e._order.length+2)*this.numSublayers*this.depthEpsilon],this.renderPass="opaque",this.currentLayer=n.length-1;this.currentLayer>=0;this.currentLayer--){var M=this.style._layers[n[this.currentLayer]],S=i[M.source],L=s[M.source];this._renderTileClippingMasks(M,L),this.renderLayer(this,S,M,L)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<n.length;this.currentLayer++){var C=this.style._layers[n[this.currentLayer]],E=i[C.source],z=("symbol"===C.type?u:l)[C.source];this._renderTileClippingMasks(C,s[C.source]),this.renderLayer(this,E,C,z)}if(this.options.showTileBoundaries)for(var P in i){an.debug(this,i[P],s[P]);break}this.context.setDefault()},on.prototype.setupOffscreenDepthRenderbuffer=function(){var t=this.context;this.depthRbo||(this.depthRbo=t.createRenderbuffer(t.gl.DEPTH_COMPONENT16,this.width,this.height))},on.prototype.renderLayer=function(t,e,r,n){r.isHidden(this.transform.zoom)||("background"===r.type||"custom"===r.type||n.length)&&(this.id=r.id,an[r.type](t,e,r,n,this.style.placement.variableOffsets))},on.prototype.translatePosMatrix=function(e,r,n,i,a){if(!n[0]&&!n[1])return e;var o=a?"map"===i?this.transform.angle:0:"viewport"===i?-this.transform.angle:0;if(o){var s=Math.sin(o),l=Math.cos(o);n=[n[0]*l-n[1]*s,n[0]*s+n[1]*l]}var u=[a?n[0]:ue(r,n[0],this.transform.zoom),a?n[1]:ue(r,n[1],this.transform.zoom),0],c=new Float32Array(16);return t.translate(c,e,u),c},on.prototype.saveTileTexture=function(t){var e=this._tileTextures[t.size[0]];e?e.push(t):this._tileTextures[t.size[0]]=[t]},on.prototype.getTileTexture=function(t){var e=this._tileTextures[t];return e&&e.length>0?e.pop():null},on.prototype.isPatternMissing=function(t){if(!t)return!1;var e=this.imageManager.getPattern(t.from),r=this.imageManager.getPattern(t.to);return!e||!r},on.prototype.useProgram=function(t,e){void 0===e&&(e=this.emptyProgramConfiguration),this.cache=this.cache||{};var r=""+t+(e.cacheKey||"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[r]||(this.cache[r]=new hr(this.context,cr[t],e,jr[t],this._showOverdrawInspector)),this.cache[r]},on.prototype.setCustomLayerDefaults=function(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()},on.prototype.setBaseState=function(){var t=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(t.FUNC_ADD)};var cn=function(e,r,n){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=void 0===n||n,this._minZoom=e||0,this._maxZoom=r||22,this.setMaxBounds(),this.width=0,this.height=0,this._center=new t.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._posMatrixCache={},this._alignedPosMatrixCache={}},pn={minZoom:{configurable:!0},maxZoom:{configurable:!0},renderWorldCopies:{configurable:!0},worldSize:{configurable:!0},centerPoint:{configurable:!0},size:{configurable:!0},bearing:{configurable:!0},pitch:{configurable:!0},fov:{configurable:!0},zoom:{configurable:!0},center:{configurable:!0},unmodified:{configurable:!0},point:{configurable:!0}};cn.prototype.clone=function(){var t=new cn(this._minZoom,this._maxZoom,this._renderWorldCopies);return t.tileSize=this.tileSize,t.latRange=this.latRange,t.width=this.width,t.height=this.height,t._center=this._center,t.zoom=this.zoom,t.angle=this.angle,t._fov=this._fov,t._pitch=this._pitch,t._unmodified=this._unmodified,t._calcMatrices(),t},pn.minZoom.get=function(){return this._minZoom},pn.minZoom.set=function(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))},pn.maxZoom.get=function(){return this._maxZoom},pn.maxZoom.set=function(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))},pn.renderWorldCopies.get=function(){return this._renderWorldCopies},pn.renderWorldCopies.set=function(t){void 0===t?t=!0:null===t&&(t=!1),this._renderWorldCopies=t},pn.worldSize.get=function(){return this.tileSize*this.scale},pn.centerPoint.get=function(){return this.size._div(2)},pn.size.get=function(){return new t.Point(this.width,this.height)},pn.bearing.get=function(){return-this.angle/Math.PI*180},pn.bearing.set=function(e){var r=-t.wrap(e,-180,180)*Math.PI/180;this.angle!==r&&(this._unmodified=!1,this.angle=r,this._calcMatrices(),this.rotationMatrix=t.create$2(),t.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},pn.pitch.get=function(){return this._pitch/Math.PI*180},pn.pitch.set=function(e){var r=t.clamp(e,0,60)/180*Math.PI;this._pitch!==r&&(this._unmodified=!1,this._pitch=r,this._calcMatrices())},pn.fov.get=function(){return this._fov/Math.PI*180},pn.fov.set=function(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=t/180*Math.PI,this._calcMatrices())},pn.zoom.get=function(){return this._zoom},pn.zoom.set=function(t){var e=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==e&&(this._unmodified=!1,this._zoom=e,this.scale=this.zoomScale(e),this.tileZoom=Math.floor(e),this.zoomFraction=e-this.tileZoom,this._constrain(),this._calcMatrices())},pn.center.get=function(){return this._center},pn.center.set=function(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())},cn.prototype.coveringZoomLevel=function(t){return(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize))},cn.prototype.getVisibleUnwrappedCoordinates=function(e){var r=[new t.UnwrappedTileID(0,e)];if(this._renderWorldCopies)for(var n=this.pointCoordinate(new t.Point(0,0)),i=this.pointCoordinate(new t.Point(this.width,0)),a=this.pointCoordinate(new t.Point(this.width,this.height)),o=this.pointCoordinate(new t.Point(0,this.height)),s=Math.floor(Math.min(n.x,i.x,a.x,o.x)),l=Math.floor(Math.max(n.x,i.x,a.x,o.x)),u=s-1;u<=l+1;u++)0!==u&&r.push(new t.UnwrappedTileID(u,e));return r},cn.prototype.coveringTiles=function(e){var r=this.coveringZoomLevel(e),n=r;if(void 0!==e.minzoom&&r<e.minzoom)return[];void 0!==e.maxzoom&&r>e.maxzoom&&(r=e.maxzoom);var i=t.MercatorCoordinate.fromLngLat(this.center),a=Math.pow(2,r),o=new t.Point(a*i.x-.5,a*i.y-.5);return function(e,r,n,i){void 0===i&&(i=!0);var a=1<<e,o={};function s(r,s,l){var u,c,p,h;if(l>=0&&l<=a)for(u=r;u<s;u++)c=Math.floor(u/a),p=(u%a+a)%a,0!==c&&!0!==i||(h=new t.OverscaledTileID(n,c,e,p,l),o[h.key]=h)}var l=r.map(function(e){return new t.Point(e.x,e.y)._mult(a)});return un(l[0],l[1],l[2],0,a,s),un(l[2],l[3],l[0],0,a,s),Object.keys(o).map(function(t){return o[t]})}(r,[this.pointCoordinate(new t.Point(0,0)),this.pointCoordinate(new t.Point(this.width,0)),this.pointCoordinate(new t.Point(this.width,this.height)),this.pointCoordinate(new t.Point(0,this.height))],e.reparseOverscaled?n:r,this._renderWorldCopies).sort(function(t,e){return o.dist(t.canonical)-o.dist(e.canonical)})},cn.prototype.resize=function(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._constrain(),this._calcMatrices()},pn.unmodified.get=function(){return this._unmodified},cn.prototype.zoomScale=function(t){return Math.pow(2,t)},cn.prototype.scaleZoom=function(t){return Math.log(t)/Math.LN2},cn.prototype.project=function(e){var r=t.clamp(e.lat,-this.maxValidLatitude,this.maxValidLatitude);return new t.Point(t.mercatorXfromLng(e.lng)*this.worldSize,t.mercatorYfromLat(r)*this.worldSize)},cn.prototype.unproject=function(e){return new t.MercatorCoordinate(e.x/this.worldSize,e.y/this.worldSize).toLngLat()},pn.point.get=function(){return this.project(this.center)},cn.prototype.setLocationAtPoint=function(e,r){var n=this.pointCoordinate(r),i=this.pointCoordinate(this.centerPoint),a=this.locationCoordinate(e),o=new t.MercatorCoordinate(a.x-(n.x-i.x),a.y-(n.y-i.y));this.center=this.coordinateLocation(o),this._renderWorldCopies&&(this.center=this.center.wrap())},cn.prototype.locationPoint=function(t){return this.coordinatePoint(this.locationCoordinate(t))},cn.prototype.pointLocation=function(t){return this.coordinateLocation(this.pointCoordinate(t))},cn.prototype.locationCoordinate=function(e){return t.MercatorCoordinate.fromLngLat(e)},cn.prototype.coordinateLocation=function(t){return t.toLngLat()},cn.prototype.pointCoordinate=function(e){var r=[e.x,e.y,0,1],n=[e.x,e.y,1,1];t.transformMat4(r,r,this.pixelMatrixInverse),t.transformMat4(n,n,this.pixelMatrixInverse);var i=r[3],a=n[3],o=r[0]/i,s=n[0]/a,l=r[1]/i,u=n[1]/a,c=r[2]/i,p=n[2]/a,h=c===p?0:(0-c)/(p-c);return new t.MercatorCoordinate(t.number(o,s,h)/this.worldSize,t.number(l,u,h)/this.worldSize)},cn.prototype.coordinatePoint=function(e){var r=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.transformMat4(r,r,this.pixelMatrix),new t.Point(r[0]/r[3],r[1]/r[3])},cn.prototype.getBounds=function(){return(new t.LngLatBounds).extend(this.pointLocation(new t.Point(0,0))).extend(this.pointLocation(new t.Point(this.width,0))).extend(this.pointLocation(new t.Point(this.width,this.height))).extend(this.pointLocation(new t.Point(0,this.height)))},cn.prototype.getMaxBounds=function(){return this.latRange&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new t.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null},cn.prototype.setMaxBounds=function(t){t?(this.lngRange=[t.getWest(),t.getEast()],this.latRange=[t.getSouth(),t.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])},cn.prototype.calculatePosMatrix=function(e,r){void 0===r&&(r=!1);var n=e.key,i=r?this._alignedPosMatrixCache:this._posMatrixCache;if(i[n])return i[n];var a=e.canonical,o=this.worldSize/this.zoomScale(a.z),s=a.x+Math.pow(2,a.z)*e.wrap,l=t.identity(new Float64Array(16));return t.translate(l,l,[s*o,a.y*o,0]),t.scale(l,l,[o/t.EXTENT,o/t.EXTENT,1]),t.multiply(l,r?this.alignedProjMatrix:this.projMatrix,l),i[n]=new Float32Array(l),i[n]},cn.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},cn.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var e,r,n,i,a=-90,o=90,s=-180,l=180,u=this.size,c=this._unmodified;if(this.latRange){var p=this.latRange;a=t.mercatorYfromLat(p[1])*this.worldSize,e=(o=t.mercatorYfromLat(p[0])*this.worldSize)-a<u.y?u.y/(o-a):0}if(this.lngRange){var h=this.lngRange;s=t.mercatorXfromLng(h[0])*this.worldSize,r=(l=t.mercatorXfromLng(h[1])*this.worldSize)-s<u.x?u.x/(l-s):0}var f=this.point,d=Math.max(r||0,e||0);if(d)return this.center=this.unproject(new t.Point(r?(l+s)/2:f.x,e?(o+a)/2:f.y)),this.zoom+=this.scaleZoom(d),this._unmodified=c,void(this._constraining=!1);if(this.latRange){var m=f.y,y=u.y/2;m-y<a&&(i=a+y),m+y>o&&(i=o-y)}if(this.lngRange){var g=f.x,v=u.x/2;g-v<s&&(n=s+v),g+v>l&&(n=l-v)}void 0===n&&void 0===i||(this.center=this.unproject(new t.Point(void 0!==n?n:f.x,void 0!==i?i:f.y))),this._unmodified=c,this._constraining=!1}},cn.prototype._calcMatrices=function(){if(this.height){this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;var e=this._fov/2,r=Math.PI/2+this._pitch,n=Math.sin(e)*this.cameraToCenterDistance/Math.sin(Math.PI-r-e),i=this.point,a=i.x,o=i.y,s=1.01*(Math.cos(Math.PI/2-this._pitch)*n+this.cameraToCenterDistance),l=this.height/50,u=new Float64Array(16);t.perspective(u,this._fov,this.width/this.height,l,s),t.scale(u,u,[1,-1,1]),t.translate(u,u,[0,0,-this.cameraToCenterDistance]),t.rotateX(u,u,this._pitch),t.rotateZ(u,u,this.angle),t.translate(u,u,[-a,-o,0]),this.mercatorMatrix=t.scale([],u,[this.worldSize,this.worldSize,this.worldSize]),t.scale(u,u,[1,1,t.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=u;var c=this.width%2/2,p=this.height%2/2,h=Math.cos(this.angle),f=Math.sin(this.angle),d=a-Math.round(a)+h*c+f*p,m=o-Math.round(o)+h*p+f*c,y=new Float64Array(u);if(t.translate(y,y,[d>.5?d-1:d,m>.5?m-1:m,0]),this.alignedProjMatrix=y,u=t.create(),t.scale(u,u,[this.width/2,-this.height/2,1]),t.translate(u,u,[1,-1,0]),this.labelPlaneMatrix=u,u=t.create(),t.scale(u,u,[1,-1,1]),t.translate(u,u,[-1,-1,0]),t.scale(u,u,[2/this.width,2/this.height,1]),this.glCoordMatrix=u,this.pixelMatrix=t.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(u=t.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=u,this._posMatrixCache={},this._alignedPosMatrixCache={}}},cn.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var e=this.pointCoordinate(new t.Point(0,0)),r=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.transformMat4(r,r,this.pixelMatrix)[3]/this.cameraToCenterDistance},cn.prototype.getCameraPoint=function(){var e=this._pitch,r=Math.tan(e)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new t.Point(0,r))},cn.prototype.getCameraQueryGeometry=function(e){var r=this.getCameraPoint();if(1===e.length)return[e[0],r];for(var n=r.x,i=r.y,a=r.x,o=r.y,s=0,l=e;s<l.length;s+=1){var u=l[s];n=Math.min(n,u.x),i=Math.min(i,u.y),a=Math.max(a,u.x),o=Math.max(o,u.y)}return[new t.Point(n,i),new t.Point(a,i),new t.Point(a,o),new t.Point(n,o),new t.Point(n,i)]},Object.defineProperties(cn.prototype,pn);var hn=function(){var e,r,n,i;t.bindAll(["_onHashChange","_updateHash"],this),this._updateHash=(e=this._updateHashUnthrottled.bind(this),300,r=!1,n=null,i=function(){n=null,r&&(e(),n=setTimeout(i,300),r=!1)},function(){return r=!0,n||i(),n})};hn.prototype.addTo=function(e){return this._map=e,t.window.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},hn.prototype.remove=function(){return t.window.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this},hn.prototype.getHashString=function(t){var e=this._map.getCenter(),r=Math.round(100*this._map.getZoom())/100,n=Math.ceil((r*Math.LN2+Math.log(512/360/.5))/Math.LN10),i=Math.pow(10,n),a=Math.round(e.lng*i)/i,o=Math.round(e.lat*i)/i,s=this._map.getBearing(),l=this._map.getPitch(),u="";return u+=t?"#/"+a+"/"+o+"/"+r:"#"+r+"/"+o+"/"+a,(s||l)&&(u+="/"+Math.round(10*s)/10),l&&(u+="/"+Math.round(l)),u},hn.prototype._onHashChange=function(){var e=t.window.location.hash.replace("#","").split("/");return e.length>=3&&(this._map.jumpTo({center:[+e[2],+e[1]],zoom:+e[0],bearing:+(e[3]||0),pitch:+(e[4]||0)}),!0)},hn.prototype._updateHashUnthrottled=function(){var e=this.getHashString();try{t.window.history.replaceState(t.window.history.state,"",e)}catch(t){}};var fn=function(e){function n(n,i,a,o){void 0===o&&(o={});var s=r.mousePos(i.getCanvasContainer(),a),l=i.unproject(s);e.call(this,n,t.extend({point:s,lngLat:l,originalEvent:a},o)),this._defaultPrevented=!1,this.target=i}e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n;var i={defaultPrevented:{configurable:!0}};return n.prototype.preventDefault=function(){this._defaultPrevented=!0},i.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(n.prototype,i),n}(t.Event),dn=function(e){function n(n,i,a){var o=r.touchPos(i.getCanvasContainer(),a),s=o.map(function(t){return i.unproject(t)}),l=o.reduce(function(t,e,r,n){return t.add(e.div(n.length))},new t.Point(0,0)),u=i.unproject(l);e.call(this,n,{points:o,point:l,lngLats:s,lngLat:u,originalEvent:a}),this._defaultPrevented=!1}e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n;var i={defaultPrevented:{configurable:!0}};return n.prototype.preventDefault=function(){this._defaultPrevented=!0},i.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(n.prototype,i),n}(t.Event),mn=function(t){function e(e,r,n){t.call(this,e,{originalEvent:n}),this._defaultPrevented=!1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={defaultPrevented:{configurable:!0}};return e.prototype.preventDefault=function(){this._defaultPrevented=!0},r.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(e.prototype,r),e}(t.Event),yn=function(e){this._map=e,this._el=e.getCanvasContainer(),this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=1/450,t.bindAll(["_onWheel","_onTimeout","_onScrollFrame","_onScrollFinished"],this)};yn.prototype.setZoomRate=function(t){this._defaultZoomRate=t},yn.prototype.setWheelZoomRate=function(t){this._wheelZoomRate=t},yn.prototype.isEnabled=function(){return!!this._enabled},yn.prototype.isActive=function(){return!!this._active},yn.prototype.isZooming=function(){return!!this._zooming},yn.prototype.enable=function(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=t&&"center"===t.around)},yn.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},yn.prototype.onWheel=function(e){if(this.isEnabled()){var r=e.deltaMode===t.window.WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY,n=t.browser.now(),i=n-(this._lastWheelEventTime||0);this._lastWheelEventTime=n,0!==r&&r%4.000244140625==0?this._type="wheel":0!==r&&Math.abs(r)<4?this._type="trackpad":i>400?(this._type=null,this._lastValue=r,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(i*r)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,r+=this._lastValue)),e.shiftKey&&r&&(r/=4),this._type&&(this._lastWheelEvent=e,this._delta-=r,this.isActive()||this._start(e)),e.preventDefault()}},yn.prototype._onTimeout=function(t){this._type="wheel",this._delta-=this._lastValue,this.isActive()||this._start(t)},yn.prototype._start=function(e){if(this._delta){this._frameId&&(this._map._cancelRenderFrame(this._frameId),this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0,this._map.fire(new t.Event("movestart",{originalEvent:e})),this._map.fire(new t.Event("zoomstart",{originalEvent:e}))),this._finishTimeout&&clearTimeout(this._finishTimeout);var n=r.mousePos(this._el,e);this._around=t.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(n)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=this._map._requestRenderFrame(this._onScrollFrame))}},yn.prototype._onScrollFrame=function(){var e=this;if(this._frameId=null,this.isActive()){var r=this._map.transform;if(0!==this._delta){var n="wheel"===this._type&&Math.abs(this._delta)>4.000244140625?this._wheelZoomRate:this._defaultZoomRate,i=2/(1+Math.exp(-Math.abs(this._delta*n)));this._delta<0&&0!==i&&(i=1/i);var a="number"==typeof this._targetZoom?r.zoomScale(this._targetZoom):r.scale;this._targetZoom=Math.min(r.maxZoom,Math.max(r.minZoom,r.scaleZoom(a*i))),"wheel"===this._type&&(this._startZoom=r.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var o="number"==typeof this._targetZoom?this._targetZoom:r.zoom,s=this._startZoom,l=this._easing,u=!1;if("wheel"===this._type&&s&&l){var c=Math.min((t.browser.now()-this._lastWheelEventTime)/200,1),p=l(c);r.zoom=t.number(s,o,p),c<1?this._frameId||(this._frameId=this._map._requestRenderFrame(this._onScrollFrame)):u=!0}else r.zoom=o,u=!0;r.setLocationAtPoint(this._around,this._aroundPoint),this._map.fire(new t.Event("move",{originalEvent:this._lastWheelEvent})),this._map.fire(new t.Event("zoom",{originalEvent:this._lastWheelEvent})),u&&(this._active=!1,this._finishTimeout=setTimeout(function(){e._zooming=!1,e._map.fire(new t.Event("zoomend",{originalEvent:e._lastWheelEvent})),e._map.fire(new t.Event("moveend",{originalEvent:e._lastWheelEvent})),delete e._targetZoom},200))}},yn.prototype._smoothOutEasing=function(e){var r=t.ease;if(this._prevEase){var n=this._prevEase,i=(t.browser.now()-n.start)/n.duration,a=n.easing(i+.01)-n.easing(i),o=.27/Math.sqrt(a*a+1e-4)*.01,s=Math.sqrt(.0729-o*o);r=t.bezier(o,s,.25,1)}return this._prevEase={start:t.browser.now(),duration:e,easing:r},r};var gn=function(e,r){this._map=e,this._el=e.getCanvasContainer(),this._container=e.getContainer(),this._clickTolerance=r.clickTolerance||1,t.bindAll(["_onMouseMove","_onMouseUp","_onKeyDown"],this)};gn.prototype.isEnabled=function(){return!!this._enabled},gn.prototype.isActive=function(){return!!this._active},gn.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},gn.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},gn.prototype.onMouseDown=function(e){this.isEnabled()&&e.shiftKey&&0===e.button&&(t.window.document.addEventListener("mousemove",this._onMouseMove,!1),t.window.document.addEventListener("keydown",this._onKeyDown,!1),t.window.document.addEventListener("mouseup",this._onMouseUp,!1),r.disableDrag(),this._startPos=this._lastPos=r.mousePos(this._el,e),this._active=!0)},gn.prototype._onMouseMove=function(t){var e=r.mousePos(this._el,t);if(!(this._lastPos.equals(e)||!this._box&&e.dist(this._startPos)<this._clickTolerance)){var n=this._startPos;this._lastPos=e,this._box||(this._box=r.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",t));var i=Math.min(n.x,e.x),a=Math.max(n.x,e.x),o=Math.min(n.y,e.y),s=Math.max(n.y,e.y);r.setTransform(this._box,"translate("+i+"px,"+o+"px)"),this._box.style.width=a-i+"px",this._box.style.height=s-o+"px"}},gn.prototype._onMouseUp=function(e){if(0===e.button){var n=this._startPos,i=r.mousePos(this._el,e);this._finish(),r.suppressClick(),n.x===i.x&&n.y===i.y?this._fireEvent("boxzoomcancel",e):this._map.fitScreenCoordinates(n,i,this._map.getBearing(),{linear:!0}).fire(new t.Event("boxzoomend",{originalEvent:e}))}},gn.prototype._onKeyDown=function(t){27===t.keyCode&&(this._finish(),this._fireEvent("boxzoomcancel",t))},gn.prototype._finish=function(){this._active=!1,t.window.document.removeEventListener("mousemove",this._onMouseMove,!1),t.window.document.removeEventListener("keydown",this._onKeyDown,!1),t.window.document.removeEventListener("mouseup",this._onMouseUp,!1),this._container.classList.remove("mapboxgl-crosshair"),this._box&&(r.remove(this._box),this._box=null),r.enableDrag(),delete this._startPos,delete this._lastPos},gn.prototype._fireEvent=function(e,r){return this._map.fire(new t.Event(e,{originalEvent:r}))};var vn=t.bezier(0,0,.25,1),_n=function(e,r){this._map=e,this._el=r.element||e.getCanvasContainer(),this._state="disabled",this._button=r.button||"right",this._bearingSnap=r.bearingSnap||0,this._pitchWithRotate=!1!==r.pitchWithRotate,t.bindAll(["onMouseDown","_onMouseMove","_onMouseUp","_onBlur","_onDragFrame"],this)};_n.prototype.isEnabled=function(){return"disabled"!==this._state},_n.prototype.isActive=function(){return"active"===this._state},_n.prototype.enable=function(){this.isEnabled()||(this._state="enabled")},_n.prototype.disable=function(){if(this.isEnabled())switch(this._state){case"active":this._state="disabled",this._unbind(),this._deactivate(),this._fireEvent("rotateend"),this._pitchWithRotate&&this._fireEvent("pitchend"),this._fireEvent("moveend");break;case"pending":this._state="disabled",this._unbind();break;default:this._state="disabled"}},_n.prototype.onMouseDown=function(e){if("enabled"===this._state){var n="touchstart"===e.type;if(n)this._startTime=Date.now();else if("right"===this._button){if(this._eventButton=r.mouseButton(e),this._eventButton!==(e.ctrlKey?0:2))return}else{if(e.ctrlKey||0!==r.mouseButton(e))return;this._eventButton=0}r.disableDrag(),n?(t.window.document.addEventListener("touchmove",this._onMouseMove,{capture:!0}),t.window.document.addEventListener("touchend",this._onMouseUp)):(t.window.document.addEventListener("mousemove",this._onMouseMove,{capture:!0}),t.window.document.addEventListener("mouseup",this._onMouseUp)),t.window.addEventListener("blur",this._onBlur),this._state="pending",this._inertia=[[t.browser.now(),this._map.getBearing()]],this._startPos=this._prevPos=this._lastPos=r.mousePos(this._el,e),this._center=this._map.transform.centerPoint,e.preventDefault()}},_n.prototype._onMouseMove=function(t){var e=r.mousePos(this._el,t);this._lastPos.equals(e)||(this._lastMoveEvent=t,this._lastPos=e,"pending"===this._state&&(this._state="active",this._fireEvent("rotatestart",t),this._fireEvent("movestart",t),this._pitchWithRotate&&this._fireEvent("pitchstart",t)),this._frameId||(this._frameId=this._map._requestRenderFrame(this._onDragFrame)))},_n.prototype._onDragFrame=function(){this._frameId=null;var e=this._lastMoveEvent;if(e){var r=this._map.transform,n=this._prevPos,i=this._lastPos,a=.8*(n.x-i.x),o=-.5*(n.y-i.y),s=r.bearing-a,l=r.pitch-o,u=this._inertia,c=u[u.length-1];this._drainInertiaBuffer(),u.push([t.browser.now(),this._map._normalizeBearing(s,c[1])]),r.bearing=s,this._pitchWithRotate&&(this._fireEvent("pitch",e),r.pitch=l),this._fireEvent("rotate",e),this._fireEvent("move",e),delete this._lastMoveEvent,this._prevPos=this._lastPos}},_n.prototype._onMouseUp=function(t){if("touchend"===t.type&&this._startPos===this._lastPos&&Date.now()-this._startTime<300&&this._el.click(),r.mouseButton(t)===this._eventButton)switch(this._state){case"active":this._state="enabled",r.suppressClick(),this._unbind(),this._deactivate(),this._inertialRotate(t);break;case"pending":this._state="enabled",this._unbind()}},_n.prototype._onBlur=function(t){switch(this._state){case"active":this._state="enabled",this._unbind(),this._deactivate(),this._fireEvent("rotateend",t),this._pitchWithRotate&&this._fireEvent("pitchend",t),this._fireEvent("moveend",t);break;case"pending":this._state="enabled",this._unbind()}},_n.prototype._unbind=function(){t.window.document.removeEventListener("mousemove",this._onMouseMove,{capture:!0}),t.window.document.removeEventListener("mouseup",this._onMouseUp),t.window.document.removeEventListener("touchmove",this._onMouseMove,{capture:!0}),t.window.document.removeEventListener("touchend",this._onMouseUp),t.window.removeEventListener("blur",this._onBlur),r.enableDrag()},_n.prototype._deactivate=function(){this._frameId&&(this._map._cancelRenderFrame(this._frameId),this._frameId=null),delete this._lastMoveEvent,delete this._startPos,delete this._prevPos,delete this._lastPos},_n.prototype._inertialRotate=function(t){var e=this;this._fireEvent("rotateend",t),this._drainInertiaBuffer();var r=this._map,n=r.getBearing(),i=this._inertia,a=function(){Math.abs(n)<e._bearingSnap?r.resetNorth({noMoveStart:!0},{originalEvent:t}):e._fireEvent("moveend",t),e._pitchWithRotate&&e._fireEvent("pitchend",t)};if(i.length<2)a();else{var o=i[0],s=i[i.length-1],l=i[i.length-2],u=r._normalizeBearing(n,l[1]),c=s[1]-o[1],p=c<0?-1:1,h=(s[0]-o[0])/1e3;if(0!==c&&0!==h){var f=Math.abs(c*(.25/h));f>180&&(f=180);var d=f/180;u+=p*f*(d/2),Math.abs(r._normalizeBearing(u,0))<this._bearingSnap&&(u=r._normalizeBearing(0,u)),r.rotateTo(u,{duration:1e3*d,easing:vn,noMoveStart:!0},{originalEvent:t})}else a()}},_n.prototype._fireEvent=function(e,r){return this._map.fire(new t.Event(e,r?{originalEvent:r}:{}))},_n.prototype._drainInertiaBuffer=function(){for(var e=this._inertia,r=t.browser.now();e.length>0&&r-e[0][0]>160;)e.shift()};var xn=t.bezier(0,0,.3,1),bn=function(e,r){this._map=e,this._el=e.getCanvasContainer(),this._state="disabled",this._clickTolerance=r.clickTolerance||1,t.bindAll(["_onMove","_onMouseUp","_onTouchEnd","_onBlur","_onDragFrame"],this)};bn.prototype.isEnabled=function(){return"disabled"!==this._state},bn.prototype.isActive=function(){return"active"===this._state},bn.prototype.enable=function(){this.isEnabled()||(this._el.classList.add("mapboxgl-touch-drag-pan"),this._state="enabled")},bn.prototype.disable=function(){if(this.isEnabled())switch(this._el.classList.remove("mapboxgl-touch-drag-pan"),this._state){case"active":this._state="disabled",this._unbind(),this._deactivate(),this._fireEvent("dragend"),this._fireEvent("moveend");break;case"pending":this._state="disabled",this._unbind();break;default:this._state="disabled"}},bn.prototype.onMouseDown=function(e){"enabled"===this._state&&(e.ctrlKey||0!==r.mouseButton(e)||(r.addEventListener(t.window.document,"mousemove",this._onMove,{capture:!0}),r.addEventListener(t.window.document,"mouseup",this._onMouseUp),this._start(e)))},bn.prototype.onTouchStart=function(e){"enabled"===this._state&&(e.touches.length>1||(r.addEventListener(t.window.document,"touchmove",this._onMove,{capture:!0,passive:!1}),r.addEventListener(t.window.document,"touchend",this._onTouchEnd),this._start(e)))},bn.prototype._start=function(e){t.window.addEventListener("blur",this._onBlur),this._state="pending",this._startPos=this._mouseDownPos=this._prevPos=this._lastPos=r.mousePos(this._el,e),this._inertia=[[t.browser.now(),this._startPos]]},bn.prototype._onMove=function(e){e.preventDefault();var n=r.mousePos(this._el,e);this._lastPos.equals(n)||"pending"===this._state&&n.dist(this._mouseDownPos)<this._clickTolerance||(this._lastMoveEvent=e,this._lastPos=n,this._drainInertiaBuffer(),this._inertia.push([t.browser.now(),this._lastPos]),"pending"===this._state&&(this._state="active",this._fireEvent("dragstart",e),this._fireEvent("movestart",e)),this._frameId||(this._frameId=this._map._requestRenderFrame(this._onDragFrame)))},bn.prototype._onDragFrame=function(){this._frameId=null;var t=this._lastMoveEvent;if(t){var e=this._map.transform;e.setLocationAtPoint(e.pointLocation(this._prevPos),this._lastPos),this._fireEvent("drag",t),this._fireEvent("move",t),this._prevPos=this._lastPos,delete this._lastMoveEvent}},bn.prototype._onMouseUp=function(t){if(0===r.mouseButton(t))switch(this._state){case"active":this._state="enabled",r.suppressClick(),this._unbind(),this._deactivate(),this._inertialPan(t);break;case"pending":this._state="enabled",this._unbind()}},bn.prototype._onTouchEnd=function(t){switch(this._state){case"active":this._state="enabled",this._unbind(),this._deactivate(),this._inertialPan(t);break;case"pending":this._state="enabled",this._unbind()}},bn.prototype._onBlur=function(t){switch(this._state){case"active":this._state="enabled",this._unbind(),this._deactivate(),this._fireEvent("dragend",t),this._fireEvent("moveend",t);break;case"pending":this._state="enabled",this._unbind()}},bn.prototype._unbind=function(){r.removeEventListener(t.window.document,"touchmove",this._onMove,{capture:!0,passive:!1}),r.removeEventListener(t.window.document,"touchend",this._onTouchEnd),r.removeEventListener(t.window.document,"mousemove",this._onMove,{capture:!0}),r.removeEventListener(t.window.document,"mouseup",this._onMouseUp),r.removeEventListener(t.window,"blur",this._onBlur)},bn.prototype._deactivate=function(){this._frameId&&(this._map._cancelRenderFrame(this._frameId),this._frameId=null),delete this._lastMoveEvent,delete this._startPos,delete this._prevPos,delete this._mouseDownPos,delete this._lastPos},bn.prototype._inertialPan=function(t){this._fireEvent("dragend",t),this._drainInertiaBuffer();var e=this._inertia;if(e.length<2)this._fireEvent("moveend",t);else{var r=e[e.length-1],n=e[0],i=r[1].sub(n[1]),a=(r[0]-n[0])/1e3;if(0===a||r[1].equals(n[1]))this._fireEvent("moveend",t);else{var o=i.mult(.3/a),s=o.mag();s>1400&&(s=1400,o._unit()._mult(s));var l=s/750,u=o.mult(-l/2);this._map.panBy(u,{duration:1e3*l,easing:xn,noMoveStart:!0},{originalEvent:t})}}},bn.prototype._fireEvent=function(e,r){return this._map.fire(new t.Event(e,r?{originalEvent:r}:{}))},bn.prototype._drainInertiaBuffer=function(){for(var e=this._inertia,r=t.browser.now();e.length>0&&r-e[0][0]>160;)e.shift()};var wn=function(e){this._map=e,this._el=e.getCanvasContainer(),t.bindAll(["_onKeyDown"],this)};function kn(t){return t*(2-t)}wn.prototype.isEnabled=function(){return!!this._enabled},wn.prototype.enable=function(){this.isEnabled()||(this._el.addEventListener("keydown",this._onKeyDown,!1),this._enabled=!0)},wn.prototype.disable=function(){this.isEnabled()&&(this._el.removeEventListener("keydown",this._onKeyDown),this._enabled=!1)},wn.prototype._onKeyDown=function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var e=0,r=0,n=0,i=0,a=0;switch(t.keyCode){case 61:case 107:case 171:case 187:e=1;break;case 189:case 109:case 173:e=-1;break;case 37:t.shiftKey?r=-1:(t.preventDefault(),i=-1);break;case 39:t.shiftKey?r=1:(t.preventDefault(),i=1);break;case 38:t.shiftKey?n=1:(t.preventDefault(),a=-1);break;case 40:t.shiftKey?n=-1:(a=1,t.preventDefault());break;default:return}var o=this._map,s=o.getZoom(),l={duration:300,delayEndEvents:500,easing:kn,zoom:e?Math.round(s)+e*(t.shiftKey?2:1):s,bearing:o.getBearing()+15*r,pitch:o.getPitch()+10*n,offset:[100*-i,100*-a],center:o.getCenter()};o.easeTo(l,{originalEvent:t})}};var Tn=function(e){this._map=e,t.bindAll(["_onDblClick","_onZoomEnd"],this)};Tn.prototype.isEnabled=function(){return!!this._enabled},Tn.prototype.isActive=function(){return!!this._active},Tn.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},Tn.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},Tn.prototype.onTouchStart=function(t){var e=this;if(this.isEnabled()&&!(t.points.length>1))if(this._tapped){var r=t.points[0],n=this._tappedPoint;if(n&&n.dist(r)<=30){t.originalEvent.preventDefault();var i=function(){e._tapped&&e._zoom(t),e._map.off("touchcancel",a),e._resetTapped()},a=function(){e._map.off("touchend",i),e._resetTapped()};this._map.once("touchend",i),this._map.once("touchcancel",a)}else this._resetTapped()}else this._tappedPoint=t.points[0],this._tapped=setTimeout(function(){e._tapped=null,e._tappedPoint=null},300)},Tn.prototype._resetTapped=function(){clearTimeout(this._tapped),this._tapped=null,this._tappedPoint=null},Tn.prototype.onDblClick=function(t){this.isEnabled()&&(t.originalEvent.preventDefault(),this._zoom(t))},Tn.prototype._zoom=function(t){this._active=!0,this._map.on("zoomend",this._onZoomEnd),this._map.zoomTo(this._map.getZoom()+(t.originalEvent.shiftKey?-1:1),{around:t.lngLat},t)},Tn.prototype._onZoomEnd=function(){this._active=!1,this._map.off("zoomend",this._onZoomEnd)};var An=t.bezier(0,0,.15,1),Mn=function(e){this._map=e,this._el=e.getCanvasContainer(),t.bindAll(["_onMove","_onEnd","_onTouchFrame"],this)};Mn.prototype.isEnabled=function(){return!!this._enabled},Mn.prototype.enable=function(t){this.isEnabled()||(this._el.classList.add("mapboxgl-touch-zoom-rotate"),this._enabled=!0,this._aroundCenter=!!t&&"center"===t.around)},Mn.prototype.disable=function(){this.isEnabled()&&(this._el.classList.remove("mapboxgl-touch-zoom-rotate"),this._enabled=!1)},Mn.prototype.disableRotation=function(){this._rotationDisabled=!0},Mn.prototype.enableRotation=function(){this._rotationDisabled=!1},Mn.prototype.onStart=function(e){if(this.isEnabled()&&2===e.touches.length){var n=r.mousePos(this._el,e.touches[0]),i=r.mousePos(this._el,e.touches[1]),a=n.add(i).div(2);this._startVec=n.sub(i),this._startAround=this._map.transform.pointLocation(a),this._gestureIntent=void 0,this._inertia=[],r.addEventListener(t.window.document,"touchmove",this._onMove,{passive:!1}),r.addEventListener(t.window.document,"touchend",this._onEnd)}},Mn.prototype._getTouchEventData=function(t){var e=r.mousePos(this._el,t.touches[0]),n=r.mousePos(this._el,t.touches[1]),i=e.sub(n);return{vec:i,center:e.add(n).div(2),scale:i.mag()/this._startVec.mag(),bearing:this._rotationDisabled?0:180*i.angleWith(this._startVec)/Math.PI}},Mn.prototype._onMove=function(e){if(2===e.touches.length){var r=this._getTouchEventData(e),n=r.vec,i=r.scale,a=r.bearing;if(!this._gestureIntent){var o=this._rotationDisabled&&1!==i||Math.abs(1-i)>.15;Math.abs(a)>10?this._gestureIntent="rotate":o&&(this._gestureIntent="zoom"),this._gestureIntent&&(this._map.fire(new t.Event(this._gestureIntent+"start",{originalEvent:e})),this._map.fire(new t.Event("movestart",{originalEvent:e})),this._startVec=n)}this._lastTouchEvent=e,this._frameId||(this._frameId=this._map._requestRenderFrame(this._onTouchFrame)),e.preventDefault()}},Mn.prototype._onTouchFrame=function(){this._frameId=null;var e=this._gestureIntent;if(e){var r=this._map.transform;this._startScale||(this._startScale=r.scale,this._startBearing=r.bearing);var n=this._getTouchEventData(this._lastTouchEvent),i=n.center,a=n.bearing,o=n.scale,s=r.pointLocation(i),l=r.locationPoint(s);"rotate"===e&&(r.bearing=this._startBearing+a),r.zoom=r.scaleZoom(this._startScale*o),r.setLocationAtPoint(this._startAround,l),this._map.fire(new t.Event(e,{originalEvent:this._lastTouchEvent})),this._map.fire(new t.Event("move",{originalEvent:this._lastTouchEvent})),this._drainInertiaBuffer(),this._inertia.push([t.browser.now(),o,i])}},Mn.prototype._onEnd=function(e){r.removeEventListener(t.window.document,"touchmove",this._onMove,{passive:!1}),r.removeEventListener(t.window.document,"touchend",this._onEnd);var n=this._gestureIntent,i=this._startScale;if(this._frameId&&(this._map._cancelRenderFrame(this._frameId),this._frameId=null),delete this._gestureIntent,delete this._startScale,delete this._startBearing,delete this._lastTouchEvent,n){this._map.fire(new t.Event(n+"end",{originalEvent:e})),this._drainInertiaBuffer();var a=this._inertia,o=this._map;if(a.length<2)o.snapToNorth({},{originalEvent:e});else{var s=a[a.length-1],l=a[0],u=o.transform.scaleZoom(i*s[1]),c=o.transform.scaleZoom(i*l[1]),p=u-c,h=(s[0]-l[0])/1e3,f=s[2];if(0!==h&&u!==c){var d=.15*p/h;Math.abs(d)>2.5&&(d=d>0?2.5:-2.5);var m=1e3*Math.abs(d/(12*.15)),y=u+d*m/2e3;y<0&&(y=0),o.easeTo({zoom:y,duration:m,easing:An,around:this._aroundCenter?o.getCenter():o.unproject(f),noMoveStart:!0},{originalEvent:e})}else o.snapToNorth({},{originalEvent:e})}}},Mn.prototype._drainInertiaBuffer=function(){for(var e=this._inertia,r=t.browser.now();e.length>2&&r-e[0][0]>160;)e.shift()};var Sn={scrollZoom:yn,boxZoom:gn,dragRotate:_n,dragPan:bn,keyboard:wn,doubleClickZoom:Tn,touchZoomRotate:Mn},Ln=function(e){function r(r,n){e.call(this),this._moving=!1,this._zooming=!1,this.transform=r,this._bearingSnap=n.bearingSnap,t.bindAll(["_renderFrameCallback"],this)}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.getCenter=function(){return new t.LngLat(this.transform.center.lng,this.transform.center.lat)},r.prototype.setCenter=function(t,e){return this.jumpTo({center:t},e)},r.prototype.panBy=function(e,r,n){return e=t.Point.convert(e).mult(-1),this.panTo(this.transform.center,t.extend({offset:e},r),n)},r.prototype.panTo=function(e,r,n){return this.easeTo(t.extend({center:e},r),n)},r.prototype.getZoom=function(){return this.transform.zoom},r.prototype.setZoom=function(t,e){return this.jumpTo({zoom:t},e),this},r.prototype.zoomTo=function(e,r,n){return this.easeTo(t.extend({zoom:e},r),n)},r.prototype.zoomIn=function(t,e){return this.zoomTo(this.getZoom()+1,t,e),this},r.prototype.zoomOut=function(t,e){return this.zoomTo(this.getZoom()-1,t,e),this},r.prototype.getBearing=function(){return this.transform.bearing},r.prototype.setBearing=function(t,e){return this.jumpTo({bearing:t},e),this},r.prototype.rotateTo=function(e,r,n){return this.easeTo(t.extend({bearing:e},r),n)},r.prototype.resetNorth=function(e,r){return this.rotateTo(0,t.extend({duration:1e3},e),r),this},r.prototype.resetNorthPitch=function(e,r){return this.easeTo(t.extend({bearing:0,pitch:0,duration:1e3},e),r),this},r.prototype.snapToNorth=function(t,e){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(t,e):this},r.prototype.getPitch=function(){return this.transform.pitch},r.prototype.setPitch=function(t,e){return this.jumpTo({pitch:t},e),this},r.prototype.cameraForBounds=function(e,r){return e=t.LngLatBounds.convert(e),this._cameraForBoxAndBearing(e.getNorthWest(),e.getSouthEast(),0,r)},r.prototype._cameraForBoxAndBearing=function(e,r,n,i){if("number"==typeof(i=t.extend({padding:{top:0,bottom:0,right:0,left:0},offset:[0,0],maxZoom:this.transform.maxZoom},i)).padding){var a=i.padding;i.padding={top:a,bottom:a,right:a,left:a}}if(t.deepEqual(Object.keys(i.padding).sort(function(t,e){return t<e?-1:t>e?1:0}),["bottom","left","right","top"])){var o=this.transform,s=o.project(t.LngLat.convert(e)),l=o.project(t.LngLat.convert(r)),u=s.rotate(-n*Math.PI/180),c=l.rotate(-n*Math.PI/180),p=new t.Point(Math.max(u.x,c.x),Math.max(u.y,c.y)),h=new t.Point(Math.min(u.x,c.x),Math.min(u.y,c.y)),f=p.sub(h),d=(o.width-i.padding.left-i.padding.right)/f.x,m=(o.height-i.padding.top-i.padding.bottom)/f.y;if(!(m<0||d<0)){var y=Math.min(o.scaleZoom(o.scale*Math.min(d,m)),i.maxZoom),g=t.Point.convert(i.offset),v=(i.padding.left-i.padding.right)/2,_=(i.padding.top-i.padding.bottom)/2,x=new t.Point(g.x+v,g.y+_).mult(o.scale/o.zoomScale(y));return{center:o.unproject(s.add(l).div(2).sub(x)),zoom:y,bearing:n}}t.warnOnce("Map cannot fit within canvas with the given bounds, padding, and/or offset.")}else t.warnOnce("options.padding must be a positive number, or an Object with keys 'bottom', 'left', 'right', 'top'")},r.prototype.fitBounds=function(t,e,r){return this._fitInternal(this.cameraForBounds(t,e),e,r)},r.prototype.fitScreenCoordinates=function(e,r,n,i,a){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(t.Point.convert(e)),this.transform.pointLocation(t.Point.convert(r)),n,i),i,a)},r.prototype._fitInternal=function(e,r,n){return e?(r=t.extend(e,r)).linear?this.easeTo(r,n):this.flyTo(r,n):this},r.prototype.jumpTo=function(e,r){this.stop();var n=this.transform,i=!1,a=!1,o=!1;return"zoom"in e&&n.zoom!==+e.zoom&&(i=!0,n.zoom=+e.zoom),void 0!==e.center&&(n.center=t.LngLat.convert(e.center)),"bearing"in e&&n.bearing!==+e.bearing&&(a=!0,n.bearing=+e.bearing),"pitch"in e&&n.pitch!==+e.pitch&&(o=!0,n.pitch=+e.pitch),this.fire(new t.Event("movestart",r)).fire(new t.Event("move",r)),i&&this.fire(new t.Event("zoomstart",r)).fire(new t.Event("zoom",r)).fire(new t.Event("zoomend",r)),a&&this.fire(new t.Event("rotatestart",r)).fire(new t.Event("rotate",r)).fire(new t.Event("rotateend",r)),o&&this.fire(new t.Event("pitchstart",r)).fire(new t.Event("pitch",r)).fire(new t.Event("pitchend",r)),this.fire(new t.Event("moveend",r))},r.prototype.easeTo=function(e,r){var n=this;this.stop(),(!1===(e=t.extend({offset:[0,0],duration:500,easing:t.ease},e)).animate||t.browser.prefersReducedMotion)&&(e.duration=0);var i=this.transform,a=this.getZoom(),o=this.getBearing(),s=this.getPitch(),l="zoom"in e?+e.zoom:a,u="bearing"in e?this._normalizeBearing(e.bearing,o):o,c="pitch"in e?+e.pitch:s,p=i.centerPoint.add(t.Point.convert(e.offset)),h=i.pointLocation(p),f=t.LngLat.convert(e.center||h);this._normalizeCenter(f);var d,m,y=i.project(h),g=i.project(f).sub(y),v=i.zoomScale(l-a);return e.around&&(d=t.LngLat.convert(e.around),m=i.locationPoint(d)),this._zooming=l!==a,this._rotating=o!==u,this._pitching=c!==s,this._prepareEase(r,e.noMoveStart),clearTimeout(this._easeEndTimeoutID),this._ease(function(e){if(n._zooming&&(i.zoom=t.number(a,l,e)),n._rotating&&(i.bearing=t.number(o,u,e)),n._pitching&&(i.pitch=t.number(s,c,e)),d)i.setLocationAtPoint(d,m);else{var h=i.zoomScale(i.zoom-a),f=l>a?Math.min(2,v):Math.max(.5,v),_=Math.pow(f,1-e),x=i.unproject(y.add(g.mult(e*_)).mult(h));i.setLocationAtPoint(i.renderWorldCopies?x.wrap():x,p)}n._fireMoveEvents(r)},function(){e.delayEndEvents?n._easeEndTimeoutID=setTimeout(function(){return n._afterEase(r)},e.delayEndEvents):n._afterEase(r)},e),this},r.prototype._prepareEase=function(e,r){this._moving=!0,r||this.fire(new t.Event("movestart",e)),this._zooming&&this.fire(new t.Event("zoomstart",e)),this._rotating&&this.fire(new t.Event("rotatestart",e)),this._pitching&&this.fire(new t.Event("pitchstart",e))},r.prototype._fireMoveEvents=function(e){this.fire(new t.Event("move",e)),this._zooming&&this.fire(new t.Event("zoom",e)),this._rotating&&this.fire(new t.Event("rotate",e)),this._pitching&&this.fire(new t.Event("pitch",e))},r.prototype._afterEase=function(e){var r=this._zooming,n=this._rotating,i=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,r&&this.fire(new t.Event("zoomend",e)),n&&this.fire(new t.Event("rotateend",e)),i&&this.fire(new t.Event("pitchend",e)),this.fire(new t.Event("moveend",e))},r.prototype.flyTo=function(e,r){var n=this;if(t.browser.prefersReducedMotion){var i=t.pick(e,["center","zoom","bearing","pitch","around"]);return this.jumpTo(i,r)}this.stop(),e=t.extend({offset:[0,0],speed:1.2,curve:1.42,easing:t.ease},e);var a=this.transform,o=this.getZoom(),s=this.getBearing(),l=this.getPitch(),u="zoom"in e?t.clamp(+e.zoom,a.minZoom,a.maxZoom):o,c="bearing"in e?this._normalizeBearing(e.bearing,s):s,p="pitch"in e?+e.pitch:l,h=a.zoomScale(u-o),f=a.centerPoint.add(t.Point.convert(e.offset)),d=a.pointLocation(f),m=t.LngLat.convert(e.center||d);this._normalizeCenter(m);var y=a.project(d),g=a.project(m).sub(y),v=e.curve,_=Math.max(a.width,a.height),x=_/h,b=g.mag();if("minZoom"in e){var w=t.clamp(Math.min(e.minZoom,o,u),a.minZoom,a.maxZoom),k=_/a.zoomScale(w-o);v=Math.sqrt(k/b*2)}var T=v*v;function A(t){var e=(x*x-_*_+(t?-1:1)*T*T*b*b)/(2*(t?x:_)*T*b);return Math.log(Math.sqrt(e*e+1)-e)}function M(t){return(Math.exp(t)-Math.exp(-t))/2}function S(t){return(Math.exp(t)+Math.exp(-t))/2}var L=A(0),C=function(t){return S(L)/S(L+v*t)},E=function(t){return _*((S(L)*(M(e=L+v*t)/S(e))-M(L))/T)/b;var e},z=(A(1)-L)/v;if(Math.abs(b)<1e-6||!isFinite(z)){if(Math.abs(_-x)<1e-6)return this.easeTo(e,r);var P=x<_?-1:1;z=Math.abs(Math.log(x/_))/v,E=function(){return 0},C=function(t){return Math.exp(P*v*t)}}if("duration"in e)e.duration=+e.duration;else{var I="screenSpeed"in e?+e.screenSpeed/v:+e.speed;e.duration=1e3*z/I}return e.maxDuration&&e.duration>e.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=s!==c,this._pitching=p!==l,this._prepareEase(r,!1),this._ease(function(e){var i=e*z,h=1/C(i);a.zoom=1===e?u:o+a.scaleZoom(h),n._rotating&&(a.bearing=t.number(s,c,e)),n._pitching&&(a.pitch=t.number(l,p,e));var d=1===e?m:a.unproject(y.add(g.mult(E(i))).mult(h));a.setLocationAtPoint(a.renderWorldCopies?d.wrap():d,f),n._fireMoveEvents(r)},function(){return n._afterEase(r)},e),this},r.prototype.isEasing=function(){return!!this._easeFrameId},r.prototype.stop=function(){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var t=this._onEaseEnd;delete this._onEaseEnd,t.call(this)}return this},r.prototype._ease=function(e,r,n){!1===n.animate||0===n.duration?(e(1),r()):(this._easeStart=t.browser.now(),this._easeOptions=n,this._onEaseFrame=e,this._onEaseEnd=r,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},r.prototype._renderFrameCallback=function(){var e=Math.min((t.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(e)),e<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},r.prototype._normalizeBearing=function(e,r){e=t.wrap(e,-180,180);var n=Math.abs(e-r);return Math.abs(e-360-r)<n&&(e-=360),Math.abs(e+360-r)<n&&(e+=360),e},r.prototype._normalizeCenter=function(t){var e=this.transform;if(e.renderWorldCopies&&!e.lngRange){var r=t.lng-e.center.lng;t.lng+=r>180?-360:r<-180?360:0}},r}(t.Evented),Cn=function(e){void 0===e&&(e={}),this.options=e,t.bindAll(["_updateEditLink","_updateData","_updateCompact"],this)};Cn.prototype.getDefaultPosition=function(){return"bottom-right"},Cn.prototype.onAdd=function(t){var e=this.options&&this.options.compact;return this._map=t,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._innerContainer=r.create("div","mapboxgl-ctrl-attrib-inner",this._container),e&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),void 0===e&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},Cn.prototype.onRemove=function(){r.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0},Cn.prototype._updateEditLink=function(){var e=this._editLink;e||(e=this._editLink=this._container.querySelector(".mapbox-improve-map"));var r=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||t.config.ACCESS_TOKEN}];if(e){var n=r.reduce(function(t,e,n){return e.value&&(t+=e.key+"="+e.value+(n<r.length-1?"&":"")),t},"?");e.href=t.config.FEEDBACK_URL+"/"+n+(this._map._hash?this._map._hash.getHashString(!0):""),e.rel="noopener nofollow"}},Cn.prototype._updateData=function(t){!t||"metadata"!==t.sourceDataType&&"style"!==t.dataType||(this._updateAttributions(),this._updateEditLink())},Cn.prototype._updateAttributions=function(){if(this._map.style){var t=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?t=t.concat(this.options.customAttribution.map(function(t){return"string"!=typeof t?"":t})):"string"==typeof this.options.customAttribution&&t.push(this.options.customAttribution)),this._map.style.stylesheet){var e=this._map.style.stylesheet;this.styleOwner=e.owner,this.styleId=e.id}var r=this._map.style.sourceCaches;for(var n in r){var i=r[n];if(i.used){var a=i.getSource();a.attribution&&t.indexOf(a.attribution)<0&&t.push(a.attribution)}}t.sort(function(t,e){return t.length-e.length});var o=(t=t.filter(function(e,r){for(var n=r+1;n<t.length;n++)if(t[n].indexOf(e)>=0)return!1;return!0})).join(" | ");o!==this._attribHTML&&(this._attribHTML=o,t.length?(this._innerContainer.innerHTML=o,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},Cn.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact")};var En=function(){t.bindAll(["_updateLogo"],this),t.bindAll(["_updateCompact"],this)};En.prototype.onAdd=function(t){this._map=t,this._container=r.create("div","mapboxgl-ctrl");var e=r.create("a","mapboxgl-ctrl-logo");return e.target="_blank",e.rel="noopener nofollow",e.href="https://www.mapbox.com/",e.setAttribute("aria-label","Mapbox logo"),e.setAttribute("rel","noopener nofollow"),this._container.appendChild(e),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},En.prototype.onRemove=function(){r.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},En.prototype.getDefaultPosition=function(){return"bottom-left"},En.prototype._updateLogo=function(t){t&&"metadata"!==t.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")},En.prototype._logoRequired=function(){if(this._map.style){var t=this._map.style.sourceCaches;for(var e in t)if(t[e].getSource().mapbox_logo)return!0;return!1}},En.prototype._updateCompact=function(){var t=this._container.children;if(t.length){var e=t[0];this._map.getCanvasContainer().offsetWidth<250?e.classList.add("mapboxgl-compact"):e.classList.remove("mapboxgl-compact")}};var zn=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};zn.prototype.add=function(t){var e=++this._id;return this._queue.push({callback:t,id:e,cancelled:!1}),e},zn.prototype.remove=function(t){for(var e=this._currentlyRunning,r=0,n=e?this._queue.concat(e):this._queue;r<n.length;r+=1){var i=n[r];if(i.id===t)return void(i.cancelled=!0)}},zn.prototype.run=function(){var t=this._currentlyRunning=this._queue;this._queue=[];for(var e=0,r=t;e<r.length;e+=1){var n=r[e];if(!n.cancelled&&(n.callback(),this._cleared))break}this._cleared=!1,this._currentlyRunning=!1},zn.prototype.clear=function(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]};var Pn=t.window.HTMLImageElement,In=t.window.HTMLElement,Dn={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:0,maxZoom:22,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,bearingSnap:7,clickTolerance:3,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",transformRequest:null,accessToken:null,fadeDuration:300,crossSourceCollisions:!0},On=function(n){function i(e){var i=this;if(null!=(e=t.extend({},Dn,e)).minZoom&&null!=e.maxZoom&&e.minZoom>e.maxZoom)throw new Error("maxZoom must be greater than minZoom");var a=new cn(e.minZoom,e.maxZoom,e.renderWorldCopies);if(n.call(this,a,e),this._interactive=e.interactive,this._maxTileCacheSize=e.maxTileCacheSize,this._failIfMajorPerformanceCaveat=e.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=e.preserveDrawingBuffer,this._antialias=e.antialias,this._trackResize=e.trackResize,this._bearingSnap=e.bearingSnap,this._refreshExpiredTiles=e.refreshExpiredTiles,this._fadeDuration=e.fadeDuration,this._crossSourceCollisions=e.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=e.collectResourceTiming,this._renderTaskQueue=new zn,this._controls=[],this._mapId=t.uniqueId(),this._requestManager=new t.RequestManager(e.transformRequest,e.accessToken),"string"==typeof e.container){if(this._container=t.window.document.getElementById(e.container),!this._container)throw new Error("Container '"+e.container+"' not found.")}else{if(!(e.container instanceof In))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=e.container}if(e.maxBounds&&this.setMaxBounds(e.maxBounds),t.bindAll(["_onWindowOnline","_onWindowResize","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),void 0===this.painter)throw new Error("Failed to initialize WebGL.");this.on("move",function(){return i._update(!1)}),this.on("moveend",function(){return i._update(!1)}),this.on("zoom",function(){return i._update(!0)}),void 0!==t.window&&(t.window.addEventListener("online",this._onWindowOnline,!1),t.window.addEventListener("resize",this._onWindowResize,!1)),function(t,e){var n=t.getCanvasContainer(),i=null,a=!1,o=null;for(var s in Sn)t[s]=new Sn[s](t,e),e.interactive&&e[s]&&t[s].enable(e[s]);r.addEventListener(n,"mouseout",function(e){t.fire(new fn("mouseout",t,e))}),r.addEventListener(n,"mousedown",function(i){a=!0,o=r.mousePos(n,i);var s=new fn("mousedown",t,i);t.fire(s),s.defaultPrevented||(e.interactive&&!t.doubleClickZoom.isActive()&&t.stop(),t.boxZoom.onMouseDown(i),t.boxZoom.isActive()||t.dragPan.isActive()||t.dragRotate.onMouseDown(i),t.boxZoom.isActive()||t.dragRotate.isActive()||t.dragPan.onMouseDown(i))}),r.addEventListener(n,"mouseup",function(e){var r=t.dragRotate.isActive();i&&!r&&t.fire(new fn("contextmenu",t,i)),i=null,a=!1,t.fire(new fn("mouseup",t,e))}),r.addEventListener(n,"mousemove",function(e){if(!t.dragPan.isActive()&&!t.dragRotate.isActive()){for(var r=e.target;r&&r!==n;)r=r.parentNode;r===n&&t.fire(new fn("mousemove",t,e))}}),r.addEventListener(n,"mouseover",function(e){for(var r=e.target;r&&r!==n;)r=r.parentNode;r===n&&t.fire(new fn("mouseover",t,e))}),r.addEventListener(n,"touchstart",function(r){var n=new dn("touchstart",t,r);t.fire(n),n.defaultPrevented||(e.interactive&&t.stop(),t.boxZoom.isActive()||t.dragRotate.isActive()||t.dragPan.onTouchStart(r),t.touchZoomRotate.onStart(r),t.doubleClickZoom.onTouchStart(n))},{passive:!1}),r.addEventListener(n,"touchmove",function(e){t.fire(new dn("touchmove",t,e))},{passive:!1}),r.addEventListener(n,"touchend",function(e){t.fire(new dn("touchend",t,e))}),r.addEventListener(n,"touchcancel",function(e){t.fire(new dn("touchcancel",t,e))}),r.addEventListener(n,"click",function(i){var a=r.mousePos(n,i);(!o||a.equals(o)||a.dist(o)<e.clickTolerance)&&t.fire(new fn("click",t,i))}),r.addEventListener(n,"dblclick",function(e){var r=new fn("dblclick",t,e);t.fire(r),r.defaultPrevented||t.doubleClickZoom.onDblClick(r)}),r.addEventListener(n,"contextmenu",function(e){var r=t.dragRotate.isActive();a||r?a&&(i=e):t.fire(new fn("contextmenu",t,e)),(t.dragRotate.isEnabled()||t.listens("contextmenu"))&&e.preventDefault()}),r.addEventListener(n,"wheel",function(r){e.interactive&&t.stop();var n=new mn("wheel",t,r);t.fire(n),n.defaultPrevented||t.scrollZoom.onWheel(r)},{passive:!1})}(this,e),this._hash=e.hash&&(new hn).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:e.center,zoom:e.zoom,bearing:e.bearing,pitch:e.pitch}),e.bounds&&(this.resize(),this.fitBounds(e.bounds,t.extend({},e.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=e.localIdeographFontFamily,e.style&&this.setStyle(e.style,{localIdeographFontFamily:e.localIdeographFontFamily}),e.attributionControl&&this.addControl(new Cn({customAttribution:e.customAttribution})),this.addControl(new En,e.logoPosition),this.on("style.load",function(){i.transform.unmodified&&i.jumpTo(i.style.stylesheet)}),this.on("data",function(e){i._update("style"===e.dataType),i.fire(new t.Event(e.dataType+"data",e))}),this.on("dataloading",function(e){i.fire(new t.Event(e.dataType+"dataloading",e))})}n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i;var a={showTileBoundaries:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return i.prototype._getMapId=function(){return this._mapId},i.prototype.addControl=function(e,r){if(void 0===r&&e.getDefaultPosition&&(r=e.getDefaultPosition()),void 0===r&&(r="top-right"),!e||!e.onAdd)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var n=e.onAdd(this);this._controls.push(e);var i=this._controlPositions[r];return-1!==r.indexOf("bottom")?i.insertBefore(n,i.firstChild):i.appendChild(n),this},i.prototype.removeControl=function(e){if(!e||!e.onRemove)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var r=this._controls.indexOf(e);return r>-1&&this._controls.splice(r,1),e.onRemove(this),this},i.prototype.resize=function(e){var r=this._containerDimensions(),n=r[0],i=r[1];return this._resizeCanvas(n,i),this.transform.resize(n,i),this.painter.resize(n,i),this.fire(new t.Event("movestart",e)).fire(new t.Event("move",e)).fire(new t.Event("resize",e)).fire(new t.Event("moveend",e)),this},i.prototype.getBounds=function(){return this.transform.getBounds()},i.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},i.prototype.setMaxBounds=function(e){return this.transform.setMaxBounds(t.LngLatBounds.convert(e)),this._update()},i.prototype.setMinZoom=function(t){if((t=null==t?0:t)>=0&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()<t&&this.setZoom(t),this;throw new Error("minZoom must be between 0 and the current maxZoom, inclusive")},i.prototype.getMinZoom=function(){return this.transform.minZoom},i.prototype.setMaxZoom=function(t){if((t=null==t?22:t)>=this.transform.minZoom)return this.transform.maxZoom=t,this._update(),this.getZoom()>t&&this.setZoom(t),this;throw new Error("maxZoom must be greater than the current minZoom")},i.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},i.prototype.setRenderWorldCopies=function(t){return this.transform.renderWorldCopies=t,this._update()},i.prototype.getMaxZoom=function(){return this.transform.maxZoom},i.prototype.project=function(e){return this.transform.locationPoint(t.LngLat.convert(e))},i.prototype.unproject=function(e){return this.transform.pointLocation(t.Point.convert(e))},i.prototype.isMoving=function(){return this._moving||this.dragPan.isActive()||this.dragRotate.isActive()||this.scrollZoom.isActive()},i.prototype.isZooming=function(){return this._zooming||this.scrollZoom.isZooming()},i.prototype.isRotating=function(){return this._rotating||this.dragRotate.isActive()},i.prototype.on=function(t,e,r){var i=this;if(void 0===r)return n.prototype.on.call(this,t,e);var a=function(){var n;if("mouseenter"===t||"mouseover"===t){var a=!1;return{layer:e,listener:r,delegates:{mousemove:function(n){var o=i.getLayer(e)?i.queryRenderedFeatures(n.point,{layers:[e]}):[];o.length?a||(a=!0,r.call(i,new fn(t,i,n.originalEvent,{features:o}))):a=!1},mouseout:function(){a=!1}}}}if("mouseleave"===t||"mouseout"===t){var o=!1;return{layer:e,listener:r,delegates:{mousemove:function(n){(i.getLayer(e)?i.queryRenderedFeatures(n.point,{layers:[e]}):[]).length?o=!0:o&&(o=!1,r.call(i,new fn(t,i,n.originalEvent)))},mouseout:function(e){o&&(o=!1,r.call(i,new fn(t,i,e.originalEvent)))}}}}return{layer:e,listener:r,delegates:(n={},n[t]=function(t){var n=i.getLayer(e)?i.queryRenderedFeatures(t.point,{layers:[e]}):[];n.length&&(t.features=n,r.call(i,t),delete t.features)},n)}}();for(var o in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[t]=this._delegatedListeners[t]||[],this._delegatedListeners[t].push(a),a.delegates)this.on(o,a.delegates[o]);return this},i.prototype.off=function(t,e,r){if(void 0===r)return n.prototype.off.call(this,t,e);if(this._delegatedListeners&&this._delegatedListeners[t])for(var i=this._delegatedListeners[t],a=0;a<i.length;a++){var o=i[a];if(o.layer===e&&o.listener===r){for(var s in o.delegates)this.off(s,o.delegates[s]);return i.splice(a,1),this}}return this},i.prototype.queryRenderedFeatures=function(e,r){if(!this.style)return[];var n;if(void 0!==r||void 0===e||e instanceof t.Point||Array.isArray(e)||(r=e,e=void 0),r=r||{},(e=e||[[0,0],[this.transform.width,this.transform.height]])instanceof t.Point||"number"==typeof e[0])n=[t.Point.convert(e)];else{var i=t.Point.convert(e[0]),a=t.Point.convert(e[1]);n=[i,new t.Point(a.x,i.y),a,new t.Point(i.x,a.y),i]}return this.style.queryRenderedFeatures(n,r,this.transform)},i.prototype.querySourceFeatures=function(t,e){return this.style.querySourceFeatures(t,e)},i.prototype.setStyle=function(e,r){return!1!==(r=t.extend({},{localIdeographFontFamily:this._localIdeographFontFamily},r)).diff&&r.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&e?(this._diffStyle(e,r),this):(this._localIdeographFontFamily=r.localIdeographFontFamily,this._updateStyle(e,r))},i.prototype._updateStyle=function(t,e){return this.style&&(this.style.setEventedParent(null),this.style._remove()),t?(this.style=new Re(this,e||{}),this.style.setEventedParent(this,{style:this.style}),"string"==typeof t?this.style.loadURL(t):this.style.loadJSON(t),this):(delete this.style,this)},i.prototype._diffStyle=function(e,r){var n=this;if("string"==typeof e){var i=this._requestManager.normalizeStyleURL(e),a=this._requestManager.transformRequest(i,t.ResourceType.Style);t.getJSON(a,function(e,i){e?n.fire(new t.ErrorEvent(e)):i&&n._updateDiff(i,r)})}else"object"==typeof e&&this._updateDiff(e,r)},i.prototype._updateDiff=function(e,r){try{this.style.setState(e)&&this._update(!0)}catch(n){t.warnOnce("Unable to perform style diff: "+(n.message||n.error||n)+". Rebuilding the style from scratch."),this._updateStyle(e,r)}},i.prototype.getStyle=function(){if(this.style)return this.style.serialize()},i.prototype.isStyleLoaded=function(){return this.style?this.style.loaded():t.warnOnce("There is no style added to the map.")},i.prototype.addSource=function(t,e){return this.style.addSource(t,e),this._update(!0)},i.prototype.isSourceLoaded=function(e){var r=this.style&&this.style.sourceCaches[e];if(void 0!==r)return r.loaded();this.fire(new t.ErrorEvent(new Error("There is no source with ID '"+e+"'")))},i.prototype.areTilesLoaded=function(){var t=this.style&&this.style.sourceCaches;for(var e in t){var r=t[e]._tiles;for(var n in r){var i=r[n];if("loaded"!==i.state&&"errored"!==i.state)return!1}}return!0},i.prototype.addSourceType=function(t,e,r){return this.style.addSourceType(t,e,r)},i.prototype.removeSource=function(t){return this.style.removeSource(t),this._update(!0)},i.prototype.getSource=function(t){return this.style.getSource(t)},i.prototype.addImage=function(e,r,n){void 0===n&&(n={});var i=n.pixelRatio;void 0===i&&(i=1);var a=n.sdf;if(void 0===a&&(a=!1),r instanceof Pn){var o=t.browser.getImageData(r),s=o.width,l=o.height,u=o.data;this.style.addImage(e,{data:new t.RGBAImage({width:s,height:l},u),pixelRatio:i,sdf:a,version:0})}else{if(void 0===r.width||void 0===r.height)return this.fire(new t.ErrorEvent(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));var c=r.width,p=r.height,h=r.data,f=r;this.style.addImage(e,{data:new t.RGBAImage({width:c,height:p},new Uint8Array(h)),pixelRatio:i,sdf:a,version:0,userImage:f}),f.onAdd&&f.onAdd(this,e)}},i.prototype.updateImage=function(e,r){var n=this.style.getImage(e);if(!n)return this.fire(new t.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));var i=r instanceof Pn?t.browser.getImageData(r):r,a=i.width,o=i.height,s=i.data;if(void 0===a||void 0===o)return this.fire(new t.ErrorEvent(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(a!==n.data.width||o!==n.data.height)return this.fire(new t.ErrorEvent(new Error("The width and height of the updated image must be that same as the previous version of the image")));var l=!(r instanceof Pn);n.data.replace(s,l),this.style.updateImage(e,n)},i.prototype.hasImage=function(e){return e?!!this.style.getImage(e):(this.fire(new t.ErrorEvent(new Error("Missing required image id"))),!1)},i.prototype.removeImage=function(t){this.style.removeImage(t)},i.prototype.loadImage=function(e,r){t.getImage(this._requestManager.transformRequest(e,t.ResourceType.Image),r)},i.prototype.listImages=function(){return this.style.listImages()},i.prototype.addLayer=function(t,e){return this.style.addLayer(t,e),this._update(!0)},i.prototype.moveLayer=function(t,e){return this.style.moveLayer(t,e),this._update(!0)},i.prototype.removeLayer=function(t){return this.style.removeLayer(t),this._update(!0)},i.prototype.getLayer=function(t){return this.style.getLayer(t)},i.prototype.setFilter=function(t,e,r){return void 0===r&&(r={}),this.style.setFilter(t,e,r),this._update(!0)},i.prototype.setLayerZoomRange=function(t,e,r){return this.style.setLayerZoomRange(t,e,r),this._update(!0)},i.prototype.getFilter=function(t){return this.style.getFilter(t)},i.prototype.setPaintProperty=function(t,e,r,n){return void 0===n&&(n={}),this.style.setPaintProperty(t,e,r,n),this._update(!0)},i.prototype.getPaintProperty=function(t,e){return this.style.getPaintProperty(t,e)},i.prototype.setLayoutProperty=function(t,e,r,n){return void 0===n&&(n={}),this.style.setLayoutProperty(t,e,r,n),this._update(!0)},i.prototype.getLayoutProperty=function(t,e){return this.style.getLayoutProperty(t,e)},i.prototype.setLight=function(t,e){return void 0===e&&(e={}),this.style.setLight(t,e),this._update(!0)},i.prototype.getLight=function(){return this.style.getLight()},i.prototype.setFeatureState=function(t,e){return this.style.setFeatureState(t,e),this._update()},i.prototype.removeFeatureState=function(t,e){return this.style.removeFeatureState(t,e),this._update()},i.prototype.getFeatureState=function(t){return this.style.getFeatureState(t)},i.prototype.getContainer=function(){return this._container},i.prototype.getCanvasContainer=function(){return this._canvasContainer},i.prototype.getCanvas=function(){return this._canvas},i.prototype._containerDimensions=function(){var t=0,e=0;return this._container&&(t=this._container.clientWidth||400,e=this._container.clientHeight||300),[t,e]},i.prototype._detectMissingCSS=function(){"rgb(250, 128, 114)"!==t.window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")&&t.warnOnce("This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described in https://www.mapbox.com/mapbox-gl-js/api/.")},i.prototype._setupContainer=function(){var t=this._container;t.classList.add("mapboxgl-map"),(this._missingCSSCanary=r.create("div","mapboxgl-canary",t)).style.visibility="hidden",this._detectMissingCSS();var e=this._canvasContainer=r.create("div","mapboxgl-canvas-container",t);this._interactive&&e.classList.add("mapboxgl-interactive"),this._canvas=r.create("canvas","mapboxgl-canvas",e),this._canvas.style.position="absolute",this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label","Map");var n=this._containerDimensions();this._resizeCanvas(n[0],n[1]);var i=this._controlContainer=r.create("div","mapboxgl-control-container",t),a=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(function(t){a[t]=r.create("div","mapboxgl-ctrl-"+t,i)})},i.prototype._resizeCanvas=function(e,r){var n=t.window.devicePixelRatio||1;this._canvas.width=n*e,this._canvas.height=n*r,this._canvas.style.width=e+"px",this._canvas.style.height=r+"px"},i.prototype._setupPainter=function(){var r=t.extend({},e.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),n=this._canvas.getContext("webgl",r)||this._canvas.getContext("experimental-webgl",r);n?(this.painter=new on(n,this.transform),t.webpSupported.testSupport(n)):this.fire(new t.ErrorEvent(new Error("Failed to initialize WebGL")))},i.prototype._contextLost=function(e){e.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new t.Event("webglcontextlost",{originalEvent:e}))},i.prototype._contextRestored=function(e){this._setupPainter(),this.resize(),this._update(),this.fire(new t.Event("webglcontextrestored",{originalEvent:e}))},i.prototype.loaded=function(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()},i.prototype._update=function(t){return this.style?(this._styleDirty=this._styleDirty||t,this._sourcesDirty=!0,this.triggerRepaint(),this):this},i.prototype._requestRenderFrame=function(t){return this._update(),this._renderTaskQueue.add(t)},i.prototype._cancelRenderFrame=function(t){this._renderTaskQueue.remove(t)},i.prototype._render=function(){this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run();var e=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;var r=this.transform.zoom,n=t.browser.now();this.style.zoomHistory.update(r,n);var i=new t.EvaluationParameters(r,{now:n,fadeDuration:this._fadeDuration,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),a=i.crossFadingFactor();1===a&&a===this._crossFadingFactor||(e=!0,this._crossFadingFactor=a),this.style.update(i)}return this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,this._fadeDuration,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:this._fadeDuration}),this.fire(new t.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new t.Event("load"))),this.style&&(this.style.hasTransitions()||e)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),this._sourcesDirty||this._repaint||this._styleDirty||this._placementDirty?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new t.Event("idle")),this},i.prototype.remove=function(){this._hash&&this._hash.remove();for(var e=0,r=this._controls;e<r.length;e+=1)r[e].onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this.setStyle(null),void 0!==t.window&&(t.window.removeEventListener("resize",this._onWindowResize,!1),t.window.removeEventListener("online",this._onWindowOnline,!1));var n=this.painter.context.gl.getExtension("WEBGL_lose_context");n&&n.loseContext(),Rn(this._canvasContainer),Rn(this._controlContainer),Rn(this._missingCSSCanary),this._container.classList.remove("mapboxgl-map"),this.fire(new t.Event("remove"))},i.prototype.triggerRepaint=function(){var e=this;this.style&&!this._frame&&(this._frame=t.browser.frame(function(){e._frame=null,e._render()}))},i.prototype._onWindowOnline=function(){this._update()},i.prototype._onWindowResize=function(){this._trackResize&&this.resize()._update()},a.showTileBoundaries.get=function(){return!!this._showTileBoundaries},a.showTileBoundaries.set=function(t){this._showTileBoundaries!==t&&(this._showTileBoundaries=t,this._update())},a.showCollisionBoxes.get=function(){return!!this._showCollisionBoxes},a.showCollisionBoxes.set=function(t){this._showCollisionBoxes!==t&&(this._showCollisionBoxes=t,t?this.style._generateCollisionBoxes():this._update())},a.showOverdrawInspector.get=function(){return!!this._showOverdrawInspector},a.showOverdrawInspector.set=function(t){this._showOverdrawInspector!==t&&(this._showOverdrawInspector=t,this._update())},a.repaint.get=function(){return!!this._repaint},a.repaint.set=function(t){this._repaint!==t&&(this._repaint=t,this.triggerRepaint())},a.vertices.get=function(){return!!this._vertices},a.vertices.set=function(t){this._vertices=t,this._update()},i.prototype._setCacheLimits=function(e,r){t.setCacheLimits(e,r)},a.version.get=function(){return t.version},Object.defineProperties(i.prototype,a),i}(Ln);function Rn(t){t.parentNode&&t.parentNode.removeChild(t)}var Fn={showCompass:!0,showZoom:!0,visualizePitch:!1},Bn=function(e){var n=this;this.options=t.extend({},Fn,e),this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",function(t){return t.preventDefault()}),this.options.showZoom&&(t.bindAll(["_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-icon mapboxgl-ctrl-zoom-in","Zoom in",function(){return n._map.zoomIn()}),this._zoomOutButton=this._createButton("mapboxgl-ctrl-icon mapboxgl-ctrl-zoom-out","Zoom out",function(){return n._map.zoomOut()})),this.options.showCompass&&(t.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-icon mapboxgl-ctrl-compass","Reset bearing to north",function(){n.options.visualizePitch?n._map.resetNorthPitch():n._map.resetNorth()}),this._compassArrow=r.create("span","mapboxgl-ctrl-compass-arrow",this._compass))};function Nn(e,r,n){if(e=new t.LngLat(e.lng,e.lat),r){var i=new t.LngLat(e.lng-360,e.lat),a=new t.LngLat(e.lng+360,e.lat),o=n.locationPoint(e).distSqr(r);n.locationPoint(i).distSqr(r)<o?e=i:n.locationPoint(a).distSqr(r)<o&&(e=a)}for(;Math.abs(e.lng-n.center.lng)>180;){var s=n.locationPoint(e);if(s.x>=0&&s.y>=0&&s.x<=n.width&&s.y<=n.height)break;e.lng>n.center.lng?e.lng-=360:e.lng+=360}return e}Bn.prototype._updateZoomButtons=function(){var t=this._map.getZoom();t===this._map.getMaxZoom()?this._zoomInButton.classList.add("mapboxgl-ctrl-icon-disabled"):this._zoomInButton.classList.remove("mapboxgl-ctrl-icon-disabled"),t===this._map.getMinZoom()?this._zoomOutButton.classList.add("mapboxgl-ctrl-icon-disabled"):this._zoomOutButton.classList.remove("mapboxgl-ctrl-icon-disabled")},Bn.prototype._rotateCompassArrow=function(){var t=this.options.visualizePitch?"scale("+1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)+") rotateX("+this._map.transform.pitch+"deg) rotateZ("+this._map.transform.angle*(180/Math.PI)+"deg)":"rotate("+this._map.transform.angle*(180/Math.PI)+"deg)";this._compassArrow.style.transform=t},Bn.prototype.onAdd=function(t){return this._map=t,this.options.showZoom&&(this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new _n(t,{button:"left",element:this._compass}),r.addEventListener(this._compass,"mousedown",this._handler.onMouseDown),r.addEventListener(this._compass,"touchstart",this._handler.onMouseDown,{passive:!1}),this._handler.enable()),this._container},Bn.prototype.onRemove=function(){r.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),r.removeEventListener(this._compass,"mousedown",this._handler.onMouseDown),r.removeEventListener(this._compass,"touchstart",this._handler.onMouseDown,{passive:!1}),this._handler.disable(),delete this._handler),delete this._map},Bn.prototype._createButton=function(t,e,n){var i=r.create("button",t,this._container);return i.type="button",i.title=e,i.setAttribute("aria-label",e),i.addEventListener("click",n),i};var Un={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function jn(t,e,r){var n=t.classList;for(var i in Un)n.remove("mapboxgl-"+r+"-anchor-"+i);n.add("mapboxgl-"+r+"-anchor-"+e)}var Vn,qn=function(e){function n(n,i){if(e.call(this),(n instanceof t.window.HTMLElement||i)&&(n=t.extend({element:n},i)),t.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick"],this),this._anchor=n&&n.anchor||"center",this._color=n&&n.color||"#3FB1CE",this._draggable=n&&n.draggable||!1,this._state="inactive",n&&n.element)this._element=n.element,this._offset=t.Point.convert(n&&n.offset||[0,0]);else{this._defaultMarker=!0,this._element=r.create("div");var a=r.createNS("http://www.w3.org/2000/svg","svg");a.setAttributeNS(null,"display","block"),a.setAttributeNS(null,"height","41px"),a.setAttributeNS(null,"width","27px"),a.setAttributeNS(null,"viewBox","0 0 27 41");var o=r.createNS("http://www.w3.org/2000/svg","g");o.setAttributeNS(null,"stroke","none"),o.setAttributeNS(null,"stroke-width","1"),o.setAttributeNS(null,"fill","none"),o.setAttributeNS(null,"fill-rule","evenodd");var s=r.createNS("http://www.w3.org/2000/svg","g");s.setAttributeNS(null,"fill-rule","nonzero");var l=r.createNS("http://www.w3.org/2000/svg","g");l.setAttributeNS(null,"transform","translate(3.0, 29.0)"),l.setAttributeNS(null,"fill","#000000");for(var u=0,c=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];u<c.length;u+=1){var p=c[u],h=r.createNS("http://www.w3.org/2000/svg","ellipse");h.setAttributeNS(null,"opacity","0.04"),h.setAttributeNS(null,"cx","10.5"),h.setAttributeNS(null,"cy","5.80029008"),h.setAttributeNS(null,"rx",p.rx),h.setAttributeNS(null,"ry",p.ry),l.appendChild(h)}var f=r.createNS("http://www.w3.org/2000/svg","g");f.setAttributeNS(null,"fill",this._color);var d=r.createNS("http://www.w3.org/2000/svg","path");d.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),f.appendChild(d);var m=r.createNS("http://www.w3.org/2000/svg","g");m.setAttributeNS(null,"opacity","0.25"),m.setAttributeNS(null,"fill","#000000");var y=r.createNS("http://www.w3.org/2000/svg","path");y.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),m.appendChild(y);var g=r.createNS("http://www.w3.org/2000/svg","g");g.setAttributeNS(null,"transform","translate(6.0, 7.0)"),g.setAttributeNS(null,"fill","#FFFFFF");var v=r.createNS("http://www.w3.org/2000/svg","g");v.setAttributeNS(null,"transform","translate(8.0, 8.0)");var _=r.createNS("http://www.w3.org/2000/svg","circle");_.setAttributeNS(null,"fill","#000000"),_.setAttributeNS(null,"opacity","0.25"),_.setAttributeNS(null,"cx","5.5"),_.setAttributeNS(null,"cy","5.5"),_.setAttributeNS(null,"r","5.4999962");var x=r.createNS("http://www.w3.org/2000/svg","circle");x.setAttributeNS(null,"fill","#FFFFFF"),x.setAttributeNS(null,"cx","5.5"),x.setAttributeNS(null,"cy","5.5"),x.setAttributeNS(null,"r","5.4999962"),v.appendChild(_),v.appendChild(x),s.appendChild(l),s.appendChild(f),s.appendChild(m),s.appendChild(g),s.appendChild(v),a.appendChild(s),this._element.appendChild(a),this._offset=t.Point.convert(n&&n.offset||[0,-14])}this._element.classList.add("mapboxgl-marker"),this._element.addEventListener("dragstart",function(t){t.preventDefault()}),jn(this._element,this._anchor,"marker"),this._popup=null}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.addTo=function(t){return this.remove(),this._map=t,t.getCanvasContainer().appendChild(this._element),t.on("move",this._update),t.on("moveend",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this},n.prototype.remove=function(){return this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),r.remove(this._element),this._popup&&this._popup.remove(),this},n.prototype.getLngLat=function(){return this._lngLat},n.prototype.setLngLat=function(e){return this._lngLat=t.LngLat.convert(e),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this},n.prototype.getElement=function(){return this._element},n.prototype.setPopup=function(t){if(this._popup&&(this._popup.remove(),this._popup=null),t){if(!("offset"in t.options)){var e=Math.sqrt(Math.pow(13.5,2)/2);t.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[e,-1*(24.6+e)],"bottom-right":[-e,-1*(24.6+e)],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset}this._popup=t,this._lngLat&&this._popup.setLngLat(this._lngLat)}return this},n.prototype._onMapClick=function(t){var e=t.originalEvent.target,r=this._element;this._popup&&(e===r||r.contains(e))&&this.togglePopup()},n.prototype.getPopup=function(){return this._popup},n.prototype.togglePopup=function(){var t=this._popup;return t?(t.isOpen()?t.remove():t.addTo(this._map),this):this},n.prototype._update=function(t){this._map&&(this._map.transform.renderWorldCopies&&(this._lngLat=Nn(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset),t&&"moveend"!==t.type||(this._pos=this._pos.round()),r.setTransform(this._element,Un[this._anchor]+" translate("+this._pos.x+"px, "+this._pos.y+"px)"))},n.prototype.getOffset=function(){return this._offset},n.prototype.setOffset=function(e){return this._offset=t.Point.convert(e),this._update(),this},n.prototype._onMove=function(e){this._pos=e.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new t.Event("dragstart"))),this.fire(new t.Event("drag"))},n.prototype._onUp=function(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),"active"===this._state&&this.fire(new t.Event("dragend")),this._state="inactive"},n.prototype._addDragHandler=function(t){this._element.contains(t.originalEvent.target)&&(t.preventDefault(),this._positionDelta=t.point.sub(this._pos).add(this._offset),this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},n.prototype.setDraggable=function(t){return this._draggable=!!t,this._map&&(t?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this},n.prototype.isDraggable=function(){return this._draggable},n}(t.Evented),Gn={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showUserLocation:!0},Hn=function(e){function n(r){e.call(this),this.options=t.extend({},Gn,r),t.bindAll(["_onSuccess","_onError","_finish","_setupUI","_updateCamera","_updateMarker"],this)}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.onAdd=function(e){var n;return this._map=e,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),n=this._setupUI,void 0!==Vn?n(Vn):void 0!==t.window.navigator.permissions?t.window.navigator.permissions.query({name:"geolocation"}).then(function(t){Vn="denied"!==t.state,n(Vn)}):(Vn=!!t.window.navigator.geolocation,n(Vn)),this._container},n.prototype.onRemove=function(){void 0!==this._geolocationWatchID&&(t.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),r.remove(this._container),this._map=void 0},n.prototype._onSuccess=function(e){if(this.options.trackUserLocation)switch(this._lastKnownPosition=e,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(e),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(e),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("geolocate",e)),this._finish()},n.prototype._updateCamera=function(e){var r=new t.LngLat(e.coords.longitude,e.coords.latitude),n=e.coords.accuracy,i=this._map.getBearing(),a=t.extend({bearing:i},this.options.fitBoundsOptions);this._map.fitBounds(r.toBounds(n),a,{geolocateSource:!0})},n.prototype._updateMarker=function(t){t?this._userLocationDotMarker.setLngLat([t.coords.longitude,t.coords.latitude]).addTo(this._map):this._userLocationDotMarker.remove()},n.prototype._onError=function(e){if(this.options.trackUserLocation)if(1===e.code)this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),void 0!==this._geolocationWatchID&&this._clearWatch();else switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("error",e)),this._finish()},n.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},n.prototype._setupUI=function(e){var n=this;!1!==e?(this._container.addEventListener("contextmenu",function(t){return t.preventDefault()}),this._geolocateButton=r.create("button","mapboxgl-ctrl-icon mapboxgl-ctrl-geolocate",this._container),this._geolocateButton.type="button",this._geolocateButton.setAttribute("aria-label","Geolocate"),this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=r.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new qn(this._dotElement),this.options.trackUserLocation&&(this._watchState="OFF")),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",function(e){e.geolocateSource||"ACTIVE_LOCK"!==n._watchState||(n._watchState="BACKGROUND",n._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),n._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),n.fire(new t.Event("trackuserlocationend")))})):t.warnOnce("Geolocation support is not available, the GeolocateControl will not be visible.")},n.prototype.trigger=function(){if(!this._setup)return t.warnOnce("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new t.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new t.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new t.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}"OFF"===this._watchState&&void 0!==this._geolocationWatchID?this._clearWatch():void 0===this._geolocationWatchID&&(this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),this._geolocationWatchID=t.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,this.options.positionOptions))}else t.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},n.prototype._clearWatch=function(){t.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)},n}(t.Evented),Zn={maxWidth:100,unit:"metric"},Xn=function(e){this.options=t.extend({},Zn,e),t.bindAll(["_onMove","setUnit"],this)};function Wn(t,e,r){var n,i,a,o,s,l,u=r&&r.maxWidth||100,c=t._container.clientHeight/2,p=(n=t.unproject([0,c]),i=t.unproject([u,c]),a=Math.PI/180,o=n.lat*a,s=i.lat*a,l=Math.sin(o)*Math.sin(s)+Math.cos(o)*Math.cos(s)*Math.cos((i.lng-n.lng)*a),6371e3*Math.acos(Math.min(l,1)));if(r&&"imperial"===r.unit){var h=3.2808*p;h>5280?Yn(e,u,h/5280,"mi"):Yn(e,u,h,"ft")}else r&&"nautical"===r.unit?Yn(e,u,p/1852,"nm"):Yn(e,u,p,"m")}function Yn(t,e,r,n){var i,a,o,s=(i=r,(a=Math.pow(10,(""+Math.floor(i)).length-1))*(o=(o=i/a)>=10?10:o>=5?5:o>=3?3:o>=2?2:o>=1?1:function(t){var e=Math.pow(10,Math.ceil(-Math.log(t)/Math.LN10));return Math.round(t*e)/e}(o))),l=s/r;"m"===n&&s>=1e3&&(s/=1e3,n="km"),t.style.width=e*l+"px",t.innerHTML=s+n}Xn.prototype.getDefaultPosition=function(){return"bottom-left"},Xn.prototype._onMove=function(){Wn(this._map,this._container,this.options)},Xn.prototype.onAdd=function(t){return this._map=t,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},Xn.prototype.onRemove=function(){r.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},Xn.prototype.setUnit=function(t){this.options.unit=t,Wn(this._map,this._container,this.options)};var Kn=function(e){this._fullscreen=!1,e&&e.container&&(e.container instanceof t.window.HTMLElement?this._container=e.container:t.warnOnce("Full screen control 'container' must be a DOM element.")),t.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in t.window.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in t.window.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in t.window.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in t.window.document&&(this._fullscreenchange="MSFullscreenChange"),this._className="mapboxgl-ctrl"};Kn.prototype.onAdd=function(e){return this._map=e,this._container||(this._container=this._map.getContainer()),this._controlContainer=r.create("div",this._className+" mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",t.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},Kn.prototype.onRemove=function(){r.remove(this._controlContainer),this._map=null,t.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},Kn.prototype._checkFullscreenSupport=function(){return!!(t.window.document.fullscreenEnabled||t.window.document.mozFullScreenEnabled||t.window.document.msFullscreenEnabled||t.window.document.webkitFullscreenEnabled)},Kn.prototype._setupUI=function(){(this._fullscreenButton=r.create("button",this._className+"-icon "+this._className+"-fullscreen",this._controlContainer)).type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),t.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},Kn.prototype._updateTitle=function(){var t=this._isFullscreen()?"Exit fullscreen":"Enter fullscreen";this._fullscreenButton.setAttribute("aria-label",t),this._fullscreenButton.title=t},Kn.prototype._isFullscreen=function(){return this._fullscreen},Kn.prototype._changeIcon=function(){(t.window.document.fullscreenElement||t.window.document.mozFullScreenElement||t.window.document.webkitFullscreenElement||t.window.document.msFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle(this._className+"-shrink"),this._fullscreenButton.classList.toggle(this._className+"-fullscreen"),this._updateTitle())},Kn.prototype._onClickFullscreen=function(){this._isFullscreen()?t.window.document.exitFullscreen?t.window.document.exitFullscreen():t.window.document.mozCancelFullScreen?t.window.document.mozCancelFullScreen():t.window.document.msExitFullscreen?t.window.document.msExitFullscreen():t.window.document.webkitCancelFullScreen&&t.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()};var Jn={closeButton:!0,closeOnClick:!0,className:"",maxWidth:"240px"},$n=function(e){function n(r){e.call(this),this.options=t.extend(Object.create(Jn),r),t.bindAll(["_update","_onClickClose","remove"],this)}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.addTo=function(e){var r=this;return this._map=e,this.options.closeOnClick&&this._map.on("click",this._onClickClose),this._map.on("remove",this.remove),this._update(),this._trackPointer?(this._map.on("mousemove",function(t){r._update(t.point)}),this._map.on("mouseup",function(t){r._update(t.point)}),this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new t.Event("open")),this},n.prototype.isOpen=function(){return!!this._map},n.prototype.remove=function(){return this._content&&r.remove(this._content),this._container&&(r.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("click",this._onClickClose),this._map.off("remove",this.remove),this._map.off("mousemove"),delete this._map),this.fire(new t.Event("close")),this},n.prototype.getLngLat=function(){return this._lngLat},n.prototype.setLngLat=function(e){return this._lngLat=t.LngLat.convert(e),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove"),this._container.classList.remove("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this},n.prototype.trackPointer=function(){var t=this;return this._trackPointer=!0,this._pos=null,this._map&&(this._map.off("move",this._update),this._map.on("mousemove",function(e){t._update(e.point)}),this._map.on("drag",function(e){t._update(e.point)}),this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")),this},n.prototype.getElement=function(){return this._container},n.prototype.setText=function(e){return this.setDOMContent(t.window.document.createTextNode(e))},n.prototype.setHTML=function(e){var r,n=t.window.document.createDocumentFragment(),i=t.window.document.createElement("body");for(i.innerHTML=e;r=i.firstChild;)n.appendChild(r);return this.setDOMContent(n)},n.prototype.getMaxWidth=function(){return this._container.style.maxWidth},n.prototype.setMaxWidth=function(t){return this.options.maxWidth=t,this._update(),this},n.prototype.setDOMContent=function(t){return this._createContent(),this._content.appendChild(t),this._update(),this},n.prototype._createContent=function(){this._content&&r.remove(this._content),this._content=r.create("div","mapboxgl-popup-content",this._container),this.options.closeButton&&(this._closeButton=r.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="&#215;",this._closeButton.addEventListener("click",this._onClickClose))},n.prototype._update=function(e){var n=this,i=this._lngLat||this._trackPointer;if(this._map&&i&&this._content&&(this._container||(this._container=r.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=r.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach(function(t){return n._container.classList.add(t)})),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Nn(this._lngLat,this._pos,this._map.transform)),!this._trackPointer||e)){var a=this._pos=this._trackPointer&&e?e:this._map.project(this._lngLat),o=this.options.anchor,s=function e(r){if(r){if("number"==typeof r){var n=Math.round(Math.sqrt(.5*Math.pow(r,2)));return{center:new t.Point(0,0),top:new t.Point(0,r),"top-left":new t.Point(n,n),"top-right":new t.Point(-n,n),bottom:new t.Point(0,-r),"bottom-left":new t.Point(n,-n),"bottom-right":new t.Point(-n,-n),left:new t.Point(r,0),right:new t.Point(-r,0)}}if(r instanceof t.Point||Array.isArray(r)){var i=t.Point.convert(r);return{center:i,top:i,"top-left":i,"top-right":i,bottom:i,"bottom-left":i,"bottom-right":i,left:i,right:i}}return{center:t.Point.convert(r.center||[0,0]),top:t.Point.convert(r.top||[0,0]),"top-left":t.Point.convert(r["top-left"]||[0,0]),"top-right":t.Point.convert(r["top-right"]||[0,0]),bottom:t.Point.convert(r.bottom||[0,0]),"bottom-left":t.Point.convert(r["bottom-left"]||[0,0]),"bottom-right":t.Point.convert(r["bottom-right"]||[0,0]),left:t.Point.convert(r.left||[0,0]),right:t.Point.convert(r.right||[0,0])}}return e(new t.Point(0,0))}(this.options.offset);if(!o){var l,u=this._container.offsetWidth,c=this._container.offsetHeight;l=a.y+s.bottom.y<c?["top"]:a.y>this._map.transform.height-c?["bottom"]:[],a.x<u/2?l.push("left"):a.x>this._map.transform.width-u/2&&l.push("right"),o=0===l.length?"bottom":l.join("-")}var p=a.add(s[o]).round();r.setTransform(this._container,Un[o]+" translate("+p.x+"px,"+p.y+"px)"),jn(this._container,o,"popup")}},n.prototype._onClickClose=function(){this.remove()},n}(t.Evented),Qn={version:t.version,supported:e,setRTLTextPlugin:t.setRTLTextPlugin,Map:On,NavigationControl:Bn,GeolocateControl:Hn,AttributionControl:Cn,ScaleControl:Xn,FullscreenControl:Kn,Popup:$n,Marker:qn,Style:Re,LngLat:t.LngLat,LngLatBounds:t.LngLatBounds,Point:t.Point,MercatorCoordinate:t.MercatorCoordinate,Evented:t.Evented,config:t.config,get accessToken(){return t.config.ACCESS_TOKEN},set accessToken(e){t.config.ACCESS_TOKEN=e},get baseApiUrl(){return t.config.API_URL},set baseApiUrl(e){t.config.API_URL=e},get workerCount(){return Dt.workerCount},set workerCount(t){Dt.workerCount=t},get maxParallelImageRequests(){return t.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(e){t.config.MAX_PARALLEL_IMAGE_REQUESTS=e},clearStorage:function(e){t.clearTileCache(e)},workerUrl:""};return Qn}),r},"object"==typeof r&&"undefined"!=typeof e?e.exports=i():(n=n||self).mapboxgl=i()},{}],23:[function(t,e,r){var n={left:0,top:0};e.exports=function(t,e,r){e=e||t.currentTarget||t.srcElement,Array.isArray(r)||(r=[0,0]);var i=t.clientX||0,a=t.clientY||0,o=(s=e,s===window||s===document||s===document.body?n:s.getBoundingClientRect());var s;return r[0]=i-o.left,r[1]=a-o.top,r}},{}],24:[function(t,e,r){var n,i=t("./lib/build-log"),a=t("./lib/epsilon"),o=t("./lib/intersecter"),s=t("./lib/segment-chainer"),l=t("./lib/segment-selector"),u=t("./lib/geojson"),c=!1,p=a();function h(t,e,r){var i=n.segments(t),a=n.segments(e),o=r(n.combine(i,a));return n.polygon(o)}n={buildLog:function(t){return!0===t?c=i():!1===t&&(c=!1),!1!==c&&c.list},epsilon:function(t){return p.epsilon(t)},segments:function(t){var e=o(!0,p,c);return t.regions.forEach(e.addRegion),{segments:e.calculate(t.inverted),inverted:t.inverted}},combine:function(t,e){return{combined:o(!1,p,c).calculate(t.segments,t.inverted,e.segments,e.inverted),inverted1:t.inverted,inverted2:e.inverted}},selectUnion:function(t){return{segments:l.union(t.combined,c),inverted:t.inverted1||t.inverted2}},selectIntersect:function(t){return{segments:l.intersect(t.combined,c),inverted:t.inverted1&&t.inverted2}},selectDifference:function(t){return{segments:l.difference(t.combined,c),inverted:t.inverted1&&!t.inverted2}},selectDifferenceRev:function(t){return{segments:l.differenceRev(t.combined,c),inverted:!t.inverted1&&t.inverted2}},selectXor:function(t){return{segments:l.xor(t.combined,c),inverted:t.inverted1!==t.inverted2}},polygon:function(t){return{regions:s(t.segments,p,c),inverted:t.inverted}},polygonFromGeoJSON:function(t){return u.toPolygon(n,t)},polygonToGeoJSON:function(t){return u.fromPolygon(n,p,t)},union:function(t,e){return h(t,e,n.selectUnion)},intersect:function(t,e){return h(t,e,n.selectIntersect)},difference:function(t,e){return h(t,e,n.selectDifference)},differenceRev:function(t,e){return h(t,e,n.selectDifferenceRev)},xor:function(t,e){return h(t,e,n.selectXor)}},"object"==typeof window&&(window.PolyBool=n),e.exports=n},{"./lib/build-log":25,"./lib/epsilon":26,"./lib/geojson":27,"./lib/intersecter":28,"./lib/segment-chainer":30,"./lib/segment-selector":31}],25:[function(t,e,r){e.exports=function(){var t,e=0,r=!1;function n(e,r){return t.list.push({type:e,data:r?JSON.parse(JSON.stringify(r)):void 0}),t}return t={list:[],segmentId:function(){return e++},checkIntersection:function(t,e){return n("check",{seg1:t,seg2:e})},segmentChop:function(t,e){return n("div_seg",{seg:t,pt:e}),n("chop",{seg:t,pt:e})},statusRemove:function(t){return n("pop_seg",{seg:t})},segmentUpdate:function(t){return n("seg_update",{seg:t})},segmentNew:function(t,e){return n("new_seg",{seg:t,primary:e})},segmentRemove:function(t){return n("rem_seg",{seg:t})},tempStatus:function(t,e,r){return n("temp_status",{seg:t,above:e,below:r})},rewind:function(t){return n("rewind",{seg:t})},status:function(t,e,r){return n("status",{seg:t,above:e,below:r})},vert:function(e){return e===r?t:(r=e,n("vert",{x:e}))},log:function(t){return"string"!=typeof t&&(t=JSON.stringify(t,!1," ")),n("log",{txt:t})},reset:function(){return n("reset")},selected:function(t){return n("selected",{segs:t})},chainStart:function(t){return n("chain_start",{seg:t})},chainRemoveHead:function(t,e){return n("chain_rem_head",{index:t,pt:e})},chainRemoveTail:function(t,e){return n("chain_rem_tail",{index:t,pt:e})},chainNew:function(t,e){return n("chain_new",{pt1:t,pt2:e})},chainMatch:function(t){return n("chain_match",{index:t})},chainClose:function(t){return n("chain_close",{index:t})},chainAddHead:function(t,e){return n("chain_add_head",{index:t,pt:e})},chainAddTail:function(t,e){return n("chain_add_tail",{index:t,pt:e})},chainConnect:function(t,e){return n("chain_con",{index1:t,index2:e})},chainReverse:function(t){return n("chain_rev",{index:t})},chainJoin:function(t,e){return n("chain_join",{index1:t,index2:e})},done:function(){return n("done")}}}},{}],26:[function(t,e,r){e.exports=function(t){"number"!=typeof t&&(t=1e-10);var e={epsilon:function(e){return"number"==typeof e&&(t=e),t},pointAboveOrOnLine:function(e,r,n){var i=r[0],a=r[1],o=n[0],s=n[1],l=e[0];return(o-i)*(e[1]-a)-(s-a)*(l-i)>=-t},pointBetween:function(e,r,n){var i=e[1]-r[1],a=n[0]-r[0],o=e[0]-r[0],s=n[1]-r[1],l=o*a+i*s;return!(l<t||l-(a*a+s*s)>-t)},pointsSameX:function(e,r){return Math.abs(e[0]-r[0])<t},pointsSameY:function(e,r){return Math.abs(e[1]-r[1])<t},pointsSame:function(t,r){return e.pointsSameX(t,r)&&e.pointsSameY(t,r)},pointsCompare:function(t,r){return e.pointsSameX(t,r)?e.pointsSameY(t,r)?0:t[1]<r[1]?-1:1:t[0]<r[0]?-1:1},pointsCollinear:function(e,r,n){var i=e[0]-r[0],a=e[1]-r[1],o=r[0]-n[0],s=r[1]-n[1];return Math.abs(i*s-o*a)<t},linesIntersect:function(e,r,n,i){var a=r[0]-e[0],o=r[1]-e[1],s=i[0]-n[0],l=i[1]-n[1],u=a*l-o*s;if(Math.abs(u)<t)return!1;var c=e[0]-n[0],p=e[1]-n[1],h=(s*p-l*c)/u,f=(a*p-o*c)/u,d={alongA:0,alongB:0,pt:[e[0]+h*a,e[1]+h*o]};return d.alongA=h<=-t?-2:h<t?-1:h-1<=-t?0:h-1<t?1:2,d.alongB=f<=-t?-2:f<t?-1:f-1<=-t?0:f-1<t?1:2,d},pointInsideRegion:function(e,r){for(var n=e[0],i=e[1],a=r[r.length-1][0],o=r[r.length-1][1],s=!1,l=0;l<r.length;l++){var u=r[l][0],c=r[l][1];c-i>t!=o-i>t&&(a-u)*(i-c)/(o-c)+u-n>t&&(s=!s),a=u,o=c}return s}};return e}},{}],27:[function(t,e,r){var n={toPolygon:function(t,e){function r(e){if(e.length<=0)return t.segments({inverted:!1,regions:[]});function r(e){var r=e.slice(0,e.length-1);return t.segments({inverted:!1,regions:[r]})}for(var n=r(e[0]),i=1;i<e.length;i++)n=t.selectDifference(t.combine(n,r(e[i])));return n}if("Polygon"===e.type)return t.polygon(r(e.coordinates));if("MultiPolygon"===e.type){for(var n=t.segments({inverted:!1,regions:[]}),i=0;i<e.coordinates.length;i++)n=t.selectUnion(t.combine(n,r(e.coordinates[i])));return t.polygon(n)}throw new Error("PolyBool: Cannot convert GeoJSON object to PolyBool polygon")},fromPolygon:function(t,e,r){function n(t,r){return e.pointInsideRegion([.5*(t[0][0]+t[1][0]),.5*(t[0][1]+t[1][1])],r)}function i(t){return{region:t,children:[]}}r=t.polygon(t.segments(r));var a=i(null);function o(t,e){for(var r=0;r<t.children.length;r++){if(n(e,(s=t.children[r]).region))return void o(s,e)}var a=i(e);for(r=0;r<t.children.length;r++){var s;n((s=t.children[r]).region,e)&&(a.children.push(s),t.children.splice(r,1),r--)}t.children.push(a)}for(var s=0;s<r.regions.length;s++){var l=r.regions[s];l.length<3||o(a,l)}function u(t,e){for(var r=0,n=t[t.length-1][0],i=t[t.length-1][1],a=[],o=0;o<t.length;o++){var s=t[o][0],l=t[o][1];a.push([s,l]),r+=l*n-s*i,n=s,i=l}return r<0!==e&&a.reverse(),a.push([a[0][0],a[0][1]]),a}var c=[];function p(t){var e=[u(t.region,!1)];c.push(e);for(var r=0;r<t.children.length;r++)e.push(h(t.children[r]))}function h(t){for(var e=0;e<t.children.length;e++)p(t.children[e]);return u(t.region,!0)}for(s=0;s<a.children.length;s++)p(a.children[s]);return c.length<=0?{type:"Polygon",coordinates:[]}:1==c.length?{type:"Polygon",coordinates:c[0]}:{type:"MultiPolygon",coordinates:c}}};e.exports=n},{}],28:[function(t,e,r){var n=t("./linked-list");e.exports=function(t,e,r){function i(t,e,n){return{id:r?r.segmentId():-1,start:t,end:e,myFill:{above:n.myFill.above,below:n.myFill.below},otherFill:null}}var a=n.create();function o(t,r){a.insertBefore(t,function(n){return function(t,r,n,i,a,o){var s=e.pointsCompare(r,a);return 0!==s?s:e.pointsSame(n,o)?0:t!==i?t?1:-1:e.pointAboveOrOnLine(n,i?a:o,i?o:a)?1:-1}(t.isStart,t.pt,r,n.isStart,n.pt,n.other.pt)<0})}function s(t,e){var r=function(t,e){var r=n.node({isStart:!0,pt:t.start,seg:t,primary:e,other:null,status:null});return o(r,t.end),r}(t,e);return function(t,e,r){var i=n.node({isStart:!1,pt:e.end,seg:e,primary:r,other:t,status:null});t.other=i,o(i,t.pt)}(r,t,e),r}function l(t,e){var n=i(e,t.seg.end,t.seg);return function(t,e){r&&r.segmentChop(t.seg,e),t.other.remove(),t.seg.end=e,t.other.pt=e,o(t.other,t.pt)}(t,e),s(n,t.primary)}function u(i,o){var s=n.create();function u(t){return s.findTransition(function(r){var n,i,a,o,s,l;return n=t,i=r.ev,a=n.seg.start,o=n.seg.end,s=i.seg.start,l=i.seg.end,(e.pointsCollinear(a,s,l)?e.pointsCollinear(o,s,l)?1:e.pointAboveOrOnLine(o,s,l)?1:-1:e.pointAboveOrOnLine(a,s,l)?1:-1)>0})}function c(t,n){var i=t.seg,a=n.seg,o=i.start,s=i.end,u=a.start,c=a.end;r&&r.checkIntersection(i,a);var p=e.linesIntersect(o,s,u,c);if(!1===p){if(!e.pointsCollinear(o,s,u))return!1;if(e.pointsSame(o,c)||e.pointsSame(s,u))return!1;var h=e.pointsSame(o,u),f=e.pointsSame(s,c);if(h&&f)return n;var d=!h&&e.pointBetween(o,u,c),m=!f&&e.pointBetween(s,u,c);if(h)return m?l(n,s):l(t,c),n;d&&(f||(m?l(n,s):l(t,c)),l(n,o))}else 0===p.alongA&&(-1===p.alongB?l(t,u):0===p.alongB?l(t,p.pt):1===p.alongB&&l(t,c)),0===p.alongB&&(-1===p.alongA?l(n,o):0===p.alongA?l(n,p.pt):1===p.alongA&&l(n,s));return!1}for(var p=[];!a.isEmpty();){var h=a.getHead();if(r&&r.vert(h.pt[0]),h.isStart){r&&r.segmentNew(h.seg,h.primary);var f=u(h),d=f.before?f.before.ev:null,m=f.after?f.after.ev:null;function y(){if(d){var t=c(h,d);if(t)return t}return!!m&&c(h,m)}r&&r.tempStatus(h.seg,!!d&&d.seg,!!m&&m.seg);var g,v,_=y();if(_)t?(v=null===h.seg.myFill.below||h.seg.myFill.above!==h.seg.myFill.below)&&(_.seg.myFill.above=!_.seg.myFill.above):_.seg.otherFill=h.seg.myFill,r&&r.segmentUpdate(_.seg),h.other.remove(),h.remove();if(a.getHead()!==h){r&&r.rewind(h.seg);continue}t?(v=null===h.seg.myFill.below||h.seg.myFill.above!==h.seg.myFill.below,h.seg.myFill.below=m?m.seg.myFill.above:i,h.seg.myFill.above=v?!h.seg.myFill.below:h.seg.myFill.below):null===h.seg.otherFill&&(g=m?h.primary===m.primary?m.seg.otherFill.above:m.seg.myFill.above:h.primary?o:i,h.seg.otherFill={above:g,below:g}),r&&r.status(h.seg,!!d&&d.seg,!!m&&m.seg),h.other.status=f.insert(n.node({ev:h}))}else{var x=h.status;if(null===x)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(s.exists(x.prev)&&s.exists(x.next)&&c(x.prev.ev,x.next.ev),r&&r.statusRemove(x.ev.seg),x.remove(),!h.primary){var b=h.seg.myFill;h.seg.myFill=h.seg.otherFill,h.seg.otherFill=b}p.push(h.seg)}a.getHead().remove()}return r&&r.done(),p}return t?{addRegion:function(t){for(var n,i,a,o=t[t.length-1],l=0;l<t.length;l++){n=o,o=t[l];var u=e.pointsCompare(n,o);0!==u&&s((i=u<0?n:o,a=u<0?o:n,{id:r?r.segmentId():-1,start:i,end:a,myFill:{above:null,below:null},otherFill:null}),!0)}},calculate:function(t){return u(t,!1)}}:{calculate:function(t,e,r,n){return t.forEach(function(t){s(i(t.start,t.end,t),!0)}),r.forEach(function(t){s(i(t.start,t.end,t),!1)}),u(e,n)}}}},{"./linked-list":29}],29:[function(t,e,r){e.exports={create:function(){var t={root:{root:!0,next:null},exists:function(e){return null!==e&&e!==t.root},isEmpty:function(){return null===t.root.next},getHead:function(){return t.root.next},insertBefore:function(e,r){for(var n=t.root,i=t.root.next;null!==i;){if(r(i))return e.prev=i.prev,e.next=i,i.prev.next=e,void(i.prev=e);n=i,i=i.next}n.next=e,e.prev=n,e.next=null},findTransition:function(e){for(var r=t.root,n=t.root.next;null!==n&&!e(n);)r=n,n=n.next;return{before:r===t.root?null:r,after:n,insert:function(t){return t.prev=r,t.next=n,r.next=t,null!==n&&(n.prev=t),t}}}};return t},node:function(t){return t.prev=null,t.next=null,t.remove=function(){t.prev.next=t.next,t.next&&(t.next.prev=t.prev),t.prev=null,t.next=null},t}}},{}],30:[function(t,e,r){e.exports=function(t,e,r){var n=[],i=[];return t.forEach(function(t){var a=t.start,o=t.end;if(e.pointsSame(a,o))console.warn("PolyBool: Warning: Zero-length segment detected; your epsilon is probably too small or too large");else{r&&r.chainStart(t);for(var s={index:0,matches_head:!1,matches_pt1:!1},l={index:0,matches_head:!1,matches_pt1:!1},u=s,c=0;c<n.length;c++){var p=(y=n[c])[0],h=(y[1],y[y.length-1]);if(y[y.length-2],e.pointsSame(p,a)){if(T(c,!0,!0))break}else if(e.pointsSame(p,o)){if(T(c,!0,!1))break}else if(e.pointsSame(h,a)){if(T(c,!1,!0))break}else if(e.pointsSame(h,o)&&T(c,!1,!1))break}if(u===s)return n.push([a,o]),void(r&&r.chainNew(a,o));if(u===l){r&&r.chainMatch(s.index);var f=s.index,d=s.matches_pt1?o:a,m=s.matches_head,y=n[f],g=m?y[0]:y[y.length-1],v=m?y[1]:y[y.length-2],_=m?y[y.length-1]:y[0],x=m?y[y.length-2]:y[1];return e.pointsCollinear(v,g,d)&&(m?(r&&r.chainRemoveHead(s.index,d),y.shift()):(r&&r.chainRemoveTail(s.index,d),y.pop()),g=v),e.pointsSame(_,d)?(n.splice(f,1),e.pointsCollinear(x,_,g)&&(m?(r&&r.chainRemoveTail(s.index,g),y.pop()):(r&&r.chainRemoveHead(s.index,g),y.shift())),r&&r.chainClose(s.index),void i.push(y)):void(m?(r&&r.chainAddHead(s.index,d),y.unshift(d)):(r&&r.chainAddTail(s.index,d),y.push(d)))}var b=s.index,w=l.index;r&&r.chainConnect(b,w);var k=n[b].length<n[w].length;s.matches_head?l.matches_head?k?(A(b),M(b,w)):(A(w),M(w,b)):M(w,b):l.matches_head?M(b,w):k?(A(b),M(w,b)):(A(w),M(b,w))}function T(t,e,r){return u.index=t,u.matches_head=e,u.matches_pt1=r,u===s?(u=l,!1):(u=null,!0)}function A(t){r&&r.chainReverse(t),n[t].reverse()}function M(t,i){var a=n[t],o=n[i],s=a[a.length-1],l=a[a.length-2],u=o[0],c=o[1];e.pointsCollinear(l,s,u)&&(r&&r.chainRemoveTail(t,s),a.pop(),s=l),e.pointsCollinear(s,u,c)&&(r&&r.chainRemoveHead(i,u),o.shift()),r&&r.chainJoin(t,i),n[t]=a.concat(o),n.splice(i,1)}}),i}},{}],31:[function(t,e,r){function n(t,e,r){var n=[];return t.forEach(function(t){var i=(t.myFill.above?8:0)+(t.myFill.below?4:0)+(t.otherFill&&t.otherFill.above?2:0)+(t.otherFill&&t.otherFill.below?1:0);0!==e[i]&&n.push({id:r?r.segmentId():-1,start:t.start,end:t.end,myFill:{above:1===e[i],below:2===e[i]},otherFill:null})}),r&&r.selected(n),n}var i={union:function(t,e){return n(t,[0,2,1,0,2,2,0,0,1,0,1,0,0,0,0,0],e)},intersect:function(t,e){return n(t,[0,0,0,0,0,2,0,2,0,0,1,1,0,2,1,0],e)},difference:function(t,e){return n(t,[0,0,0,0,2,0,2,0,1,1,0,0,0,1,2,0],e)},differenceRev:function(t,e){return n(t,[0,2,1,0,0,0,1,1,0,2,0,2,0,0,0,0],e)},xor:function(t,e){return n(t,[0,2,1,0,2,0,0,1,1,0,0,2,0,1,2,0],e)}};e.exports=i},{}],32:[function(t,e,r){var n,i,a=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function l(t){if(n===setTimeout)return setTimeout(t,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(t){n=o}try{i="function"==typeof clearTimeout?clearTimeout:s}catch(t){i=s}}();var u,c=[],p=!1,h=-1;function f(){p&&u&&(p=!1,u.length?c=u.concat(c):h=-1,c.length&&d())}function d(){if(!p){var t=l(f);p=!0;for(var e=c.length;e;){for(u=c,c=[];++h<e;)u&&u[h].run();h=-1,e=c.length}u=null,p=!1,function(t){if(i===clearTimeout)return clearTimeout(t);if((i===s||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(t);try{i(t)}catch(e){try{return i.call(null,t)}catch(e){return i.call(this,t)}}}(t)}}function m(t,e){this.fun=t,this.array=e}function y(){}a.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];c.push(new m(t,e)),1!==c.length||p||l(d)},m.prototype.run=function(){this.fun.apply(null,this.array)},a.title="browser",a.browser=!0,a.env={},a.argv=[],a.version="",a.versions={},a.on=y,a.addListener=y,a.once=y,a.off=y,a.removeListener=y,a.removeAllListeners=y,a.emit=y,a.prependListener=y,a.prependOnceListener=y,a.listeners=function(t){return[]},a.binding=function(t){throw new Error("process.binding is not supported")},a.cwd=function(){return"/"},a.chdir=function(t){throw new Error("process.chdir is not supported")},a.umask=function(){return 0}},{}],33:[function(t,e,r){!function(t){var r=/^\s+/,n=/\s+$/,i=0,a=t.round,o=t.min,s=t.max,l=t.random;function u(e,l){if(l=l||{},(e=e||"")instanceof u)return e;if(!(this instanceof u))return new u(e,l);var c=function(e){var i={r:0,g:0,b:0},a=1,l=null,u=null,c=null,p=!1,h=!1;"string"==typeof e&&(e=function(t){t=t.replace(r,"").replace(n,"").toLowerCase();var e,i=!1;if(S[t])t=S[t],i=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};if(e=U.rgb.exec(t))return{r:e[1],g:e[2],b:e[3]};if(e=U.rgba.exec(t))return{r:e[1],g:e[2],b:e[3],a:e[4]};if(e=U.hsl.exec(t))return{h:e[1],s:e[2],l:e[3]};if(e=U.hsla.exec(t))return{h:e[1],s:e[2],l:e[3],a:e[4]};if(e=U.hsv.exec(t))return{h:e[1],s:e[2],v:e[3]};if(e=U.hsva.exec(t))return{h:e[1],s:e[2],v:e[3],a:e[4]};if(e=U.hex8.exec(t))return{r:P(e[1]),g:P(e[2]),b:P(e[3]),a:R(e[4]),format:i?"name":"hex8"};if(e=U.hex6.exec(t))return{r:P(e[1]),g:P(e[2]),b:P(e[3]),format:i?"name":"hex"};if(e=U.hex4.exec(t))return{r:P(e[1]+""+e[1]),g:P(e[2]+""+e[2]),b:P(e[3]+""+e[3]),a:R(e[4]+""+e[4]),format:i?"name":"hex8"};if(e=U.hex3.exec(t))return{r:P(e[1]+""+e[1]),g:P(e[2]+""+e[2]),b:P(e[3]+""+e[3]),format:i?"name":"hex"};return!1}(e));"object"==typeof e&&(j(e.r)&&j(e.g)&&j(e.b)?(f=e.r,d=e.g,m=e.b,i={r:255*E(f,255),g:255*E(d,255),b:255*E(m,255)},p=!0,h="%"===String(e.r).substr(-1)?"prgb":"rgb"):j(e.h)&&j(e.s)&&j(e.v)?(l=D(e.s),u=D(e.v),i=function(e,r,n){e=6*E(e,360),r=E(r,100),n=E(n,100);var i=t.floor(e),a=e-i,o=n*(1-r),s=n*(1-a*r),l=n*(1-(1-a)*r),u=i%6;return{r:255*[n,s,o,o,l,n][u],g:255*[l,n,n,s,o,o][u],b:255*[o,o,l,n,n,s][u]}}(e.h,l,u),p=!0,h="hsv"):j(e.h)&&j(e.s)&&j(e.l)&&(l=D(e.s),c=D(e.l),i=function(t,e,r){var n,i,a;function o(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}if(t=E(t,360),e=E(e,100),r=E(r,100),0===e)n=i=a=r;else{var s=r<.5?r*(1+e):r+e-r*e,l=2*r-s;n=o(l,s,t+1/3),i=o(l,s,t),a=o(l,s,t-1/3)}return{r:255*n,g:255*i,b:255*a}}(e.h,l,c),p=!0,h="hsl"),e.hasOwnProperty("a")&&(a=e.a));var f,d,m;return a=C(a),{ok:p,format:e.format||h,r:o(255,s(i.r,0)),g:o(255,s(i.g,0)),b:o(255,s(i.b,0)),a:a}}(e);this._originalInput=e,this._r=c.r,this._g=c.g,this._b=c.b,this._a=c.a,this._roundA=a(100*this._a)/100,this._format=l.format||c.format,this._gradientType=l.gradientType,this._r<1&&(this._r=a(this._r)),this._g<1&&(this._g=a(this._g)),this._b<1&&(this._b=a(this._b)),this._ok=c.ok,this._tc_id=i++}function c(t,e,r){t=E(t,255),e=E(e,255),r=E(r,255);var n,i,a=s(t,e,r),l=o(t,e,r),u=(a+l)/2;if(a==l)n=i=0;else{var c=a-l;switch(i=u>.5?c/(2-a-l):c/(a+l),a){case t:n=(e-r)/c+(e<r?6:0);break;case e:n=(r-t)/c+2;break;case r:n=(t-e)/c+4}n/=6}return{h:n,s:i,l:u}}function p(t,e,r){t=E(t,255),e=E(e,255),r=E(r,255);var n,i,a=s(t,e,r),l=o(t,e,r),u=a,c=a-l;if(i=0===a?0:c/a,a==l)n=0;else{switch(a){case t:n=(e-r)/c+(e<r?6:0);break;case e:n=(r-t)/c+2;break;case r:n=(t-e)/c+4}n/=6}return{h:n,s:i,v:u}}function h(t,e,r,n){var i=[I(a(t).toString(16)),I(a(e).toString(16)),I(a(r).toString(16))];return n&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function f(t,e,r,n){return[I(O(n)),I(a(t).toString(16)),I(a(e).toString(16)),I(a(r).toString(16))].join("")}function d(t,e){e=0===e?0:e||10;var r=u(t).toHsl();return r.s-=e/100,r.s=z(r.s),u(r)}function m(t,e){e=0===e?0:e||10;var r=u(t).toHsl();return r.s+=e/100,r.s=z(r.s),u(r)}function y(t){return u(t).desaturate(100)}function g(t,e){e=0===e?0:e||10;var r=u(t).toHsl();return r.l+=e/100,r.l=z(r.l),u(r)}function v(t,e){e=0===e?0:e||10;var r=u(t).toRgb();return r.r=s(0,o(255,r.r-a(-e/100*255))),r.g=s(0,o(255,r.g-a(-e/100*255))),r.b=s(0,o(255,r.b-a(-e/100*255))),u(r)}function _(t,e){e=0===e?0:e||10;var r=u(t).toHsl();return r.l-=e/100,r.l=z(r.l),u(r)}function x(t,e){var r=u(t).toHsl(),n=(r.h+e)%360;return r.h=n<0?360+n:n,u(r)}function b(t){var e=u(t).toHsl();return e.h=(e.h+180)%360,u(e)}function w(t){var e=u(t).toHsl(),r=e.h;return[u(t),u({h:(r+120)%360,s:e.s,l:e.l}),u({h:(r+240)%360,s:e.s,l:e.l})]}function k(t){var e=u(t).toHsl(),r=e.h;return[u(t),u({h:(r+90)%360,s:e.s,l:e.l}),u({h:(r+180)%360,s:e.s,l:e.l}),u({h:(r+270)%360,s:e.s,l:e.l})]}function T(t){var e=u(t).toHsl(),r=e.h;return[u(t),u({h:(r+72)%360,s:e.s,l:e.l}),u({h:(r+216)%360,s:e.s,l:e.l})]}function A(t,e,r){e=e||6,r=r||30;var n=u(t).toHsl(),i=360/r,a=[u(t)];for(n.h=(n.h-(i*e>>1)+720)%360;--e;)n.h=(n.h+i)%360,a.push(u(n));return a}function M(t,e){e=e||6;for(var r=u(t).toHsv(),n=r.h,i=r.s,a=r.v,o=[],s=1/e;e--;)o.push(u({h:n,s:i,v:a})),a=(a+s)%1;return o}u.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var e,r,n,i=this.toRgb();return e=i.r/255,r=i.g/255,n=i.b/255,.2126*(e<=.03928?e/12.92:t.pow((e+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:t.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:t.pow((n+.055)/1.055,2.4))},setAlpha:function(t){return this._a=C(t),this._roundA=a(100*this._a)/100,this},toHsv:function(){var t=p(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=p(this._r,this._g,this._b),e=a(360*t.h),r=a(100*t.s),n=a(100*t.v);return 1==this._a?"hsv("+e+", "+r+"%, "+n+"%)":"hsva("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=c(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=c(this._r,this._g,this._b),e=a(360*t.h),r=a(100*t.s),n=a(100*t.l);return 1==this._a?"hsl("+e+", "+r+"%, "+n+"%)":"hsla("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return h(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,e,r,n,i){var o=[I(a(t).toString(16)),I(a(e).toString(16)),I(a(r).toString(16)),I(O(n))];if(i&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1))return o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0);return o.join("")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:a(this._r),g:a(this._g),b:a(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+a(this._r)+", "+a(this._g)+", "+a(this._b)+")":"rgba("+a(this._r)+", "+a(this._g)+", "+a(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:a(100*E(this._r,255))+"%",g:a(100*E(this._g,255))+"%",b:a(100*E(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+a(100*E(this._r,255))+"%, "+a(100*E(this._g,255))+"%, "+a(100*E(this._b,255))+"%)":"rgba("+a(100*E(this._r,255))+"%, "+a(100*E(this._g,255))+"%, "+a(100*E(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(L[h(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+f(this._r,this._g,this._b,this._a),r=e,n=this._gradientType?"GradientType = 1, ":"";if(t){var i=u(t);r="#"+f(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+e+",endColorstr="+r+")"},toString:function(t){var e=!!t;t=t||this._format;var r=!1,n=this._a<1&&this._a>=0;return e||!n||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("rgb"===t&&(r=this.toRgbString()),"prgb"===t&&(r=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(r=this.toHexString()),"hex3"===t&&(r=this.toHexString(!0)),"hex4"===t&&(r=this.toHex8String(!0)),"hex8"===t&&(r=this.toHex8String()),"name"===t&&(r=this.toName()),"hsl"===t&&(r=this.toHslString()),"hsv"===t&&(r=this.toHsvString()),r||this.toHexString()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return u(this.toString())},_applyModification:function(t,e){var r=t.apply(null,[this].concat([].slice.call(e)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(g,arguments)},brighten:function(){return this._applyModification(v,arguments)},darken:function(){return this._applyModification(_,arguments)},desaturate:function(){return this._applyModification(d,arguments)},saturate:function(){return this._applyModification(m,arguments)},greyscale:function(){return this._applyModification(y,arguments)},spin:function(){return this._applyModification(x,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(A,arguments)},complement:function(){return this._applyCombination(b,arguments)},monochromatic:function(){return this._applyCombination(M,arguments)},splitcomplement:function(){return this._applyCombination(T,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(k,arguments)}},u.fromRatio=function(t,e){if("object"==typeof t){var r={};for(var n in t)t.hasOwnProperty(n)&&(r[n]="a"===n?t[n]:D(t[n]));t=r}return u(t,e)},u.equals=function(t,e){return!(!t||!e)&&u(t).toRgbString()==u(e).toRgbString()},u.random=function(){return u.fromRatio({r:l(),g:l(),b:l()})},u.mix=function(t,e,r){r=0===r?0:r||50;var n=u(t).toRgb(),i=u(e).toRgb(),a=r/100;return u({r:(i.r-n.r)*a+n.r,g:(i.g-n.g)*a+n.g,b:(i.b-n.b)*a+n.b,a:(i.a-n.a)*a+n.a})},u.readability=function(e,r){var n=u(e),i=u(r);return(t.max(n.getLuminance(),i.getLuminance())+.05)/(t.min(n.getLuminance(),i.getLuminance())+.05)},u.isReadable=function(t,e,r){var n,i,a=u.readability(t,e);switch(i=!1,(n=function(t){var e,r;e=((t=t||{level:"AA",size:"small"}).level||"AA").toUpperCase(),r=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA");"small"!==r&&"large"!==r&&(r="small");return{level:e,size:r}}(r)).level+n.size){case"AAsmall":case"AAAlarge":i=a>=4.5;break;case"AAlarge":i=a>=3;break;case"AAAsmall":i=a>=7}return i},u.mostReadable=function(t,e,r){var n,i,a,o,s=null,l=0;i=(r=r||{}).includeFallbackColors,a=r.level,o=r.size;for(var c=0;c<e.length;c++)(n=u.readability(t,e[c]))>l&&(l=n,s=u(e[c]));return u.isReadable(t,s,{level:a,size:o})||!i?s:(r.includeFallbackColors=!1,u.mostReadable(t,["#fff","#000"],r))};var S=u.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},L=u.hexNames=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}(S);function C(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function E(e,r){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(e)&&(e="100%");var n=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(e);return e=o(r,s(0,parseFloat(e))),n&&(e=parseInt(e*r,10)/100),t.abs(e-r)<1e-6?1:e%r/parseFloat(r)}function z(t){return o(1,s(0,t))}function P(t){return parseInt(t,16)}function I(t){return 1==t.length?"0"+t:""+t}function D(t){return t<=1&&(t=100*t+"%"),t}function O(e){return t.round(255*parseFloat(e)).toString(16)}function R(t){return P(t)/255}var F,B,N,U=(B="[\\s|\\(]+("+(F="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",N="[\\s|\\(]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",{CSS_UNIT:new RegExp(F),rgb:new RegExp("rgb"+B),rgba:new RegExp("rgba"+N),hsl:new RegExp("hsl"+B),hsla:new RegExp("hsla"+N),hsv:new RegExp("hsv"+B),hsva:new RegExp("hsva"+N),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function j(t){return!!U.CSS_UNIT.exec(t)}"undefined"!=typeof e&&e.exports?e.exports=u:window.tinycolor=u}(Math)},{}],34:[function(t,e,r){"use strict";e.exports=[{path:"",backoff:0},{path:"M-2.4,-3V3L0.6,0Z",backoff:.6},{path:"M-3.7,-2.5V2.5L1.3,0Z",backoff:1.3},{path:"M-4.45,-3L-1.65,-0.2V0.2L-4.45,3L1.55,0Z",backoff:1.55},{path:"M-2.2,-2.2L-0.2,-0.2V0.2L-2.2,2.2L-1.4,3L1.6,0L-1.4,-3Z",backoff:1.6},{path:"M-4.4,-2.1L-0.6,-0.2V0.2L-4.4,2.1L-4,3L2,0L-4,-3Z",backoff:2},{path:"M2,0A2,2 0 1,1 0,-2A2,2 0 0,1 2,0Z",backoff:0,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}]},{}],35:[function(t,e,r){"use strict";var n=t("./arrow_paths"),i=t("../../plots/font_attributes"),a=t("../../plots/cartesian/constants"),o=t("../../plot_api/plot_template").templatedArray;e.exports=o("annotation",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},text:{valType:"string",editType:"calc+arraydraw"},textangle:{valType:"angle",dflt:0,editType:"calc+arraydraw"},font:i({editType:"calc+arraydraw",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},height:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},align:{valType:"enumerated",values:["left","center","right"],dflt:"center",editType:"arraydraw"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"arraydraw"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},borderpad:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},showarrow:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},arrowcolor:{valType:"color",editType:"arraydraw"},arrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},arrowside:{valType:"flaglist",flags:["end","start"],extras:["none"],dflt:"end",editType:"arraydraw"},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},arrowwidth:{valType:"number",min:.1,editType:"calc+arraydraw"},standoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},ax:{valType:"any",editType:"calc+arraydraw"},ay:{valType:"any",editType:"calc+arraydraw"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",a.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",a.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",a.idRegex.x.toString()],editType:"calc"},x:{valType:"any",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},xshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},yref:{valType:"enumerated",values:["paper",a.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calc+arraydraw"},yshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1,editType:"arraydraw"},xclick:{valType:"any",editType:"arraydraw"},yclick:{valType:"any",editType:"arraydraw"},hovertext:{valType:"string",editType:"arraydraw"},hoverlabel:{bgcolor:{valType:"color",editType:"arraydraw"},bordercolor:{valType:"color",editType:"arraydraw"},font:i({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc",_deprecated:{ref:{valType:"string",editType:"calc"}}})},{"../../plot_api/plot_template":203,"../../plots/cartesian/constants":219,"../../plots/font_attributes":239,"./arrow_paths":34}],36:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axes"),a=t("./draw").draw;function o(t){var e=t._fullLayout;n.filterVisible(e.annotations).forEach(function(e){var r=i.getFromId(t,e.xref),n=i.getFromId(t,e.yref);e._extremes={},r&&s(e,r),n&&s(e,n)})}function s(t,e){var r,n=e._id,a=n.charAt(0),o=t[a],s=t["a"+a],l=t[a+"ref"],u=t["a"+a+"ref"],c=t["_"+a+"padplus"],p=t["_"+a+"padminus"],h={x:1,y:-1}[a]*t[a+"shift"],f=3*t.arrowsize*t.arrowwidth||0,d=f+h,m=f-h,y=3*t.startarrowsize*t.arrowwidth||0,g=y+h,v=y-h;if(u===l){var _=i.findExtremes(e,[e.r2c(o)],{ppadplus:d,ppadminus:m}),x=i.findExtremes(e,[e.r2c(s)],{ppadplus:Math.max(c,g),ppadminus:Math.max(p,v)});r={min:[_.min[0],x.min[0]],max:[_.max[0],x.max[0]]}}else g=s?g+s:g,v=s?v-s:v,r=i.findExtremes(e,[e.r2c(o)],{ppadplus:Math.max(c,d,g),ppadminus:Math.max(p,m,v)});t._extremes[n]=r}e.exports=function(t){var e=t._fullLayout;if(n.filterVisible(e.annotations).length&&t._fullData.length)return n.syncOrAsync([a,o],t)}},{"../../lib":169,"../../plots/cartesian/axes":213,"./draw":41}],37:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry"),a=t("../../plot_api/plot_template").arrayEditor;function o(t,e){var r,n,i,a,o,l,u,c=t._fullLayout.annotations,p=[],h=[],f=[],d=(e||[]).length;for(r=0;r<c.length;r++)if(a=(i=c[r]).clicktoshow){for(n=0;n<d;n++)if(l=(o=e[n]).xaxis,u=o.yaxis,l._id===i.xref&&u._id===i.yref&&l.d2r(o.x)===s(i._xclick,l)&&u.d2r(o.y)===s(i._yclick,u)){(i.visible?"onout"===a?h:f:p).push(r);break}n===d&&i.visible&&"onout"===a&&h.push(r)}return{on:p,off:h,explicitOff:f}}function s(t,e){return"log"===e.type?e.l2r(t):e.d2r(t)}e.exports={hasClickToShow:function(t,e){var r=o(t,e);return r.on.length>0||r.explicitOff.length>0},onClick:function(t,e){var r,s,l=o(t,e),u=l.on,c=l.off.concat(l.explicitOff),p={},h=t._fullLayout.annotations;if(!u.length&&!c.length)return;for(r=0;r<u.length;r++)(s=a(t.layout,"annotations",h[u[r]])).modifyItem("visible",!0),n.extendFlat(p,s.getUpdateObj());for(r=0;r<c.length;r++)(s=a(t.layout,"annotations",h[c[r]])).modifyItem("visible",!1),n.extendFlat(p,s.getUpdateObj());return i.call("update",t,{},p)}}},{"../../lib":169,"../../plot_api/plot_template":203,"../../registry":261}],38:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../color");e.exports=function(t,e,r,a){a("opacity");var o=a("bgcolor"),s=a("bordercolor"),l=i.opacity(s);a("borderpad");var u=a("borderwidth"),c=a("showarrow");if(a("text",c?" ":r._dfltTitle.annotation),a("textangle"),n.coerceFont(a,"font",r.font),a("width"),a("align"),a("height")&&a("valign"),c){var p,h,f=a("arrowside");-1!==f.indexOf("end")&&(p=a("arrowhead"),h=a("arrowsize")),-1!==f.indexOf("start")&&(a("startarrowhead",p),a("startarrowsize",h)),a("arrowcolor",l?e.bordercolor:i.defaultLine),a("arrowwidth",2*(l&&u||1)),a("standoff"),a("startstandoff")}var d=a("hovertext"),m=r.hoverlabel||{};if(d){var y=a("hoverlabel.bgcolor",m.bgcolor||(i.opacity(o)?i.rgb(o):i.defaultLine)),g=a("hoverlabel.bordercolor",m.bordercolor||i.contrast(y));n.coerceFont(a,"hoverlabel.font",{family:m.font.family,size:m.font.size,color:m.font.color||g})}a("captureevents",!!d)}},{"../../lib":169,"../color":50}],39:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib/to_log_range");e.exports=function(t,e,r,a){e=e||{};var o="log"===r&&"linear"===e.type,s="linear"===r&&"log"===e.type;if(o||s)for(var l,u,c=t._fullLayout.annotations,p=e._id.charAt(0),h=0;h<c.length;h++)l=c[h],u="annotations["+h+"].",l[p+"ref"]===e._id&&f(p),l["a"+p+"ref"]===e._id&&f("a"+p);function f(t){var r=l[t],s=null;s=o?i(r,e.range):Math.pow(10,r),n(s)||(s=null),a(u+t,s)}}},{"../../lib/to_log_range":192,"fast-isnumeric":16}],40:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axes"),a=t("../../plots/array_container_defaults"),o=t("./common_defaults"),s=t("./attributes");function l(t,e,r){function a(r,i){return n.coerce(t,e,s,r,i)}var l=a("visible"),u=a("clicktoshow");if(l||u){o(t,e,r,a);for(var c=e.showarrow,p=["x","y"],h=[-10,-30],f={_fullLayout:r},d=0;d<2;d++){var m=p[d],y=i.coerceRef(t,e,f,m,"","paper");if("paper"!==y)i.getFromId(f,y)._annIndices.push(e._index);if(i.coercePosition(e,f,a,y,m,.5),c){var g="a"+m,v=i.coerceRef(t,e,f,g,"pixel");"pixel"!==v&&v!==y&&(v=e[g]="pixel");var _="pixel"===v?h[d]:.4;i.coercePosition(e,f,a,v,g,_)}a(m+"anchor"),a(m+"shift")}if(n.noneOrAll(t,e,["x","y"]),c&&n.noneOrAll(t,e,["ax","ay"]),u){var x=a("xclick"),b=a("yclick");e._xclick=void 0===x?e.x:i.cleanPosition(x,f,e.xref),e._yclick=void 0===b?e.y:i.cleanPosition(b,f,e.yref)}}}e.exports=function(t,e){a(t,e,{name:"annotations",handleItemDefaults:l})}},{"../../lib":169,"../../plots/array_container_defaults":209,"../../plots/cartesian/axes":213,"./attributes":35,"./common_defaults":38}],41:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../registry"),a=t("../../plots/plots"),o=t("../../lib"),s=t("../../plots/cartesian/axes"),l=t("../color"),u=t("../drawing"),c=t("../fx"),p=t("../../lib/svg_text_utils"),h=t("../../lib/setcursor"),f=t("../dragelement"),d=t("../../plot_api/plot_template").arrayEditor,m=t("./draw_arrow_head");function y(t,e){var r=t._fullLayout.annotations[e]||{},n=s.getFromId(t,r.xref),i=s.getFromId(t,r.yref);n&&n.setScale(),i&&i.setScale(),g(t,r,e,!1,n,i)}function g(t,e,r,a,s,y){var g,v,_=t._fullLayout,x=t._fullLayout._size,b=t._context.edits;a?(g="annotation-"+a,v=a+".annotations"):(g="annotation",v="annotations");var w=d(t.layout,v,e),k=w.modifyBase,T=w.modifyItem,A=w.getUpdateObj;_._infolayer.selectAll("."+g+'[data-index="'+r+'"]').remove();var M="clip"+_._uid+"_ann"+r;if(e._input&&!1!==e.visible){var S={x:{},y:{}},L=+e.textangle||0,C=_._infolayer.append("g").classed(g,!0).attr("data-index",String(r)).style("opacity",e.opacity),E=C.append("g").classed("annotation-text-g",!0),z=b[e.showarrow?"annotationTail":"annotationPosition"],P=e.captureevents||b.annotationText||z,I=E.append("g").style("pointer-events",P?"all":null).call(h,"pointer").on("click",function(){t._dragging=!1,t.emit("plotly_clickannotation",q(n.event))});e.hovertext&&I.on("mouseover",function(){var r=e.hoverlabel,n=r.font,i=this.getBoundingClientRect(),a=t.getBoundingClientRect();c.loneHover({x0:i.left-a.left,x1:i.right-a.left,y:(i.top+i.bottom)/2-a.top,text:e.hovertext,color:r.bgcolor,borderColor:r.bordercolor,fontFamily:n.family,fontSize:n.size,fontColor:n.color},{container:_._hoverlayer.node(),outerContainer:_._paper.node(),gd:t})}).on("mouseout",function(){c.loneUnhover(_._hoverlayer.node())});var D=e.borderwidth,O=e.borderpad,R=D+O,F=I.append("rect").attr("class","bg").style("stroke-width",D+"px").call(l.stroke,e.bordercolor).call(l.fill,e.bgcolor),B=e.width||e.height,N=_._topclips.selectAll("#"+M).data(B?[0]:[]);N.enter().append("clipPath").classed("annclip",!0).attr("id",M).append("rect"),N.exit().remove();var U=e.font,j=_._meta?o.templateString(e.text,_._meta):e.text,V=I.append("text").classed("annotation-text",!0).text(j);b.annotationText?V.call(p.makeEditable,{delegate:I,gd:t}).call(G).on("edit",function(r){e.text=r,this.call(G),T("text",r),s&&s.autorange&&k(s._name+".autorange",!0),y&&y.autorange&&k(y._name+".autorange",!0),i.call("_guiRelayout",t,A())}):V.call(G)}else n.selectAll("#"+M).remove();function q(t){var n={index:r,annotation:e._input,fullAnnotation:e,event:t};return a&&(n.subplotId=a),n}function G(r){return r.call(u.font,U).attr({"text-anchor":{left:"start",right:"end"}[e.align]||"middle"}),p.convertToTspans(r,t,H),r}function H(){var r=V.selectAll("a");1===r.size()&&r.text()===V.text()&&I.insert("a",":first-child").attr({"xlink:xlink:href":r.attr("xlink:href"),"xlink:xlink:show":r.attr("xlink:show")}).style({cursor:"pointer"}).node().appendChild(F.node());var n=I.select(".annotation-text-math-group"),c=!n.empty(),d=u.bBox((c?n:V).node()),g=d.width,v=d.height,w=e.width||g,P=e.height||v,O=Math.round(w+2*R),U=Math.round(P+2*R);function j(t,e){return"auto"===e&&(e=t<1/3?"left":t>2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}for(var G=!1,H=["x","y"],Z=0;Z<H.length;Z++){var X,W,Y,K,J,$=H[Z],Q=e[$+"ref"]||$,tt=e["a"+$+"ref"],et={x:s,y:y}[$],rt=(L+("x"===$?0:-90))*Math.PI/180,nt=O*Math.cos(rt),it=U*Math.sin(rt),at=Math.abs(nt)+Math.abs(it),ot=e[$+"anchor"],st=e[$+"shift"]*("x"===$?1:-1),lt=S[$];if(et){var ut=et.r2fraction(e[$]);(ut<0||ut>1)&&(tt===Q?((ut=et.r2fraction(e["a"+$]))<0||ut>1)&&(G=!0):G=!0),X=et._offset+et.r2p(e[$]),K=.5}else"x"===$?(Y=e[$],X=x.l+x.w*Y):(Y=1-e[$],X=x.t+x.h*Y),K=e.showarrow?.5:Y;if(e.showarrow){lt.head=X;var ct=e["a"+$];J=nt*j(.5,e.xanchor)-it*j(.5,e.yanchor),tt===Q?(lt.tail=et._offset+et.r2p(ct),W=J):(lt.tail=X+ct,W=J+ct),lt.text=lt.tail+J;var pt=_["x"===$?"width":"height"];if("paper"===Q&&(lt.head=o.constrain(lt.head,1,pt-1)),"pixel"===tt){var ht=-Math.max(lt.tail-3,lt.text),ft=Math.min(lt.tail+3,lt.text)-pt;ht>0?(lt.tail+=ht,lt.text+=ht):ft>0&&(lt.tail-=ft,lt.text-=ft)}lt.tail+=st,lt.head+=st}else W=J=at*j(K,ot),lt.text=X+J;lt.text+=st,J+=st,W+=st,e["_"+$+"padplus"]=at/2+W,e["_"+$+"padminus"]=at/2-W,e["_"+$+"size"]=at,e["_"+$+"shift"]=J}if(G)I.remove();else{var dt=0,mt=0;if("left"!==e.align&&(dt=(w-g)*("center"===e.align?.5:1)),"top"!==e.valign&&(mt=(P-v)*("middle"===e.valign?.5:1)),c)n.select("svg").attr({x:R+dt-1,y:R+mt}).call(u.setClipUrl,B?M:null,t);else{var yt=R+mt-d.top,gt=R+dt-d.left;V.call(p.positionText,gt,yt).call(u.setClipUrl,B?M:null,t)}N.select("rect").call(u.setRect,R,R,w,P),F.call(u.setRect,D/2,D/2,O-D,U-D),I.call(u.setTranslate,Math.round(S.x.text-O/2),Math.round(S.y.text-U/2)),E.attr({transform:"rotate("+L+","+S.x.text+","+S.y.text+")"});var vt,_t=function(r,n){C.selectAll(".annotation-arrow-g").remove();var c=S.x.head,p=S.y.head,h=S.x.tail+r,d=S.y.tail+n,g=S.x.text+r,v=S.y.text+n,_=o.rotationXYMatrix(L,g,v),w=o.apply2DTransform(_),M=o.apply2DTransform2(_),z=+F.attr("width"),P=+F.attr("height"),D=g-.5*z,O=D+z,R=v-.5*P,B=R+P,N=[[D,R,D,B],[D,B,O,B],[O,B,O,R],[O,R,D,R]].map(M);if(!N.reduce(function(t,e){return t^!!o.segmentsIntersect(c,p,c+1e6,p+1e6,e[0],e[1],e[2],e[3])},!1)){N.forEach(function(t){var e=o.segmentsIntersect(h,d,c,p,t[0],t[1],t[2],t[3]);e&&(h=e.x,d=e.y)});var U=e.arrowwidth,j=e.arrowcolor,V=e.arrowside,q=C.append("g").style({opacity:l.opacity(j)}).classed("annotation-arrow-g",!0),G=q.append("path").attr("d","M"+h+","+d+"L"+c+","+p).style("stroke-width",U+"px").call(l.stroke,l.rgb(j));if(m(G,V,e),b.annotationPosition&&G.node().parentNode&&!a){var H=c,Z=p;if(e.standoff){var X=Math.sqrt(Math.pow(c-h,2)+Math.pow(p-d,2));H+=e.standoff*(h-c)/X,Z+=e.standoff*(d-p)/X}var W,Y,K=q.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(h-H)+","+(d-Z),transform:"translate("+H+","+Z+")"}).style("stroke-width",U+6+"px").call(l.stroke,"rgba(0,0,0,0)").call(l.fill,"rgba(0,0,0,0)");f.init({element:K.node(),gd:t,prepFn:function(){var t=u.getTranslate(I);W=t.x,Y=t.y,s&&s.autorange&&k(s._name+".autorange",!0),y&&y.autorange&&k(y._name+".autorange",!0)},moveFn:function(t,r){var n=w(W,Y),i=n[0]+t,a=n[1]+r;I.call(u.setTranslate,i,a),T("x",s?s.p2r(s.r2p(e.x)+t):e.x+t/x.w),T("y",y?y.p2r(y.r2p(e.y)+r):e.y-r/x.h),e.axref===e.xref&&T("ax",s.p2r(s.r2p(e.ax)+t)),e.ayref===e.yref&&T("ay",y.p2r(y.r2p(e.ay)+r)),q.attr("transform","translate("+t+","+r+")"),E.attr({transform:"rotate("+L+","+i+","+a+")"})},doneFn:function(){i.call("_guiRelayout",t,A());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}};if(e.showarrow&&_t(0,0),z)f.init({element:I.node(),gd:t,prepFn:function(){vt=E.attr("transform")},moveFn:function(t,r){var n="pointer";if(e.showarrow)e.axref===e.xref?T("ax",s.p2r(s.r2p(e.ax)+t)):T("ax",e.ax+t),e.ayref===e.yref?T("ay",y.p2r(y.r2p(e.ay)+r)):T("ay",e.ay+r),_t(t,r);else{if(a)return;var i,o;if(s)i=s.p2r(s.r2p(e.x)+t);else{var l=e._xsize/x.w,u=e.x+(e._xshift-e.xshift)/x.w-l/2;i=f.align(u+t/x.w,l,0,1,e.xanchor)}if(y)o=y.p2r(y.r2p(e.y)+r);else{var c=e._ysize/x.h,p=e.y-(e._yshift+e.yshift)/x.h-c/2;o=f.align(p-r/x.h,c,0,1,e.yanchor)}T("x",i),T("y",o),s&&y||(n=f.getCursor(s?.5:i,y?.5:o,e.xanchor,e.yanchor))}E.attr({transform:"translate("+t+","+r+")"+vt}),h(I,n)},clickFn:function(r,n){e.captureevents&&t.emit("plotly_clickannotation",q(n))},doneFn:function(){h(I),i.call("_guiRelayout",t,A());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}}e.exports={draw:function(t){var e=t._fullLayout;e._infolayer.selectAll(".annotation").remove();for(var r=0;r<e.annotations.length;r++)e.annotations[r].visible&&y(t,r);return a.previousPromises(t)},drawOne:y,drawRaw:g}},{"../../lib":169,"../../lib/setcursor":188,"../../lib/svg_text_utils":190,"../../plot_api/plot_template":203,"../../plots/cartesian/axes":213,"../../plots/plots":252,"../../registry":261,"../color":50,"../dragelement":68,"../drawing":71,"../fx":88,"./draw_arrow_head":42,d3:14}],42:[function(t,e,r){"use strict";var n=t("d3"),i=t("../color"),a=t("./arrow_paths");e.exports=function(t,e,r){var o,s,l,u,c=t.node(),p=a[r.arrowhead||0],h=a[r.startarrowhead||0],f=(r.arrowwidth||1)*(r.arrowsize||1),d=(r.arrowwidth||1)*(r.startarrowsize||1),m=e.indexOf("start")>=0,y=e.indexOf("end")>=0,g=p.backoff*f+r.standoff,v=h.backoff*d+r.startstandoff;if("line"===c.nodeName){o={x:+t.attr("x1"),y:+t.attr("y1")},s={x:+t.attr("x2"),y:+t.attr("y2")};var _=o.x-s.x,x=o.y-s.y;if(u=(l=Math.atan2(x,_))+Math.PI,g&&v&&g+v>Math.sqrt(_*_+x*x))return void z();if(g){if(g*g>_*_+x*x)return void z();var b=g*Math.cos(l),w=g*Math.sin(l);s.x+=b,s.y+=w,t.attr({x2:s.x,y2:s.y})}if(v){if(v*v>_*_+x*x)return void z();var k=v*Math.cos(l),T=v*Math.sin(l);o.x-=k,o.y-=T,t.attr({x1:o.x,y1:o.y})}}else if("path"===c.nodeName){var A=c.getTotalLength(),M="";if(A<g+v)return void z();var S=c.getPointAtLength(0),L=c.getPointAtLength(.1);l=Math.atan2(S.y-L.y,S.x-L.x),o=c.getPointAtLength(Math.min(v,A)),M="0px,"+v+"px,";var C=c.getPointAtLength(A),E=c.getPointAtLength(A-.1);u=Math.atan2(C.y-E.y,C.x-E.x),s=c.getPointAtLength(Math.max(0,A-g)),M+=A-(M?v+g:g)+"px,"+A+"px",t.style("stroke-dasharray",M)}function z(){t.style("stroke-dasharray","0px,100px")}function P(e,a,o,s){e.path&&(e.noRotate&&(o=0),n.select(c.parentNode).append("path").attr({class:t.attr("class"),d:e.path,transform:"translate("+a.x+","+a.y+")"+(o?"rotate("+180*o/Math.PI+")":"")+"scale("+s+")"}).style({fill:i.rgb(r.arrowcolor),"stroke-width":0}))}m&&P(h,o,l,d),y&&P(p,s,u,f)}},{"../color":50,"./arrow_paths":34,d3:14}],43:[function(t,e,r){"use strict";var n=t("./draw"),i=t("./click");e.exports={moduleType:"component",name:"annotations",layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),includeBasePlot:t("../../plots/cartesian/include_components")("annotations"),calcAutorange:t("./calc_autorange"),draw:n.draw,drawOne:n.drawOne,drawRaw:n.drawRaw,hasClickToShow:i.hasClickToShow,onClick:i.onClick,convertCoords:t("./convert_coords")}},{"../../plots/cartesian/include_components":223,"./attributes":35,"./calc_autorange":36,"./click":37,"./convert_coords":39,"./defaults":40,"./draw":41}],44:[function(t,e,r){"use strict";var n=t("../annotations/attributes"),i=t("../../plot_api/edit_types").overrideAll,a=t("../../plot_api/plot_template").templatedArray;e.exports=i(a("annotation",{visible:n.visible,x:{valType:"any"},y:{valType:"any"},z:{valType:"any"},ax:{valType:"number"},ay:{valType:"number"},xanchor:n.xanchor,xshift:n.xshift,yanchor:n.yanchor,yshift:n.yshift,text:n.text,textangle:n.textangle,font:n.font,width:n.width,height:n.height,opacity:n.opacity,align:n.align,valign:n.valign,bgcolor:n.bgcolor,bordercolor:n.bordercolor,borderpad:n.borderpad,borderwidth:n.borderwidth,showarrow:n.showarrow,arrowcolor:n.arrowcolor,arrowhead:n.arrowhead,startarrowhead:n.startarrowhead,arrowside:n.arrowside,arrowsize:n.arrowsize,startarrowsize:n.startarrowsize,arrowwidth:n.arrowwidth,standoff:n.standoff,startstandoff:n.startstandoff,hovertext:n.hovertext,hoverlabel:n.hoverlabel,captureevents:n.captureevents}),"calc","from-root")},{"../../plot_api/edit_types":196,"../../plot_api/plot_template":203,"../annotations/attributes":35}],45:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axes");function a(t,e){var r=e.fullSceneLayout.domain,a=e.fullLayout._size,o={pdata:null,type:"linear",autorange:!1,range:[-1/0,1/0]};t._xa={},n.extendFlat(t._xa,o),i.setConvert(t._xa),t._xa._offset=a.l+r.x[0]*a.w,t._xa.l2p=function(){return.5*(1+t._pdata[0]/t._pdata[3])*a.w*(r.x[1]-r.x[0])},t._ya={},n.extendFlat(t._ya,o),i.setConvert(t._ya),t._ya._offset=a.t+(1-r.y[1])*a.h,t._ya.l2p=function(){return.5*(1-t._pdata[1]/t._pdata[3])*a.h*(r.y[1]-r.y[0])}}e.exports=function(t){for(var e=t.fullSceneLayout.annotations,r=0;r<e.length;r++)a(e[r],t);t.fullLayout._infolayer.selectAll(".annotation-"+t.id).remove()}},{"../../lib":169,"../../plots/cartesian/axes":213}],46:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axes"),a=t("../../plots/array_container_defaults"),o=t("../annotations/common_defaults"),s=t("./attributes");function l(t,e,r,a){function l(r,i){return n.coerce(t,e,s,r,i)}function u(t){var n=t+"axis",a={_fullLayout:{}};return a._fullLayout[n]=r[n],i.coercePosition(e,a,l,t,t,.5)}l("visible")&&(o(t,e,a.fullLayout,l),u("x"),u("y"),u("z"),n.noneOrAll(t,e,["x","y","z"]),e.xref="x",e.yref="y",e.zref="z",l("xanchor"),l("yanchor"),l("xshift"),l("yshift"),e.showarrow&&(e.axref="pixel",e.ayref="pixel",l("ax",-10),l("ay",-30),n.noneOrAll(t,e,["ax","ay"])))}e.exports=function(t,e,r){a(t,e,{name:"annotations",handleItemDefaults:l,fullLayout:r.fullLayout})}},{"../../lib":169,"../../plots/array_container_defaults":209,"../../plots/cartesian/axes":213,"../annotations/common_defaults":38,"./attributes":44}],47:[function(t,e,r){"use strict";var n=t("../annotations/draw").drawRaw,i=t("../../plots/gl3d/project"),a=["x","y","z"];e.exports=function(t){for(var e=t.fullSceneLayout,r=t.dataScale,o=e.annotations,s=0;s<o.length;s++){for(var l=o[s],u=!1,c=0;c<3;c++){var p=a[c],h=l[p],f=e[p+"axis"].r2fraction(h);if(f<0||f>1){u=!0;break}}u?t.fullLayout._infolayer.select(".annotation-"+t.id+'[data-index="'+s+'"]').remove():(l._pdata=i(t.glplot.cameraParams,[e.xaxis.r2l(l.x)*r[0],e.yaxis.r2l(l.y)*r[1],e.zaxis.r2l(l.z)*r[2]]),n(t.graphDiv,l,s,t.id,l._xa,l._ya))}}},{"../../plots/gl3d/project":242,"../annotations/draw":41}],48:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib");e.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:t("./attributes")}}},layoutAttributes:t("./attributes"),handleDefaults:t("./defaults"),includeBasePlot:function(t,e){var r=n.subplotsRegistry.gl3d;if(!r)return;for(var a=r.attrRegex,o=Object.keys(t),s=0;s<o.length;s++){var l=o[s];a.test(l)&&(t[l].annotations||[]).length&&(i.pushUnique(e._basePlotModules,r),i.pushUnique(e._subplots.gl3d,l))}},convert:t("./convert"),draw:t("./draw")}},{"../../lib":169,"../../registry":261,"./attributes":44,"./convert":45,"./defaults":46,"./draw":47}],49:[function(t,e,r){"use strict";r.defaults=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],r.defaultLine="#444",r.lightLine="#eee",r.background="#fff",r.borderLine="#BEC8D9",r.lightFraction=1e3/11},{}],50:[function(t,e,r){"use strict";var n=t("tinycolor2"),i=t("fast-isnumeric"),a=e.exports={},o=t("./attributes");a.defaults=o.defaults;var s=a.defaultLine=o.defaultLine;a.lightLine=o.lightLine;var l=a.background=o.background;function u(t){if(i(t)||"string"!=typeof t)return t;var e=t.trim();if("rgb"!==e.substr(0,3))return t;var r=e.match(/^rgba?\s*\(([^()]*)\)$/);if(!r)return t;var n=r[1].trim().split(/\s*[\s,]\s*/),a="a"===e.charAt(3)&&4===n.length;if(!a&&3!==n.length)return t;for(var o=0;o<n.length;o++){if(!n[o].length)return t;if(n[o]=Number(n[o]),!(n[o]>=0))return t;if(3===o)n[o]>1&&(n[o]=1);else if(n[o]>=1)return t}var s=Math.round(255*n[0])+", "+Math.round(255*n[1])+", "+Math.round(255*n[2]);return a?"rgba("+s+", "+n[3]+")":"rgb("+s+")"}a.tinyRGB=function(t){var e=t.toRgb();return"rgb("+Math.round(e.r)+", "+Math.round(e.g)+", "+Math.round(e.b)+")"},a.rgb=function(t){return a.tinyRGB(n(t))},a.opacity=function(t){return t?n(t).getAlpha():0},a.addOpacity=function(t,e){var r=n(t).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+e+")"},a.combine=function(t,e){var r=n(t).toRgb();if(1===r.a)return n(t).toRgbString();var i=n(e||l).toRgb(),a=1===i.a?i:{r:255*(1-i.a)+i.r*i.a,g:255*(1-i.a)+i.g*i.a,b:255*(1-i.a)+i.b*i.a},o={r:a.r*(1-r.a)+r.r*r.a,g:a.g*(1-r.a)+r.g*r.a,b:a.b*(1-r.a)+r.b*r.a};return n(o).toRgbString()},a.contrast=function(t,e,r){var i=n(t);return 1!==i.getAlpha()&&(i=n(a.combine(t,l))),(i.isDark()?e?i.lighten(e):l:r?i.darken(r):s).toString()},a.stroke=function(t,e){var r=n(e);t.style({stroke:a.tinyRGB(r),"stroke-opacity":r.getAlpha()})},a.fill=function(t,e){var r=n(e);t.style({fill:a.tinyRGB(r),"fill-opacity":r.getAlpha()})},a.clean=function(t){if(t&&"object"==typeof t){var e,r,n,i,o=Object.keys(t);for(e=0;e<o.length;e++)if(i=t[n=o[e]],"color"===n.substr(n.length-5))if(Array.isArray(i))for(r=0;r<i.length;r++)i[r]=u(i[r]);else t[n]=u(i);else if("colorscale"===n.substr(n.length-10)&&Array.isArray(i))for(r=0;r<i.length;r++)Array.isArray(i[r])&&(i[r][1]=u(i[r][1]));else if(Array.isArray(i)){var s=i[0];if(!Array.isArray(s)&&s&&"object"==typeof s)for(r=0;r<i.length;r++)a.clean(i[r])}else i&&"object"==typeof i&&a.clean(i)}}},{"./attributes":49,"fast-isnumeric":16,tinycolor2:33}],51:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/layout_attributes"),i=t("../../plots/font_attributes"),a=t("../../lib/extend").extendFlat,o=t("../../plot_api/edit_types").overrideAll;e.exports=o({thicknessmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"pixels"},thickness:{valType:"number",min:0,dflt:30},lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction"},len:{valType:"number",min:0,dflt:1},x:{valType:"number",dflt:1.02,min:-2,max:3},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left"},xpad:{valType:"number",min:0,dflt:10},y:{valType:"number",dflt:.5,min:-2,max:3},yanchor:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle"},ypad:{valType:"number",min:0,dflt:10},outlinecolor:n.linecolor,outlinewidth:n.linewidth,bordercolor:n.linecolor,borderwidth:{valType:"number",min:0,dflt:0},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},tickmode:n.tickmode,nticks:n.nticks,tick0:n.tick0,dtick:n.dtick,tickvals:n.tickvals,ticktext:n.ticktext,ticks:a({},n.ticks,{dflt:""}),ticklen:n.ticklen,tickwidth:n.tickwidth,tickcolor:n.tickcolor,showticklabels:n.showticklabels,tickfont:i({}),tickangle:n.tickangle,tickformat:n.tickformat,tickformatstops:n.tickformatstops,tickprefix:n.tickprefix,showtickprefix:n.showtickprefix,ticksuffix:n.ticksuffix,showticksuffix:n.showticksuffix,separatethousands:n.separatethousands,exponentformat:n.exponentformat,showexponent:n.showexponent,title:{text:{valType:"string"},font:i({}),side:{valType:"enumerated",values:["right","top","bottom"],dflt:"top"}},_deprecated:{title:{valType:"string"},titlefont:i({}),titleside:{valType:"enumerated",values:["right","top","bottom"],dflt:"top"}}},"colorbars","from-root")},{"../../lib/extend":162,"../../plot_api/edit_types":196,"../../plots/cartesian/layout_attributes":225,"../../plots/font_attributes":239}],52:[function(t,e,r){"use strict";e.exports={cn:{colorbar:"colorbar",cbbg:"cbbg",cbfill:"cbfill",cbfills:"cbfills",cbline:"cbline",cblines:"cblines",cbaxis:"cbaxis",cbtitleunshift:"cbtitleunshift",cbtitle:"cbtitle",cboutline:"cboutline",crisp:"crisp",jsPlaceholder:"js-placeholder"}}},{}],53:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plot_api/plot_template"),a=t("../../plots/cartesian/tick_value_defaults"),o=t("../../plots/cartesian/tick_mark_defaults"),s=t("../../plots/cartesian/tick_label_defaults"),l=t("./attributes");e.exports=function(t,e,r){var u=i.newContainer(e,"colorbar"),c=t.colorbar||{};function p(t,e){return n.coerce(c,u,l,t,e)}var h=p("thicknessmode");p("thickness","fraction"===h?30/(r.width-r.margin.l-r.margin.r):30);var f=p("lenmode");p("len","fraction"===f?1:r.height-r.margin.t-r.margin.b),p("x"),p("xanchor"),p("xpad"),p("y"),p("yanchor"),p("ypad"),n.noneOrAll(c,u,["x","y"]),p("outlinecolor"),p("outlinewidth"),p("bordercolor"),p("borderwidth"),p("bgcolor"),a(c,u,p,"linear");var d={outerTicks:!1,font:r.font};s(c,u,p,"linear",d),o(c,u,p,"linear",d),p("title.text",r._dfltTitle.colorbar),n.coerceFont(p,"title.font",r.font),p("title.side")}},{"../../lib":169,"../../plot_api/plot_template":203,"../../plots/cartesian/tick_label_defaults":232,"../../plots/cartesian/tick_mark_defaults":233,"../../plots/cartesian/tick_value_defaults":234,"./attributes":51}],54:[function(t,e,r){"use strict";var n=t("d3"),i=t("tinycolor2"),a=t("../../plots/plots"),o=t("../../registry"),s=t("../../plots/cartesian/axes"),l=t("../dragelement"),u=t("../../lib"),c=t("../../lib/extend").extendFlat,p=t("../../lib/setcursor"),h=t("../drawing"),f=t("../color"),d=t("../titles"),m=t("../../lib/svg_text_utils"),y=t("../colorscale/helpers").flipScale,g=t("../../plots/cartesian/axis_defaults"),v=t("../../plots/cartesian/position_defaults"),_=t("../../plots/cartesian/layout_attributes"),x=t("../../constants/alignment"),b=x.LINE_SPACING,w=x.FROM_TL,k=x.FROM_BR,T=t("./constants").cn;e.exports={draw:function(t){var e=t._fullLayout._infolayer.selectAll("g."+T.colorbar).data(function(t){var e,r,n,i,a=t._fullLayout,o=t.calcdata,s=[];function l(t){return c(t,{_fillcolor:null,_line:{color:null,width:null,dash:null},_levels:{start:null,end:null,size:null},_filllevels:null,_fillgradient:null,_zrange:null})}function u(){"function"==typeof i.calc?i.calc(t,n,e):(e._fillgradient=r.reversescale?y(r.colorscale):r.colorscale,e._zrange=[r[i.min],r[i.max]])}for(var p=0;p<o.length;p++){var h=o[p],f=(n=h[0].trace)._module.colorbar;if(!0===n.visible&&f)for(var d=Array.isArray(f),m=d?f:[f],g=0;g<m.length;g++){var v=(i=m[g]).container;(r=v?n[v]:n)&&r.showscale&&((e=l(r.colorbar))._id="cb"+n.uid+(d&&v?"-"+v:""),e._traceIndex=n.index,e._propPrefix=(v?v+".":"")+"colorbar.",e._meta=n._meta,u(),s.push(e))}}for(var _ in a._colorAxes)if((r=a[_]).showscale){var x=a._colorAxes[_];(e=l(r.colorbar))._id="cb"+_,e._propPrefix=_+".colorbar.",e._meta=a._meta,i={min:"cmin",max:"cmax"},"heatmap"!==x[0]&&(n=x[1],i.calc=n._module.colorbar.calc),u(),s.push(e)}return s}(t),function(t){return t._id});e.enter().append("g").attr("class",function(t){return t._id}).classed(T.colorbar,!0),e.each(function(e){var r=n.select(this);u.ensureSingle(r,"rect",T.cbbg),u.ensureSingle(r,"g",T.cbfills),u.ensureSingle(r,"g",T.cblines),u.ensureSingle(r,"g",T.cbaxis,function(t){t.classed(T.crisp,!0)}),u.ensureSingle(r,"g",T.cbtitleunshift,function(t){t.append("g").classed(T.cbtitle,!0)}),u.ensureSingle(r,"rect",T.cboutline);var y=function(t,e,r){var o=r._fullLayout,l=o._size,p=e._fillcolor,y=e._line,x=e.title,A=x.side,M=e._zrange||n.extent(("function"==typeof p?p:y.color).domain()),S="function"==typeof y.color?y.color:function(){return y.color},L="function"==typeof p?p:function(){return p},C=e._levels,E=function(t,e,r){var n,i,a=e._levels,o=[],s=[],l=a.end+a.size/100,u=a.size,c=1.001*r[0]-.001*r[1],p=1.001*r[1]-.001*r[0];for(i=0;i<1e5&&(n=a.start+i*u,!(u>0?n>=l:n<=l));i++)n>c&&n<p&&o.push(n);if(e._fillgradient)s=[0];else if("function"==typeof e._fillcolor){var h=e._filllevels;if(h)for(l=h.end+h.size/100,u=h.size,i=0;i<1e5&&(n=h.start+i*u,!(u>0?n>=l:n<=l));i++)n>r[0]&&n<r[1]&&s.push(n);else(s=o.map(function(t){return t-a.size/2})).push(s[s.length-1]+a.size)}else e._fillcolor&&"string"==typeof e._fillcolor&&(s=[0]);return a.size<0&&(o.reverse(),s.reverse()),{line:o,fill:s}}(0,e,M),z=E.fill,P=E.line,I=Math.round(e.thickness*("fraction"===e.thicknessmode?l.w:1)),D=I/l.w,O=Math.round(e.len*("fraction"===e.lenmode?l.h:1)),R=O/l.h,F=e.xpad/l.w,B=(e.borderwidth+e.outlinewidth)/2,N=e.ypad/l.h,U=Math.round(e.x*l.w+e.xpad),j=e.x-D*({middle:.5,right:1}[e.xanchor]||0),V=e.y+R*(({top:-.5,bottom:.5}[e.yanchor]||0)-.5),q=Math.round(l.h*(1-V)),G=q-O;e._lenFrac=R,e._thickFrac=D,e._xLeftFrac=j,e._yBottomFrac=V;var H=e._axis=function(t,e,r){var n=t._fullLayout,i={type:"linear",range:r,tickmode:e.tickmode,nticks:e.nticks,tick0:e.tick0,dtick:e.dtick,tickvals:e.tickvals,ticktext:e.ticktext,ticks:e.ticks,ticklen:e.ticklen,tickwidth:e.tickwidth,tickcolor:e.tickcolor,showticklabels:e.showticklabels,tickfont:e.tickfont,tickangle:e.tickangle,tickformat:e.tickformat,exponentformat:e.exponentformat,separatethousands:e.separatethousands,showexponent:e.showexponent,showtickprefix:e.showtickprefix,tickprefix:e.tickprefix,showticksuffix:e.showticksuffix,ticksuffix:e.ticksuffix,title:e.title,showline:!0,anchor:"free",side:"right",position:1},a={type:"linear",_id:"y"+e._id},o={letter:"y",font:n.font,noHover:!0,noTickson:!0,calendar:n.calendar};function s(t,e){return u.coerce(i,a,_,t,e)}return g(i,a,s,o,n),v(i,a,s,o),a}(r,e,M);if(H.position=e.x+F+D,-1!==["top","bottom"].indexOf(A)&&(H.title.side=A,H.titlex=e.x+F,H.titley=V+("top"===x.side?R-N:N)),y.color&&"auto"===e.tickmode){H.tickmode="linear",H.tick0=C.start;var Z=C.size,X=u.constrain((q-G)/50,4,15)+1,W=(M[1]-M[0])/((e.nticks||X)*Z);if(W>1){var Y=Math.pow(10,Math.floor(Math.log(W)/Math.LN10));Z*=Y*u.roundUp(W/Y,[2,5,10]),(Math.abs(C.start)/C.size+1e-6)%1<2e-6&&(H.tick0=0)}H.dtick=Z}H.domain=[V+N,V+R-N],H.setScale(),t.attr("transform","translate("+Math.round(l.l)+","+Math.round(l.t)+")");var K,J=t.select("."+T.cbtitleunshift).attr("transform","translate(-"+Math.round(l.l)+",-"+Math.round(l.t)+")"),$=t.select("."+T.cbaxis),Q=0;function tt(n,i){var a={propContainer:H,propName:e._propPrefix+"title",traceIndex:e._traceIndex,_meta:e._meta,placeholder:o._dfltTitle.colorbar,containerGroup:t.select("."+T.cbtitle)},s="h"===n.charAt(0)?n.substr(1):"h"+n;t.selectAll("."+s+",."+s+"-math-group").remove(),d.draw(r,n,c(a,i||{}))}return u.syncOrAsync([a.previousPromises,function(){if(-1!==["top","bottom"].indexOf(A)){var t,r=l.l+(e.x+F)*l.w,n=H.title.font.size;t="top"===A?(1-(V+R-N))*l.h+l.t+3+.75*n:(1-(V+N))*l.h+l.t-3-.25*n,tt(H._id+"title",{attributes:{x:r,y:t,"text-anchor":"start"}})}},function(){if(-1!==["top","bottom"].indexOf(A)){var a=t.select("."+T.cbtitle),o=a.select("text"),c=[-e.outlinewidth/2,e.outlinewidth/2],p=a.select(".h"+H._id+"title-math-group").node(),f=15.6;if(o.node()&&(f=parseInt(o.node().style.fontSize,10)*b),p?(Q=h.bBox(p).height)>f&&(c[1]-=(Q-f)/2):o.node()&&!o.classed(T.jsPlaceholder)&&(Q=h.bBox(o.node()).height),Q){if(Q+=5,"top"===A)H.domain[1]-=Q/l.h,c[1]*=-1;else{H.domain[0]+=Q/l.h;var d=m.lineCount(o);c[1]+=(1-d)*f}a.attr("transform","translate("+c+")"),H.setScale()}}t.selectAll("."+T.cbfills+",."+T.cblines).attr("transform","translate(0,"+Math.round(l.h*(1-H.domain[1]))+")"),$.attr("transform","translate(0,"+Math.round(-l.t)+")");var g=t.select("."+T.cbfills).selectAll("rect."+T.cbfill).data(z);g.enter().append("rect").classed(T.cbfill,!0).style("stroke","none"),g.exit().remove();var v=M.map(H.c2p).map(Math.round).sort(function(t,e){return t-e});g.each(function(t,a){var o=[0===a?M[0]:(z[a]+z[a-1])/2,a===z.length-1?M[1]:(z[a]+z[a+1])/2].map(H.c2p).map(Math.round);o[1]=u.constrain(o[1]+(o[1]>o[0])?1:-1,v[0],v[1]);var s=n.select(this).attr({x:U,width:Math.max(I,2),y:n.min(o),height:Math.max(n.max(o)-n.min(o),2)});if(e._fillgradient)h.gradient(s,r,e._id,"vertical",e._fillgradient,"fill");else{var l=L(t).replace("e-","");s.attr("fill",i(l).toHexString())}});var _=t.select("."+T.cblines).selectAll("path."+T.cbline).data(y.color&&y.width?P:[]);_.enter().append("path").classed(T.cbline,!0),_.exit().remove(),_.each(function(t){n.select(this).attr("d","M"+U+","+(Math.round(H.c2p(t))+y.width/2%1)+"h"+I).call(h.lineGroupStyle,y.width,S(t),y.dash)}),$.selectAll("g."+H._id+"tick,path").remove();var x=U+I+(e.outlinewidth||0)/2-("outside"===e.ticks?1:0),w=s.calcTicks(H),k=s.makeTransFn(H),C=s.getTickSigns(H)[2];return s.drawTicks(r,H,{vals:"inside"===H.ticks?s.clipEnds(H,w):w,layer:$,path:s.makeTickPath(H,x,C),transFn:k}),s.drawLabels(r,H,{vals:w,layer:$,transFn:k,labelFns:s.makeLabelFns(H,x)})},function(){if(-1===["top","bottom"].indexOf(A)){var t=H.title.font.size,e=H._offset+H._length/2,i=l.l+(H.position||0)*l.w+("right"===H.side?10+t*(H.showticklabels?1:.5):-10-t*(H.showticklabels?.5:0));tt("h"+H._id+"title",{avoid:{selection:n.select(r).selectAll("g."+H._id+"tick"),side:A,offsetLeft:l.l,offsetTop:0,maxShift:o.width},attributes:{x:i,y:e,"text-anchor":"middle"},transform:{rotate:"-90",offset:0}})}},a.previousPromises,function(){var n=I+e.outlinewidth/2+h.bBox($.node()).width;if((K=J.select("text")).node()&&!K.classed(T.jsPlaceholder)){var i,o=J.select(".h"+H._id+"title-math-group").node();i=o&&-1!==["top","bottom"].indexOf(A)?h.bBox(o).width:h.bBox(J.node()).right-U-l.l,n=Math.max(n,i)}var s=2*e.xpad+n+e.borderwidth+e.outlinewidth/2,u=q-G;t.select("."+T.cbbg).attr({x:U-e.xpad-(e.borderwidth+e.outlinewidth)/2,y:G-B,width:Math.max(s,2),height:Math.max(u+2*B,2)}).call(f.fill,e.bgcolor).call(f.stroke,e.bordercolor).style("stroke-width",e.borderwidth),t.selectAll("."+T.cboutline).attr({x:U,y:G+e.ypad+("top"===A?Q:0),width:Math.max(I,2),height:Math.max(u-2*e.ypad-Q,2)}).call(f.stroke,e.outlinecolor).style({fill:"none","stroke-width":e.outlinewidth});var c=({center:.5,right:1}[e.xanchor]||0)*s;t.attr("transform","translate("+(l.l-c)+","+l.t+")");var p={},d=w[e.yanchor],m=k[e.yanchor];"pixels"===e.lenmode?(p.y=e.y,p.t=u*d,p.b=u*m):(p.t=p.b=0,p.yt=e.y+e.len*d,p.yb=e.y-e.len*m);var y=w[e.xanchor],g=k[e.xanchor];if("pixels"===e.thicknessmode)p.x=e.x,p.l=s*y,p.r=s*g;else{var v=s-I;p.l=v*y,p.r=v*g,p.xl=e.x-e.thickness*y,p.xr=e.x+e.thickness*g}a.autoMargin(r,e._id,p)}],r)}(r,e,t);y&&y.then&&(t._promises||[]).push(y),t._context.edits.colorbarPosition&&function(t,e,r){var n,i,a,s=r._fullLayout._size;l.init({element:t.node(),gd:r,prepFn:function(){n=t.attr("transform"),p(t)},moveFn:function(r,o){t.attr("transform",n+" translate("+r+","+o+")"),i=l.align(e._xLeftFrac+r/s.w,e._thickFrac,0,1,e.xanchor),a=l.align(e._yBottomFrac-o/s.h,e._lenFrac,0,1,e.yanchor);var u=l.getCursor(i,a,e.xanchor,e.yanchor);p(t,u)},doneFn:function(){if(p(t),void 0!==i&&void 0!==a){var n={};n[e._propPrefix+"x"]=i,n[e._propPrefix+"y"]=a,void 0!==e._traceIndex?o.call("_guiRestyle",r,n,e._traceIndex):o.call("_guiRelayout",r,n)}}})}(r,e,t)}),e.exit().each(function(e){a.autoMargin(t,e._id)}).remove(),e.order()}}},{"../../constants/alignment":144,"../../lib":169,"../../lib/extend":162,"../../lib/setcursor":188,"../../lib/svg_text_utils":190,"../../plots/cartesian/axes":213,"../../plots/cartesian/axis_defaults":215,"../../plots/cartesian/layout_attributes":225,"../../plots/cartesian/position_defaults":228,"../../plots/plots":252,"../../registry":261,"../color":50,"../colorscale/helpers":61,"../dragelement":68,"../drawing":71,"../titles":137,"./constants":52,d3:14,tinycolor2:33}],55:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t){return n.isPlainObject(t.colorbar)}},{"../../lib":169}],56:[function(t,e,r){"use strict";e.exports={moduleType:"component",name:"colorbar",attributes:t("./attributes"),supplyDefaults:t("./defaults"),draw:t("./draw").draw,hasColorbar:t("./has_colorbar")}},{"./attributes":51,"./defaults":53,"./draw":54,"./has_colorbar":55}],57:[function(t,e,r){"use strict";var n=t("../colorbar/attributes"),i=t("../../lib/regex").counter,a=t("./scales.js").scales;Object.keys(a);function o(t){return"`"+t+"`"}e.exports=function(t,e){t=t||"";var r,s=(e=e||{}).cLetter||"c",l=("onlyIfNumerical"in e?e.onlyIfNumerical:Boolean(t),"noScale"in e?e.noScale:"marker.line"===t),u="showScaleDflt"in e?e.showScaleDflt:"z"===s,c="string"==typeof e.colorscaleDflt?a[e.colorscaleDflt]:null,p=e.editTypeOverride||"",h=t?t+".":"";"colorAttr"in e?(r=e.colorAttr,e.colorAttr):o(h+(r={z:"z",c:"color"}[s]));var f=s+"auto",d=s+"min",m=s+"max",y=s+"mid",g=(o(h+f),o(h+d),o(h+m),{});g[d]=g[m]=void 0;var v={};v[f]=!1;var _={};return"color"===r&&(_.color={valType:"color",arrayOk:!0,editType:p||"style"},e.anim&&(_.color.anim=!0)),_[f]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:g},_[d]={valType:"number",dflt:null,editType:p||"plot",impliedEdits:v},_[m]={valType:"number",dflt:null,editType:p||"plot",impliedEdits:v},_[y]={valType:"number",dflt:null,editType:"calc",impliedEdits:g},_.colorscale={valType:"colorscale",editType:"calc",dflt:c,impliedEdits:{autocolorscale:!1}},_.autocolorscale={valType:"boolean",dflt:!1!==e.autoColorDflt,editType:"calc",impliedEdits:{colorscale:void 0}},_.reversescale={valType:"boolean",dflt:!1,editType:"plot"},l||(_.showscale={valType:"boolean",dflt:u,editType:"calc"},_.colorbar=n),e.noColorAxis||(_.coloraxis={valType:"subplotid",regex:i("coloraxis"),dflt:null,editType:"calc"}),_}},{"../../lib/regex":184,"../colorbar/attributes":51,"./scales.js":65}],58:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("./helpers").extractOpts;e.exports=function(t,e,r){var o,s=t._fullLayout,l=r.vals,u=r.containerStr,c=u?i.nestedProperty(e,u).get():e,p=a(c),h=!1!==p.auto,f=p.min,d=p.max,m=p.mid,y=function(){return i.aggNums(Math.min,null,l)},g=function(){return i.aggNums(Math.max,null,l)};(void 0===f?f=y():h&&(f=c._colorAx&&n(f)?Math.min(f,y()):y()),void 0===d?d=g():h&&(d=c._colorAx&&n(d)?Math.max(d,g()):g()),h&&void 0!==m&&(d-m>m-f?f=m-(d-m):d-m<m-f&&(d=m+(m-f))),f===d&&(f-=.5,d+=.5),p._sync("min",f),p._sync("max",d),p.autocolorscale)&&(o=f*d<0?s.colorscale.diverging:f>=0?s.colorscale.sequential:s.colorscale.sequentialminus,p._sync("colorscale",o))}},{"../../lib":169,"./helpers":61,"fast-isnumeric":16}],59:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./helpers").hasColorscale,a=t("./helpers").extractOpts;e.exports=function(t,e){function r(t,e){var r=t["_"+e];void 0!==r&&(t[e]=r)}function o(t,i){var o=i.container?n.nestedProperty(t,i.container).get():t;if(o)if(o.coloraxis)o._colorAx=e[o.coloraxis];else{var s=a(o),l=s.auto;(l||void 0===s.min)&&r(o,i.min),(l||void 0===s.max)&&r(o,i.max),s.autocolorscale&&r(o,"colorscale")}}for(var s=0;s<t.length;s++){var l=t[s],u=l._module.colorbar;if(u)if(Array.isArray(u))for(var c=0;c<u.length;c++)o(l,u[c]);else o(l,u);i(l,"marker.line")&&o(l,{container:"marker.line",min:"cmin",max:"cmax"})}for(var p in e._colorAxes)o(e[p],{min:"cmin",max:"cmax"})}},{"../../lib":169,"./helpers":61}],60:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../colorbar/has_colorbar"),o=t("../colorbar/defaults"),s=t("./scales").isValid,l=t("../../registry").traceIs;function u(t,e){var r=e.slice(0,e.length-1);return e?i.nestedProperty(t,r).get()||{}:t}e.exports=function t(e,r,c,p,h){var f=h.prefix,d=h.cLetter,m="_module"in r,y=u(e,f),g=u(r,f),v=u(r._template||{},f)||{},_=function(){return delete e.coloraxis,delete r.coloraxis,t(e,r,c,p,h)};if(m){var x=c._colorAxes||{},b=p(f+"coloraxis");if(b){var w=l(r,"contour")&&i.nestedProperty(r,"contours.coloring").get()||"heatmap",k=x[b];return void(k?(k[2].push(_),k[0]!==w&&(k[0]=!1,i.warn(["Ignoring coloraxis:",b,"setting","as it is linked to incompatible colorscales."].join(" ")))):x[b]=[w,r,[_]])}}var T=y[d+"min"],A=y[d+"max"],M=n(T)&&n(A)&&T<A;p(f+d+"auto",!M)?p(f+d+"mid"):(p(f+d+"min"),p(f+d+"max"));var S,L,C=y.colorscale,E=v.colorscale;(void 0!==C&&(S=!s(C)),void 0!==E&&(S=!s(E)),p(f+"autocolorscale",S),p(f+"colorscale"),p(f+"reversescale"),"marker.line."!==f)&&(f&&m&&(L=a(y)),p(f+"showscale",L)&&(f&&v&&(g._template=v),o(y,g,c)))}},{"../../lib":169,"../../registry":261,"../colorbar/defaults":53,"../colorbar/has_colorbar":55,"./scales":65,"fast-isnumeric":16}],61:[function(t,e,r){"use strict";var n=t("d3"),i=t("tinycolor2"),a=t("fast-isnumeric"),o=t("../../lib"),s=t("../color"),l=t("./scales").isValid;var u=["showscale","autocolorscale","colorscale","reversescale","colorbar"],c=["min","max","mid","auto"];function p(t){var e,r,n,i=t._colorAx,a=i||t,o={};for(r=0;r<u.length;r++)o[n=u[r]]=a[n];if(i)for(e="c",r=0;r<c.length;r++)o[n=c[r]]=a["c"+n];else{var s;for(r=0;r<c.length;r++)(s="c"+(n=c[r]))in a?o[n]=a[s]:(s="z"+n)in a&&(o[n]=a[s]);e=s.charAt(0)}return o._sync=function(t,r){var n=-1!==c.indexOf(t)?e+t:t;a[n]=a["_"+n]=r},o}function h(t){for(var e=p(t),r=e.min,n=e.max,i=e.reversescale?f(e.colorscale):e.colorscale,a=i.length,o=new Array(a),s=new Array(a),l=0;l<a;l++){var u=i[l];o[l]=r+u[0]*(n-r),s[l]=u[1]}return{domain:o,range:s}}function f(t){for(var e=t.length,r=new Array(e),n=e-1,i=0;n>=0;n--,i++){var a=t[n];r[i]=[1-a[0],a[1]]}return r}function d(t,e){e=e||{};for(var r=t.domain,o=t.range,l=o.length,u=new Array(l),c=0;c<l;c++){var p=i(o[c]).toRgb();u[c]=[p.r,p.g,p.b,p.a]}var h,f=n.scale.linear().domain(r).range(u).clamp(!0),d=e.noNumericCheck,y=e.returnArray;return(h=d&&y?f:d?function(t){return m(f(t))}:y?function(t){return a(t)?f(t):i(t).isValid()?t:s.defaultLine}:function(t){return a(t)?m(f(t)):i(t).isValid()?t:s.defaultLine}).domain=f.domain,h.range=function(){return o},h}function m(t){var e={r:t[0],g:t[1],b:t[2],a:t[3]};return i(e).toRgbString()}e.exports={hasColorscale:function(t,e,r){var n=e?o.nestedProperty(t,e).get()||{}:t,i=n[r||"color"],s=!1;if(o.isArrayOrTypedArray(i))for(var u=0;u<i.length;u++)if(a(i[u])){s=!0;break}return o.isPlainObject(n)&&(s||!0===n.showscale||a(n.cmin)&&a(n.cmax)||l(n.colorscale)||o.isPlainObject(n.colorbar))},extractOpts:p,extractScale:h,flipScale:f,makeColorScaleFunc:d,makeColorScaleFuncFromTrace:function(t,e){return d(h(t),e)}}},{"../../lib":169,"../color":50,"./scales":65,d3:14,"fast-isnumeric":16,tinycolor2:33}],62:[function(t,e,r){"use strict";var n=t("./scales"),i=t("./helpers");e.exports={moduleType:"component",name:"colorscale",attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyLayoutDefaults:t("./layout_defaults"),handleDefaults:t("./defaults"),crossTraceDefaults:t("./cross_trace_defaults"),calc:t("./calc"),scales:n.scales,defaultScale:n.defaultScale,getScale:n.get,isValidScale:n.isValid,hasColorscale:i.hasColorscale,extractOpts:i.extractOpts,extractScale:i.extractScale,flipScale:i.flipScale,makeColorScaleFunc:i.makeColorScaleFunc,makeColorScaleFuncFromTrace:i.makeColorScaleFuncFromTrace}},{"./attributes":57,"./calc":58,"./cross_trace_defaults":59,"./defaults":60,"./helpers":61,"./layout_attributes":63,"./layout_defaults":64,"./scales":65}],63:[function(t,e,r){"use strict";var n=t("../../lib/extend").extendFlat,i=t("./attributes"),a=t("./scales").scales;e.exports={editType:"calc",colorscale:{editType:"calc",sequential:{valType:"colorscale",dflt:a.Reds,editType:"calc"},sequentialminus:{valType:"colorscale",dflt:a.Blues,editType:"calc"},diverging:{valType:"colorscale",dflt:a.RdBu,editType:"calc"}},coloraxis:n({_isSubplotObj:!0,editType:"calc"},i("",{colorAttr:"corresponding trace color array(s)",noColorAxis:!0,showScaleDflt:!0}))}},{"../../lib/extend":162,"./attributes":57,"./scales":65}],64:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plot_api/plot_template"),a=t("./layout_attributes"),o=t("./defaults");e.exports=function(t,e){function r(r,i){return n.coerce(t,e,a,r,i)}r("colorscale.sequential"),r("colorscale.sequentialminus"),r("colorscale.diverging");var s,l,u=e._colorAxes;function c(t,e){return n.coerce(s,l,a.coloraxis,t,e)}for(var p in u){var h=u[p];if(h[0])s=t[p]||{},(l=i.newContainer(e,p,"coloraxis"))._name=p,o(s,l,e,c,{prefix:"",cLetter:"c"});else{for(var f=0;f<h[2].length;f++)h[2][f]();delete e._colorAxes[p]}}}},{"../../lib":169,"../../plot_api/plot_template":203,"./defaults":60,"./layout_attributes":63}],65:[function(t,e,r){"use strict";var n=t("tinycolor2"),i={Greys:[[0,"rgb(0,0,0)"],[1,"rgb(255,255,255)"]],YlGnBu:[[0,"rgb(8,29,88)"],[.125,"rgb(37,52,148)"],[.25,"rgb(34,94,168)"],[.375,"rgb(29,145,192)"],[.5,"rgb(65,182,196)"],[.625,"rgb(127,205,187)"],[.75,"rgb(199,233,180)"],[.875,"rgb(237,248,217)"],[1,"rgb(255,255,217)"]],Greens:[[0,"rgb(0,68,27)"],[.125,"rgb(0,109,44)"],[.25,"rgb(35,139,69)"],[.375,"rgb(65,171,93)"],[.5,"rgb(116,196,118)"],[.625,"rgb(161,217,155)"],[.75,"rgb(199,233,192)"],[.875,"rgb(229,245,224)"],[1,"rgb(247,252,245)"]],YlOrRd:[[0,"rgb(128,0,38)"],[.125,"rgb(189,0,38)"],[.25,"rgb(227,26,28)"],[.375,"rgb(252,78,42)"],[.5,"rgb(253,141,60)"],[.625,"rgb(254,178,76)"],[.75,"rgb(254,217,118)"],[.875,"rgb(255,237,160)"],[1,"rgb(255,255,204)"]],Bluered:[[0,"rgb(0,0,255)"],[1,"rgb(255,0,0)"]],RdBu:[[0,"rgb(5,10,172)"],[.35,"rgb(106,137,247)"],[.5,"rgb(190,190,190)"],[.6,"rgb(220,170,132)"],[.7,"rgb(230,145,90)"],[1,"rgb(178,10,28)"]],Reds:[[0,"rgb(220,220,220)"],[.2,"rgb(245,195,157)"],[.4,"rgb(245,160,105)"],[1,"rgb(178,10,28)"]],Blues:[[0,"rgb(5,10,172)"],[.35,"rgb(40,60,190)"],[.5,"rgb(70,100,245)"],[.6,"rgb(90,120,245)"],[.7,"rgb(106,137,247)"],[1,"rgb(220,220,220)"]],Picnic:[[0,"rgb(0,0,255)"],[.1,"rgb(51,153,255)"],[.2,"rgb(102,204,255)"],[.3,"rgb(153,204,255)"],[.4,"rgb(204,204,255)"],[.5,"rgb(255,255,255)"],[.6,"rgb(255,204,255)"],[.7,"rgb(255,153,255)"],[.8,"rgb(255,102,204)"],[.9,"rgb(255,102,102)"],[1,"rgb(255,0,0)"]],Rainbow:[[0,"rgb(150,0,90)"],[.125,"rgb(0,0,200)"],[.25,"rgb(0,25,255)"],[.375,"rgb(0,152,255)"],[.5,"rgb(44,255,150)"],[.625,"rgb(151,255,0)"],[.75,"rgb(255,234,0)"],[.875,"rgb(255,111,0)"],[1,"rgb(255,0,0)"]],Portland:[[0,"rgb(12,51,131)"],[.25,"rgb(10,136,186)"],[.5,"rgb(242,211,56)"],[.75,"rgb(242,143,56)"],[1,"rgb(217,30,30)"]],Jet:[[0,"rgb(0,0,131)"],[.125,"rgb(0,60,170)"],[.375,"rgb(5,255,255)"],[.625,"rgb(255,255,0)"],[.875,"rgb(250,0,0)"],[1,"rgb(128,0,0)"]],Hot:[[0,"rgb(0,0,0)"],[.3,"rgb(230,0,0)"],[.6,"rgb(255,210,0)"],[1,"rgb(255,255,255)"]],Blackbody:[[0,"rgb(0,0,0)"],[.2,"rgb(230,0,0)"],[.4,"rgb(230,210,0)"],[.7,"rgb(255,255,255)"],[1,"rgb(160,200,255)"]],Earth:[[0,"rgb(0,0,130)"],[.1,"rgb(0,180,180)"],[.2,"rgb(40,210,40)"],[.4,"rgb(230,230,50)"],[.6,"rgb(120,70,20)"],[1,"rgb(255,255,255)"]],Electric:[[0,"rgb(0,0,0)"],[.15,"rgb(30,0,100)"],[.4,"rgb(120,0,100)"],[.6,"rgb(160,90,0)"],[.8,"rgb(230,200,0)"],[1,"rgb(255,250,220)"]],Viridis:[[0,"#440154"],[.06274509803921569,"#48186a"],[.12549019607843137,"#472d7b"],[.18823529411764706,"#424086"],[.25098039215686274,"#3b528b"],[.3137254901960784,"#33638d"],[.3764705882352941,"#2c728e"],[.4392156862745098,"#26828e"],[.5019607843137255,"#21918c"],[.5647058823529412,"#1fa088"],[.6274509803921569,"#28ae80"],[.6901960784313725,"#3fbc73"],[.7529411764705882,"#5ec962"],[.8156862745098039,"#84d44b"],[.8784313725490196,"#addc30"],[.9411764705882353,"#d8e219"],[1,"#fde725"]],Cividis:[[0,"rgb(0,32,76)"],[.058824,"rgb(0,42,102)"],[.117647,"rgb(0,52,110)"],[.176471,"rgb(39,63,108)"],[.235294,"rgb(60,74,107)"],[.294118,"rgb(76,85,107)"],[.352941,"rgb(91,95,109)"],[.411765,"rgb(104,106,112)"],[.470588,"rgb(117,117,117)"],[.529412,"rgb(131,129,120)"],[.588235,"rgb(146,140,120)"],[.647059,"rgb(161,152,118)"],[.705882,"rgb(176,165,114)"],[.764706,"rgb(192,177,109)"],[.823529,"rgb(209,191,102)"],[.882353,"rgb(225,204,92)"],[.941176,"rgb(243,219,79)"],[1,"rgb(255,233,69)"]]},a=i.RdBu;function o(t){var e=0;if(!Array.isArray(t)||t.length<2)return!1;if(!t[0]||!t[t.length-1])return!1;if(0!=+t[0][0]||1!=+t[t.length-1][0])return!1;for(var r=0;r<t.length;r++){var i=t[r];if(2!==i.length||+i[0]<e||!n(i[1]).isValid())return!1;e=+i[0]}return!0}e.exports={scales:i,defaultScale:a,get:function(t,e){if(e||(e=a),!t)return e;function r(){try{t=i[t]||JSON.parse(t)}catch(r){t=e}}return"string"==typeof t&&(r(),"string"==typeof t&&r()),o(t)?t:e},isValid:function(t){return void 0!==i[t]||o(t)}}},{tinycolor2:33}],66:[function(t,e,r){"use strict";e.exports=function(t,e,r,n,i){var a=(t-r)/(n-r),o=a+e/(n-r),s=(a+o)/2;return"left"===i||"bottom"===i?a:"center"===i||"middle"===i?s:"right"===i||"top"===i?o:a<2/3-s?a:o>4/3-s?o:s}},{}],67:[function(t,e,r){"use strict";var n=t("../../lib"),i=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];e.exports=function(t,e,r,a){return t="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*t),0,2),e="bottom"===a?0:"middle"===a?1:"top"===a?2:n.constrain(Math.floor(3*e),0,2),i[e][t]}},{"../../lib":169}],68:[function(t,e,r){"use strict";var n=t("mouse-event-offset"),i=t("has-hover"),a=t("has-passive-events"),o=t("../../lib").removeElement,s=t("../../plots/cartesian/constants"),l=e.exports={};l.align=t("./align"),l.getCursor=t("./cursor");var u=t("./unhover");function c(){var t=document.createElement("div");t.className="dragcover";var e=t.style;return e.position="fixed",e.left=0,e.right=0,e.top=0,e.bottom=0,e.zIndex=999999999,e.background="none",document.body.appendChild(t),t}function p(t){return n(t.changedTouches?t.changedTouches[0]:t,document.body)}l.unhover=u.wrapped,l.unhoverRaw=u.raw,l.init=function(t){var e,r,n,u,h,f,d,m,y=t.gd,g=1,v=y._context.doubleClickDelay,_=t.element;y._mouseDownTime||(y._mouseDownTime=0),_.style.pointerEvents="all",_.onmousedown=b,a?(_._ontouchstart&&_.removeEventListener("touchstart",_._ontouchstart),_._ontouchstart=b,_.addEventListener("touchstart",b,{passive:!1})):_.ontouchstart=b;var x=t.clampFn||function(t,e,r){return Math.abs(t)<r&&(t=0),Math.abs(e)<r&&(e=0),[t,e]};function b(a){y._dragged=!1,y._dragging=!0;var o=p(a);e=o[0],r=o[1],d=a.target,f=a,m=2===a.buttons||a.ctrlKey,"undefined"==typeof a.clientX&&"undefined"==typeof a.clientY&&(a.clientX=e,a.clientY=r),(n=(new Date).getTime())-y._mouseDownTime<v?g+=1:(g=1,y._mouseDownTime=n),t.prepFn&&t.prepFn(a,e,r),i&&!m?(h=c()).style.cursor=window.getComputedStyle(_).cursor:i||(h=document,u=window.getComputedStyle(document.documentElement).cursor,document.documentElement.style.cursor=window.getComputedStyle(_).cursor),document.addEventListener("mouseup",k),document.addEventListener("touchend",k),!1!==t.dragmode&&(a.preventDefault(),document.addEventListener("mousemove",w),document.addEventListener("touchmove",w,{passive:!1}))}function w(n){n.preventDefault();var i=p(n),a=t.minDrag||s.MINDRAG,o=x(i[0]-e,i[1]-r,a),u=o[0],c=o[1];(u||c)&&(y._dragged=!0,l.unhover(y)),y._dragged&&t.moveFn&&!m&&(y._dragdata={element:_,dx:u,dy:c},t.moveFn(u,c))}function k(e){if(delete y._dragdata,!1!==t.dragmode&&(e.preventDefault(),document.removeEventListener("mousemove",w),document.removeEventListener("touchmove",w)),document.removeEventListener("mouseup",k),document.removeEventListener("touchend",k),i?o(h):u&&(h.documentElement.style.cursor=u,u=null),y._dragging){if(y._dragging=!1,(new Date).getTime()-y._mouseDownTime>v&&(g=Math.max(g-1,1)),y._dragged)t.doneFn&&t.doneFn();else if(t.clickFn&&t.clickFn(g,f),!m){var r;try{r=new MouseEvent("click",e)}catch(t){var n=p(e);(r=document.createEvent("MouseEvents")).initMouseEvent("click",e.bubbles,e.cancelable,e.view,e.detail,e.screenX,e.screenY,n[0],n[1],e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget)}d.dispatchEvent(r)}y._dragging=!1,y._dragged=!1}else y._dragged=!1}},l.coverSlip=c},{"../../lib":169,"../../plots/cartesian/constants":219,"./align":66,"./cursor":67,"./unhover":69,"has-hover":18,"has-passive-events":19,"mouse-event-offset":23}],69:[function(t,e,r){"use strict";var n=t("../../lib/events"),i=t("../../lib/throttle"),a=t("../../lib/dom").getGraphDiv,o=t("../fx/constants"),s=e.exports={};s.wrapped=function(t,e,r){(t=a(t))._fullLayout&&i.clear(t._fullLayout._uid+o.HOVERID),s.raw(t,e,r)},s.raw=function(t,e){var r=t._fullLayout,i=t._hoverdata;e||(e={}),e.target&&!1===n.triggerHandler(t,"plotly_beforehover",e)||(r._hoverlayer.selectAll("g").remove(),r._hoverlayer.selectAll("line").remove(),r._hoverlayer.selectAll("circle").remove(),t._hoverdata=void 0,e.target&&i&&t.emit("plotly_unhover",{event:e,points:i}))}},{"../../lib/dom":160,"../../lib/events":161,"../../lib/throttle":191,"../fx/constants":83}],70:[function(t,e,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"}},{}],71:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("tinycolor2"),o=t("../../registry"),s=t("../color"),l=t("../colorscale"),u=t("../../lib"),c=t("../../lib/svg_text_utils"),p=t("../../constants/xmlns_namespaces"),h=t("../../constants/alignment").LINE_SPACING,f=t("../../constants/interactions").DESELECTDIM,d=t("../../traces/scatter/subtypes"),m=t("../../traces/scatter/make_bubble_size_func"),y=t("../../components/fx/helpers").appendArrayPointValue,g=e.exports={};g.font=function(t,e,r,n){u.isPlainObject(e)&&(n=e.color,r=e.size,e=e.family),e&&t.style("font-family",e),r+1&&t.style("font-size",r+"px"),n&&t.call(s.fill,n)},g.setPosition=function(t,e,r){t.attr("x",e).attr("y",r)},g.setSize=function(t,e,r){t.attr("width",e).attr("height",r)},g.setRect=function(t,e,r,n,i){t.call(g.setPosition,e,r).call(g.setSize,n,i)},g.translatePoint=function(t,e,r,n){var a=r.c2p(t.x),o=n.c2p(t.y);return!!(i(a)&&i(o)&&e.node())&&("text"===e.node().nodeName?e.attr("x",a).attr("y",o):e.attr("transform","translate("+a+","+o+")"),!0)},g.translatePoints=function(t,e,r){t.each(function(t){var i=n.select(this);g.translatePoint(t,i,e,r)})},g.hideOutsideRangePoint=function(t,e,r,n,i,a){e.attr("display",r.isPtWithinRange(t,i)&&n.isPtWithinRange(t,a)?null:"none")},g.hideOutsideRangePoints=function(t,e){if(e._hasClipOnAxisFalse){var r=e.xaxis,i=e.yaxis;t.each(function(e){var a=e[0].trace,s=a.xcalendar,l=a.ycalendar,u=o.traceIs(a,"bar-like")?".bartext":".point,.textpoint";t.selectAll(u).each(function(t){g.hideOutsideRangePoint(t,n.select(this),r,i,s,l)})})}},g.crispRound=function(t,e,r){return e&&i(e)?t._context.staticPlot?e:e<1?1:Math.round(e):r||0},g.singleLineStyle=function(t,e,r,n,i){e.style("fill","none");var a=(((t||[])[0]||{}).trace||{}).line||{},o=r||a.width||0,l=i||a.dash||"";s.stroke(e,n||a.color),g.dashLine(e,l,o)},g.lineGroupStyle=function(t,e,r,i){t.style("fill","none").each(function(t){var a=(((t||[])[0]||{}).trace||{}).line||{},o=e||a.width||0,l=i||a.dash||"";n.select(this).call(s.stroke,r||a.color).call(g.dashLine,l,o)})},g.dashLine=function(t,e,r){r=+r||0,e=g.dashStyle(e,r),t.style({"stroke-dasharray":e,"stroke-width":r+"px"})},g.dashStyle=function(t,e){e=+e||1;var r=Math.max(e,3);return"solid"===t?t="":"dot"===t?t=r+"px,"+r+"px":"dash"===t?t=3*r+"px,"+3*r+"px":"longdash"===t?t=5*r+"px,"+5*r+"px":"dashdot"===t?t=3*r+"px,"+r+"px,"+r+"px,"+r+"px":"longdashdot"===t&&(t=5*r+"px,"+2*r+"px,"+r+"px,"+2*r+"px"),t},g.singleFillStyle=function(t){var e=(((n.select(t.node()).data()[0]||[])[0]||{}).trace||{}).fillcolor;e&&t.call(s.fill,e)},g.fillGroupStyle=function(t){t.style("stroke-width",0).each(function(t){var e=n.select(this);t[0].trace&&e.call(s.fill,t[0].trace.fillcolor)})};var v=t("./symbol_defs");g.symbolNames=[],g.symbolFuncs=[],g.symbolNeedLines={},g.symbolNoDot={},g.symbolNoFill={},g.symbolList=[],Object.keys(v).forEach(function(t){var e=v[t],r=e.n;g.symbolList.push(r,t,r+100,t+"-open"),g.symbolNames[r]=t,g.symbolFuncs[r]=e.f,e.needLine&&(g.symbolNeedLines[r]=!0),e.noDot?g.symbolNoDot[r]=!0:g.symbolList.push(r+200,t+"-dot",r+300,t+"-open-dot"),e.noFill&&(g.symbolNoFill[r]=!0)});var _=g.symbolNames.length,x="M0,0.5L0.5,0L0,-0.5L-0.5,0Z";function b(t,e){var r=t%100;return g.symbolFuncs[r](e)+(t>=200?x:"")}g.symbolNumber=function(t){if("string"==typeof t){var e=0;t.indexOf("-open")>0&&(e=100,t=t.replace("-open","")),t.indexOf("-dot")>0&&(e+=200,t=t.replace("-dot","")),(t=g.symbolNames.indexOf(t))>=0&&(t+=e)}return t%100>=_||t>=400?0:Math.floor(Math.max(t,0))};var w={x1:1,x2:0,y1:0,y2:0},k={x1:0,x2:0,y1:1,y2:0},T=n.format("~.1f"),A={radial:{node:"radialGradient"},radialreversed:{node:"radialGradient",reversed:!0},horizontal:{node:"linearGradient",attrs:w},horizontalreversed:{node:"linearGradient",attrs:w,reversed:!0},vertical:{node:"linearGradient",attrs:k},verticalreversed:{node:"linearGradient",attrs:k,reversed:!0}};g.gradient=function(t,e,r,i,o,l){for(var c=o.length,p=A[i],h=new Array(c),f=0;f<c;f++)p.reversed?h[c-1-f]=[T(100*(1-o[f][0])),o[f][1]]:h[f]=[T(100*o[f][0]),o[f][1]];var d=e._fullLayout,m="g"+d._uid+"-"+r,y=d._defs.select(".gradients").selectAll("#"+m).data([i+h.join(";")],u.identity);y.exit().remove(),y.enter().append(p.node).each(function(){var t=n.select(this);p.attrs&&t.attr(p.attrs),t.attr("id",m);var e=t.selectAll("stop").data(h);e.exit().remove(),e.enter().append("stop"),e.each(function(t){var e=a(t[1]);n.select(this).attr({offset:t[0]+"%","stop-color":s.tinyRGB(e),"stop-opacity":e.getAlpha()})})}),t.style(l,O(m,e)).style(l+"-opacity",null);var g=function(t){return"."+t.attr("class").replace(/\s/g,".")},v=g(n.select(t.node().parentNode))+">"+g(t);d._gradientUrlQueryParts[v]=1},g.initGradients=function(t){var e=t._fullLayout;u.ensureSingle(e._defs,"g","gradients").selectAll("linearGradient,radialGradient").remove(),e._gradientUrlQueryParts={}},g.pointStyle=function(t,e,r){if(t.size()){var i=g.makePointStyleFns(e);t.each(function(t){g.singlePointStyle(t,n.select(this),e,i,r)})}},g.singlePointStyle=function(t,e,r,n,i){var a=r.marker,o=a.line;if(e.style("opacity",n.selectedOpacityFn?n.selectedOpacityFn(t):void 0===t.mo?a.opacity:t.mo),n.ms2mrc){var l;l="various"===t.ms||"various"===a.size?3:n.ms2mrc(t.ms),t.mrc=l,n.selectedSizeFn&&(l=t.mrc=n.selectedSizeFn(t));var c=g.symbolNumber(t.mx||a.symbol)||0;t.om=c%200>=100,e.attr("d",b(c,l))}var p,h,f,d=!1;if(t.so)f=o.outlierwidth,h=o.outliercolor,p=a.outliercolor;else{var m=(o||{}).width;f=(t.mlw+1||m+1||(t.trace?(t.trace.marker.line||{}).width:0)+1)-1||0,h="mlc"in t?t.mlcc=n.lineScale(t.mlc):u.isArrayOrTypedArray(o.color)?s.defaultLine:o.color,u.isArrayOrTypedArray(a.color)&&(p=s.defaultLine,d=!0),p="mc"in t?t.mcc=n.markerScale(t.mc):a.color||"rgba(0,0,0,0)",n.selectedColorFn&&(p=n.selectedColorFn(t))}if(t.om)e.call(s.stroke,p).style({"stroke-width":(f||1)+"px",fill:"none"});else{e.style("stroke-width",(t.isBlank?0:f)+"px");var y=a.gradient,v=t.mgt;if(v?d=!0:v=y&&y.type,Array.isArray(v)&&(v=v[0],A[v]||(v=0)),v&&"none"!==v){var _=t.mgc;_?d=!0:_=y.color;var x=r.uid;d&&(x+="-"+t.i),g.gradient(e,i,x,v,[[0,_],[1,p]],"fill")}else s.fill(e,p);f&&s.stroke(e,h)}},g.makePointStyleFns=function(t){var e={},r=t.marker;return e.markerScale=g.tryColorscale(r,""),e.lineScale=g.tryColorscale(r,"line"),o.traceIs(t,"symbols")&&(e.ms2mrc=d.isBubble(t)?m(t):function(){return(r.size||6)/2}),t.selectedpoints&&u.extendFlat(e,g.makeSelectedPointStyleFns(t)),e},g.makeSelectedPointStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},i=t.marker||{},a=r.marker||{},s=n.marker||{},l=i.opacity,c=a.opacity,p=s.opacity,h=void 0!==c,d=void 0!==p;(u.isArrayOrTypedArray(l)||h||d)&&(e.selectedOpacityFn=function(t){var e=void 0===t.mo?i.opacity:t.mo;return t.selected?h?c:e:d?p:f*e});var m=i.color,y=a.color,g=s.color;(y||g)&&(e.selectedColorFn=function(t){var e=t.mcc||m;return t.selected?y||e:g||e});var v=i.size,_=a.size,x=s.size,b=void 0!==_,w=void 0!==x;return o.traceIs(t,"symbols")&&(b||w)&&(e.selectedSizeFn=function(t){var e=t.mrc||v/2;return t.selected?b?_/2:e:w?x/2:e}),e},g.makeSelectedTextStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},i=t.textfont||{},a=r.textfont||{},o=n.textfont||{},l=i.color,u=a.color,c=o.color;return e.selectedTextColorFn=function(t){var e=t.tc||l;return t.selected?u||e:c||(u?e:s.addOpacity(e,f))},e},g.selectedPointStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=g.makeSelectedPointStyleFns(e),i=e.marker||{},a=[];r.selectedOpacityFn&&a.push(function(t,e){t.style("opacity",r.selectedOpacityFn(e))}),r.selectedColorFn&&a.push(function(t,e){s.fill(t,r.selectedColorFn(e))}),r.selectedSizeFn&&a.push(function(t,e){var n=e.mx||i.symbol||0,a=r.selectedSizeFn(e);t.attr("d",b(g.symbolNumber(n),a)),e.mrc2=a}),a.length&&t.each(function(t){for(var e=n.select(this),r=0;r<a.length;r++)a[r](e,t)})}},g.tryColorscale=function(t,e){var r=e?u.nestedProperty(t,e).get():t;if(r){var n=r.color;if((r.colorscale||r._colorAx)&&u.isArrayOrTypedArray(n))return l.makeColorScaleFuncFromTrace(r)}return u.identity};var M={start:1,end:-1,middle:0,bottom:1,top:-1};function S(t,e,r,i){var a=n.select(t.node().parentNode),o=-1!==e.indexOf("top")?"top":-1!==e.indexOf("bottom")?"bottom":"middle",s=-1!==e.indexOf("left")?"end":-1!==e.indexOf("right")?"start":"middle",l=i?i/.8+1:0,u=(c.lineCount(t)-1)*h+1,p=M[s]*l,f=.75*r+M[o]*l+(M[o]-1)*u*r/2;t.attr("text-anchor",s),a.attr("transform","translate("+p+","+f+")")}function L(t,e){var r=t.ts||e.textfont.size;return i(r)&&r>0?r:0}g.textPointStyle=function(t,e,r){if(t.size()){var i;if(e.selectedpoints){var a=g.makeSelectedTextStyleFns(e);i=a.selectedTextColorFn}var o=e.texttemplate,s=r._fullLayout;t.each(function(t){var a=n.select(this),l=o?u.extractOption(t,e,"txt","texttemplate"):u.extractOption(t,e,"tx","text");if(l||0===l){if(o){var p=e._module.formatLabels?e._module.formatLabels(t,e,s):{},h={};y(h,e,t.i);var f=e._meta||{};l=u.texttemplateString(l,p,s._d3locale,h,t,f)}var d=t.tp||e.textposition,m=L(t,e),v=i?i(t):t.tc||e.textfont.color;a.call(g.font,t.tf||e.textfont.family,m,v).text(l).call(c.convertToTspans,r).call(S,d,m,t.mrc)}else a.remove()})}},g.selectedTextStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=g.makeSelectedTextStyleFns(e);t.each(function(t){var i=n.select(this),a=r.selectedTextColorFn(t),o=t.tp||e.textposition,l=L(t,e);s.fill(i,a),S(i,o,l,t.mrc2||t.mrc)})}};var C=.5;function E(t,e,r,i){var a=t[0]-e[0],o=t[1]-e[1],s=r[0]-e[0],l=r[1]-e[1],u=Math.pow(a*a+o*o,C/2),c=Math.pow(s*s+l*l,C/2),p=(c*c*a-u*u*s)*i,h=(c*c*o-u*u*l)*i,f=3*c*(u+c),d=3*u*(u+c);return[[n.round(e[0]+(f&&p/f),2),n.round(e[1]+(f&&h/f),2)],[n.round(e[0]-(d&&p/d),2),n.round(e[1]-(d&&h/d),2)]]}g.smoothopen=function(t,e){if(t.length<3)return"M"+t.join("L");var r,n="M"+t[0],i=[];for(r=1;r<t.length-1;r++)i.push(E(t[r-1],t[r],t[r+1],e));for(n+="Q"+i[0][0]+" "+t[1],r=2;r<t.length-1;r++)n+="C"+i[r-2][1]+" "+i[r-1][0]+" "+t[r];return n+="Q"+i[t.length-3][1]+" "+t[t.length-1]},g.smoothclosed=function(t,e){if(t.length<3)return"M"+t.join("L")+"Z";var r,n="M"+t[0],i=t.length-1,a=[E(t[i],t[0],t[1],e)];for(r=1;r<i;r++)a.push(E(t[r-1],t[r],t[r+1],e));for(a.push(E(t[i-1],t[i],t[0],e)),r=1;r<=i;r++)n+="C"+a[r-1][1]+" "+a[r][0]+" "+t[r];return n+="C"+a[i][1]+" "+a[0][0]+" "+t[0]+"Z"};var z={hv:function(t,e){return"H"+n.round(e[0],2)+"V"+n.round(e[1],2)},vh:function(t,e){return"V"+n.round(e[1],2)+"H"+n.round(e[0],2)},hvh:function(t,e){return"H"+n.round((t[0]+e[0])/2,2)+"V"+n.round(e[1],2)+"H"+n.round(e[0],2)},vhv:function(t,e){return"V"+n.round((t[1]+e[1])/2,2)+"H"+n.round(e[0],2)+"V"+n.round(e[1],2)}},P=function(t,e){return"L"+n.round(e[0],2)+","+n.round(e[1],2)};g.steps=function(t){var e=z[t]||P;return function(t){for(var r="M"+n.round(t[0][0],2)+","+n.round(t[0][1],2),i=1;i<t.length;i++)r+=e(t[i-1],t[i]);return r}},g.makeTester=function(){var t=u.ensureSingleById(n.select("body"),"svg","js-plotly-tester",function(t){t.attr(p.svgAttrs).style({position:"absolute",left:"-10000px",top:"-10000px",width:"9000px",height:"9000px","z-index":"1"})}),e=u.ensureSingle(t,"path","js-reference-point",function(t){t.attr("d","M0,0H1V1H0Z").style({"stroke-width":0,fill:"black"})});g.tester=t,g.testref=e},g.savedBBoxes={};var I=0;function D(t){var e=t.getAttribute("data-unformatted");if(null!==e)return e+t.getAttribute("data-math")+t.getAttribute("text-anchor")+t.getAttribute("style")}function O(t,e){if(!t)return null;var r=e._context;return"url('"+(r._exportedPlot?"":r._baseUrl||"")+"#"+t+"')"}g.bBox=function(t,e,r){var i,a,o;if(r||(r=D(t)),r){if(i=g.savedBBoxes[r])return u.extendFlat({},i)}else if(1===t.childNodes.length){var s=t.childNodes[0];if(r=D(s)){var l=+s.getAttribute("x")||0,p=+s.getAttribute("y")||0,h=s.getAttribute("transform");if(!h){var f=g.bBox(s,!1,r);return l&&(f.left+=l,f.right+=l),p&&(f.top+=p,f.bottom+=p),f}if(r+="~"+l+"~"+p+"~"+h,i=g.savedBBoxes[r])return u.extendFlat({},i)}}e?a=t:(o=g.tester.node(),a=t.cloneNode(!0),o.appendChild(a)),n.select(a).attr("transform",null).call(c.positionText,0,0);var d=a.getBoundingClientRect(),m=g.testref.node().getBoundingClientRect();e||o.removeChild(a);var y={height:d.height,width:d.width,left:d.left-m.left,top:d.top-m.top,right:d.right-m.left,bottom:d.bottom-m.top};return I>=1e4&&(g.savedBBoxes={},I=0),r&&(g.savedBBoxes[r]=y),I++,u.extendFlat({},y)},g.setClipUrl=function(t,e,r){t.attr("clip-path",O(e,r))},g.getTranslate=function(t){var e=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,function(t,e,r){return[e,r].join(" ")}).split(" ");return{x:+e[0]||0,y:+e[1]||0}},g.setTranslate=function(t,e,r){var n=t.attr?"attr":"getAttribute",i=t.attr?"attr":"setAttribute",a=t[n]("transform")||"";return e=e||0,r=r||0,a=a.replace(/(\btranslate\(.*?\);?)/,"").trim(),a=(a+=" translate("+e+", "+r+")").trim(),t[i]("transform",a),a},g.getScale=function(t){var e=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,function(t,e,r){return[e,r].join(" ")}).split(" ");return{x:+e[0]||1,y:+e[1]||1}},g.setScale=function(t,e,r){var n=t.attr?"attr":"getAttribute",i=t.attr?"attr":"setAttribute",a=t[n]("transform")||"";return e=e||1,r=r||1,a=a.replace(/(\bscale\(.*?\);?)/,"").trim(),a=(a+=" scale("+e+", "+r+")").trim(),t[i]("transform",a),a};var R=/\s*sc.*/;g.setPointGroupScale=function(t,e,r){if(e=e||1,r=r||1,t){var n=1===e&&1===r?"":" scale("+e+","+r+")";t.each(function(){var t=(this.getAttribute("transform")||"").replace(R,"");t=(t+=n).trim(),this.setAttribute("transform",t)})}};var F=/translate\([^)]*\)\s*$/;g.setTextPointsScale=function(t,e,r){t&&t.each(function(){var t,i=n.select(this),a=i.select("text");if(a.node()){var o=parseFloat(a.attr("x")||0),s=parseFloat(a.attr("y")||0),l=(i.attr("transform")||"").match(F);t=1===e&&1===r?[]:["translate("+o+","+s+")","scale("+e+","+r+")","translate("+-o+","+-s+")"],l&&t.push(l),i.attr("transform",t.join(" "))}})}},{"../../components/fx/helpers":85,"../../constants/alignment":144,"../../constants/interactions":146,"../../constants/xmlns_namespaces":148,"../../lib":169,"../../lib/svg_text_utils":190,"../../registry":261,"../../traces/scatter/make_bubble_size_func":309,"../../traces/scatter/subtypes":316,"../color":50,"../colorscale":62,"./symbol_defs":72,d3:14,"fast-isnumeric":16,tinycolor2:33}],72:[function(t,e,r){"use strict";var n=t("d3");e.exports={circle:{n:0,f:function(t){var e=n.round(t,2);return"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"}},square:{n:1,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"}},diamond:{n:2,f:function(t){var e=n.round(1.3*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"Z"}},cross:{n:3,f:function(t){var e=n.round(.4*t,2),r=n.round(1.2*t,2);return"M"+r+","+e+"H"+e+"V"+r+"H-"+e+"V"+e+"H-"+r+"V-"+e+"H-"+e+"V-"+r+"H"+e+"V-"+e+"H"+r+"Z"}},x:{n:4,f:function(t){var e=n.round(.8*t/Math.sqrt(2),2),r="l"+e+","+e,i="l"+e+",-"+e,a="l-"+e+",-"+e,o="l-"+e+","+e;return"M0,"+e+r+i+a+i+a+o+a+o+r+o+r+"Z"}},"triangle-up":{n:5,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+e+","+n.round(t/2,2)+"H"+e+"L0,-"+n.round(t,2)+"Z"}},"triangle-down":{n:6,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+e+",-"+n.round(t/2,2)+"H"+e+"L0,"+n.round(t,2)+"Z"}},"triangle-left":{n:7,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M"+n.round(t/2,2)+",-"+e+"V"+e+"L-"+n.round(t,2)+",0Z"}},"triangle-right":{n:8,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+n.round(t/2,2)+",-"+e+"V"+e+"L"+n.round(t,2)+",0Z"}},"triangle-ne":{n:9,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M-"+r+",-"+e+"H"+e+"V"+r+"Z"}},"triangle-se":{n:10,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M"+e+",-"+r+"V"+e+"H-"+r+"Z"}},"triangle-sw":{n:11,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M"+r+","+e+"H-"+e+"V-"+r+"Z"}},"triangle-nw":{n:12,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M-"+e+","+r+"V-"+e+"H"+r+"Z"}},pentagon:{n:13,f:function(t){var e=n.round(.951*t,2),r=n.round(.588*t,2),i=n.round(-t,2),a=n.round(-.309*t,2);return"M"+e+","+a+"L"+r+","+n.round(.809*t,2)+"H-"+r+"L-"+e+","+a+"L0,"+i+"Z"}},hexagon:{n:14,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),i=n.round(t*Math.sqrt(3)/2,2);return"M"+i+",-"+r+"V"+r+"L0,"+e+"L-"+i+","+r+"V-"+r+"L0,-"+e+"Z"}},hexagon2:{n:15,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),i=n.round(t*Math.sqrt(3)/2,2);return"M-"+r+","+i+"H"+r+"L"+e+",0L"+r+",-"+i+"H-"+r+"L-"+e+",0Z"}},octagon:{n:16,f:function(t){var e=n.round(.924*t,2),r=n.round(.383*t,2);return"M-"+r+",-"+e+"H"+r+"L"+e+",-"+r+"V"+r+"L"+r+","+e+"H-"+r+"L-"+e+","+r+"V-"+r+"Z"}},star:{n:17,f:function(t){var e=1.4*t,r=n.round(.225*e,2),i=n.round(.951*e,2),a=n.round(.363*e,2),o=n.round(.588*e,2),s=n.round(-e,2),l=n.round(-.309*e,2),u=n.round(.118*e,2),c=n.round(.809*e,2);return"M"+r+","+l+"H"+i+"L"+a+","+u+"L"+o+","+c+"L0,"+n.round(.382*e,2)+"L-"+o+","+c+"L-"+a+","+u+"L-"+i+","+l+"H-"+r+"L0,"+s+"Z"}},hexagram:{n:18,f:function(t){var e=n.round(.66*t,2),r=n.round(.38*t,2),i=n.round(.76*t,2);return"M-"+i+",0l-"+r+",-"+e+"h"+i+"l"+r+",-"+e+"l"+r+","+e+"h"+i+"l-"+r+","+e+"l"+r+","+e+"h-"+i+"l-"+r+","+e+"l-"+r+",-"+e+"h-"+i+"Z"}},"star-triangle-up":{n:19,f:function(t){var e=n.round(t*Math.sqrt(3)*.8,2),r=n.round(.8*t,2),i=n.round(1.6*t,2),a=n.round(4*t,2),o="A "+a+","+a+" 0 0 1 ";return"M-"+e+","+r+o+e+","+r+o+"0,-"+i+o+"-"+e+","+r+"Z"}},"star-triangle-down":{n:20,f:function(t){var e=n.round(t*Math.sqrt(3)*.8,2),r=n.round(.8*t,2),i=n.round(1.6*t,2),a=n.round(4*t,2),o="A "+a+","+a+" 0 0 1 ";return"M"+e+",-"+r+o+"-"+e+",-"+r+o+"0,"+i+o+e+",-"+r+"Z"}},"star-square":{n:21,f:function(t){var e=n.round(1.1*t,2),r=n.round(2*t,2),i="A "+r+","+r+" 0 0 1 ";return"M-"+e+",-"+e+i+"-"+e+","+e+i+e+","+e+i+e+",-"+e+i+"-"+e+",-"+e+"Z"}},"star-diamond":{n:22,f:function(t){var e=n.round(1.4*t,2),r=n.round(1.9*t,2),i="A "+r+","+r+" 0 0 1 ";return"M-"+e+",0"+i+"0,"+e+i+e+",0"+i+"0,-"+e+i+"-"+e+",0Z"}},"diamond-tall":{n:23,f:function(t){var e=n.round(.7*t,2),r=n.round(1.4*t,2);return"M0,"+r+"L"+e+",0L0,-"+r+"L-"+e+",0Z"}},"diamond-wide":{n:24,f:function(t){var e=n.round(1.4*t,2),r=n.round(.7*t,2);return"M0,"+r+"L"+e+",0L0,-"+r+"L-"+e+",0Z"}},hourglass:{n:25,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"H-"+e+"L"+e+",-"+e+"H-"+e+"Z"},noDot:!0},bowtie:{n:26,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"V-"+e+"L-"+e+","+e+"V-"+e+"Z"},noDot:!0},"circle-cross":{n:27,f:function(t){var e=n.round(t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"},needLine:!0,noDot:!0},"circle-x":{n:28,f:function(t){var e=n.round(t,2),r=n.round(t/Math.sqrt(2),2);return"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r+"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"},needLine:!0,noDot:!0},"square-cross":{n:29,f:function(t){var e=n.round(t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"},needLine:!0,noDot:!0},"square-x":{n:30,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e+"M"+e+",-"+e+"L-"+e+","+e+"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"},needLine:!0,noDot:!0},"diamond-cross":{n:31,f:function(t){var e=n.round(1.3*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"ZM0,-"+e+"V"+e+"M-"+e+",0H"+e},needLine:!0,noDot:!0},"diamond-x":{n:32,f:function(t){var e=n.round(1.3*t,2),r=n.round(.65*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"ZM-"+r+",-"+r+"L"+r+","+r+"M-"+r+","+r+"L"+r+",-"+r},needLine:!0,noDot:!0},"cross-thin":{n:33,f:function(t){var e=n.round(1.4*t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e},needLine:!0,noDot:!0,noFill:!0},"x-thin":{n:34,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e+"M"+e+",-"+e+"L-"+e+","+e},needLine:!0,noDot:!0,noFill:!0},asterisk:{n:35,f:function(t){var e=n.round(1.2*t,2),r=n.round(.85*t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r},needLine:!0,noDot:!0,noFill:!0},hash:{n:36,f:function(t){var e=n.round(t/2,2),r=n.round(t,2);return"M"+e+","+r+"V-"+r+"m-"+r+",0V"+r+"M"+r+","+e+"H-"+r+"m0,-"+r+"H"+r},needLine:!0,noFill:!0},"y-up":{n:37,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M-"+e+","+i+"L0,0M"+e+","+i+"L0,0M0,-"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-down":{n:38,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M-"+e+",-"+i+"L0,0M"+e+",-"+i+"L0,0M0,"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-left":{n:39,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M"+i+","+e+"L0,0M"+i+",-"+e+"L0,0M-"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-right":{n:40,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M-"+i+","+e+"L0,0M-"+i+",-"+e+"L0,0M"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"line-ew":{n:41,f:function(t){var e=n.round(1.4*t,2);return"M"+e+",0H-"+e},needLine:!0,noDot:!0,noFill:!0},"line-ns":{n:42,f:function(t){var e=n.round(1.4*t,2);return"M0,"+e+"V-"+e},needLine:!0,noDot:!0,noFill:!0},"line-ne":{n:43,f:function(t){var e=n.round(t,2);return"M"+e+",-"+e+"L-"+e+","+e},needLine:!0,noDot:!0,noFill:!0},"line-nw":{n:44,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e},needLine:!0,noDot:!0,noFill:!0}}},{d3:14}],73:[function(t,e,r){"use strict";e.exports={visible:{valType:"boolean",editType:"calc"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"],editType:"calc"},symmetric:{valType:"boolean",editType:"calc"},array:{valType:"data_array",editType:"calc"},arrayminus:{valType:"data_array",editType:"calc"},value:{valType:"number",min:0,dflt:10,editType:"calc"},valueminus:{valType:"number",min:0,dflt:10,editType:"calc"},traceref:{valType:"integer",min:0,dflt:0,editType:"style"},tracerefminus:{valType:"integer",min:0,dflt:0,editType:"style"},copy_ystyle:{valType:"boolean",editType:"plot"},copy_zstyle:{valType:"boolean",editType:"style"},color:{valType:"color",editType:"style"},thickness:{valType:"number",min:0,dflt:2,editType:"style"},width:{valType:"number",min:0,editType:"plot"},editType:"calc",_deprecated:{opacity:{valType:"number",editType:"style"}}}},{}],74:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../registry"),a=t("../../plots/cartesian/axes"),o=t("../../lib"),s=t("./compute_error");function l(t,e,r,i){var l=e["error_"+i]||{},u=[];if(l.visible&&-1!==["linear","log"].indexOf(r.type)){for(var c=s(l),p=0;p<t.length;p++){var h=t[p],f=h.i;if(void 0===f)f=p;else if(null===f)continue;var d=h[i];if(n(r.c2l(d))){var m=c(d,f);if(n(m[0])&&n(m[1])){var y=h[i+"s"]=d-m[0],g=h[i+"h"]=d+m[1];u.push(y,g)}}}var v=r._id,_=e._extremes[v],x=a.findExtremes(r,u,o.extendFlat({tozero:_.opts.tozero},{padded:!0}));_.min=_.min.concat(x.min),_.max=_.max.concat(x.max)}}e.exports=function(t){for(var e=t.calcdata,r=0;r<e.length;r++){var n=e[r],o=n[0].trace;if(!0===o.visible&&i.traceIs(o,"errorBarsOK")){var s=a.getFromId(t,o.xaxis),u=a.getFromId(t,o.yaxis);l(n,o,s,"x"),l(n,o,u,"y")}}}},{"../../lib":169,"../../plots/cartesian/axes":213,"../../registry":261,"./compute_error":75,"fast-isnumeric":16}],75:[function(t,e,r){"use strict";function n(t,e){return"percent"===t?function(t){return Math.abs(t*e/100)}:"constant"===t?function(){return Math.abs(e)}:"sqrt"===t?function(t){return Math.sqrt(Math.abs(t))}:void 0}e.exports=function(t){var e=t.type,r=t.symmetric;if("data"===e){var i=t.array||[];if(r)return function(t,e){var r=+i[e];return[r,r]};var a=t.arrayminus||[];return function(t,e){var r=+i[e],n=+a[e];return isNaN(r)&&isNaN(n)?[NaN,NaN]:[n||0,r||0]}}var o=n(e,t.value),s=n(e,t.valueminus);return r||void 0===t.valueminus?function(t){var e=o(t);return[e,e]}:function(t){return[s(t),o(t)]}}},{}],76:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../registry"),a=t("../../lib"),o=t("../../plot_api/plot_template"),s=t("./attributes");e.exports=function(t,e,r,l){var u="error_"+l.axis,c=o.newContainer(e,u),p=t[u]||{};function h(t,e){return a.coerce(p,c,s,t,e)}if(!1!==h("visible",void 0!==p.array||void 0!==p.value||"sqrt"===p.type)){var f=h("type","array"in p?"data":"percent"),d=!0;"sqrt"!==f&&(d=h("symmetric",!(("data"===f?"arrayminus":"valueminus")in p))),"data"===f?(h("array"),h("traceref"),d||(h("arrayminus"),h("tracerefminus"))):"percent"!==f&&"constant"!==f||(h("value"),d||h("valueminus"));var m="copy_"+l.inherit+"style";if(l.inherit)(e["error_"+l.inherit]||{}).visible&&h(m,!(p.color||n(p.thickness)||n(p.width)));l.inherit&&c[m]||(h("color",r),h("thickness"),h("width",i.traceIs(e,"gl3d")?0:4))}}},{"../../lib":169,"../../plot_api/plot_template":203,"../../registry":261,"./attributes":73,"fast-isnumeric":16}],77:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plot_api/edit_types").overrideAll,a=t("./attributes"),o={error_x:n.extendFlat({},a),error_y:n.extendFlat({},a)};delete o.error_x.copy_zstyle,delete o.error_y.copy_zstyle,delete o.error_y.copy_ystyle;var s={error_x:n.extendFlat({},a),error_y:n.extendFlat({},a),error_z:n.extendFlat({},a)};delete s.error_x.copy_ystyle,delete s.error_y.copy_ystyle,delete s.error_z.copy_ystyle,delete s.error_z.copy_zstyle,e.exports={moduleType:"component",name:"errorbars",schema:{traces:{scatter:o,bar:o,histogram:o,scatter3d:i(s,"calc","nested"),scattergl:i(o,"calc","nested")}},supplyDefaults:t("./defaults"),calc:t("./calc"),makeComputeError:t("./compute_error"),plot:t("./plot"),style:t("./style"),hoverInfo:function(t,e,r){(e.error_y||{}).visible&&(r.yerr=t.yh-t.y,e.error_y.symmetric||(r.yerrneg=t.y-t.ys));(e.error_x||{}).visible&&(r.xerr=t.xh-t.x,e.error_x.symmetric||(r.xerrneg=t.x-t.xs))}}},{"../../lib":169,"../../plot_api/edit_types":196,"./attributes":73,"./calc":74,"./compute_error":75,"./defaults":76,"./plot":78,"./style":79}],78:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("../drawing"),o=t("../../traces/scatter/subtypes");e.exports=function(t,e,r,s){var l=r.xaxis,u=r.yaxis,c=s&&s.duration>0;e.each(function(e){var p,h=e[0].trace,f=h.error_x||{},d=h.error_y||{};h.ids&&(p=function(t){return t.id});var m=o.hasMarkers(h)&&h.marker.maxdisplayed>0;d.visible||f.visible||(e=[]);var y=n.select(this).selectAll("g.errorbar").data(e,p);if(y.exit().remove(),e.length){f.visible||y.selectAll("path.xerror").remove(),d.visible||y.selectAll("path.yerror").remove(),y.style("opacity",1);var g=y.enter().append("g").classed("errorbar",!0);c&&g.style("opacity",0).transition().duration(s.duration).style("opacity",1),a.setClipUrl(y,r.layerClipId,t),y.each(function(t){var e=n.select(this),r=function(t,e,r){var n={x:e.c2p(t.x),y:r.c2p(t.y)};void 0!==t.yh&&(n.yh=r.c2p(t.yh),n.ys=r.c2p(t.ys),i(n.ys)||(n.noYS=!0,n.ys=r.c2p(t.ys,!0)));void 0!==t.xh&&(n.xh=e.c2p(t.xh),n.xs=e.c2p(t.xs),i(n.xs)||(n.noXS=!0,n.xs=e.c2p(t.xs,!0)));return n}(t,l,u);if(!m||t.vis){var a,o=e.select("path.yerror");if(d.visible&&i(r.x)&&i(r.yh)&&i(r.ys)){var p=d.width;a="M"+(r.x-p)+","+r.yh+"h"+2*p+"m-"+p+",0V"+r.ys,r.noYS||(a+="m-"+p+",0h"+2*p),!o.size()?o=e.append("path").style("vector-effect","non-scaling-stroke").classed("yerror",!0):c&&(o=o.transition().duration(s.duration).ease(s.easing)),o.attr("d",a)}else o.remove();var h=e.select("path.xerror");if(f.visible&&i(r.y)&&i(r.xh)&&i(r.xs)){var y=(f.copy_ystyle?d:f).width;a="M"+r.xh+","+(r.y-y)+"v"+2*y+"m0,-"+y+"H"+r.xs,r.noXS||(a+="m0,-"+y+"v"+2*y),!h.size()?h=e.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0):c&&(h=h.transition().duration(s.duration).ease(s.easing)),h.attr("d",a)}else h.remove()}})}})}},{"../../traces/scatter/subtypes":316,"../drawing":71,d3:14,"fast-isnumeric":16}],79:[function(t,e,r){"use strict";var n=t("d3"),i=t("../color");e.exports=function(t){t.each(function(t){var e=t[0].trace,r=e.error_y||{},a=e.error_x||{},o=n.select(this);o.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(i.stroke,r.color),a.copy_ystyle&&(a=r),o.selectAll("path.xerror").style("stroke-width",a.thickness+"px").call(i.stroke,a.color)})}},{"../color":50,d3:14}],80:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("./layout_attributes").hoverlabel,a=t("../../lib/extend").extendFlat;e.exports={hoverlabel:{bgcolor:a({},i.bgcolor,{arrayOk:!0}),bordercolor:a({},i.bordercolor,{arrayOk:!0}),font:n({arrayOk:!0,editType:"none"}),align:a({},i.align,{arrayOk:!0}),namelength:a({},i.namelength,{arrayOk:!0}),editType:"none"}}},{"../../lib/extend":162,"../../plots/font_attributes":239,"./layout_attributes":89}],81:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry");function a(t,e,r,i){i=i||n.identity,Array.isArray(t)&&(e[0][r]=i(t))}e.exports=function(t){var e=t.calcdata,r=t._fullLayout;function o(t){return function(e){return n.coerceHoverinfo({hoverinfo:e},{_module:t._module},r)}}for(var s=0;s<e.length;s++){var l=e[s],u=l[0].trace;if(!i.traceIs(u,"pie-like")){var c=i.traceIs(u,"2dMap")?a:n.fillArray;c(u.hoverinfo,l,"hi",o(u)),u.hovertemplate&&c(u.hovertemplate,l,"ht"),u.hoverlabel&&(c(u.hoverlabel.bgcolor,l,"hbg"),c(u.hoverlabel.bordercolor,l,"hbc"),c(u.hoverlabel.font.size,l,"hts"),c(u.hoverlabel.font.color,l,"htc"),c(u.hoverlabel.font.family,l,"htf"),c(u.hoverlabel.namelength,l,"hnl"),c(u.hoverlabel.align,l,"hta"))}}}},{"../../lib":169,"../../registry":261}],82:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("./hover").hover;e.exports=function(t,e,r){var a=n.getComponentMethod("annotations","onClick")(t,t._hoverdata);function o(){t.emit("plotly_click",{points:t._hoverdata,event:e})}void 0!==r&&i(t,e,r,!0),t._hoverdata&&e&&e.target&&(a&&a.then?a.then(o):o(),e.stopImmediatePropagation&&e.stopImmediatePropagation())}},{"../../registry":261,"./hover":86}],83:[function(t,e,r){"use strict";e.exports={YANGLE:60,HOVERARROWSIZE:6,HOVERTEXTPAD:3,HOVERFONTSIZE:13,HOVERFONT:"Arial, sans-serif",HOVERMINTIME:50,HOVERID:"-hover"}},{}],84:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes"),a=t("./hoverlabel_defaults");e.exports=function(t,e,r,o){var s=n.extendFlat({},o.hoverlabel);e.hovertemplate&&(s.namelength=-1),a(t,e,function(r,a){return n.coerce(t,e,i,r,a)},s)}},{"../../lib":169,"./attributes":80,"./hoverlabel_defaults":87}],85:[function(t,e,r){"use strict";var n=t("../../lib");r.getSubplot=function(t){return t.subplot||t.xaxis+t.yaxis||t.geo},r.isTraceInSubplots=function(t,e){if("splom"===t.type){for(var n=t.xaxes||[],i=t.yaxes||[],a=0;a<n.length;a++)for(var o=0;o<i.length;o++)if(-1!==e.indexOf(n[a]+i[o]))return!0;return!1}return-1!==e.indexOf(r.getSubplot(t))},r.flat=function(t,e){for(var r=new Array(t.length),n=0;n<t.length;n++)r[n]=e;return r},r.p2c=function(t,e){for(var r=new Array(t.length),n=0;n<t.length;n++)r[n]=t[n].p2c(e);return r},r.getDistanceFunction=function(t,e,n,i){return"closest"===t?i||r.quadrature(e,n):"x"===t?e:n},r.getClosest=function(t,e,r){if(!1!==r.index)r.index>=0&&r.index<t.length?r.distance=0:r.index=!1;else for(var n=0;n<t.length;n++){var i=e(t[n]);i<=r.distance&&(r.index=n,r.distance=i)}return r},r.inbox=function(t,e,r){return t*e<0||0===t?r:1/0},r.quadrature=function(t,e){return function(r){var n=t(r),i=e(r);return Math.sqrt(n*n+i*i)}},r.makeEventData=function(t,e,n){var i="index"in t?t.index:t.pointNumber,a={data:e._input,fullData:e,curveNumber:e.index,pointNumber:i};if(e._indexToPoints){var o=e._indexToPoints[i];1===o.length?a.pointIndex=o[0]:a.pointIndices=o}else a.pointIndex=i;return e._module.eventData?a=e._module.eventData(a,t,e,n,i):("xVal"in t?a.x=t.xVal:"x"in t&&(a.x=t.x),"yVal"in t?a.y=t.yVal:"y"in t&&(a.y=t.y),t.xa&&(a.xaxis=t.xa),t.ya&&(a.yaxis=t.ya),void 0!==t.zLabelVal&&(a.z=t.zLabelVal)),r.appendArrayPointValue(a,e,i),a},r.appendArrayPointValue=function(t,e,r){var i=e._arrayAttrs;if(i)for(var s=0;s<i.length;s++){var l=i[s],u=a(l);if(void 0===t[u]){var c=o(n.nestedProperty(e,l).get(),r);void 0!==c&&(t[u]=c)}}},r.appendArrayMultiPointValues=function(t,e,r){var i=e._arrayAttrs;if(i)for(var s=0;s<i.length;s++){var l=i[s],u=a(l);if(void 0===t[u]){for(var c=n.nestedProperty(e,l).get(),p=new Array(r.length),h=0;h<r.length;h++)p[h]=o(c,r[h]);t[u]=p}}};var i={ids:"id",locations:"location",labels:"label",values:"value","marker.colors":"color",parents:"parent"};function a(t){return i[t]||t}function o(t,e){return Array.isArray(e)?Array.isArray(t)&&Array.isArray(t[e[0]])?t[e[0]][e[1]]:void 0:t[e]}},{"../../lib":169}],86:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("tinycolor2"),o=t("../../lib"),s=t("../../lib/events"),l=t("../../lib/svg_text_utils"),u=t("../../lib/override_cursor"),c=t("../drawing"),p=t("../color"),h=t("../dragelement"),f=t("../../plots/cartesian/axes"),d=t("../../registry"),m=t("./helpers"),y=t("./constants"),g=y.YANGLE,v=Math.PI*g/180,_=1/Math.sin(v),x=Math.cos(v),b=Math.sin(v),w=y.HOVERARROWSIZE,k=y.HOVERTEXTPAD;r.hover=function(t,e,r,a){t=o.getGraphDiv(t),o.throttle(t._fullLayout._uid+y.HOVERID,y.HOVERMINTIME,function(){!function(t,e,r,a){r||(r="xy");var l=Array.isArray(r)?r:[r],c=t._fullLayout,f=c._plots||[],y=f[r],g=c._has("cartesian");if(y){var v=y.overlays.map(function(t){return t.id});l=l.concat(v)}for(var x=l.length,b=new Array(x),w=new Array(x),k=!1,T=0;T<x;T++){var E=l[T];if(f[E])k=!0,b[T]=f[E].xaxis,w[T]=f[E].yaxis;else{if(!c[E]||!c[E]._subplot)return void o.warn("Unrecognized subplot: "+E);var z=c[E]._subplot;b[T]=z.xaxis,w[T]=z.yaxis}}var P=e.hovermode||c.hovermode;P&&!k&&(P="closest");if(-1===["x","y","closest"].indexOf(P)||!t.calcdata||t.querySelector(".zoombox")||t._dragging)return h.unhoverRaw(t,e);var I,D,O,R,F,B,N,U,j,V,q,G,H,Z=-1===c.hoverdistance?1/0:c.hoverdistance,X=-1===c.spikedistance?1/0:c.spikedistance,W=[],Y=[],K={hLinePoint:null,vLinePoint:null},J=!1;if(Array.isArray(e))for(P="array",O=0;O<e.length;O++)(F=t.calcdata[e[O].curveNumber||0])&&(B=F[0].trace,"skip"!==F[0].trace.hoverinfo&&(Y.push(F),"h"===B.orientation&&(J=!0)));else{for(R=0;R<t.calcdata.length;R++)F=t.calcdata[R],"skip"!==(B=F[0].trace).hoverinfo&&m.isTraceInSubplots(B,l)&&(Y.push(F),"h"===B.orientation&&(J=!0));var $,Q,tt=!e.target;if(tt)$="xpx"in e?e.xpx:b[0]._length/2,Q="ypx"in e?e.ypx:w[0]._length/2;else{if(!1===s.triggerHandler(t,"plotly_beforehover",e))return;var et=e.target.getBoundingClientRect();if($=e.clientX-et.left,Q=e.clientY-et.top,$<0||$>b[0]._length||Q<0||Q>w[0]._length)return h.unhoverRaw(t,e)}if(e.pointerX=$+b[0]._offset,e.pointerY=Q+w[0]._offset,I="xval"in e?m.flat(l,e.xval):m.p2c(b,$),D="yval"in e?m.flat(l,e.yval):m.p2c(w,Q),!i(I[0])||!i(D[0]))return o.warn("Fx.hover failed",e,t),h.unhoverRaw(t,e)}var rt=1/0;for(R=0;R<Y.length;R++)if((F=Y[R])&&F[0]&&F[0].trace&&!0===(B=F[0].trace).visible&&0!==B._length&&-1===["carpet","contourcarpet"].indexOf(B._module.name)){if("splom"===B.type?N=l[U=0]:(N=m.getSubplot(B),U=l.indexOf(N)),j=P,G={cd:F,trace:B,xa:b[U],ya:w[U],maxHoverDistance:Z,maxSpikeDistance:X,index:!1,distance:Math.min(rt,Z),spikeDistance:1/0,xSpike:void 0,ySpike:void 0,color:p.defaultLine,name:B.name,x0:void 0,x1:void 0,y0:void 0,y1:void 0,xLabelVal:void 0,yLabelVal:void 0,zLabelVal:void 0,text:void 0},c[N]&&(G.subplot=c[N]._subplot),c._splomScenes&&c._splomScenes[B.uid]&&(G.scene=c._splomScenes[B.uid]),H=W.length,"array"===j){var nt=e[R];"pointNumber"in nt?(G.index=nt.pointNumber,j="closest"):(j="","xval"in nt&&(V=nt.xval,j="x"),"yval"in nt&&(q=nt.yval,j=j?"closest":"y"))}else V=I[U],q=D[U];if(0!==Z)if(B._module&&B._module.hoverPoints){var it=B._module.hoverPoints(G,V,q,j,c._hoverlayer);if(it)for(var at,ot=0;ot<it.length;ot++)at=it[ot],i(at.x0)&&i(at.y0)&&W.push(S(at,P))}else o.log("Unrecognized trace type in hover:",B);if("closest"===P&&W.length>H&&(W.splice(0,H),rt=W[0].distance),g&&0!==X&&0===W.length){G.distance=X,G.index=!1;var st=B._module.hoverPoints(G,V,q,"closest",c._hoverlayer);if(st&&(st=st.filter(function(t){return t.spikeDistance<=X})),st&&st.length){var lt,ut=st.filter(function(t){return t.xa.showspikes});if(ut.length){var ct=ut[0];i(ct.x0)&&i(ct.y0)&&(lt=dt(ct),(!K.vLinePoint||K.vLinePoint.spikeDistance>lt.spikeDistance)&&(K.vLinePoint=lt))}var pt=st.filter(function(t){return t.ya.showspikes});if(pt.length){var ht=pt[0];i(ht.x0)&&i(ht.y0)&&(lt=dt(ht),(!K.hLinePoint||K.hLinePoint.spikeDistance>lt.spikeDistance)&&(K.hLinePoint=lt))}}}}function ft(t,e){for(var r,n=null,i=1/0,a=0;a<t.length;a++)(r=t[a].spikeDistance)<i&&r<=e&&(n=t[a],i=r);return n}function dt(t){return t?{xa:t.xa,ya:t.ya,x:void 0!==t.xSpike?t.xSpike:(t.x0+t.x1)/2,y:void 0!==t.ySpike?t.ySpike:(t.y0+t.y1)/2,distance:t.distance,spikeDistance:t.spikeDistance,curveNumber:t.trace.index,color:t.color,pointNumber:t.index}:null}var mt={fullLayout:c,container:c._hoverlayer,outerContainer:c._paperdiv,event:e},yt=t._spikepoints,gt={vLinePoint:K.vLinePoint,hLinePoint:K.hLinePoint};if(t._spikepoints=gt,g&&0!==X&&0!==W.length){var vt=W.filter(function(t){return t.ya.showspikes}),_t=ft(vt,X);K.hLinePoint=dt(_t);var xt=W.filter(function(t){return t.xa.showspikes}),bt=ft(xt,X);K.vLinePoint=dt(bt)}if(0===W.length){var wt=h.unhoverRaw(t,e);return!g||null===K.hLinePoint&&null===K.vLinePoint||C(yt)&&L(t,K,mt),wt}g&&C(yt)&&L(t,K,mt);W.sort(function(t,e){return t.distance-e.distance});var kt=t._hoverdata,Tt=[];for(O=0;O<W.length;O++){var At=W[O],Mt=m.makeEventData(At,At.trace,At.cd);if(!1!==At.hovertemplate){var St=!1;At.cd[At.index]&&At.cd[At.index].ht&&(St=At.cd[At.index].ht),At.hovertemplate=St||At.trace.hovertemplate||!1}At.eventData=[Mt],Tt.push(Mt)}t._hoverdata=Tt;var Lt="y"===P&&(Y.length>1||W.length>1)||"closest"===P&&J&&W.length>1,Ct=p.combine(c.plot_bgcolor||p.background,c.paper_bgcolor),Et={hovermode:P,rotateLabels:Lt,bgColor:Ct,container:c._hoverlayer,outerContainer:c._paperdiv,commonLabelOpts:c.hoverlabel,hoverdistance:c.hoverdistance},zt=A(W,Et,t);if(function(t,e,r){var n,i,a,o,s,l,u,c=0,p=1,h=t.size(),f=new Array(h),d=0;function m(t){var e=t[0],r=t[t.length-1];if(i=e.pmin-e.pos-e.dp+e.size,a=r.pos+r.dp+r.size-e.pmax,i>.01){for(s=t.length-1;s>=0;s--)t[s].dp+=i;n=!1}if(!(a<.01)){if(i<-.01){for(s=t.length-1;s>=0;s--)t[s].dp-=a;n=!1}if(n){var u=0;for(o=0;o<t.length;o++)(l=t[o]).pos+l.dp+l.size>e.pmax&&u++;for(o=t.length-1;o>=0&&!(u<=0);o--)(l=t[o]).pos>e.pmax-1&&(l.del=!0,u--);for(o=0;o<t.length&&!(u<=0);o++)if((l=t[o]).pos<e.pmin+1)for(l.del=!0,u--,a=2*l.size,s=t.length-1;s>=0;s--)t[s].dp-=a;for(o=t.length-1;o>=0&&!(u<=0);o--)(l=t[o]).pos+l.dp+l.size>e.pmax&&(l.del=!0,u--)}}}for(t.each(function(t){var n=t[e],i="x"===n._id.charAt(0),a=n.range;0===d&&a&&a[0]>a[1]!==i&&(p=-1),f[d++]=[{datum:t,traceIndex:t.trace.index,dp:0,pos:t.pos,posref:t.posref,size:t.by*(i?_:1)/2,pmin:0,pmax:i?r.width:r.height}]}),f.sort(function(t,e){return t[0].posref-e[0].posref||p*(e[0].traceIndex-t[0].traceIndex)});!n&&c<=h;){for(c++,n=!0,o=0;o<f.length-1;){var y=f[o],g=f[o+1],v=y[y.length-1],x=g[0];if((i=v.pos+v.dp+v.size-x.pos-x.dp+x.size)>.01&&v.pmin===x.pmin&&v.pmax===x.pmax){for(s=g.length-1;s>=0;s--)g[s].dp+=i;for(y.push.apply(y,g),f.splice(o+1,1),u=0,s=y.length-1;s>=0;s--)u+=y[s].dp;for(a=u/y.length,s=y.length-1;s>=0;s--)y[s].dp-=a;n=!1}else o++}f.forEach(m)}for(o=f.length-1;o>=0;o--){var b=f[o];for(s=b.length-1;s>=0;s--){var w=b[s],k=w.datum;k.offset=w.dp,k.del=w.del}}}(zt,Lt?"xa":"ya",c),M(zt,Lt),e.target&&e.target.tagName){var Pt=d.getComponentMethod("annotations","hasClickToShow")(t,Tt);u(n.select(e.target),Pt?"pointer":"")}if(!e.target||a||!function(t,e,r){if(!r||r.length!==t._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var i=r[n],a=t._hoverdata[n];if(i.curveNumber!==a.curveNumber||String(i.pointNumber)!==String(a.pointNumber)||String(i.pointNumbers)!==String(a.pointNumbers))return!0}return!1}(t,0,kt))return;kt&&t.emit("plotly_unhover",{event:e,points:kt});t.emit("plotly_hover",{event:e,points:t._hoverdata,xaxes:b,yaxes:w,xvals:I,yvals:D})}(t,e,r,a)})},r.loneHover=function(t,e){var r=!0;Array.isArray(t)||(r=!1,t=[t]);var i=t.map(function(t){return{color:t.color||p.defaultLine,x0:t.x0||t.x||0,x1:t.x1||t.x||0,y0:t.y0||t.y||0,y1:t.y1||t.y||0,xLabel:t.xLabel,yLabel:t.yLabel,zLabel:t.zLabel,text:t.text,name:t.name,idealAlign:t.idealAlign,borderColor:t.borderColor,fontFamily:t.fontFamily,fontSize:t.fontSize,fontColor:t.fontColor,nameLength:t.nameLength,textAlign:t.textAlign,trace:t.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:t.hovertemplate||!1,eventData:t.eventData||!1,hovertemplateLabels:t.hovertemplateLabels||!1}}),a=n.select(e.container),o=e.outerContainer?n.select(e.outerContainer):a,s={hovermode:"closest",rotateLabels:!1,bgColor:e.bgColor||p.background,container:a,outerContainer:o},l=A(i,s,e.gd),u=0,c=0;return l.sort(function(t,e){return t.y0-e.y0}).each(function(t,r){var n=t.y0-t.by/2;t.offset=n-5<u?u-n+5:0,u=n+t.by+t.offset,r===e.anchorIndex&&(c=t.offset)}).each(function(t){t.offset-=c}),M(l,s.rotateLabels),r?l:l.node()};var T=/<extra>([\s\S]*)<\/extra>/;function A(t,e,r){var i=r._fullLayout,a=e.hovermode,s=e.rotateLabels,u=e.bgColor,h=e.container,f=e.outerContainer,d=e.commonLabelOpts||{},m=e.fontFamily||y.HOVERFONT,v=e.fontSize||y.HOVERFONTSIZE,_=t[0],x=_.xa,b=_.ya,A="y"===a?"yLabel":"xLabel",M=_[A],S=(String(M)||"").split(" ")[0],L=f.node().getBoundingClientRect(),C=L.top,z=L.width,P=L.height,I=void 0!==M&&_.distance<=e.hoverdistance&&("x"===a||"y"===a);if(I){var D,O,R=!0;for(D=0;D<t.length;D++)if(R&&void 0===t[D].zLabel&&(R=!1),O=t[D].hoverinfo||t[D].trace.hoverinfo){var F=Array.isArray(O)?O:O.split("+");if(-1===F.indexOf("all")&&-1===F.indexOf(a)){I=!1;break}}R&&(I=!1)}var B=h.selectAll("g.axistext").data(I?[0]:[]);B.enter().append("g").classed("axistext",!0),B.exit().remove(),B.each(function(){var e=n.select(this),s=o.ensureSingle(e,"path","",function(t){t.style({"stroke-width":"1px"})}),u=o.ensureSingle(e,"text","",function(t){t.attr("data-notex",1)}),h=d.bgcolor||p.defaultLine,f=d.bordercolor||p.contrast(h),y=p.contrast(h),g={family:d.font.family||m,size:d.font.size||v,color:d.font.color||y};s.style({fill:h,stroke:f}),u.text(M).call(c.font,g).call(l.positionText,0,0).call(l.convertToTspans,r),e.attr("transform","");var T,L,E=u.node().getBoundingClientRect();if("x"===a){var z="top"===x.side?"-":"";u.attr("text-anchor","middle").call(l.positionText,0,"top"===x.side?C-E.bottom-w-k:C-E.top+w+k),T=x._offset+(_.x0+_.x1)/2,L=b._offset+("top"===x.side?0:b._length);var P=E.width/2+k;T<P?(T=P,s.attr("d","M-"+(P-w)+",0L-"+(P-2*w)+","+z+w+"H"+(k+E.width/2)+"v"+z+(2*k+E.height)+"H-"+P+"V"+z+w+"Z")):T>i.width-P?(T=i.width-P,s.attr("d","M"+(P-w)+",0L"+P+","+z+w+"v"+z+(2*k+E.height)+"H-"+P+"V"+z+w+"H"+(P-2*w)+"Z")):s.attr("d","M0,0L"+w+","+z+w+"H"+(k+E.width/2)+"v"+z+(2*k+E.height)+"H-"+(k+E.width/2)+"V"+z+w+"H-"+w+"Z")}else{var I,D,O;"right"===b.side?(I="start",D=1,O="",T=x._offset+x._length):(I="end",D=-1,O="-",T=x._offset),L=b._offset+(_.y0+_.y1)/2,u.attr("text-anchor",I),s.attr("d","M0,0L"+O+w+","+w+"V"+(k+E.height/2)+"h"+O+(2*k+E.width)+"V-"+(k+E.height/2)+"H"+O+w+"V-"+w+"Z");var R,F=E.height/2,B=C-E.top-F,N="clip"+i._uid+"commonlabel"+b._id;if(T<E.width+2*k+w){R="M-"+(w+k)+"-"+F+"h-"+(E.width-k)+"V"+F+"h"+(E.width-k)+"Z";var U=E.width-T+k;l.positionText(u,U,B),"end"===I&&u.selectAll("tspan").each(function(){var t=n.select(this),e=c.tester.append("text").text(t.text()).call(c.font,g),r=e.node().getBoundingClientRect();Math.round(r.width)<Math.round(E.width)&&t.attr("x",U-r.width),e.remove()})}else l.positionText(u,D*(k+w),B),R=null;var j=i._topclips.selectAll("#"+N).data(R?[0]:[]);j.enter().append("clipPath").attr("id",N).append("path"),j.exit().remove(),j.select("path").attr("d",R),c.setClipUrl(u,R?N:null,r)}e.attr("transform","translate("+T+","+L+")"),t=t.filter(function(t){return void 0!==t.zLabelVal||(t[A]||"").split(" ")[0]===S})});var N=h.selectAll("g.hovertext").data(t,function(t){return[t.trace.index,t.index,t.x0,t.y0,t.name,t.attr,t.xa,t.ya||""].join(",")});return N.enter().append("g").classed("hovertext",!0).each(function(){var t=n.select(this);t.append("rect").call(p.fill,p.addOpacity(u,.8)),t.append("text").classed("name",!0),t.append("path").style("stroke-width","1px"),t.append("text").classed("nums",!0).call(c.font,m,v)}),N.exit().remove(),N.each(function(t){var e=n.select(this).attr("transform",""),h="",f="",d=t.bgcolor||t.color,y=p.combine(p.opacity(d)?d:p.defaultLine,u),_=p.combine(p.opacity(t.color)?t.color:p.defaultLine,u),x=t.borderColor||p.contrast(y);void 0!==t.nameOverride&&(t.name=t.nameOverride),t.name&&(t.trace._meta&&(t.name=o.templateString(t.name,t.trace._meta)),h=E(t.name,t.nameLength)),void 0!==t.zLabel?(void 0!==t.xLabel&&(f+="x: "+t.xLabel+"<br>"),void 0!==t.yLabel&&(f+="y: "+t.yLabel+"<br>"),"choropleth"!==t.trace.type&&"choroplethmapbox"!==t.trace.type&&(f+=(f?"z: ":"")+t.zLabel)):I&&t[a+"Label"]===M?f=t[("x"===a?"y":"x")+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&"scattercarpet"!==t.trace.type&&(f=t.yLabel):f=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",!t.text&&0!==t.text||Array.isArray(t.text)||(f+=(f?"<br>":"")+t.text),void 0!==t.extraText&&(f+=(f?"<br>":"")+t.extraText),""!==f||t.hovertemplate||(""===h&&e.remove(),f=h);var b=i._d3locale,A=t.hovertemplate||!1,S=t.hovertemplateLabels||t,L=t.eventData[0]||{};A&&(f=(f=o.hovertemplateString(A,S,b,L,t.trace._meta)).replace(T,function(e,r){return h=E(r,t.nameLength),""}));var D=e.select("text.nums").call(c.font,t.fontFamily||m,t.fontSize||v,t.fontColor||x).text(f).attr("data-notex",1).call(l.positionText,0,0).call(l.convertToTspans,r),O=e.select("text.name"),R=0,F=0;if(h&&h!==f){O.call(c.font,t.fontFamily||m,t.fontSize||v,_).text(h).attr("data-notex",1).call(l.positionText,0,0).call(l.convertToTspans,r);var B=O.node().getBoundingClientRect();R=B.width+2*k,F=B.height+2*k}else O.remove(),e.select("rect").remove();e.select("path").style({fill:y,stroke:x});var N,U,j=D.node().getBoundingClientRect(),V=t.xa._offset+(t.x0+t.x1)/2,q=t.ya._offset+(t.y0+t.y1)/2,G=Math.abs(t.x1-t.x0),H=Math.abs(t.y1-t.y0),Z=j.width+w+k+R;if(t.ty0=C-j.top,t.bx=j.width+2*k,t.by=Math.max(j.height+2*k,F),t.anchor="start",t.txwidth=j.width,t.tx2width=R,t.offset=0,s)t.pos=V,N=q+H/2+Z<=P,U=q-H/2-Z>=0,"top"!==t.idealAlign&&N||!U?N?(q+=H/2,t.anchor="start"):t.anchor="middle":(q-=H/2,t.anchor="end");else if(t.pos=q,N=V+G/2+Z<=z,U=V-G/2-Z>=0,"left"!==t.idealAlign&&N||!U)if(N)V+=G/2,t.anchor="start";else{t.anchor="middle";var X=Z/2,W=V+X-z,Y=V-X;W>0&&(V-=W),Y<0&&(V+=-Y)}else V-=G/2,t.anchor="end";D.attr("text-anchor",t.anchor),R&&O.attr("text-anchor",t.anchor),e.attr("transform","translate("+V+","+q+")"+(s?"rotate("+g+")":""))}),N}function M(t,e){t.each(function(t){var r=n.select(this);if(t.del)return r.remove();var i=r.select("text.nums"),a=t.anchor,o="end"===a?-1:1,s={start:1,end:-1,middle:0}[a],u=s*(w+k),p=u+s*(t.txwidth+k),h=0,f=t.offset;"middle"===a&&(u-=t.tx2width/2,p+=t.txwidth/2+k),e&&(f*=-b,h=t.offset*x),r.select("path").attr("d","middle"===a?"M-"+(t.bx/2+t.tx2width/2)+","+(f-t.by/2)+"h"+t.bx+"v"+t.by+"h-"+t.bx+"Z":"M0,0L"+(o*w+h)+","+(w+f)+"v"+(t.by/2-w)+"h"+o*t.bx+"v-"+t.by+"H"+(o*w+h)+"V"+(f-w)+"Z");var d=u+h,m=f+t.ty0-t.by/2+k,y=t.textAlign||"auto";"auto"!==y&&("left"===y&&"start"!==a?(i.attr("text-anchor","start"),d="middle"===a?-t.bx/2-t.tx2width/2+k:-t.bx-k):"right"===y&&"end"!==a&&(i.attr("text-anchor","end"),d="middle"===a?t.bx/2-t.tx2width/2-k:t.bx+k)),i.call(l.positionText,d,m),t.tx2width&&(r.select("text.name").call(l.positionText,p+s*k+h,f+t.ty0-t.by/2+k),r.select("rect").call(c.setRect,p+(s-1)*t.tx2width/2+h,f-t.by/2-1,t.tx2width,t.by+2))})}function S(t,e){var r=t.index,n=t.trace||{},a=t.cd[0],s=t.cd[r]||{};function l(t){return t||i(t)&&0===t}var u=Array.isArray(r)?function(t,e){var i=o.castOption(a,r,t);return l(i)?i:o.extractOption({},n,"",e)}:function(t,e){return o.extractOption(s,n,t,e)};function c(e,r,n){var i=u(r,n);l(i)&&(t[e]=i)}if(c("hoverinfo","hi","hoverinfo"),c("bgcolor","hbg","hoverlabel.bgcolor"),c("borderColor","hbc","hoverlabel.bordercolor"),c("fontFamily","htf","hoverlabel.font.family"),c("fontSize","hts","hoverlabel.font.size"),c("fontColor","htc","hoverlabel.font.color"),c("nameLength","hnl","hoverlabel.namelength"),c("textAlign","hta","hoverlabel.align"),t.posref="y"===e||"closest"===e&&"h"===n.orientation?t.xa._offset+(t.x0+t.x1)/2:t.ya._offset+(t.y0+t.y1)/2,t.x0=o.constrain(t.x0,0,t.xa._length),t.x1=o.constrain(t.x1,0,t.xa._length),t.y0=o.constrain(t.y0,0,t.ya._length),t.y1=o.constrain(t.y1,0,t.ya._length),void 0!==t.xLabelVal&&(t.xLabel="xLabel"in t?t.xLabel:f.hoverLabelText(t.xa,t.xLabelVal),t.xVal=t.xa.c2d(t.xLabelVal)),void 0!==t.yLabelVal&&(t.yLabel="yLabel"in t?t.yLabel:f.hoverLabelText(t.ya,t.yLabelVal),t.yVal=t.ya.c2d(t.yLabelVal)),void 0!==t.zLabelVal&&void 0===t.zLabel&&(t.zLabel=String(t.zLabelVal)),!(isNaN(t.xerr)||"log"===t.xa.type&&t.xerr<=0)){var p=f.tickText(t.xa,t.xa.c2l(t.xerr),"hover").text;void 0!==t.xerrneg?t.xLabel+=" +"+p+" / -"+f.tickText(t.xa,t.xa.c2l(t.xerrneg),"hover").text:t.xLabel+=" \xb1 "+p,"x"===e&&(t.distance+=1)}if(!(isNaN(t.yerr)||"log"===t.ya.type&&t.yerr<=0)){var h=f.tickText(t.ya,t.ya.c2l(t.yerr),"hover").text;void 0!==t.yerrneg?t.yLabel+=" +"+h+" / -"+f.tickText(t.ya,t.ya.c2l(t.yerrneg),"hover").text:t.yLabel+=" \xb1 "+h,"y"===e&&(t.distance+=1)}var d=t.hoverinfo||t.trace.hoverinfo;return d&&"all"!==d&&(-1===(d=Array.isArray(d)?d:d.split("+")).indexOf("x")&&(t.xLabel=void 0),-1===d.indexOf("y")&&(t.yLabel=void 0),-1===d.indexOf("z")&&(t.zLabel=void 0),-1===d.indexOf("text")&&(t.text=void 0),-1===d.indexOf("name")&&(t.name=void 0)),t}function L(t,e,r){var n,i,o=r.container,s=r.fullLayout,l=s._size,u=r.event,h=!!e.hLinePoint,d=!!e.vLinePoint;if(o.selectAll(".spikeline").remove(),d||h){var m=p.combine(s.plot_bgcolor,s.paper_bgcolor);if(h){var y,g,v=e.hLinePoint;n=v&&v.xa,"cursor"===(i=v&&v.ya).spikesnap?(y=u.pointerX,g=u.pointerY):(y=n._offset+v.x,g=i._offset+v.y);var _,x,b=a.readability(v.color,m)<1.5?p.contrast(m):v.color,w=i.spikemode,k=i.spikethickness,T=i.spikecolor||b,A=f.getPxPosition(t,i);if(-1!==w.indexOf("toaxis")||-1!==w.indexOf("across")){if(-1!==w.indexOf("toaxis")&&(_=A,x=y),-1!==w.indexOf("across")){var M=i._counterDomainMin,S=i._counterDomainMax;"free"===i.anchor&&(M=Math.min(M,i.position),S=Math.max(S,i.position)),_=l.l+M*l.w,x=l.l+S*l.w}o.insert("line",":first-child").attr({x1:_,x2:x,y1:g,y2:g,"stroke-width":k,stroke:T,"stroke-dasharray":c.dashStyle(i.spikedash,k)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:_,x2:x,y1:g,y2:g,"stroke-width":k+2,stroke:m}).classed("spikeline",!0).classed("crisp",!0)}-1!==w.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:A+("right"!==i.side?k:-k),cy:g,r:k,fill:T}).classed("spikeline",!0)}if(d){var L,C,E=e.vLinePoint;n=E&&E.xa,i=E&&E.ya,"cursor"===n.spikesnap?(L=u.pointerX,C=u.pointerY):(L=n._offset+E.x,C=i._offset+E.y);var z,P,I=a.readability(E.color,m)<1.5?p.contrast(m):E.color,D=n.spikemode,O=n.spikethickness,R=n.spikecolor||I,F=f.getPxPosition(t,n);if(-1!==D.indexOf("toaxis")||-1!==D.indexOf("across")){if(-1!==D.indexOf("toaxis")&&(z=F,P=C),-1!==D.indexOf("across")){var B=n._counterDomainMin,N=n._counterDomainMax;"free"===n.anchor&&(B=Math.min(B,n.position),N=Math.max(N,n.position)),z=l.t+(1-N)*l.h,P=l.t+(1-B)*l.h}o.insert("line",":first-child").attr({x1:L,x2:L,y1:z,y2:P,"stroke-width":O,stroke:R,"stroke-dasharray":c.dashStyle(n.spikedash,O)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:L,x2:L,y1:z,y2:P,"stroke-width":O+2,stroke:m}).classed("spikeline",!0).classed("crisp",!0)}-1!==D.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:L,cy:F-("top"!==n.side?O:-O),r:O,fill:R}).classed("spikeline",!0)}}}function C(t,e){return!e||(e.vLinePoint!==t._spikepoints.vLinePoint||e.hLinePoint!==t._spikepoints.hLinePoint)}function E(t,e){return l.plainText(t||"",{len:e,allowedTags:["br","sub","sup","b","i","em"]})}},{"../../lib":169,"../../lib/events":161,"../../lib/override_cursor":180,"../../lib/svg_text_utils":190,"../../plots/cartesian/axes":213,"../../registry":261,"../color":50,"../dragelement":68,"../drawing":71,"./constants":83,"./helpers":85,d3:14,"fast-isnumeric":16,tinycolor2:33}],87:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e,r,i){r("hoverlabel.bgcolor",(i=i||{}).bgcolor),r("hoverlabel.bordercolor",i.bordercolor),r("hoverlabel.namelength",i.namelength),n.coerceFont(r,"hoverlabel.font",i.font),r("hoverlabel.align",i.align)}},{"../../lib":169}],88:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../lib"),a=t("../dragelement"),o=t("./helpers"),s=t("./layout_attributes"),l=t("./hover");e.exports={moduleType:"component",name:"fx",constants:t("./constants"),schema:{layout:s},attributes:t("./attributes"),layoutAttributes:s,supplyLayoutGlobalDefaults:t("./layout_global_defaults"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),getDistanceFunction:o.getDistanceFunction,getClosest:o.getClosest,inbox:o.inbox,quadrature:o.quadrature,appendArrayPointValue:o.appendArrayPointValue,castHoverOption:function(t,e,r){return i.castOption(t,e,"hoverlabel."+r)},castHoverinfo:function(t,e,r){return i.castOption(t,r,"hoverinfo",function(r){return i.coerceHoverinfo({hoverinfo:r},{_module:t._module},e)})},hover:l.hover,unhover:a.unhover,loneHover:l.loneHover,loneUnhover:function(t){var e=i.isD3Selection(t)?t:n.select(t);e.selectAll("g.hovertext").remove(),e.selectAll(".spikeline").remove()},click:t("./click")}},{"../../lib":169,"../dragelement":68,"./attributes":80,"./calc":81,"./click":82,"./constants":83,"./defaults":84,"./helpers":85,"./hover":86,"./layout_attributes":89,"./layout_defaults":90,"./layout_global_defaults":91,d3:14}],89:[function(t,e,r){"use strict";var n=t("./constants"),i=t("../../plots/font_attributes")({editType:"none"});i.family.dflt=n.HOVERFONT,i.size.dflt=n.HOVERFONTSIZE,e.exports={clickmode:{valType:"flaglist",flags:["event","select"],dflt:"event",editType:"plot",extras:["none"]},dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","orbit","turntable",!1],dflt:"zoom",editType:"modebar"},hovermode:{valType:"enumerated",values:["x","y","closest",!1],editType:"modebar"},hoverdistance:{valType:"integer",min:-1,dflt:20,editType:"none"},spikedistance:{valType:"integer",min:-1,dflt:20,editType:"none"},hoverlabel:{bgcolor:{valType:"color",editType:"none"},bordercolor:{valType:"color",editType:"none"},font:i,align:{valType:"enumerated",values:["left","right","auto"],dflt:"auto",editType:"none"},namelength:{valType:"integer",min:-1,dflt:15,editType:"none"},editType:"none"},selectdirection:{valType:"enumerated",values:["h","v","d","any"],dflt:"any",editType:"none"}}},{"../../plots/font_attributes":239,"./constants":83}],90:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e,r){function a(r,a){return n.coerce(t,e,i,r,a)}var o,s=a("clickmode");"select"===a("dragmode")&&a("selectdirection"),e._has("cartesian")?s.indexOf("select")>-1?o="closest":(e._isHoriz=function(t,e){for(var r=e._scatterStackOpts||{},n=0;n<t.length;n++){var i=t[n],a=i.xaxis+i.yaxis,o=r[a]||{},s=o[i.stackgroup]||{};if("h"!==i.orientation&&"h"!==s.orientation)return!1}return!0}(r,e),o=e._isHoriz?"y":"x"):o="closest",a("hovermode",o)&&(a("hoverdistance"),a("spikedistance"));var l=e._has("mapbox"),u=e._has("geo"),c=e._basePlotModules.length;"zoom"===e.dragmode&&((l||u)&&1===c||l&&u&&2===c)&&(e.dragmode="pan")}},{"../../lib":169,"./layout_attributes":89}],91:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./hoverlabel_defaults"),a=t("./layout_attributes");e.exports=function(t,e){i(t,e,function(r,i){return n.coerce(t,e,a,r,i)})}},{"../../lib":169,"./hoverlabel_defaults":87,"./layout_attributes":89}],92:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../lib/regex").counter,a=t("../../plots/domain").attributes,o=t("../../plots/cartesian/constants").idRegex,s=t("../../plot_api/plot_template"),l={rows:{valType:"integer",min:1,editType:"plot"},roworder:{valType:"enumerated",values:["top to bottom","bottom to top"],dflt:"top to bottom",editType:"plot"},columns:{valType:"integer",min:1,editType:"plot"},subplots:{valType:"info_array",freeLength:!0,dimensions:2,items:{valType:"enumerated",values:[i("xy").toString(),""],editType:"plot"},editType:"plot"},xaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.x.toString(),""],editType:"plot"},editType:"plot"},yaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.y.toString(),""],editType:"plot"},editType:"plot"},pattern:{valType:"enumerated",values:["independent","coupled"],dflt:"coupled",editType:"plot"},xgap:{valType:"number",min:0,max:1,editType:"plot"},ygap:{valType:"number",min:0,max:1,editType:"plot"},domain:a({name:"grid",editType:"plot",noGridCell:!0},{}),xside:{valType:"enumerated",values:["bottom","bottom plot","top plot","top"],dflt:"bottom plot",editType:"plot"},yside:{valType:"enumerated",values:["left","left plot","right plot","right"],dflt:"left plot",editType:"plot"},editType:"plot"};function u(t,e,r){var n=e[r+"axes"],i=Object.keys((t._splomAxes||{})[r]||{});return Array.isArray(n)?n:i.length?i:void 0}function c(t,e,r,n,i,a){var o=e(t+"gap",r),s=e("domain."+t);e(t+"side",n);for(var l=new Array(i),u=s[0],c=(s[1]-u)/(i-o),p=c*(1-o),h=0;h<i;h++){var f=u+c*h;l[a?i-1-h:h]=[f,f+p]}return l}function p(t,e,r,n,i){var a,o=new Array(r);function s(t,r){-1!==e.indexOf(r)&&void 0===n[r]?(o[t]=r,n[r]=t):o[t]=""}if(Array.isArray(t))for(a=0;a<r;a++)s(a,t[a]);else for(s(0,i),a=1;a<r;a++)s(a,i+(a+1));return o}e.exports={moduleType:"component",name:"grid",schema:{layout:{grid:l}},layoutAttributes:l,sizeDefaults:function(t,e){var r=t.grid||{},i=u(e,r,"x"),a=u(e,r,"y");if(t.grid||i||a){var o,p,h=Array.isArray(r.subplots)&&Array.isArray(r.subplots[0]),f=Array.isArray(i),d=Array.isArray(a),m=f&&i!==r.xaxes&&d&&a!==r.yaxes;h?(o=r.subplots.length,p=r.subplots[0].length):(d&&(o=a.length),f&&(p=i.length));var y=s.newContainer(e,"grid"),g=T("rows",o),v=T("columns",p);if(g*v>1){h||f||d||"independent"===T("pattern")&&(h=!0),y._hasSubplotGrid=h;var _,x,b="top to bottom"===T("roworder"),w=h?.2:.1,k=h?.3:.1;m&&e._splomGridDflt&&(_=e._splomGridDflt.xside,x=e._splomGridDflt.yside),y._domains={x:c("x",T,w,_,v),y:c("y",T,k,x,g,b)}}else delete e.grid}function T(t,e){return n.coerce(r,y,l,t,e)}},contentDefaults:function(t,e){var r=e.grid;if(r&&r._domains){var n,i,a,o,s,l,c,h=t.grid||{},f=e._subplots,d=r._hasSubplotGrid,m=r.rows,y=r.columns,g="independent"===r.pattern,v=r._axisMap={};if(d){var _=h.subplots||[];l=r.subplots=new Array(m);var x=1;for(n=0;n<m;n++){var b=l[n]=new Array(y),w=_[n]||[];for(i=0;i<y;i++)if(g?(s=1===x?"xy":"x"+x+"y"+x,x++):s=w[i],b[i]="",-1!==f.cartesian.indexOf(s)){if(c=s.indexOf("y"),a=s.slice(0,c),o=s.slice(c),void 0!==v[a]&&v[a]!==i||void 0!==v[o]&&v[o]!==n)continue;b[i]=s,v[a]=i,v[o]=n}}}else{var k=u(e,h,"x"),T=u(e,h,"y");r.xaxes=p(k,f.xaxis,y,v,"x"),r.yaxes=p(T,f.yaxis,m,v,"y")}var A=r._anchors={},M="top to bottom"===r.roworder;for(var S in v){var L,C,E,z=S.charAt(0),P=r[z+"side"];if(P.length<8)A[S]="free";else if("x"===z){if("t"===P.charAt(0)===M?(L=0,C=1,E=m):(L=m-1,C=-1,E=-1),d){var I=v[S];for(n=L;n!==E;n+=C)if((s=l[n][I])&&(c=s.indexOf("y"),s.slice(0,c)===S)){A[S]=s.slice(c);break}}else for(n=L;n!==E;n+=C)if(o=r.yaxes[n],-1!==f.cartesian.indexOf(S+o)){A[S]=o;break}}else if("l"===P.charAt(0)?(L=0,C=1,E=y):(L=y-1,C=-1,E=-1),d){var D=v[S];for(n=L;n!==E;n+=C)if((s=l[D][n])&&(c=s.indexOf("y"),s.slice(c)===S)){A[S]=s.slice(0,c);break}}else for(n=L;n!==E;n+=C)if(a=r.xaxes[n],-1!==f.cartesian.indexOf(a+S)){A[S]=a;break}}}}}},{"../../lib":169,"../../lib/regex":184,"../../plot_api/plot_template":203,"../../plots/cartesian/constants":219,"../../plots/domain":238}],93:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/constants"),i=t("../../plot_api/plot_template").templatedArray;e.exports=i("image",{visible:{valType:"boolean",dflt:!0,editType:"arraydraw"},source:{valType:"string",editType:"arraydraw"},layer:{valType:"enumerated",values:["below","above"],dflt:"above",editType:"arraydraw"},sizex:{valType:"number",dflt:0,editType:"arraydraw"},sizey:{valType:"number",dflt:0,editType:"arraydraw"},sizing:{valType:"enumerated",values:["fill","contain","stretch"],dflt:"contain",editType:"arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},x:{valType:"any",dflt:0,editType:"arraydraw"},y:{valType:"any",dflt:0,editType:"arraydraw"},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left",editType:"arraydraw"},yanchor:{valType:"enumerated",values:["top","middle","bottom"],dflt:"top",editType:"arraydraw"},xref:{valType:"enumerated",values:["paper",n.idRegex.x.toString()],dflt:"paper",editType:"arraydraw"},yref:{valType:"enumerated",values:["paper",n.idRegex.y.toString()],dflt:"paper",editType:"arraydraw"},editType:"arraydraw"})},{"../../plot_api/plot_template":203,"../../plots/cartesian/constants":219}],94:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib/to_log_range");e.exports=function(t,e,r,a){e=e||{};var o="log"===r&&"linear"===e.type,s="linear"===r&&"log"===e.type;if(o||s)for(var l,u,c=t._fullLayout.images,p=e._id.charAt(0),h=0;h<c.length;h++)if(u="images["+h+"].",(l=c[h])[p+"ref"]===e._id){var f=l[p],d=l["size"+p],m=null,y=null;if(o){m=i(f,e.range);var g=d/Math.pow(10,m)/2;y=2*Math.log(g+Math.sqrt(1+g*g))/Math.LN10}else y=(m=Math.pow(10,f))*(Math.pow(10,d/2)-Math.pow(10,-d/2));n(m)?n(y)||(y=null):(m=null,y=null),a(u+p,m),a(u+"size"+p,y)}}},{"../../lib/to_log_range":192,"fast-isnumeric":16}],95:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axes"),a=t("../../plots/array_container_defaults"),o=t("./attributes");function s(t,e,r){function a(r,i){return n.coerce(t,e,o,r,i)}var s=a("source");if(!a("visible",!!s))return e;a("layer"),a("xanchor"),a("yanchor"),a("sizex"),a("sizey"),a("sizing"),a("opacity");for(var l={_fullLayout:r},u=["x","y"],c=0;c<2;c++){var p=u[c],h=i.coerceRef(t,e,l,p,"paper");if("paper"!==h)i.getFromId(l,h)._imgIndices.push(e._index);i.coercePosition(e,l,a,h,p,0)}return e}e.exports=function(t,e){a(t,e,{name:"images",handleItemDefaults:s})}},{"../../lib":169,"../../plots/array_container_defaults":209,"../../plots/cartesian/axes":213,"./attributes":93}],96:[function(t,e,r){"use strict";var n=t("d3"),i=t("../drawing"),a=t("../../plots/cartesian/axes"),o=t("../../constants/xmlns_namespaces");e.exports=function(t){var e,r,s=t._fullLayout,l=[],u={},c=[];for(r=0;r<s.images.length;r++){var p=s.images[r];if(p.visible)if("below"===p.layer&&"paper"!==p.xref&&"paper"!==p.yref){e=p.xref+p.yref;var h=s._plots[e];if(!h){c.push(p);continue}h.mainplot&&(e=h.mainplot.id),u[e]||(u[e]=[]),u[e].push(p)}else"above"===p.layer?l.push(p):c.push(p)}var f={x:{left:{sizing:"xMin",offset:0},center:{sizing:"xMid",offset:-.5},right:{sizing:"xMax",offset:-1}},y:{top:{sizing:"YMin",offset:0},middle:{sizing:"YMid",offset:-.5},bottom:{sizing:"YMax",offset:-1}}};function d(e){var r=n.select(this);if(this._imgSrc!==e.source)if(r.attr("xmlns",o.svg),e.source&&"data:"===e.source.slice(0,5))r.attr("xlink:href",e.source),this._imgSrc=e.source;else{var i=new Promise(function(t){var n=new Image;function i(){r.remove(),t()}this.img=n,n.setAttribute("crossOrigin","anonymous"),n.onerror=i,n.onload=function(){var e=document.createElement("canvas");e.width=this.width,e.height=this.height,e.getContext("2d").drawImage(this,0,0);var n=e.toDataURL("image/png");r.attr("xlink:href",n),t()},r.on("error",i),n.src=e.source,this._imgSrc=e.source}.bind(this));t._promises.push(i)}}function m(e){var r=n.select(this),o=a.getFromId(t,e.xref),l=a.getFromId(t,e.yref),u=s._size,c=o?Math.abs(o.l2p(e.sizex)-o.l2p(0)):e.sizex*u.w,p=l?Math.abs(l.l2p(e.sizey)-l.l2p(0)):e.sizey*u.h,h=c*f.x[e.xanchor].offset,d=p*f.y[e.yanchor].offset,m=f.x[e.xanchor].sizing+f.y[e.yanchor].sizing,y=(o?o.r2p(e.x)+o._offset:e.x*u.w+u.l)+h,g=(l?l.r2p(e.y)+l._offset:u.h-e.y*u.h+u.t)+d;switch(e.sizing){case"fill":m+=" slice";break;case"stretch":m="none"}r.attr({x:y,y:g,width:c,height:p,preserveAspectRatio:m,opacity:e.opacity});var v=(o?o._id:"")+(l?l._id:"");i.setClipUrl(r,v?"clip"+s._uid+v:null,t)}var y=s._imageLowerLayer.selectAll("image").data(c),g=s._imageUpperLayer.selectAll("image").data(l);y.enter().append("image"),g.enter().append("image"),y.exit().remove(),g.exit().remove(),y.each(function(t){d.bind(this)(t),m.bind(this)(t)}),g.each(function(t){d.bind(this)(t),m.bind(this)(t)});var v=Object.keys(s._plots);for(r=0;r<v.length;r++){e=v[r];var _=s._plots[e];if(_.imagelayer){var x=_.imagelayer.selectAll("image").data(u[e]||[]);x.enter().append("image"),x.exit().remove(),x.each(function(t){d.bind(this)(t),m.bind(this)(t)})}}}},{"../../constants/xmlns_namespaces":148,"../../plots/cartesian/axes":213,"../drawing":71,d3:14}],97:[function(t,e,r){"use strict";e.exports={moduleType:"component",name:"images",layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),includeBasePlot:t("../../plots/cartesian/include_components")("images"),draw:t("./draw"),convertCoords:t("./convert_coords")}},{"../../plots/cartesian/include_components":223,"./attributes":93,"./convert_coords":94,"./defaults":95,"./draw":96}],98:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../color/attributes");e.exports={bgcolor:{valType:"color",editType:"legend"},bordercolor:{valType:"color",dflt:i.defaultLine,editType:"legend"},borderwidth:{valType:"number",min:0,dflt:0,editType:"legend"},font:n({editType:"legend"}),orientation:{valType:"enumerated",values:["v","h"],dflt:"v",editType:"legend"},traceorder:{valType:"flaglist",flags:["reversed","grouped"],extras:["normal"],editType:"legend"},tracegroupgap:{valType:"number",min:0,dflt:10,editType:"legend"},itemsizing:{valType:"enumerated",values:["trace","constant"],dflt:"trace",editType:"legend"},itemclick:{valType:"enumerated",values:["toggle","toggleothers",!1],dflt:"toggle",editType:"legend"},itemdoubleclick:{valType:"enumerated",values:["toggle","toggleothers",!1],dflt:"toggleothers",editType:"legend"},x:{valType:"number",min:-2,max:3,editType:"legend"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left",editType:"legend"},y:{valType:"number",min:-2,max:3,editType:"legend"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],editType:"legend"},uirevision:{valType:"any",editType:"none"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"legend"},title:{text:{valType:"string",dflt:"",editType:"legend"},font:n({editType:"legend"}),side:{valType:"enumerated",values:["top","left","top left"],editType:"legend"},editType:"legend"},editType:"legend"}},{"../../plots/font_attributes":239,"../color/attributes":49}],99:[function(t,e,r){"use strict";e.exports={scrollBarWidth:6,scrollBarMinHeight:20,scrollBarColor:"#808BA4",scrollBarMargin:4,scrollBarEnterAttrs:{rx:20,ry:3,width:0,height:0},titlePad:2,textGap:40,itemGap:5}},{}],100:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("../../plot_api/plot_template"),o=t("./attributes"),s=t("../../plots/layout_attributes"),l=t("./helpers");e.exports=function(t,e,r){for(var u=t.legend||{},c=0,p=!1,h="normal",f=0;f<r.length;f++){var d=r[f];d.visible&&((d.showlegend||d._dfltShowLegend&&!(d._module&&d._module.attributes&&d._module.attributes.showlegend&&!1===d._module.attributes.showlegend.dflt))&&(c++,d.showlegend&&(p=!0,(n.traceIs(d,"pie-like")||!0===d._input.showlegend)&&c++)),(n.traceIs(d,"bar")&&"stack"===e.barmode||-1!==["tonextx","tonexty"].indexOf(d.fill))&&(h=l.isGrouped({traceorder:h})?"grouped+reversed":"reversed"),void 0!==d.legendgroup&&""!==d.legendgroup&&(h=l.isReversed({traceorder:h})?"reversed+grouped":"grouped"))}var m=i.coerce(t,e,s,"showlegend",p&&c>1);if(!1!==m||u.uirevision){var y=a.newContainer(e,"legend");if(b("uirevision",e.uirevision),!1!==m){b("bgcolor",e.paper_bgcolor),b("bordercolor"),b("borderwidth"),i.coerceFont(b,"font",e.font);var g,v,_,x=b("orientation");"h"===x?(g=0,n.getComponentMethod("rangeslider","isVisible")(t.xaxis)?(v=1.1,_="bottom"):(v=-.1,_="top")):(g=1.02,v=1,_="auto"),b("traceorder",h),l.isGrouped(e.legend)&&b("tracegroupgap"),b("itemsizing"),b("itemclick"),b("itemdoubleclick"),b("x",g),b("xanchor"),b("y",v),b("yanchor",_),b("valign"),i.noneOrAll(u,y,["x","y"]),b("title.text")&&(b("title.side","h"===x?"left":"top"),i.coerceFont(b,"title.font",e.font))}}function b(t,e){return i.coerce(u,y,o,t,e)}}},{"../../lib":169,"../../plot_api/plot_template":203,"../../plots/layout_attributes":243,"../../registry":261,"./attributes":98,"./helpers":104}],101:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../lib"),a=t("../../plots/plots"),o=t("../../registry"),s=t("../../lib/events"),l=t("../dragelement"),u=t("../drawing"),c=t("../color"),p=t("../../lib/svg_text_utils"),h=t("./handle_click"),f=t("./constants"),d=t("../../constants/alignment"),m=d.LINE_SPACING,y=d.FROM_TL,g=d.FROM_BR,v=t("./get_legend_data"),_=t("./style"),x=t("./helpers");function b(t,e,r,n,i){var a=r.data()[0][0].trace,l={event:i,node:r.node(),curveNumber:a.index,expandedIndex:a._expandedIndex,data:t.data,layout:t.layout,frames:t._transitionData._frames,config:t._context,fullData:t._fullData,fullLayout:t._fullLayout};if(a._group&&(l.group=a._group),o.traceIs(a,"pie-like")&&(l.label=r.datum()[0].label),!1!==s.triggerHandler(t,"plotly_legendclick",l))if(1===n)e._clickTimeout=setTimeout(function(){h(r,t,n)},t._context.doubleClickDelay);else if(2===n){e._clickTimeout&&clearTimeout(e._clickTimeout),t._legendMouseDownTime=0,!1!==s.triggerHandler(t,"plotly_legenddoubleclick",l)&&h(r,t,n)}}function w(t,e){var r=t.data()[0][0],n=e._fullLayout.legend,a=r.trace,s=o.traceIs(a,"pie-like"),l=a.index,c=e._context.edits.legendText&&!s,h=n._maxNameLength,d=s?r.label:a.name;a._meta&&(d=i.templateString(d,a._meta));var m=i.ensureSingle(t,"text","legendtext");m.attr("text-anchor","start").classed("user-select-none",!0).call(u.font,n.font).text(c?k(d,h):d),p.positionText(m,f.textGap,0),c?m.call(p.makeEditable,{gd:e,text:d}).call(A,t,e).on("edit",function(n){this.text(k(n,h)).call(A,t,e);var a=r.trace._fullInput||{},s={};if(o.hasTransform(a,"groupby")){var u=o.getTransformIndices(a,"groupby"),c=u[u.length-1],p=i.keyedContainer(a,"transforms["+c+"].styles","target","value.name");p.set(r.trace._group,n),s=p.constructUpdate()}else s.name=n;return o.call("_guiRestyle",e,s,l)}):A(m,t,e)}function k(t,e){var r=Math.max(4,e);if(t&&t.trim().length>=r/2)return t;for(var n=r-(t=t||"").length;n>0;n--)t+=" ";return t}function T(t,e){var r,a=e._context.doubleClickDelay,o=1,s=i.ensureSingle(t,"rect","legendtoggle",function(t){t.style("cursor","pointer").attr("pointer-events","all").call(c.fill,"rgba(0,0,0,0)")});s.on("mousedown",function(){(r=(new Date).getTime())-e._legendMouseDownTime<a?o+=1:(o=1,e._legendMouseDownTime=r)}),s.on("mouseup",function(){if(!e._dragged&&!e._editing){var r=e._fullLayout.legend;(new Date).getTime()-e._legendMouseDownTime>a&&(o=Math.max(o-1,1)),b(e,r,t,o,n.event)}})}function A(t,e,r){p.convertToTspans(t,r,function(){!function(t,e){var r=t.data()[0][0];if(r&&!r.trace.showlegend)return void t.remove();var n,i,a=t.select("g[class*=math-group]"),o=a.node(),s=e._fullLayout.legend.borderwidth,l=e._fullLayout.legend,c=(r?l:l.title).font.size*m;if(o){var h=u.bBox(o);n=h.height,i=h.width,r?u.setTranslate(a,0,.25*n):u.setTranslate(a,s,.75*n+s)}else{var d=t.select(r?".legendtext":".legendtitletext"),y=p.lineCount(d),g=d.node();n=c*y,i=g?u.bBox(g).width:0;var v=c*((y-1)/2-.3);r?p.positionText(d,f.textGap,-v):p.positionText(d,f.titlePad+s,c+s)}r?(r.lineHeight=c,r.height=Math.max(n,16)+3,r.width=i):(l._titleWidth=i,l._titleHeight=n)}(e,r)})}function M(t){return i.isRightAnchor(t)?"right":i.isCenterAnchor(t)?"center":"left"}function S(t){return i.isBottomAnchor(t)?"bottom":i.isMiddleAnchor(t)?"middle":"top"}e.exports=function(t){var e=t._fullLayout,r="legend"+e._uid;if(e._infolayer&&t.calcdata){t._legendMouseDownTime||(t._legendMouseDownTime=0);var s=e.legend,p=e.showlegend&&v(t.calcdata,s),h=e.hiddenlabels||[];if(!e.showlegend||!p.length)return e._infolayer.selectAll(".legend").remove(),e._topdefs.select("#"+r).remove(),a.autoMargin(t,"legend");var d=i.ensureSingle(e._infolayer,"g","legend",function(t){t.attr("pointer-events","all")}),m=i.ensureSingleById(e._topdefs,"clipPath",r,function(t){t.append("rect")}),k=i.ensureSingle(d,"rect","bg",function(t){t.attr("shape-rendering","crispEdges")});k.call(c.stroke,s.bordercolor).call(c.fill,s.bgcolor).style("stroke-width",s.borderwidth+"px");var L=i.ensureSingle(d,"g","scrollbox"),C=s.title;if(s._titleWidth=0,s._titleHeight=0,C.text){var E=i.ensureSingle(L,"text","legendtitletext");E.attr("text-anchor","start").classed("user-select-none",!0).call(u.font,C.font).text(C.text),A(E,L,t)}var z=i.ensureSingle(d,"rect","scrollbar",function(t){t.attr(f.scrollBarEnterAttrs).call(c.fill,f.scrollBarColor)}),P=L.selectAll("g.groups").data(p);P.enter().append("g").attr("class","groups"),P.exit().remove();var I=P.selectAll("g.traces").data(i.identity);I.enter().append("g").attr("class","traces"),I.exit().remove(),I.style("opacity",function(t){var e=t[0].trace;return o.traceIs(e,"pie-like")?-1!==h.indexOf(t[0].label)?.5:1:"legendonly"===e.visible?.5:1}).each(function(){n.select(this).call(w,t)}).call(_,t).each(function(){n.select(this).call(T,t)}),i.syncOrAsync([a.previousPromises,function(){return function(t,e,r){var i=t._fullLayout,a=i.legend,o=i._size,s=x.isVertical(a),l=x.isGrouped(a),c=a.borderwidth,p=2*c,h=f.textGap,d=f.itemGap,m=2*(c+d),y=S(a),g=a.y<0||0===a.y&&"top"===y,v=a.y>1||1===a.y&&"bottom"===y;a._maxHeight=Math.max(g||v?i.height/2:o.h,30);var _=0;a._width=0,a._height=0;var b=function(t){var e=0,r=0,n=t.title.side;n&&(-1!==n.indexOf("left")&&(e=t._titleWidth),-1!==n.indexOf("top")&&(r=t._titleHeight));return[e,r]}(a);if(s)r.each(function(t){var e=t[0].height;u.setTranslate(this,c+b[0],c+b[1]+a._height+e/2+d),a._height+=e,a._width=Math.max(a._width,t[0].width)}),_=h+a._width,a._width+=d+h+p,a._height+=m,l&&(e.each(function(t,e){u.setTranslate(this,0,e*a.tracegroupgap)}),a._height+=(a._lgroupsLength-1)*a.tracegroupgap);else{var w=M(a),k=a.x<0||0===a.x&&"right"===w,T=a.x>1||1===a.x&&"left"===w,A=v||g,L=i.width/2;a._maxWidth=Math.max(k?A&&"left"===w?o.l+o.w:L:T?A&&"right"===w?o.r+o.w:L:o.w,2*h);var C=0,E=0;r.each(function(t){var e=t[0].width+h;C=Math.max(C,e),E+=e}),_=null;var z=0;if(l){var P=0,I=0,D=0;e.each(function(){var t=0,e=0;n.select(this).selectAll("g.traces").each(function(r){var n=r[0].height;u.setTranslate(this,b[0],b[1]+c+d+n/2+e),e+=n,t=Math.max(t,h+r[0].width)}),P=Math.max(P,e);var r=t+d;r+c+I>a._maxWidth&&(z=Math.max(z,I),I=0,D+=P+a.tracegroupgap,P=e),u.setTranslate(this,I,D),I+=r}),a._width=Math.max(z,I)+c,a._height=D+P+m}else{var O=r.size(),R=E+p+(O-1)*d<a._maxWidth,F=0,B=0,N=0,U=0;r.each(function(t){var e=t[0].height,r=h+t[0].width,n=(R?r:C)+d;n+c+B>a._maxWidth&&(z=Math.max(z,U),B=0,N+=F,a._height+=F,F=0),u.setTranslate(this,b[0]+c+B,b[1]+c+N+e/2+d),U=B+r+d,B+=n,F=Math.max(F,e)}),R?(a._width=B+p,a._height=F+m):(a._width=Math.max(z,U)+p,a._height+=F+m)}}a._width=Math.ceil(Math.max(a._width+b[0],a._titleWidth+2*(c+f.titlePad))),a._height=Math.ceil(Math.max(a._height+b[1],a._titleHeight+2*(c+f.itemGap))),a._effHeight=Math.min(a._height,a._maxHeight);var j=t._context.edits,V=j.legendText||j.legendPosition;r.each(function(t){var e=n.select(this).select(".legendtoggle"),r=t[0].height,i=V?h:_||h+t[0].width;s||(i+=d/2),u.setRect(e,0,-r/2,i,r)})}(t,P,I)},function(){if(!function(t){var e=t._fullLayout.legend,r=M(e),n=S(e);return a.autoMargin(t,"legend",{x:e.x,y:e.y,l:e._width*y[r],r:e._width*g[r],b:e._effHeight*g[n],t:e._effHeight*y[n]})}(t)){var c,p,h,v,_=e._size,x=s.borderwidth,w=_.l+_.w*s.x-y[M(s)]*s._width,T=_.t+_.h*(1-s.y)-y[S(s)]*s._effHeight;if(e.margin.autoexpand){var A=w,C=T;w=i.constrain(w,0,e.width-s._width),T=i.constrain(T,0,e.height-s._effHeight),w!==A&&i.log("Constrain legend.x to make legend fit inside graph"),T!==C&&i.log("Constrain legend.y to make legend fit inside graph")}if(u.setTranslate(d,w,T),z.on(".drag",null),d.on("wheel",null),s._height<=s._maxHeight||t._context.staticPlot)k.attr({width:s._width-x,height:s._effHeight-x,x:x/2,y:x/2}),u.setTranslate(L,0,0),m.select("rect").attr({width:s._width-2*x,height:s._effHeight-2*x,x:x,y:x}),u.setClipUrl(L,r,t),u.setRect(z,0,0,0,0),delete s._scrollY;else{var E,P,I,D=Math.max(f.scrollBarMinHeight,s._effHeight*s._effHeight/s._height),O=s._effHeight-D-2*f.scrollBarMargin,R=s._height-s._effHeight,F=O/R,B=Math.min(s._scrollY||0,R);k.attr({width:s._width-2*x+f.scrollBarWidth+f.scrollBarMargin,height:s._effHeight-x,x:x/2,y:x/2}),m.select("rect").attr({width:s._width-2*x+f.scrollBarWidth+f.scrollBarMargin,height:s._effHeight-2*x,x:x,y:x+B}),u.setClipUrl(L,r,t),j(B,D,F),d.on("wheel",function(){j(B=i.constrain(s._scrollY+n.event.deltaY/O*R,0,R),D,F),0!==B&&B!==R&&n.event.preventDefault()});var N=n.behavior.drag().on("dragstart",function(){var t=n.event.sourceEvent;E="touchstart"===t.type?t.changedTouches[0].clientY:t.clientY,I=B}).on("drag",function(){var t=n.event.sourceEvent;2===t.buttons||t.ctrlKey||(P="touchmove"===t.type?t.changedTouches[0].clientY:t.clientY,j(B=function(t,e,r){var n=(r-e)/F+t;return i.constrain(n,0,R)}(I,E,P),D,F))});z.call(N);var U=n.behavior.drag().on("dragstart",function(){var t=n.event.sourceEvent;"touchstart"===t.type&&(E=t.changedTouches[0].clientY,I=B)}).on("drag",function(){var t=n.event.sourceEvent;"touchmove"===t.type&&(P=t.changedTouches[0].clientY,j(B=function(t,e,r){var n=(e-r)/F+t;return i.constrain(n,0,R)}(I,E,P),D,F))});L.call(U)}if(t._context.edits.legendPosition)d.classed("cursor-move",!0),l.init({element:d.node(),gd:t,prepFn:function(){var t=u.getTranslate(d);h=t.x,v=t.y},moveFn:function(t,e){var r=h+t,n=v+e;u.setTranslate(d,r,n),c=l.align(r,0,_.l,_.l+_.w,s.xanchor),p=l.align(n,0,_.t+_.h,_.t,s.yanchor)},doneFn:function(){void 0!==c&&void 0!==p&&o.call("_guiRelayout",t,{"legend.x":c,"legend.y":p})},clickFn:function(r,n){var i=e._infolayer.selectAll("g.traces").filter(function(){var t=this.getBoundingClientRect();return n.clientX>=t.left&&n.clientX<=t.right&&n.clientY>=t.top&&n.clientY<=t.bottom});i.size()>0&&b(t,d,i,r,n)}})}function j(e,r,n){s._scrollY=t._fullLayout.legend._scrollY=e,u.setTranslate(L,0,-e),u.setRect(z,s._width,f.scrollBarMargin+e*n,f.scrollBarWidth,r),m.select("rect").attr("y",x+e)}}],t)}}},{"../../constants/alignment":144,"../../lib":169,"../../lib/events":161,"../../lib/svg_text_utils":190,"../../plots/plots":252,"../../registry":261,"../color":50,"../dragelement":68,"../drawing":71,"./constants":99,"./get_legend_data":102,"./handle_click":103,"./helpers":104,"./style":106,d3:14}],102:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("./helpers");e.exports=function(t,e){var r,a,o={},s=[],l=!1,u={},c=0,p=0;function h(t,r){if(""!==t&&i.isGrouped(e))-1===s.indexOf(t)?(s.push(t),l=!0,o[t]=[[r]]):o[t].push([r]);else{var n="~~i"+c;s.push(n),o[n]=[[r]],c++}}for(r=0;r<t.length;r++){var f=t[r],d=f[0],m=d.trace,y=m.legendgroup;if(m.visible&&m.showlegend)if(n.traceIs(m,"pie-like"))for(u[y]||(u[y]={}),a=0;a<f.length;a++){var g=f[a].label;u[y][g]||(h(y,{label:g,color:f[a].color,i:f[a].i,trace:m,pts:f[a].pts}),u[y][g]=!0,p=Math.max(p,(g||"").length))}else h(y,d),p=Math.max(p,(m.name||"").length)}if(!s.length)return[];var v,_,x=s.length;if(l&&i.isGrouped(e))for(_=new Array(x),r=0;r<x;r++)v=o[s[r]],_[r]=i.isReversed(e)?v.reverse():v;else{for(_=[new Array(x)],r=0;r<x;r++)v=o[s[r]][0],_[0][i.isReversed(e)?x-r-1:r]=v;x=1}return e._lgroupsLength=x,e._maxNameLength=p,_}},{"../../registry":261,"./helpers":104}],103:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry"),a=!0;e.exports=function(t,e,r){var o=e._fullLayout;if(!e._dragged&&!e._editing){var s,l=o.legend.itemclick,u=o.legend.itemdoubleclick;if(1===r&&"toggle"===l&&"toggleothers"===u&&a&&e.data&&e._context.showTips?(n.notifier(n._(e,"Double-click on legend to isolate one trace"),"long"),a=!1):a=!1,1===r?s=l:2===r&&(s=u),s){var c,p,h,f,d,m=o.hiddenlabels?o.hiddenlabels.slice():[],y=t.data()[0][0],g=e._fullData,v=y.trace,_=v.legendgroup,x={},b=[],w=[],k=[];if(i.traceIs(v,"pie-like")){var T=y.label,A=m.indexOf(T);"toggle"===s?-1===A?m.push(T):m.splice(A,1):"toggleothers"===s&&(m=[],e.calcdata[0].forEach(function(t){T!==t.label&&m.push(t.label)}),e._fullLayout.hiddenlabels&&e._fullLayout.hiddenlabels.length===m.length&&-1===A&&(m=[])),i.call("_guiRelayout",e,"hiddenlabels",m)}else{var M,S=_&&_.length,L=[];if(S)for(c=0;c<g.length;c++)(M=g[c]).visible&&M.legendgroup===_&&L.push(c);if("toggle"===s){var C;switch(v.visible){case!0:C="legendonly";break;case!1:C=!1;break;case"legendonly":C=!0}if(S)for(c=0;c<g.length;c++)!1!==g[c].visible&&g[c].legendgroup===_&&B(g[c],C);else B(v,C)}else if("toggleothers"===s){var E,z,P,I,D=!0;for(c=0;c<g.length;c++)if(E=g[c]===v,P=!0!==g[c].showlegend,!(E||P||(z=S&&g[c].legendgroup===_)||!0!==g[c].visible||i.traceIs(g[c],"notLegendIsolatable"))){D=!1;break}for(c=0;c<g.length;c++)if(!1!==g[c].visible&&!i.traceIs(g[c],"notLegendIsolatable"))switch(v.visible){case"legendonly":B(g[c],!0);break;case!0:I=!!D||"legendonly",E=g[c]===v,P=!0!==g[c].showlegend&&!g[c].legendgroup,z=E||S&&g[c].legendgroup===_,B(g[c],!(!z&&!P)||I)}}for(c=0;c<w.length;c++)if(h=w[c]){var O=h.constructUpdate(),R=Object.keys(O);for(p=0;p<R.length;p++)f=R[p],(x[f]=x[f]||[])[k[c]]=O[f]}for(d=Object.keys(x),c=0;c<d.length;c++)for(f=d[c],p=0;p<b.length;p++)x[f].hasOwnProperty(p)||(x[f][p]=void 0);i.call("_guiRestyle",e,x,b)}}}function F(t,e,r){var n=b.indexOf(t),i=x[e];return i||(i=x[e]=[]),-1===b.indexOf(t)&&(b.push(t),n=b.length-1),i[n]=r,n}function B(t,e){var r=t._fullInput;if(i.hasTransform(r,"groupby")){var a=w[r.index];if(!a){var o=i.getTransformIndices(r,"groupby"),s=o[o.length-1];a=n.keyedContainer(r,"transforms["+s+"].styles","target","value.visible"),w[r.index]=a}var l=a.get(t._group);void 0===l&&(l=!0),!1!==l&&a.set(t._group,e),k[r.index]=F(r.index,"visible",!1!==r.visible)}else{var u=!1!==r.visible&&e;F(r.index,"visible",u)}}}},{"../../lib":169,"../../registry":261}],104:[function(t,e,r){"use strict";r.isGrouped=function(t){return-1!==(t.traceorder||"").indexOf("grouped")},r.isVertical=function(t){return"h"!==t.orientation},r.isReversed=function(t){return-1!==(t.traceorder||"").indexOf("reversed")}},{}],105:[function(t,e,r){"use strict";e.exports={moduleType:"component",name:"legend",layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),draw:t("./draw"),style:t("./style")}},{"./attributes":98,"./defaults":100,"./draw":101,"./style":106}],106:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../registry"),a=t("../../lib"),o=t("../drawing"),s=t("../color"),l=t("../colorscale/helpers").extractOpts,u=t("../../traces/scatter/subtypes"),c=t("../../traces/pie/style_one"),p=t("../../traces/pie/helpers").castOption,h=12,f=5,d=2,m=10,y=5;function g(t,e){return(e?"radial":"horizontal")+(t?"":"reversed")}e.exports=function(t,e){var r=e._fullLayout.legend,v="constant"===r.itemsizing,_=function(t,e,r,n){var i;if(t+1)i=t;else{if(!(e&&e.width>0))return 0;i=e.width}return v?n:Math.min(i,r)};function x(t,e,r){var a=t[0].trace,o=a.marker||{},l=o.line||{},u=r?a.visible&&a.type===r:i.traceIs(a,"bar"),c=n.select(e).select("g.legendpoints").selectAll("path.legend"+r).data(u?[t]:[]);c.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),c.exit().remove(),c.each(function(t){var e=n.select(this),r=t[0],i=_(r.mlw,o.line,y,d);e.style("stroke-width",i+"px").call(s.fill,r.mc||o.color),i&&s.stroke(e,r.mlc||l.color)})}function b(t,e,r){var o=t[0],s=o.trace,l=r?s.visible&&s.type===r:i.traceIs(s,r),u=n.select(e).select("g.legendpoints").selectAll("path.legend"+r).data(l?[t]:[]);if(u.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),u.exit().remove(),u.size()){var h=(s.marker||{}).line,f=_(p(h.width,o.pts),h,y,d),m=a.minExtend(s,{marker:{line:{width:f}}});m.marker.line.color=h.color;var g=a.minExtend(o,{trace:m});c(u,g,m)}}t.each(function(t){var e=n.select(this),i=a.ensureSingle(e,"g","layers");i.style("opacity",t[0].trace.opacity);var o=r.valign,s=t[0].lineHeight,l=t[0].height;if("middle"!==o&&s&&l){var u={top:1,bottom:-1}[o]*(.5*(s-l+3));i.attr("transform","translate(0,"+u+")")}else i.attr("transform",null);i.selectAll("g.legendfill").data([t]).enter().append("g").classed("legendfill",!0),i.selectAll("g.legendlines").data([t]).enter().append("g").classed("legendlines",!0);var c=i.selectAll("g.legendsymbols").data([t]);c.enter().append("g").classed("legendsymbols",!0),c.selectAll("g.legendpoints").data([t]).enter().append("g").classed("legendpoints",!0)}).each(function(t){var r,i=t[0].trace,u=[];if(i.visible)switch(i.type){case"histogram2d":case"heatmap":u=[["M-15,-2V4H15V-2Z"]],r=!0;break;case"choropleth":case"choroplethmapbox":u=[["M-6,-6V6H6V-6Z"]],r=!0;break;case"densitymapbox":u=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],r="radial";break;case"cone":u=[["M-6,2 A2,2 0 0,0 -6,6 V6L6,4Z"],["M-6,-6 A2,2 0 0,0 -6,-2 L6,-4Z"],["M-6,-2 A2,2 0 0,0 -6,2 L6,0Z"]],r=!1;break;case"streamtube":u=[["M-6,2 A2,2 0 0,0 -6,6 H6 A2,2 0 0,1 6,2 Z"],["M-6,-6 A2,2 0 0,0 -6,-2 H6 A2,2 0 0,1 6,-6 Z"],["M-6,-2 A2,2 0 0,0 -6,2 H6 A2,2 0 0,1 6,-2 Z"]],r=!1;break;case"surface":u=[["M-6,-6 A2,3 0 0,0 -6,0 H6 A2,3 0 0,1 6,-6 Z"],["M-6,1 A2,3 0 0,1 -6,6 H6 A2,3 0 0,0 6,0 Z"]],r=!0;break;case"mesh3d":u=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!1;break;case"volume":u=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!0;break;case"isosurface":u=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],r=!1}var c=n.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(u);c.enter().append("path").classed("legend3dandfriends",!0).attr("transform","translate(20,0)").style("stroke-miterlimit",1),c.exit().remove(),c.each(function(t,u){var c,p=n.select(this),h=l(i),f=h.colorscale,d=h.reversescale;if(f){if(!r){var m=f.length;c=0===u?f[d?m-1:0][1]:1===u?f[d?0:m-1][1]:f[Math.floor((m-1)/2)][1]}}else{var y=i.vertexcolor||i.facecolor||i.color;c=a.isArrayOrTypedArray(y)?y[u]||y[0]:y}p.attr("d",t[0]),c?p.call(s.fill,c):p.call(function(t){if(t.size()){var n="legendfill-"+i.uid;o.gradient(t,e,n,g(d,"radial"===r),f,"fill")}})})}).each(function(t){var e=t[0].trace,r=[];e.visible&&"waterfall"===e.type&&(r=t[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var i=n.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(r);i.enter().append("path").classed("legendwaterfall",!0).attr("transform","translate(20,0)").style("stroke-miterlimit",1),i.exit().remove(),i.each(function(t){var r=n.select(this),i=e[t[0]].marker,a=_(void 0,i.line,y,d);r.attr("d",t[1]).style("stroke-width",a+"px").call(s.fill,i.color),a&&r.call(s.stroke,i.line.color)})}).each(function(t){x(t,this,"funnel")}).each(function(t){x(t,this)}).each(function(t){var r=t[0].trace,l=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(r.visible&&i.traceIs(r,"box-violin")?[t]:[]);l.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),l.exit().remove(),l.each(function(){var t=n.select(this);if("all"!==r.boxpoints&&"all"!==r.points||0!==s.opacity(r.fillcolor)||0!==s.opacity((r.line||{}).color)){var i=_(void 0,r.line,y,d);t.style("stroke-width",i+"px").call(s.fill,r.fillcolor),i&&s.stroke(t,r.line.color)}else{var u=a.minExtend(r,{marker:{size:v?h:a.constrain(r.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});l.call(o.pointStyle,u,e)}})}).each(function(t){b(t,this,"funnelarea")}).each(function(t){b(t,this,"pie")}).each(function(t){var r,i,s=t[0],c=s.trace,p=c.visible&&c.fill&&"none"!==c.fill,h=u.hasLines(c),d=c.contours,y=!1,v=!1,x=l(c),b=x.colorscale,w=x.reversescale;if(d){var k=d.coloring;"lines"===k?y=!0:h="none"===k||"heatmap"===k||d.showlines,"constraint"===d.type?p="="!==d._operation:"fill"!==k&&"heatmap"!==k||(v=!0)}var T=u.hasMarkers(c)||u.hasText(c),A=p||v,M=h||y,S=T||!A?"M5,0":M?"M5,-2":"M5,-3",L=n.select(this),C=L.select(".legendfill").selectAll("path").data(p||v?[t]:[]);if(C.enter().append("path").classed("js-fill",!0),C.exit().remove(),C.attr("d",S+"h30v6h-30z").call(p?o.fillGroupStyle:function(t){if(t.size()){var r="legendfill-"+c.uid;o.gradient(t,e,r,g(w),b,"fill")}}),h||y){var E=_(void 0,c.line,m,f);i=a.minExtend(c,{line:{width:E}}),r=[a.minExtend(s,{trace:i})]}var z=L.select(".legendlines").selectAll("path").data(h||y?[r]:[]);z.enter().append("path").classed("js-line",!0),z.exit().remove(),z.attr("d",S+(y?"l30,0.0001":"h30")).call(h?o.lineGroupStyle:function(t){if(t.size()){var r="legendline-"+c.uid;o.lineGroupStyle(t),o.gradient(t,e,r,g(w),b,"stroke")}})}).each(function(t){var r,i,s=t[0],l=s.trace,c=u.hasMarkers(l),p=u.hasText(l),m=u.hasLines(l);function y(t,e,r,n){var i=a.nestedProperty(l,t).get(),o=a.isArrayOrTypedArray(i)&&e?e(i):i;if(v&&o&&void 0!==n&&(o=n),r){if(o<r[0])return r[0];if(o>r[1])return r[1]}return o}function g(t){return t[0]}if(c||p||m){var _={},x={};if(c){_.mc=y("marker.color",g),_.mx=y("marker.symbol",g),_.mo=y("marker.opacity",a.mean,[.2,1]),_.mlc=y("marker.line.color",g),_.mlw=y("marker.line.width",a.mean,[0,5],d),x.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var b=y("marker.size",a.mean,[2,16],h);_.ms=b,x.marker.size=b}m&&(x.line={width:y("line.width",g,[0,10],f)}),p&&(_.tx="Aa",_.tp=y("textposition",g),_.ts=10,_.tc=y("textfont.color",g),_.tf=y("textfont.family",g)),r=[a.minExtend(s,_)],(i=a.minExtend(l,x)).selectedpoints=null,i.texttemplate=null}var w=n.select(this).select("g.legendpoints"),k=w.selectAll("path.scatterpts").data(c?r:[]);k.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform","translate(20,0)"),k.exit().remove(),k.call(o.pointStyle,i,e),c&&(r[0].mrc=3);var T=w.selectAll("g.pointtext").data(p?r:[]);T.enter().append("g").classed("pointtext",!0).append("text").attr("transform","translate(20,0)"),T.exit().remove(),T.selectAll("text").call(o.textPointStyle,i,e)}).each(function(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(e.visible&&"candlestick"===e.type?[t,t]:[]);r.enter().append("path").classed("legendcandle",!0).attr("d",function(t,e){return e?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"}).attr("transform","translate(20,0)").style("stroke-miterlimit",1),r.exit().remove(),r.each(function(t,r){var i=n.select(this),a=e[r?"increasing":"decreasing"],o=_(void 0,a.line,y,d);i.style("stroke-width",o+"px").call(s.fill,a.fillcolor),o&&s.stroke(i,a.line.color)})}).each(function(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(e.visible&&"ohlc"===e.type?[t,t]:[]);r.enter().append("path").classed("legendohlc",!0).attr("d",function(t,e){return e?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"}).attr("transform","translate(20,0)").style("stroke-miterlimit",1),r.exit().remove(),r.each(function(t,r){var i=n.select(this),a=e[r?"increasing":"decreasing"],l=_(void 0,a.line,y,d);i.style("fill","none").call(o.dashLine,a.line.dash,l),l&&s.stroke(i,a.line.color)})})}},{"../../lib":169,"../../registry":261,"../../traces/pie/helpers":289,"../../traces/pie/style_one":290,"../../traces/scatter/subtypes":316,"../color":50,"../colorscale/helpers":61,"../drawing":71,d3:14}],107:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../plots/plots"),a=t("../../plots/cartesian/axis_ids"),o=t("../../lib"),s=t("../../fonts/ploticon"),l=o._,u=e.exports={};function c(t,e){var r,i,o=e.currentTarget,s=o.getAttribute("data-attr"),l=o.getAttribute("data-val")||!0,u=t._fullLayout,c={},p=a.list(t,null,!0),h=u._cartesianSpikesEnabled;if("zoom"===s){var f,d="in"===l?.5:2,m=(1+d)/2,y=(1-d)/2;for(i=0;i<p.length;i++)if(!(r=p[i]).fixedrange)if(f=r._name,"auto"===l)c[f+".autorange"]=!0;else if("reset"===l){if(void 0===r._rangeInitial)c[f+".autorange"]=!0;else{var g=r._rangeInitial.slice();c[f+".range[0]"]=g[0],c[f+".range[1]"]=g[1]}void 0!==r._showSpikeInitial&&(c[f+".showspikes"]=r._showSpikeInitial,"on"!==h||r._showSpikeInitial||(h="off"))}else{var v=[r.r2l(r.range[0]),r.r2l(r.range[1])],_=[m*v[0]+y*v[1],m*v[1]+y*v[0]];c[f+".range[0]"]=r.l2r(_[0]),c[f+".range[1]"]=r.l2r(_[1])}}else"hovermode"!==s||"x"!==l&&"y"!==l||(l=u._isHoriz?"y":"x",o.setAttribute("data-val",l)),c[s]=l;u._cartesianSpikesEnabled=h,n.call("_guiRelayout",t,c)}function p(t,e){for(var r=e.currentTarget,i=r.getAttribute("data-attr"),a=r.getAttribute("data-val")||!0,o=t._fullLayout._subplots.gl3d||[],s={},l=i.split("."),u=0;u<o.length;u++)s[o[u]+"."+l[1]]=a;var c="pan"===a?a:"zoom";s.dragmode=c,n.call("_guiRelayout",t,s)}function h(t,e){for(var r=e.currentTarget.getAttribute("data-attr"),i=t._fullLayout,a=i._subplots.gl3d||[],o={},s=0;s<a.length;s++){var l,u=a[s],c=u+".camera",p=u+".aspectratio",h=i[u]._scene;"resetLastSave"===r?(o[c+".up"]=h.viewInitial.up,o[c+".eye"]=h.viewInitial.eye,o[c+".center"]=h.viewInitial.center,l=!0):"resetDefault"===r&&(o[c+".up"]=null,o[c+".eye"]=null,o[c+".center"]=null,l=!0),l&&(o[p+".x"]=h.viewInitial.aspectratio.x,o[p+".y"]=h.viewInitial.aspectratio.y,o[p+".z"]=h.viewInitial.aspectratio.z)}n.call("_guiRelayout",t,o)}function f(t,e){var r=e.currentTarget,n=r._previousVal,i=t._fullLayout,a=i._subplots.gl3d||[],o=["xaxis","yaxis","zaxis"],s={},l={};if(n)l=n,r._previousVal=null;else{for(var u=0;u<a.length;u++){var c=a[u],p=i[c],h=c+".hovermode";s[h]=p.hovermode,l[h]=!1;for(var f=0;f<3;f++){var d=o[f],m=c+"."+d+".showspikes";l[m]=!1,s[m]=p[d].showspikes}}r._previousVal=s}return l}function d(t,e){for(var r=e.currentTarget,i=r.getAttribute("data-attr"),a=r.getAttribute("data-val")||!0,o=t._fullLayout,s=o._subplots.geo||[],l=0;l<s.length;l++){var u=s[l],c=o[u];if("zoom"===i){var p=c.projection.scale,h="in"===a?2*p:.5*p;n.call("_guiRelayout",t,u+".projection.scale",h)}}"reset"===i&&v(t,"geo")}function m(t){var e=t._fullLayout;return!e.hovermode&&(e._has("cartesian")?e._isHoriz?"y":"x":"closest")}function y(t){var e=m(t);n.call("_guiRelayout",t,"hovermode",e)}function g(t,e){for(var r=e.currentTarget.getAttribute("data-val"),i=t._fullLayout,a=i._subplots.mapbox||[],o={},s=0;s<a.length;s++){var l=a[s],u=i[l].zoom,c="in"===r?1.05*u:u/1.05;o[l+".zoom"]=c}n.call("_guiRelayout",t,o)}function v(t,e){for(var r=t._fullLayout,i=r._subplots[e]||[],a={},o=0;o<i.length;o++)for(var s=i[o],l=r[s]._subplot.viewInitial,u=Object.keys(l),c=0;c<u.length;c++){var p=u[c];a[s+"."+p]=l[p]}n.call("_guiRelayout",t,a)}u.toImage={name:"toImage",title:function(t){var e=(t._context.toImageButtonOptions||{}).format||"png";return l(t,"png"===e?"Download plot as a png":"Download plot")},icon:s.camera,click:function(t){var e=t._context.toImageButtonOptions,r={format:e.format||"png"};o.notifier(l(t,"Taking snapshot - this may take a few seconds"),"long"),"svg"!==r.format&&o.isIE()&&(o.notifier(l(t,"IE only supports svg. Changing format to svg."),"long"),r.format="svg"),["filename","width","height","scale"].forEach(function(t){t in e&&(r[t]=e[t])}),n.call("downloadImage",t,r).then(function(e){o.notifier(l(t,"Snapshot succeeded")+" - "+e,"long")}).catch(function(){o.notifier(l(t,"Sorry, there was a problem downloading your snapshot!"),"long")})}},u.sendDataToCloud={name:"sendDataToCloud",title:function(t){return l(t,"Edit in Chart Studio")},icon:s.disk,click:function(t){i.sendDataToCloud(t)}},u.editInChartStudio={name:"editInChartStudio",title:function(t){return l(t,"Edit in Chart Studio")},icon:s.pencil,click:function(t){i.sendDataToCloud(t)}},u.zoom2d={name:"zoom2d",title:function(t){return l(t,"Zoom")},attr:"dragmode",val:"zoom",icon:s.zoombox,click:c},u.pan2d={name:"pan2d",title:function(t){return l(t,"Pan")},attr:"dragmode",val:"pan",icon:s.pan,click:c},u.select2d={name:"select2d",title:function(t){return l(t,"Box Select")},attr:"dragmode",val:"select",icon:s.selectbox,click:c},u.lasso2d={name:"lasso2d",title:function(t){return l(t,"Lasso Select")},attr:"dragmode",val:"lasso",icon:s.lasso,click:c},u.zoomIn2d={name:"zoomIn2d",title:function(t){return l(t,"Zoom in")},attr:"zoom",val:"in",icon:s.zoom_plus,click:c},u.zoomOut2d={name:"zoomOut2d",title:function(t){return l(t,"Zoom out")},attr:"zoom",val:"out",icon:s.zoom_minus,click:c},u.autoScale2d={name:"autoScale2d",title:function(t){return l(t,"Autoscale")},attr:"zoom",val:"auto",icon:s.autoscale,click:c},u.resetScale2d={name:"resetScale2d",title:function(t){return l(t,"Reset axes")},attr:"zoom",val:"reset",icon:s.home,click:c},u.hoverClosestCartesian={name:"hoverClosestCartesian",title:function(t){return l(t,"Show closest data on hover")},attr:"hovermode",val:"closest",icon:s.tooltip_basic,gravity:"ne",click:c},u.hoverCompareCartesian={name:"hoverCompareCartesian",title:function(t){return l(t,"Compare data on hover")},attr:"hovermode",val:function(t){return t._fullLayout._isHoriz?"y":"x"},icon:s.tooltip_compare,gravity:"ne",click:c},u.zoom3d={name:"zoom3d",title:function(t){return l(t,"Zoom")},attr:"scene.dragmode",val:"zoom",icon:s.zoombox,click:p},u.pan3d={name:"pan3d",title:function(t){return l(t,"Pan")},attr:"scene.dragmode",val:"pan",icon:s.pan,click:p},u.orbitRotation={name:"orbitRotation",title:function(t){return l(t,"Orbital rotation")},attr:"scene.dragmode",val:"orbit",icon:s["3d_rotate"],click:p},u.tableRotation={name:"tableRotation",title:function(t){return l(t,"Turntable rotation")},attr:"scene.dragmode",val:"turntable",icon:s["z-axis"],click:p},u.resetCameraDefault3d={name:"resetCameraDefault3d",title:function(t){return l(t,"Reset camera to default")},attr:"resetDefault",icon:s.home,click:h},u.resetCameraLastSave3d={name:"resetCameraLastSave3d",title:function(t){return l(t,"Reset camera to last save")},attr:"resetLastSave",icon:s.movie,click:h},u.hoverClosest3d={name:"hoverClosest3d",title:function(t){return l(t,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:s.tooltip_basic,gravity:"ne",click:function(t,e){var r=f(t,e);n.call("_guiRelayout",t,r)}},u.zoomInGeo={name:"zoomInGeo",title:function(t){return l(t,"Zoom in")},attr:"zoom",val:"in",icon:s.zoom_plus,click:d},u.zoomOutGeo={name:"zoomOutGeo",title:function(t){return l(t,"Zoom out")},attr:"zoom",val:"out",icon:s.zoom_minus,click:d},u.resetGeo={name:"resetGeo",title:function(t){return l(t,"Reset")},attr:"reset",val:null,icon:s.autoscale,click:d},u.hoverClosestGeo={name:"hoverClosestGeo",title:function(t){return l(t,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:s.tooltip_basic,gravity:"ne",click:y},u.hoverClosestGl2d={name:"hoverClosestGl2d",title:function(t){return l(t,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:s.tooltip_basic,gravity:"ne",click:y},u.hoverClosestPie={name:"hoverClosestPie",title:function(t){return l(t,"Toggle show closest data on hover")},attr:"hovermode",val:"closest",icon:s.tooltip_basic,gravity:"ne",click:y},u.resetViewSankey={name:"resetSankeyGroup",title:function(t){return l(t,"Reset view")},icon:s.home,click:function(t){for(var e={"node.groups":[],"node.x":[],"node.y":[]},r=0;r<t._fullData.length;r++){var i=t._fullData[r]._viewInitial;e["node.groups"].push(i.node.groups.slice()),e["node.x"].push(i.node.x.slice()),e["node.y"].push(i.node.y.slice())}n.call("restyle",t,e)}},u.toggleHover={name:"toggleHover",title:function(t){return l(t,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:s.tooltip_basic,gravity:"ne",click:function(t,e){var r=f(t,e);r.hovermode=m(t),n.call("_guiRelayout",t,r)}},u.resetViews={name:"resetViews",title:function(t){return l(t,"Reset views")},icon:s.home,click:function(t,e){var r=e.currentTarget;r.setAttribute("data-attr","zoom"),r.setAttribute("data-val","reset"),c(t,e),r.setAttribute("data-attr","resetLastSave"),h(t,e),v(t,"geo"),v(t,"mapbox")}},u.toggleSpikelines={name:"toggleSpikelines",title:function(t){return l(t,"Toggle Spike Lines")},icon:s.spikeline,attr:"_cartesianSpikesEnabled",val:"on",click:function(t){var e=t._fullLayout,r=e._cartesianSpikesEnabled;e._cartesianSpikesEnabled="on"===r?"off":"on",n.call("_guiRelayout",t,function(t){for(var e="on"===t._fullLayout._cartesianSpikesEnabled,r=a.list(t,null,!0),n={},i=0;i<r.length;i++){var o=r[i];n[o._name+".showspikes"]=!!e||o._showSpikeInitial}return n}(t))}},u.resetViewMapbox={name:"resetViewMapbox",title:function(t){return l(t,"Reset view")},attr:"reset",icon:s.home,click:function(t){v(t,"mapbox")}},u.zoomInMapbox={name:"zoomInMapbox",title:function(t){return l(t,"Zoom in")},attr:"zoom",val:"in",icon:s.zoom_plus,click:g},u.zoomOutMapbox={name:"zoomOutMapbox",title:function(t){return l(t,"Zoom out")},attr:"zoom",val:"out",icon:s.zoom_minus,click:g}},{"../../fonts/ploticon":151,"../../lib":169,"../../plots/cartesian/axis_ids":216,"../../plots/plots":252,"../../registry":261}],108:[function(t,e,r){"use strict";r.manage=t("./manage")},{"./manage":109}],109:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axis_ids"),i=t("../../traces/scatter/subtypes"),a=t("../../registry"),o=t("./modebar"),s=t("./buttons");e.exports=function(t){var e=t._fullLayout,r=t._context,l=e._modeBar;if(r.displayModeBar||r.watermark){if(!Array.isArray(r.modeBarButtonsToRemove))throw new Error(["*modeBarButtonsToRemove* configuration options","must be an array."].join(" "));if(!Array.isArray(r.modeBarButtonsToAdd))throw new Error(["*modeBarButtonsToAdd* configuration options","must be an array."].join(" "));var u,c=r.modeBarButtons;u=Array.isArray(c)&&c.length?function(t){for(var e=0;e<t.length;e++)for(var r=t[e],n=0;n<r.length;n++){var i=r[n];if("string"==typeof i){if(void 0===s[i])throw new Error(["*modeBarButtons* configuration options","invalid button name"].join(" "));t[e][n]=s[i]}}return t}(c):!r.displayModeBar&&r.watermark?[]:function(t){var e=t._fullLayout,r=t._fullData,o=t._context,l=o.modeBarButtonsToRemove,u=o.modeBarButtonsToAdd,c=e._has("cartesian"),p=e._has("gl3d"),h=e._has("geo"),f=e._has("pie"),d=e._has("funnelarea"),m=e._has("gl2d"),y=e._has("ternary"),g=e._has("mapbox"),v=e._has("polar"),_=e._has("sankey"),x=function(t){for(var e=n.list({_fullLayout:t},null,!0),r=0;r<e.length;r++)if(!e[r].fixedrange)return!1;return!0}(e),b=[];function w(t){if(t.length){for(var e=[],r=0;r<t.length;r++){var n=t[r];-1===l.indexOf(n)&&e.push(s[n])}b.push(e)}}var k=["toImage"];o.showEditInChartStudio?k.push("editInChartStudio"):o.showSendToCloud&&k.push("sendDataToCloud");w(k);var T=[],A=[],M=[],S=[];(c||m||f||d||y)+h+p+g+v>1?(A=["toggleHover"],M=["resetViews"]):h?(T=["zoomInGeo","zoomOutGeo"],A=["hoverClosestGeo"],M=["resetGeo"]):p?(A=["hoverClosest3d"],M=["resetCameraDefault3d","resetCameraLastSave3d"]):g?(T=["zoomInMapbox","zoomOutMapbox"],A=["toggleHover"],M=["resetViewMapbox"]):m?A=["hoverClosestGl2d"]:f?A=["hoverClosestPie"]:_?(A=["hoverClosestCartesian","hoverCompareCartesian"],M=["resetViewSankey"]):A=["toggleHover"];c&&(A=["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]);(function(t){for(var e=0;e<t.length;e++)if(!a.traceIs(t[e],"noHover"))return!1;return!0})(r)&&(A=[]);!c&&!m||x||(T=["zoomIn2d","zoomOut2d","autoScale2d"],"resetViews"!==M[0]&&(M=["resetScale2d"]));p?S=["zoom3d","pan3d","orbitRotation","tableRotation"]:(c||m)&&!x||y?S=["zoom2d","pan2d"]:g||h?S=["pan2d"]:v&&(S=["zoom2d"]);(function(t){for(var e=!1,r=0;r<t.length&&!e;r++){var n=t[r];n._module&&n._module.selectPoints&&(a.traceIs(n,"scatter-like")?(i.hasMarkers(n)||i.hasText(n))&&(e=!0):a.traceIs(n,"box-violin")&&"all"!==n.boxpoints&&"all"!==n.points||(e=!0))}return e})(r)&&S.push("select2d","lasso2d");return w(S),w(T.concat(M)),w(A),function(t,e){if(e.length)if(Array.isArray(e[0]))for(var r=0;r<e.length;r++)t.push(e[r]);else t.push(e);return t}(b,u)}(t),l?l.update(t,u):e._modeBar=o(t,u)}else l&&(l.destroy(),delete e._modeBar)}},{"../../plots/cartesian/axis_ids":216,"../../registry":261,"../../traces/scatter/subtypes":316,"./buttons":107,"./modebar":110}],110:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("../../lib"),o=t("../../fonts/ploticon"),s=new DOMParser;function l(t){this.container=t.container,this.element=document.createElement("div"),this.update(t.graphInfo,t.buttons),this.container.appendChild(this.element)}var u=l.prototype;u.update=function(t,e){this.graphInfo=t;var r=this.graphInfo._context,n=this.graphInfo._fullLayout,i="modebar-"+n._uid;this.element.setAttribute("id",i),this._uid=i,this.element.className="modebar","hover"===r.displayModeBar&&(this.element.className+=" modebar--hover ease-bg"),"v"===n.modebar.orientation&&(this.element.className+=" vertical",e=e.reverse());var o=n.modebar,s="hover"===r.displayModeBar?".js-plotly-plot .plotly:hover ":"";a.deleteRelatedStyleRule(i),a.addRelatedStyleRule(i,s+"#"+i+" .modebar-group","background-color: "+o.bgcolor),a.addRelatedStyleRule(i,"#"+i+" .modebar-btn .icon path","fill: "+o.color),a.addRelatedStyleRule(i,"#"+i+" .modebar-btn:hover .icon path","fill: "+o.activecolor),a.addRelatedStyleRule(i,"#"+i+" .modebar-btn.active .icon path","fill: "+o.activecolor);var l=!this.hasButtons(e),u=this.hasLogo!==r.displaylogo,c=this.locale!==r.locale;if(this.locale=r.locale,(l||u||c)&&(this.removeAllButtons(),this.updateButtons(e),r.watermark||r.displaylogo)){var p=this.getLogo();r.watermark&&(p.className=p.className+" watermark"),"v"===n.modebar.orientation?this.element.insertBefore(p,this.element.childNodes[0]):this.element.appendChild(p),this.hasLogo=!0}this.updateActiveButton()},u.updateButtons=function(t){var e=this;this.buttons=t,this.buttonElements=[],this.buttonsNames=[],this.buttons.forEach(function(t){var r=e.createGroup();t.forEach(function(t){var n=t.name;if(!n)throw new Error("must provide button 'name' in button config");if(-1!==e.buttonsNames.indexOf(n))throw new Error("button name '"+n+"' is taken");e.buttonsNames.push(n);var i=e.createButton(t);e.buttonElements.push(i),r.appendChild(i)}),e.element.appendChild(r)})},u.createGroup=function(){var t=document.createElement("div");return t.className="modebar-group",t},u.createButton=function(t){var e=this,r=document.createElement("a");r.setAttribute("rel","tooltip"),r.className="modebar-btn";var i=t.title;void 0===i?i=t.name:"function"==typeof i&&(i=i(this.graphInfo)),(i||0===i)&&r.setAttribute("data-title",i),void 0!==t.attr&&r.setAttribute("data-attr",t.attr);var a=t.val;if(void 0!==a&&("function"==typeof a&&(a=a(this.graphInfo)),r.setAttribute("data-val",a)),"function"!=typeof t.click)throw new Error("must provide button 'click' function in button config");r.addEventListener("click",function(r){t.click(e.graphInfo,r),e.updateActiveButton(r.currentTarget)}),r.setAttribute("data-toggle",t.toggle||!1),t.toggle&&n.select(r).classed("active",!0);var s=t.icon;return"function"==typeof s?r.appendChild(s()):r.appendChild(this.createIcon(s||o.question)),r.setAttribute("data-gravity",t.gravity||"n"),r},u.createIcon=function(t){var e,r=i(t.height)?Number(t.height):t.ascent-t.descent,n="http://www.w3.org/2000/svg";if(t.path){(e=document.createElementNS(n,"svg")).setAttribute("viewBox",[0,0,t.width,r].join(" ")),e.setAttribute("class","icon");var a=document.createElementNS(n,"path");a.setAttribute("d",t.path),t.transform?a.setAttribute("transform",t.transform):void 0!==t.ascent&&a.setAttribute("transform","matrix(1 0 0 -1 0 "+t.ascent+")"),e.appendChild(a)}t.svg&&(e=s.parseFromString(t.svg,"application/xml").childNodes[0]);return e.setAttribute("height","1em"),e.setAttribute("width","1em"),e},u.updateActiveButton=function(t){var e=this.graphInfo._fullLayout,r=void 0!==t?t.getAttribute("data-attr"):null;this.buttonElements.forEach(function(t){var i=t.getAttribute("data-val")||!0,o=t.getAttribute("data-attr"),s="true"===t.getAttribute("data-toggle"),l=n.select(t);if(s)o===r&&l.classed("active",!l.classed("active"));else{var u=null===o?o:a.nestedProperty(e,o).get();l.classed("active",u===i)}})},u.hasButtons=function(t){var e=this.buttons;if(!e)return!1;if(t.length!==e.length)return!1;for(var r=0;r<t.length;++r){if(t[r].length!==e[r].length)return!1;for(var n=0;n<t[r].length;n++)if(t[r][n].name!==e[r][n].name)return!1}return!0},u.getLogo=function(){var t=this.createGroup(),e=document.createElement("a");return e.href="https://plot.ly/",e.target="_blank",e.setAttribute("data-title",a._(this.graphInfo,"Produced with Plotly")),e.className="modebar-btn plotlyjsicon modebar-btn--logo",e.appendChild(this.createIcon(o.newplotlylogo)),t.appendChild(e),t},u.removeAllButtons=function(){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.hasLogo=!1},u.destroy=function(){a.removeElement(this.container.querySelector(".modebar")),a.deleteRelatedStyleRule(this._uid)},e.exports=function(t,e){var r=t._fullLayout,i=new l({graphInfo:t,container:r._modebardiv.node(),buttons:e});return r._privateplot&&n.select(i.element).append("span").classed("badge-private float--left",!0).text("PRIVATE"),i}},{"../../fonts/ploticon":151,"../../lib":169,d3:14,"fast-isnumeric":16}],111:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../color/attributes"),a=(0,t("../../plot_api/plot_template").templatedArray)("button",{visible:{valType:"boolean",dflt:!0,editType:"plot"},step:{valType:"enumerated",values:["month","year","day","hour","minute","second","all"],dflt:"month",editType:"plot"},stepmode:{valType:"enumerated",values:["backward","todate"],dflt:"backward",editType:"plot"},count:{valType:"number",min:0,dflt:1,editType:"plot"},label:{valType:"string",editType:"plot"},editType:"plot"});e.exports={visible:{valType:"boolean",editType:"plot"},buttons:a,x:{valType:"number",min:-2,max:3,editType:"plot"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left",editType:"plot"},y:{valType:"number",min:-2,max:3,editType:"plot"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"bottom",editType:"plot"},font:n({editType:"plot"}),bgcolor:{valType:"color",dflt:i.lightLine,editType:"plot"},activecolor:{valType:"color",editType:"plot"},bordercolor:{valType:"color",dflt:i.defaultLine,editType:"plot"},borderwidth:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"plot"}},{"../../plot_api/plot_template":203,"../../plots/font_attributes":239,"../color/attributes":49}],112:[function(t,e,r){"use strict";e.exports={yPad:.02,minButtonWidth:30,rx:3,ry:3,lightAmount:25,darkAmount:10}},{}],113:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../color"),a=t("../../plot_api/plot_template"),o=t("../../plots/array_container_defaults"),s=t("./attributes"),l=t("./constants");function u(t,e,r,i){var a=i.calendar;function o(r,i){return n.coerce(t,e,s.buttons,r,i)}if(o("visible")){var l=o("step");"all"!==l&&(!a||"gregorian"===a||"month"!==l&&"year"!==l?o("stepmode"):e.stepmode="backward",o("count")),o("label")}}e.exports=function(t,e,r,c,p){var h=t.rangeselector||{},f=a.newContainer(e,"rangeselector");function d(t,e){return n.coerce(h,f,s,t,e)}if(d("visible",o(h,f,{name:"buttons",handleItemDefaults:u,calendar:p}).length>0)){var m=function(t,e,r){for(var n=r.filter(function(r){return e[r].anchor===t._id}),i=0,a=0;a<n.length;a++){var o=e[n[a]].domain;o&&(i=Math.max(o[1],i))}return[t.domain[0],i+l.yPad]}(e,r,c);d("x",m[0]),d("y",m[1]),n.noneOrAll(t,e,["x","y"]),d("xanchor"),d("yanchor"),n.coerceFont(d,"font",r.font);var y=d("bgcolor");d("activecolor",i.contrast(y,l.lightAmount,l.darkAmount)),d("bordercolor"),d("borderwidth")}}},{"../../lib":169,"../../plot_api/plot_template":203,"../../plots/array_container_defaults":209,"../color":50,"./attributes":111,"./constants":112}],114:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../registry"),a=t("../../plots/plots"),o=t("../color"),s=t("../drawing"),l=t("../../lib"),u=t("../../lib/svg_text_utils"),c=t("../../plots/cartesian/axis_ids"),p=t("../../constants/alignment"),h=p.LINE_SPACING,f=p.FROM_TL,d=p.FROM_BR,m=t("./constants"),y=t("./get_update_object");function g(t){return t._id}function v(t,e,r){var n=l.ensureSingle(t,"rect","selector-rect",function(t){t.attr("shape-rendering","crispEdges")});n.attr({rx:m.rx,ry:m.ry}),n.call(o.stroke,e.bordercolor).call(o.fill,function(t,e){return e._isActive||e._isHovered?t.activecolor:t.bgcolor}(e,r)).style("stroke-width",e.borderwidth+"px")}function _(t,e,r,n){l.ensureSingle(t,"text","selector-text",function(t){t.classed("user-select-none",!0).attr("text-anchor","middle")}).call(s.font,e.font).text(function(t,e){if(t.label)return e?l.templateString(t.label,e):t.label;return"all"===t.step?"all":t.count+t.step.charAt(0)}(r,n._fullLayout._meta)).call(function(t){u.convertToTspans(t,n)})}e.exports=function(t){var e=t._fullLayout._infolayer.selectAll(".rangeselector").data(function(t){for(var e=c.list(t,"x",!0),r=[],n=0;n<e.length;n++){var i=e[n];i.rangeselector&&i.rangeselector.visible&&r.push(i)}return r}(t),g);e.enter().append("g").classed("rangeselector",!0),e.exit().remove(),e.style({cursor:"pointer","pointer-events":"all"}),e.each(function(e){var r=n.select(this),o=e,c=o.rangeselector,p=r.selectAll("g.button").data(l.filterVisible(c.buttons));p.enter().append("g").classed("button",!0),p.exit().remove(),p.each(function(e){var r=n.select(this),a=y(o,e);e._isActive=function(t,e,r){if("all"===e.step)return!0===t.autorange;var n=Object.keys(r);return t.range[0]===r[n[0]]&&t.range[1]===r[n[1]]}(o,e,a),r.call(v,c,e),r.call(_,c,e,t),r.on("click",function(){t._dragged||i.call("_guiRelayout",t,a)}),r.on("mouseover",function(){e._isHovered=!0,r.call(v,c,e)}),r.on("mouseout",function(){e._isHovered=!1,r.call(v,c,e)})}),function(t,e,r,i,o){var c=0,p=0,y=r.borderwidth;e.each(function(){var t=n.select(this),e=t.select(".selector-text"),i=r.font.size*h,a=Math.max(i*u.lineCount(e),16)+3;p=Math.max(p,a)}),e.each(function(){var t=n.select(this),e=t.select(".selector-rect"),i=t.select(".selector-text"),a=i.node()&&s.bBox(i.node()).width,o=r.font.size*h,l=u.lineCount(i),f=Math.max(a+10,m.minButtonWidth);t.attr("transform","translate("+(y+c)+","+y+")"),e.attr({x:0,y:0,width:f,height:p}),u.positionText(i,f/2,p/2-(l-1)*o/2+3),c+=f+5});var g=t._fullLayout._size,v=g.l+g.w*r.x,_=g.t+g.h*(1-r.y),x="left";l.isRightAnchor(r)&&(v-=c,x="right");l.isCenterAnchor(r)&&(v-=c/2,x="center");var b="top";l.isBottomAnchor(r)&&(_-=p,b="bottom");l.isMiddleAnchor(r)&&(_-=p/2,b="middle");c=Math.ceil(c),p=Math.ceil(p),v=Math.round(v),_=Math.round(_),a.autoMargin(t,i+"-range-selector",{x:r.x,y:r.y,l:c*f[x],r:c*d[x],b:p*d[b],t:p*f[b]}),o.attr("transform","translate("+v+","+_+")")}(t,p,c,o._name,r)})}},{"../../constants/alignment":144,"../../lib":169,"../../lib/svg_text_utils":190,"../../plots/cartesian/axis_ids":216,"../../plots/plots":252,"../../registry":261,"../color":50,"../drawing":71,"./constants":112,"./get_update_object":115,d3:14}],115:[function(t,e,r){"use strict";var n=t("d3");e.exports=function(t,e){var r=t._name,i={};if("all"===e.step)i[r+".autorange"]=!0;else{var a=function(t,e){var r,i=t.range,a=new Date(t.r2l(i[1])),o=e.step,s=e.count;switch(e.stepmode){case"backward":r=t.l2r(+n.time[o].utc.offset(a,-s));break;case"todate":var l=n.time[o].utc.offset(a,-s);r=t.l2r(+n.time[o].utc.ceil(l))}var u=i[1];return[r,u]}(t,e);i[r+".range[0]"]=a[0],i[r+".range[1]"]=a[1]}return i}},{d3:14}],116:[function(t,e,r){"use strict";e.exports={moduleType:"component",name:"rangeselector",schema:{subplots:{xaxis:{rangeselector:t("./attributes")}}},layoutAttributes:t("./attributes"),handleDefaults:t("./defaults"),draw:t("./draw")}},{"./attributes":111,"./defaults":113,"./draw":114}],117:[function(t,e,r){"use strict";var n=t("../color/attributes");e.exports={bgcolor:{valType:"color",dflt:n.background,editType:"plot"},bordercolor:{valType:"color",dflt:n.defaultLine,editType:"plot"},borderwidth:{valType:"integer",dflt:0,min:0,editType:"plot"},autorange:{valType:"boolean",dflt:!0,editType:"calc",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},range:{valType:"info_array",items:[{valType:"any",editType:"calc",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"calc",impliedEdits:{"^autorange":!1}}],editType:"calc",impliedEdits:{autorange:!1}},thickness:{valType:"number",dflt:.15,min:0,max:1,editType:"plot"},visible:{valType:"boolean",dflt:!0,editType:"calc"},editType:"calc"}},{"../color/attributes":49}],118:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axis_ids").list,i=t("../../plots/cartesian/autorange").getAutoRange,a=t("./constants");e.exports=function(t){for(var e=n(t,"x",!0),r=0;r<e.length;r++){var o=e[r],s=o[a.name];s&&s.visible&&s.autorange&&(s._input.autorange=!0,s._input.range=s.range=i(t,o))}}},{"../../plots/cartesian/autorange":212,"../../plots/cartesian/axis_ids":216,"./constants":119}],119:[function(t,e,r){"use strict";e.exports={name:"rangeslider",containerClassName:"rangeslider-container",bgClassName:"rangeslider-bg",rangePlotClassName:"rangeslider-rangeplot",maskMinClassName:"rangeslider-mask-min",maskMaxClassName:"rangeslider-mask-max",slideBoxClassName:"rangeslider-slidebox",grabberMinClassName:"rangeslider-grabber-min",grabAreaMinClassName:"rangeslider-grabarea-min",handleMinClassName:"rangeslider-handle-min",grabberMaxClassName:"rangeslider-grabber-max",grabAreaMaxClassName:"rangeslider-grabarea-max",handleMaxClassName:"rangeslider-handle-max",maskMinOppAxisClassName:"rangeslider-mask-min-opp-axis",maskMaxOppAxisClassName:"rangeslider-mask-max-opp-axis",maskColor:"rgba(0,0,0,0.4)",maskOppAxisColor:"rgba(0,0,0,0.2)",slideBoxFill:"transparent",slideBoxCursor:"ew-resize",grabAreaFill:"transparent",grabAreaCursor:"col-resize",grabAreaWidth:10,handleWidth:4,handleRadius:1,handleStrokeWidth:1,extraPad:15}},{}],120:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plot_api/plot_template"),a=t("../../plots/cartesian/axis_ids"),o=t("./attributes"),s=t("./oppaxis_attributes");e.exports=function(t,e,r){var l=t[r],u=e[r];if(l.rangeslider||e._requestRangeslider[u._id]){n.isPlainObject(l.rangeslider)||(l.rangeslider={});var c,p,h=l.rangeslider,f=i.newContainer(u,"rangeslider");if(b("visible")){b("bgcolor",e.plot_bgcolor),b("bordercolor"),b("borderwidth"),b("thickness"),b("autorange",!u.isValidRange(h.range)),b("range");var d=e._subplots;if(d)for(var m=d.cartesian.filter(function(t){return t.substr(0,t.indexOf("y"))===a.name2id(r)}).map(function(t){return t.substr(t.indexOf("y"),t.length)}),y=n.simpleMap(m,a.id2name),g=0;g<y.length;g++){var v=y[g];c=h[v]||{},p=i.newContainer(f,v,"yaxis");var _,x=e[v];c.range&&x.isValidRange(c.range)&&(_="fixed"),"match"!==w("rangemode",_)&&w("range",x.range.slice())}f._input=h}}function b(t,e){return n.coerce(h,f,o,t,e)}function w(t,e){return n.coerce(c,p,s,t,e)}}},{"../../lib":169,"../../plot_api/plot_template":203,"../../plots/cartesian/axis_ids":216,"./attributes":117,"./oppaxis_attributes":124}],121:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../registry"),a=t("../../plots/plots"),o=t("../../lib"),s=t("../drawing"),l=t("../color"),u=t("../titles"),c=t("../../plots/cartesian"),p=t("../../plots/cartesian/axis_ids"),h=t("../dragelement"),f=t("../../lib/setcursor"),d=t("./constants");function m(t,e,r,n){var i=o.ensureSingle(t,"rect",d.bgClassName,function(t){t.attr({x:0,y:0,"shape-rendering":"crispEdges"})}),a=n.borderwidth%2==0?n.borderwidth:n.borderwidth-1,l=-n._offsetShift,u=s.crispRound(e,n.borderwidth);i.attr({width:n._width+a,height:n._height+a,transform:"translate("+l+","+l+")",fill:n.bgcolor,stroke:n.bordercolor,"stroke-width":u})}function y(t,e,r,n){var i=e._fullLayout;o.ensureSingleById(i._topdefs,"clipPath",n._clipId,function(t){t.append("rect").attr({x:0,y:0})}).select("rect").attr({width:n._width,height:n._height})}function g(t,e,r,i){var l,u=e.calcdata,h=t.selectAll("g."+d.rangePlotClassName).data(r._subplotsWith,o.identity);h.enter().append("g").attr("class",function(t){return d.rangePlotClassName+" "+t}).call(s.setClipUrl,i._clipId,e),h.order(),h.exit().remove(),h.each(function(t,o){var s=n.select(this),h=0===o,f=p.getFromId(e,t,"y"),d=f._name,m=i[d],y={data:[],layout:{xaxis:{type:r.type,domain:[0,1],range:i.range.slice(),calendar:r.calendar},width:i._width,height:i._height,margin:{t:0,b:0,l:0,r:0}},_context:e._context};y.layout[d]={type:f.type,domain:[0,1],range:"match"!==m.rangemode?m.range.slice():f.range.slice(),calendar:f.calendar},a.supplyDefaults(y);var g=y._fullLayout.xaxis,v=y._fullLayout[d];g.clearCalc(),g.setScale(),v.clearCalc(),v.setScale();var _={id:t,plotgroup:s,xaxis:g,yaxis:v,isRangePlot:!0};h?l=_:(_.mainplot="xy",_.mainplotinfo=l),c.rangePlot(e,_,function(t,e){for(var r=[],n=0;n<t.length;n++){var i=t[n],a=i[0].trace;a.xaxis+a.yaxis===e&&r.push(i)}return r}(u,t))})}function v(t,e,r,n,i){(o.ensureSingle(t,"rect",d.maskMinClassName,function(t){t.attr({x:0,y:0,"shape-rendering":"crispEdges"})}).attr("height",n._height).call(l.fill,d.maskColor),o.ensureSingle(t,"rect",d.maskMaxClassName,function(t){t.attr({y:0,"shape-rendering":"crispEdges"})}).attr("height",n._height).call(l.fill,d.maskColor),"match"!==i.rangemode)&&(o.ensureSingle(t,"rect",d.maskMinOppAxisClassName,function(t){t.attr({y:0,"shape-rendering":"crispEdges"})}).attr("width",n._width).call(l.fill,d.maskOppAxisColor),o.ensureSingle(t,"rect",d.maskMaxOppAxisClassName,function(t){t.attr({y:0,"shape-rendering":"crispEdges"})}).attr("width",n._width).style("border-top",d.maskOppBorder).call(l.fill,d.maskOppAxisColor))}function _(t,e,r,n){e._context.staticPlot||o.ensureSingle(t,"rect",d.slideBoxClassName,function(t){t.attr({y:0,cursor:d.slideBoxCursor,"shape-rendering":"crispEdges"})}).attr({height:n._height,fill:d.slideBoxFill})}function x(t,e,r,n){var i=o.ensureSingle(t,"g",d.grabberMinClassName),a=o.ensureSingle(t,"g",d.grabberMaxClassName),s={x:0,width:d.handleWidth,rx:d.handleRadius,fill:l.background,stroke:l.defaultLine,"stroke-width":d.handleStrokeWidth,"shape-rendering":"crispEdges"},u={y:Math.round(n._height/4),height:Math.round(n._height/2)};if(o.ensureSingle(i,"rect",d.handleMinClassName,function(t){t.attr(s)}).attr(u),o.ensureSingle(a,"rect",d.handleMaxClassName,function(t){t.attr(s)}).attr(u),!e._context.staticPlot){var c={width:d.grabAreaWidth,x:0,y:0,fill:d.grabAreaFill,cursor:d.grabAreaCursor};o.ensureSingle(i,"rect",d.grabAreaMinClassName,function(t){t.attr(c)}).attr("height",n._height),o.ensureSingle(a,"rect",d.grabAreaMaxClassName,function(t){t.attr(c)}).attr("height",n._height)}}e.exports=function(t){for(var e=t._fullLayout,r=e._rangeSliderData,a=0;a<r.length;a++){var s=r[a][d.name];s._clipId=s._id+"-"+e._uid}var l=e._infolayer.selectAll("g."+d.containerClassName).data(r,function(t){return t._name});l.exit().each(function(t){var r=t[d.name];e._topdefs.select("#"+r._clipId).remove()}).remove(),0!==r.length&&(l.enter().append("g").classed(d.containerClassName,!0).attr("pointer-events","all"),l.each(function(r){var a=n.select(this),s=r[d.name],l=e[p.id2name(r.anchor)],c=s[p.id2name(r.anchor)];if(s.range){var b,w=o.simpleMap(s.range,r.r2l),k=o.simpleMap(r.range,r.r2l);b=k[0]<k[1]?[Math.min(w[0],k[0]),Math.max(w[1],k[1])]:[Math.max(w[0],k[0]),Math.min(w[1],k[1])],s.range=s._input.range=o.simpleMap(b,r.l2r)}r.cleanRange("rangeslider.range");var T=e._size,A=r.domain;s._width=T.w*(A[1]-A[0]);var M=Math.round(T.l+T.w*A[0]),S=Math.round(T.t+T.h*(1-r._counterDomainMin)+("bottom"===r.side?r._depth:0)+s._offsetShift+d.extraPad);a.attr("transform","translate("+M+","+S+")");var L=r.r2l(s.range[0]),C=r.r2l(s.range[1]),E=C-L;if(s.p2d=function(t){return t/s._width*E+L},s.d2p=function(t){return(t-L)/E*s._width},s._rl=[L,C],"match"!==c.rangemode){var z=l.r2l(c.range[0]),P=l.r2l(c.range[1])-z;s.d2pOppAxis=function(t){return(t-z)/P*s._height}}a.call(m,t,r,s).call(y,t,r,s).call(g,t,r,s).call(v,t,r,s,c).call(_,t,r,s).call(x,t,r,s),function(t,e,r,a){var s=t.select("rect."+d.slideBoxClassName).node(),l=t.select("rect."+d.grabAreaMinClassName).node(),u=t.select("rect."+d.grabAreaMaxClassName).node();t.on("mousedown",function(){var c=n.event,p=c.target,d=c.clientX,m=d-t.node().getBoundingClientRect().left,y=a.d2p(r._rl[0]),g=a.d2p(r._rl[1]),v=h.coverSlip();function _(t){var c,h,_,x=+t.clientX-d;switch(p){case s:_="ew-resize",c=y+x,h=g+x;break;case l:_="col-resize",c=y+x,h=g;break;case u:_="col-resize",c=y,h=g+x;break;default:_="ew-resize",c=m,h=m+x}if(h<c){var b=h;h=c,c=b}a._pixelMin=c,a._pixelMax=h,f(n.select(v),_),function(t,e,r,n){function a(t){return r.l2r(o.constrain(t,n._rl[0],n._rl[1]))}var s=a(n.p2d(n._pixelMin)),l=a(n.p2d(n._pixelMax));window.requestAnimationFrame(function(){i.call("_guiRelayout",e,r._name+".range",[s,l])})}(0,e,r,a)}v.addEventListener("mousemove",_),v.addEventListener("mouseup",function t(){v.removeEventListener("mousemove",_);v.removeEventListener("mouseup",t);o.removeElement(v)})})}(a,t,r,s),function(t,e,r,n,i,a){var s=d.handleWidth/2;function l(t){return o.constrain(t,0,n._width)}function u(t){return o.constrain(t,0,n._height)}function c(t){return o.constrain(t,-s,n._width+s)}var p=l(n.d2p(r._rl[0])),h=l(n.d2p(r._rl[1]));if(t.select("rect."+d.slideBoxClassName).attr("x",p).attr("width",h-p),t.select("rect."+d.maskMinClassName).attr("width",p),t.select("rect."+d.maskMaxClassName).attr("x",h).attr("width",n._width-h),"match"!==a.rangemode){var f=n._height-u(n.d2pOppAxis(i._rl[1])),m=n._height-u(n.d2pOppAxis(i._rl[0]));t.select("rect."+d.maskMinOppAxisClassName).attr("x",p).attr("height",f).attr("width",h-p),t.select("rect."+d.maskMaxOppAxisClassName).attr("x",p).attr("y",m).attr("height",n._height-m).attr("width",h-p),t.select("rect."+d.slideBoxClassName).attr("y",f).attr("height",m-f)}var y=Math.round(c(p-s))-.5,g=Math.round(c(h-s))+.5;t.select("g."+d.grabberMinClassName).attr("transform","translate("+y+",0.5)"),t.select("g."+d.grabberMaxClassName).attr("transform","translate("+g+",0.5)")}(a,0,r,s,l,c),"bottom"===r.side&&u.draw(t,r._id+"title",{propContainer:r,propName:r._name+".title",placeholder:e._dfltTitle.x,attributes:{x:r._offset+r._length/2,y:S+s._height+s._offsetShift+10+1.5*r.title.font.size,"text-anchor":"middle"}})}))}},{"../../lib":169,"../../lib/setcursor":188,"../../plots/cartesian":224,"../../plots/cartesian/axis_ids":216,"../../plots/plots":252,"../../registry":261,"../color":50,"../dragelement":68,"../drawing":71,"../titles":137,"./constants":119,d3:14}],122:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axis_ids"),i=t("../../lib/svg_text_utils"),a=t("./constants"),o=t("../../constants/alignment").LINE_SPACING,s=a.name;function l(t){var e=t&&t[s];return e&&e.visible}r.isVisible=l,r.makeData=function(t){var e=n.list({_fullLayout:t},"x",!0),r=t.margin,i=[];if(!t._has("gl2d"))for(var a=0;a<e.length;a++){var o=e[a];if(l(o)){i.push(o);var u=o[s];u._id=s+o._id,u._height=(t.height-r.b-r.t)*u.thickness,u._offsetShift=Math.floor(u.borderwidth/2)}}t._rangeSliderData=i},r.autoMarginOpts=function(t,e){var r=t._fullLayout,n=e[s],l=e._id.charAt(0),u=0,c=0;"bottom"===e.side&&(u=e._depth,e.title.text!==r._dfltTitle[l]&&(c=1.5*e.title.font.size+10+n._offsetShift,c+=(e.title.text.match(i.BR_TAG_ALL)||[]).length*e.title.font.size*o));return{x:0,y:e._counterDomainMin,l:0,r:0,t:0,b:n._height+u+Math.max(r.margin.b,c),pad:a.extraPad+2*n._offsetShift}}},{"../../constants/alignment":144,"../../lib/svg_text_utils":190,"../../plots/cartesian/axis_ids":216,"./constants":119}],123:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes"),a=t("./oppaxis_attributes"),o=t("./helpers");e.exports={moduleType:"component",name:"rangeslider",schema:{subplots:{xaxis:{rangeslider:n.extendFlat({},i,{yaxis:a})}}},layoutAttributes:t("./attributes"),handleDefaults:t("./defaults"),calcAutorange:t("./calc_autorange"),draw:t("./draw"),isVisible:o.isVisible,makeData:o.makeData,autoMarginOpts:o.autoMarginOpts}},{"../../lib":169,"./attributes":117,"./calc_autorange":118,"./defaults":120,"./draw":121,"./helpers":122,"./oppaxis_attributes":124}],124:[function(t,e,r){"use strict";e.exports={_isSubplotObj:!0,rangemode:{valType:"enumerated",values:["auto","fixed","match"],dflt:"match",editType:"calc"},range:{valType:"info_array",items:[{valType:"any",editType:"plot"},{valType:"any",editType:"plot"}],editType:"plot"},editType:"calc"}},{}],125:[function(t,e,r){"use strict";var n=t("../annotations/attributes"),i=t("../../traces/scatter/attributes").line,a=t("../drawing/attributes").dash,o=t("../../lib/extend").extendFlat,s=t("../../plot_api/plot_template").templatedArray;e.exports=s("shape",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},type:{valType:"enumerated",values:["circle","rect","path","line"],editType:"calc+arraydraw"},layer:{valType:"enumerated",values:["below","above"],dflt:"above",editType:"arraydraw"},xref:o({},n.xref,{}),xsizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},xanchor:{valType:"any",editType:"calc+arraydraw"},x0:{valType:"any",editType:"calc+arraydraw"},x1:{valType:"any",editType:"calc+arraydraw"},yref:o({},n.yref,{}),ysizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},yanchor:{valType:"any",editType:"calc+arraydraw"},y0:{valType:"any",editType:"calc+arraydraw"},y1:{valType:"any",editType:"calc+arraydraw"},path:{valType:"string",editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},line:{color:o({},i.color,{editType:"arraydraw"}),width:o({},i.width,{editType:"calc+arraydraw"}),dash:o({},a,{editType:"arraydraw"}),editType:"calc+arraydraw"},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},editType:"arraydraw"})},{"../../lib/extend":162,"../../plot_api/plot_template":203,"../../traces/scatter/attributes":292,"../annotations/attributes":35,"../drawing/attributes":70}],126:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axes"),a=t("./constants"),o=t("./helpers");function s(t){return u(t.line.width,t.xsizemode,t.x0,t.x1,t.path,!1)}function l(t){return u(t.line.width,t.ysizemode,t.y0,t.y1,t.path,!0)}function u(t,e,r,i,s,l){var u=t/2,c=l;if("pixel"===e){var p=s?o.extractPathCoords(s,l?a.paramIsY:a.paramIsX):[r,i],h=n.aggNums(Math.max,null,p),f=n.aggNums(Math.min,null,p),d=f<0?Math.abs(f)+u:u,m=h>0?h+u:u;return{ppad:u,ppadplus:c?d:m,ppadminus:c?m:d}}return{ppad:u}}function c(t,e,r,n,i){var s="category"===t.type||"multicategory"===t.type?t.r2c:t.d2c;if(void 0!==e)return[s(e),s(r)];if(n){var l,u,c,p,h=1/0,f=-1/0,d=n.match(a.segmentRE);for("date"===t.type&&(s=o.decodeDate(s)),l=0;l<d.length;l++)void 0!==(u=i[d[l].charAt(0)].drawn)&&(!(c=d[l].substr(1).match(a.paramRE))||c.length<u||((p=s(c[u]))<h&&(h=p),p>f&&(f=p)));return f>=h?[h,f]:void 0}}e.exports=function(t){var e=t._fullLayout,r=n.filterVisible(e.shapes);if(r.length&&t._fullData.length)for(var o=0;o<r.length;o++){var u,p,h=r[o];if(h._extremes={},"paper"!==h.xref){var f="pixel"===h.xsizemode?h.xanchor:h.x0,d="pixel"===h.xsizemode?h.xanchor:h.x1;(p=c(u=i.getFromId(t,h.xref),f,d,h.path,a.paramIsX))&&(h._extremes[u._id]=i.findExtremes(u,p,s(h)))}if("paper"!==h.yref){var m="pixel"===h.ysizemode?h.yanchor:h.y0,y="pixel"===h.ysizemode?h.yanchor:h.y1;(p=c(u=i.getFromId(t,h.yref),m,y,h.path,a.paramIsY))&&(h._extremes[u._id]=i.findExtremes(u,p,l(h)))}}}},{"../../lib":169,"../../plots/cartesian/axes":213,"./constants":127,"./helpers":130}],127:[function(t,e,r){"use strict";e.exports={segmentRE:/[MLHVQCTSZ][^MLHVQCTSZ]*/g,paramRE:/[^\s,]+/g,paramIsX:{M:{0:!0,drawn:0},L:{0:!0,drawn:0},H:{0:!0,drawn:0},V:{},Q:{0:!0,2:!0,drawn:2},C:{0:!0,2:!0,4:!0,drawn:4},T:{0:!0,drawn:0},S:{0:!0,2:!0,drawn:2},Z:{}},paramIsY:{M:{1:!0,drawn:1},L:{1:!0,drawn:1},H:{},V:{0:!0,drawn:0},Q:{1:!0,3:!0,drawn:3},C:{1:!0,3:!0,5:!0,drawn:5},T:{1:!0,drawn:1},S:{1:!0,3:!0,drawn:5},Z:{}},numParams:{M:2,L:2,H:1,V:1,Q:4,C:6,T:2,S:4,Z:0}}},{}],128:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axes"),a=t("../../plots/array_container_defaults"),o=t("./attributes"),s=t("./helpers");function l(t,e,r){function a(r,i){return n.coerce(t,e,o,r,i)}if(a("visible")){a("layer"),a("opacity"),a("fillcolor"),a("line.color"),a("line.width"),a("line.dash");for(var l=a("type",t.path?"path":"rect"),u=a("xsizemode"),c=a("ysizemode"),p=["x","y"],h=0;h<2;h++){var f,d,m,y=p[h],g=y+"anchor",v="x"===y?u:c,_={_fullLayout:r},x=i.coerceRef(t,e,_,y,"","paper");if("paper"!==x?((f=i.getFromId(_,x))._shapeIndices.push(e._index),m=s.rangeToShapePosition(f),d=s.shapePositionToRange(f)):d=m=n.identity,"path"!==l){var b=y+"0",w=y+"1",k=t[b],T=t[w];t[b]=d(t[b],!0),t[w]=d(t[w],!0),"pixel"===v?(a(b,0),a(w,10)):(i.coercePosition(e,_,a,x,b,.25),i.coercePosition(e,_,a,x,w,.75)),e[b]=m(e[b]),e[w]=m(e[w]),t[b]=k,t[w]=T}if("pixel"===v){var A=t[g];t[g]=d(t[g],!0),i.coercePosition(e,_,a,x,g,.25),e[g]=m(e[g]),t[g]=A}}"path"===l?a("path"):n.noneOrAll(t,e,["x0","x1","y0","y1"])}}e.exports=function(t,e){a(t,e,{name:"shapes",handleItemDefaults:l})}},{"../../lib":169,"../../plots/array_container_defaults":209,"../../plots/cartesian/axes":213,"./attributes":125,"./helpers":130}],129:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("../../plots/cartesian/axes"),o=t("../color"),s=t("../drawing"),l=t("../../plot_api/plot_template").arrayEditor,u=t("../dragelement"),c=t("../../lib/setcursor"),p=t("./constants"),h=t("./helpers");function f(t,e){t._fullLayout._paperdiv.selectAll('.shapelayer [data-index="'+e+'"]').remove();var r=t._fullLayout.shapes[e]||{};if(r._input&&!1!==r.visible)if("below"!==r.layer)g(t._fullLayout._shapeUpperLayer);else if("paper"===r.xref||"paper"===r.yref)g(t._fullLayout._shapeLowerLayer);else{var f=t._fullLayout._plots[r.xref+r.yref];if(f)g((f.mainplotinfo||f).shapelayer);else g(t._fullLayout._shapeLowerLayer)}function g(f){var g={"data-index":e,"fill-rule":"evenodd",d:m(t,r)},v=r.line.width?r.line.color:"rgba(0,0,0,0)",_=f.append("path").attr(g).style("opacity",r.opacity).call(o.stroke,v).call(o.fill,r.fillcolor).call(s.dashLine,r.line.dash,r.line.width);d(_,t,r),t._context.edits.shapePosition&&function(t,e,r,o,f){var g,v,_,x,b,w,k,T,A,M,S,L,C,E,z,P,I=10,D=10,O="pixel"===r.xsizemode,R="pixel"===r.ysizemode,F="line"===r.type,B="path"===r.type,N=l(t.layout,"shapes",r),U=N.modifyItem,j=a.getFromId(t,r.xref),V=a.getFromId(t,r.yref),q=h.getDataToPixel(t,j),G=h.getDataToPixel(t,V,!0),H=h.getPixelToData(t,j),Z=h.getPixelToData(t,V,!0),X=F?function(){var t=Math.max(r.line.width,10),n=f.append("g").attr("data-index",o);n.append("path").attr("d",e.attr("d")).style({cursor:"move","stroke-width":t,"stroke-opacity":"0"});var i={"fill-opacity":"0"},a=t/2>10?t/2:10;return n.append("circle").attr({"data-line-point":"start-point",cx:O?q(r.xanchor)+r.x0:q(r.x0),cy:R?G(r.yanchor)-r.y0:G(r.y0),r:a}).style(i).classed("cursor-grab",!0),n.append("circle").attr({"data-line-point":"end-point",cx:O?q(r.xanchor)+r.x1:q(r.x1),cy:R?G(r.yanchor)-r.y1:G(r.y1),r:a}).style(i).classed("cursor-grab",!0),n}():e,W={element:X.node(),gd:t,prepFn:function(n){O&&(b=q(r.xanchor));R&&(w=G(r.yanchor));"path"===r.type?z=r.path:(g=O?r.x0:q(r.x0),v=R?r.y0:G(r.y0),_=O?r.x1:q(r.x1),x=R?r.y1:G(r.y1));g<_?(A=g,C="x0",M=_,E="x1"):(A=_,C="x1",M=g,E="x0");!R&&v<x||R&&v>x?(k=v,S="y0",T=x,L="y1"):(k=x,S="y1",T=v,L="y0");Y(n),$(f,r),function(t,e,r){var n=e.xref,i=e.yref,o=a.getFromId(r,n),l=a.getFromId(r,i),u="";"paper"===n||o.autorange||(u+=n);"paper"===i||l.autorange||(u+=i);s.setClipUrl(t,u?"clip"+r._fullLayout._uid+u:null,r)}(e,r,t),W.moveFn="move"===P?K:J},doneFn:function(){c(e),Q(f),d(e,t,r),n.call("_guiRelayout",t,N.getUpdateObj())},clickFn:function(){Q(f)}};function Y(t){if(F)P="path"===t.target.tagName?"move":"start-point"===t.target.attributes["data-line-point"].value?"resize-over-start-point":"resize-over-end-point";else{var r=W.element.getBoundingClientRect(),n=r.right-r.left,i=r.bottom-r.top,a=t.clientX-r.left,o=t.clientY-r.top,s=!B&&n>I&&i>D&&!t.shiftKey?u.getCursor(a/n,1-o/i):"move";c(e,s),P=s.split("-")[0]}}function K(n,i){if("path"===r.type){var a=function(t){return t},o=a,s=a;O?U("xanchor",r.xanchor=H(b+n)):(o=function(t){return H(q(t)+n)},j&&"date"===j.type&&(o=h.encodeDate(o))),R?U("yanchor",r.yanchor=Z(w+i)):(s=function(t){return Z(G(t)+i)},V&&"date"===V.type&&(s=h.encodeDate(s))),U("path",r.path=y(z,o,s))}else O?U("xanchor",r.xanchor=H(b+n)):(U("x0",r.x0=H(g+n)),U("x1",r.x1=H(_+n))),R?U("yanchor",r.yanchor=Z(w+i)):(U("y0",r.y0=Z(v+i)),U("y1",r.y1=Z(x+i)));e.attr("d",m(t,r)),$(f,r)}function J(n,i){if(B){var a=function(t){return t},o=a,s=a;O?U("xanchor",r.xanchor=H(b+n)):(o=function(t){return H(q(t)+n)},j&&"date"===j.type&&(o=h.encodeDate(o))),R?U("yanchor",r.yanchor=Z(w+i)):(s=function(t){return Z(G(t)+i)},V&&"date"===V.type&&(s=h.encodeDate(s))),U("path",r.path=y(z,o,s))}else if(F){if("resize-over-start-point"===P){var l=g+n,u=R?v-i:v+i;U("x0",r.x0=O?l:H(l)),U("y0",r.y0=R?u:Z(u))}else if("resize-over-end-point"===P){var c=_+n,p=R?x-i:x+i;U("x1",r.x1=O?c:H(c)),U("y1",r.y1=R?p:Z(p))}}else{var d=~P.indexOf("n")?k+i:k,N=~P.indexOf("s")?T+i:T,X=~P.indexOf("w")?A+n:A,W=~P.indexOf("e")?M+n:M;~P.indexOf("n")&&R&&(d=k-i),~P.indexOf("s")&&R&&(N=T-i),(!R&&N-d>D||R&&d-N>D)&&(U(S,r[S]=R?d:Z(d)),U(L,r[L]=R?N:Z(N))),W-X>I&&(U(C,r[C]=O?X:H(X)),U(E,r[E]=O?W:H(W)))}e.attr("d",m(t,r)),$(f,r)}function $(t,e){(O||R)&&function(){var r="path"!==e.type,n=t.selectAll(".visual-cue").data([0]);n.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":1}).classed("visual-cue",!0);var a=q(O?e.xanchor:i.midRange(r?[e.x0,e.x1]:h.extractPathCoords(e.path,p.paramIsX))),o=G(R?e.yanchor:i.midRange(r?[e.y0,e.y1]:h.extractPathCoords(e.path,p.paramIsY)));if(a=h.roundPositionForSharpStrokeRendering(a,1),o=h.roundPositionForSharpStrokeRendering(o,1),O&&R){var s="M"+(a-1-1)+","+(o-1-1)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";n.attr("d",s)}else if(O){var l="M"+(a-1-1)+","+(o-9-1)+"v18 h2 v-18 Z";n.attr("d",l)}else{var u="M"+(a-9-1)+","+(o-1-1)+"h18 v2 h-18 Z";n.attr("d",u)}}()}function Q(t){t.selectAll(".visual-cue").remove()}u.init(W),X.node().onmousemove=Y}(t,_,r,e,f)}}function d(t,e,r){var n=(r.xref+r.yref).replace(/paper/g,"");s.setClipUrl(t,n?"clip"+e._fullLayout._uid+n:null,e)}function m(t,e){var r,n,o,s,l,u,c,f,d=e.type,m=a.getFromId(t,e.xref),y=a.getFromId(t,e.yref),g=t._fullLayout._size;if(m?(r=h.shapePositionToRange(m),n=function(t){return m._offset+m.r2p(r(t,!0))}):n=function(t){return g.l+g.w*t},y?(o=h.shapePositionToRange(y),s=function(t){return y._offset+y.r2p(o(t,!0))}):s=function(t){return g.t+g.h*(1-t)},"path"===d)return m&&"date"===m.type&&(n=h.decodeDate(n)),y&&"date"===y.type&&(s=h.decodeDate(s)),function(t,e,r){var n=t.path,a=t.xsizemode,o=t.ysizemode,s=t.xanchor,l=t.yanchor;return n.replace(p.segmentRE,function(t){var n=0,u=t.charAt(0),c=p.paramIsX[u],h=p.paramIsY[u],f=p.numParams[u],d=t.substr(1).replace(p.paramRE,function(t){return c[n]?t="pixel"===a?e(s)+Number(t):e(t):h[n]&&(t="pixel"===o?r(l)-Number(t):r(t)),++n>f&&(t="X"),t});return n>f&&(d=d.replace(/[\s,]*X.*/,""),i.log("Ignoring extra params in segment "+t)),u+d})}(e,n,s);if("pixel"===e.xsizemode){var v=n(e.xanchor);l=v+e.x0,u=v+e.x1}else l=n(e.x0),u=n(e.x1);if("pixel"===e.ysizemode){var _=s(e.yanchor);c=_-e.y0,f=_-e.y1}else c=s(e.y0),f=s(e.y1);if("line"===d)return"M"+l+","+c+"L"+u+","+f;if("rect"===d)return"M"+l+","+c+"H"+u+"V"+f+"H"+l+"Z";var x=(l+u)/2,b=(c+f)/2,w=Math.abs(x-l),k=Math.abs(b-c),T="A"+w+","+k,A=x+w+","+b;return"M"+A+T+" 0 1,1 "+(x+","+(b-k))+T+" 0 0,1 "+A+"Z"}function y(t,e,r){return t.replace(p.segmentRE,function(t){var n=0,i=t.charAt(0),a=p.paramIsX[i],o=p.paramIsY[i],s=p.numParams[i];return i+t.substr(1).replace(p.paramRE,function(t){return n>=s?t:(a[n]?t=e(t):o[n]&&(t=r(t)),n++,t)})})}e.exports={draw:function(t){var e=t._fullLayout;for(var r in e._shapeUpperLayer.selectAll("path").remove(),e._shapeLowerLayer.selectAll("path").remove(),e._plots){var n=e._plots[r].shapelayer;n&&n.selectAll("path").remove()}for(var i=0;i<e.shapes.length;i++)e.shapes[i].visible&&f(t,i)},drawOne:f}},{"../../lib":169,"../../lib/setcursor":188,"../../plot_api/plot_template":203,"../../plots/cartesian/axes":213,"../../registry":261,"../color":50,"../dragelement":68,"../drawing":71,"./constants":127,"./helpers":130}],130:[function(t,e,r){"use strict";var n=t("./constants"),i=t("../../lib");r.rangeToShapePosition=function(t){return"log"===t.type?t.r2d:function(t){return t}},r.shapePositionToRange=function(t){return"log"===t.type?t.d2r:function(t){return t}},r.decodeDate=function(t){return function(e){return e.replace&&(e=e.replace("_"," ")),t(e)}},r.encodeDate=function(t){return function(e){return t(e).replace(" ","_")}},r.extractPathCoords=function(t,e){var r=[];return t.match(n.segmentRE).forEach(function(t){var a=e[t.charAt(0)].drawn;if(void 0!==a){var o=t.substr(1).match(n.paramRE);!o||o.length<a||r.push(i.cleanNumber(o[a]))}}),r},r.getDataToPixel=function(t,e,n){var i,a=t._fullLayout._size;if(e){var o=r.shapePositionToRange(e);i=function(t){return e._offset+e.r2p(o(t,!0))},"date"===e.type&&(i=r.decodeDate(i))}else i=n?function(t){return a.t+a.h*(1-t)}:function(t){return a.l+a.w*t};return i},r.getPixelToData=function(t,e,n){var i,a=t._fullLayout._size;if(e){var o=r.rangeToShapePosition(e);i=function(t){return o(e.p2r(t-e._offset))}}else i=n?function(t){return 1-(t-a.t)/a.h}:function(t){return(t-a.l)/a.w};return i},r.roundPositionForSharpStrokeRendering=function(t,e){var r=1===Math.round(e%2),n=Math.round(t);return r?n+.5:n}},{"../../lib":169,"./constants":127}],131:[function(t,e,r){"use strict";var n=t("./draw");e.exports={moduleType:"component",name:"shapes",layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),includeBasePlot:t("../../plots/cartesian/include_components")("shapes"),calcAutorange:t("./calc_autorange"),draw:n.draw,drawOne:n.drawOne}},{"../../plots/cartesian/include_components":223,"./attributes":125,"./calc_autorange":126,"./defaults":128,"./draw":129}],132:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../../plots/pad_attributes"),a=t("../../lib/extend").extendDeepAll,o=t("../../plot_api/edit_types").overrideAll,s=t("../../plots/animation_attributes"),l=t("../../plot_api/plot_template").templatedArray,u=t("./constants"),c=l("step",{visible:{valType:"boolean",dflt:!0},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string"},value:{valType:"string"},execute:{valType:"boolean",dflt:!0}});e.exports=o(l("slider",{visible:{valType:"boolean",dflt:!0},active:{valType:"number",min:0,dflt:0},steps:c,lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction"},len:{valType:"number",min:0,dflt:1},x:{valType:"number",min:-2,max:3,dflt:0},pad:a(i({editType:"arraydraw"}),{},{t:{dflt:20}}),xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left"},y:{valType:"number",min:-2,max:3,dflt:0},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},transition:{duration:{valType:"number",min:0,dflt:150},easing:{valType:"enumerated",values:s.transition.easing.values,dflt:"cubic-in-out"}},currentvalue:{visible:{valType:"boolean",dflt:!0},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left"},offset:{valType:"number",dflt:10},prefix:{valType:"string"},suffix:{valType:"string"},font:n({})},font:n({}),activebgcolor:{valType:"color",dflt:u.gripBgActiveColor},bgcolor:{valType:"color",dflt:u.railBgColor},bordercolor:{valType:"color",dflt:u.railBorderColor},borderwidth:{valType:"number",min:0,dflt:u.railBorderWidth},ticklen:{valType:"number",min:0,dflt:u.tickLength},tickcolor:{valType:"color",dflt:u.tickColor},tickwidth:{valType:"number",min:0,dflt:1},minorticklen:{valType:"number",min:0,dflt:u.minorTickLength}}),"arraydraw","from-root")},{"../../lib/extend":162,"../../plot_api/edit_types":196,"../../plot_api/plot_template":203,"../../plots/animation_attributes":208,"../../plots/font_attributes":239,"../../plots/pad_attributes":251,"./constants":133}],133:[function(t,e,r){"use strict";e.exports={name:"sliders",containerClassName:"slider-container",groupClassName:"slider-group",inputAreaClass:"slider-input-area",railRectClass:"slider-rail-rect",railTouchRectClass:"slider-rail-touch-rect",gripRectClass:"slider-grip-rect",tickRectClass:"slider-tick-rect",inputProxyClass:"slider-input-proxy",labelsClass:"slider-labels",labelGroupClass:"slider-label-group",labelClass:"slider-label",currentValueClass:"slider-current-value",railHeight:5,menuIndexAttrName:"slider-active-index",autoMarginIdRoot:"slider-",minWidth:30,minHeight:30,textPadX:40,arrowOffsetX:4,railRadius:2,railWidth:5,railBorder:4,railBorderWidth:1,railBorderColor:"#bec8d9",railBgColor:"#f8fafc",railInset:8,stepInset:10,gripRadius:10,gripWidth:20,gripHeight:20,gripBorder:20,gripBorderWidth:1,gripBorderColor:"#bec8d9",gripBgColor:"#f6f8fa",gripBgActiveColor:"#dbdde0",labelPadding:8,labelOffset:0,tickWidth:1,tickColor:"#333",tickOffset:25,tickLength:7,minorTickOffset:25,minorTickColor:"#333",minorTickLength:4,currentValuePadding:8,currentValueInset:0}},{}],134:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/array_container_defaults"),a=t("./attributes"),o=t("./constants").name,s=a.steps;function l(t,e,r){function o(r,i){return n.coerce(t,e,a,r,i)}for(var s=i(t,e,{name:"steps",handleItemDefaults:u}),l=0,c=0;c<s.length;c++)s[c].visible&&l++;if(l<2?e.visible=!1:o("visible")){e._stepCount=l;var p=e._visibleSteps=n.filterVisible(s);(s[o("active")]||{}).visible||(e.active=p[0]._index),o("x"),o("y"),n.noneOrAll(t,e,["x","y"]),o("xanchor"),o("yanchor"),o("len"),o("lenmode"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),n.coerceFont(o,"font",r.font),o("currentvalue.visible")&&(o("currentvalue.xanchor"),o("currentvalue.prefix"),o("currentvalue.suffix"),o("currentvalue.offset"),n.coerceFont(o,"currentvalue.font",e.font)),o("transition.duration"),o("transition.easing"),o("bgcolor"),o("activebgcolor"),o("bordercolor"),o("borderwidth"),o("ticklen"),o("tickwidth"),o("tickcolor"),o("minorticklen")}}function u(t,e){function r(r,i){return n.coerce(t,e,s,r,i)}if("skip"===t.method||Array.isArray(t.args)?r("visible"):e.visible=!1){r("method"),r("args");var i=r("label","step-"+e._index);r("value",i),r("execute")}}e.exports=function(t,e){i(t,e,{name:o,handleItemDefaults:l})}},{"../../lib":169,"../../plots/array_container_defaults":209,"./attributes":132,"./constants":133}],135:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../plots/plots"),a=t("../color"),o=t("../drawing"),s=t("../../lib"),l=t("../../lib/svg_text_utils"),u=t("../../plot_api/plot_template").arrayEditor,c=t("./constants"),p=t("../../constants/alignment"),h=p.LINE_SPACING,f=p.FROM_TL,d=p.FROM_BR;function m(t){return c.autoMarginIdRoot+t._index}function y(t){return t._index}function g(t,e){var r=o.tester.selectAll("g."+c.labelGroupClass).data(e._visibleSteps);r.enter().append("g").classed(c.labelGroupClass,!0);var a=0,u=0;r.each(function(t){var r=x(n.select(this),{step:t},e).node();if(r){var i=o.bBox(r);u=Math.max(u,i.height),a=Math.max(a,i.width)}}),r.remove();var p=e._dims={};p.inputAreaWidth=Math.max(c.railWidth,c.gripHeight);var h=t._fullLayout._size;p.lx=h.l+h.w*e.x,p.ly=h.t+h.h*(1-e.y),"fraction"===e.lenmode?p.outerLength=Math.round(h.w*e.len):p.outerLength=e.len,p.inputAreaStart=0,p.inputAreaLength=Math.round(p.outerLength-e.pad.l-e.pad.r);var y=(p.inputAreaLength-2*c.stepInset)/(e._stepCount-1),g=a+c.labelPadding;if(p.labelStride=Math.max(1,Math.ceil(g/y)),p.labelHeight=u,p.currentValueMaxWidth=0,p.currentValueHeight=0,p.currentValueTotalHeight=0,p.currentValueMaxLines=1,e.currentvalue.visible){var _=o.tester.append("g");r.each(function(t){var r=v(_,e,t.label),n=r.node()&&o.bBox(r.node())||{width:0,height:0},i=l.lineCount(r);p.currentValueMaxWidth=Math.max(p.currentValueMaxWidth,Math.ceil(n.width)),p.currentValueHeight=Math.max(p.currentValueHeight,Math.ceil(n.height)),p.currentValueMaxLines=Math.max(p.currentValueMaxLines,i)}),p.currentValueTotalHeight=p.currentValueHeight+e.currentvalue.offset,_.remove()}p.height=p.currentValueTotalHeight+c.tickOffset+e.ticklen+c.labelOffset+p.labelHeight+e.pad.t+e.pad.b;var b="left";s.isRightAnchor(e)&&(p.lx-=p.outerLength,b="right"),s.isCenterAnchor(e)&&(p.lx-=p.outerLength/2,b="center");var w="top";s.isBottomAnchor(e)&&(p.ly-=p.height,w="bottom"),s.isMiddleAnchor(e)&&(p.ly-=p.height/2,w="middle"),p.outerLength=Math.ceil(p.outerLength),p.height=Math.ceil(p.height),p.lx=Math.round(p.lx),p.ly=Math.round(p.ly);var k={y:e.y,b:p.height*d[w],t:p.height*f[w]};"fraction"===e.lenmode?(k.l=0,k.xl=e.x-e.len*f[b],k.r=0,k.xr=e.x+e.len*d[b]):(k.x=e.x,k.l=p.outerLength*f[b],k.r=p.outerLength*d[b]),i.autoMargin(t,m(e),k)}function v(t,e,r){if(e.currentvalue.visible){var n,i,a=e._dims;switch(e.currentvalue.xanchor){case"right":n=a.inputAreaLength-c.currentValueInset-a.currentValueMaxWidth,i="left";break;case"center":n=.5*a.inputAreaLength,i="middle";break;default:n=c.currentValueInset,i="left"}var u=s.ensureSingle(t,"text",c.labelClass,function(t){t.classed("user-select-none",!0).attr({"text-anchor":i,"data-notex":1})}),p=e.currentvalue.prefix?e.currentvalue.prefix:"";if("string"==typeof r)p+=r;else{var f=e.steps[e.active].label,d=e._gd._fullLayout._meta;d&&(f=s.templateString(f,d)),p+=f}e.currentvalue.suffix&&(p+=e.currentvalue.suffix),u.call(o.font,e.currentvalue.font).text(p).call(l.convertToTspans,e._gd);var m=l.lineCount(u),y=(a.currentValueMaxLines+1-m)*e.currentvalue.font.size*h;return l.positionText(u,n,y),u}}function _(t,e,r){s.ensureSingle(t,"rect",c.gripRectClass,function(n){n.call(T,e,t,r).style("pointer-events","all")}).attr({width:c.gripWidth,height:c.gripHeight,rx:c.gripRadius,ry:c.gripRadius}).call(a.stroke,r.bordercolor).call(a.fill,r.bgcolor).style("stroke-width",r.borderwidth+"px")}function x(t,e,r){var n=s.ensureSingle(t,"text",c.labelClass,function(t){t.classed("user-select-none",!0).attr({"text-anchor":"middle","data-notex":1})}),i=e.step.label,a=r._gd._fullLayout._meta;return a&&(i=s.templateString(i,a)),n.call(o.font,r.font).text(i).call(l.convertToTspans,r._gd),n}function b(t,e){var r=s.ensureSingle(t,"g",c.labelsClass),i=e._dims,a=r.selectAll("g."+c.labelGroupClass).data(i.labelSteps);a.enter().append("g").classed(c.labelGroupClass,!0),a.exit().remove(),a.each(function(t){var r=n.select(this);r.call(x,t,e),o.setTranslate(r,S(e,t.fraction),c.tickOffset+e.ticklen+e.font.size*h+c.labelOffset+i.currentValueTotalHeight)})}function w(t,e,r,n,i){var a=Math.round(n*(r._stepCount-1)),o=r._visibleSteps[a]._index;o!==r.active&&k(t,e,r,o,!0,i)}function k(t,e,r,n,a,o){var s=r.active;r.active=n,u(t.layout,c.name,r).applyUpdate("active",n);var l=r.steps[r.active];e.call(M,r,o),e.call(v,r),t.emit("plotly_sliderchange",{slider:r,step:r.steps[r.active],interaction:a,previousActive:s}),l&&l.method&&a&&(e._nextMethod?(e._nextMethod.step=l,e._nextMethod.doCallback=a,e._nextMethod.doTransition=o):(e._nextMethod={step:l,doCallback:a,doTransition:o},e._nextMethodRaf=window.requestAnimationFrame(function(){var r=e._nextMethod.step;r.method&&(r.execute&&i.executeAPICommand(t,r.method,r.args),e._nextMethod=null,e._nextMethodRaf=null)})))}function T(t,e,r){var i=r.node(),o=n.select(e);function s(){return r.data()[0]}t.on("mousedown",function(){var t=s();e.emit("plotly_sliderstart",{slider:t});var l=r.select("."+c.gripRectClass);n.event.stopPropagation(),n.event.preventDefault(),l.call(a.fill,t.activebgcolor);var u=L(t,n.mouse(i)[0]);w(e,r,t,u,!0),t._dragging=!0,o.on("mousemove",function(){var t=s(),a=L(t,n.mouse(i)[0]);w(e,r,t,a,!1)}),o.on("mouseup",function(){var t=s();t._dragging=!1,l.call(a.fill,t.bgcolor),o.on("mouseup",null),o.on("mousemove",null),e.emit("plotly_sliderend",{slider:t,step:t.steps[t.active]})})})}function A(t,e){var r=t.selectAll("rect."+c.tickRectClass).data(e._visibleSteps),i=e._dims;r.enter().append("rect").classed(c.tickRectClass,!0),r.exit().remove(),r.attr({width:e.tickwidth+"px","shape-rendering":"crispEdges"}),r.each(function(t,r){var s=r%i.labelStride==0,l=n.select(this);l.attr({height:s?e.ticklen:e.minorticklen}).call(a.fill,e.tickcolor),o.setTranslate(l,S(e,r/(e._stepCount-1))-.5*e.tickwidth,(s?c.tickOffset:c.minorTickOffset)+i.currentValueTotalHeight)})}function M(t,e,r){for(var n=t.select("rect."+c.gripRectClass),i=0,a=0;a<e._stepCount;a++)if(e._visibleSteps[a]._index===e.active){i=a;break}var o=S(e,i/(e._stepCount-1));if(!e._invokingCommand){var s=n;r&&e.transition.duration>0&&(s=s.transition().duration(e.transition.duration).ease(e.transition.easing)),s.attr("transform","translate("+(o-.5*c.gripWidth)+","+e._dims.currentValueTotalHeight+")")}}function S(t,e){var r=t._dims;return r.inputAreaStart+c.stepInset+(r.inputAreaLength-2*c.stepInset)*Math.min(1,Math.max(0,e))}function L(t,e){var r=t._dims;return Math.min(1,Math.max(0,(e-c.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*c.stepInset-2*r.inputAreaStart)))}function C(t,e,r){var n=r._dims,i=s.ensureSingle(t,"rect",c.railTouchRectClass,function(n){n.call(T,e,t,r).style("pointer-events","all")});i.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,c.tickOffset+r.ticklen+n.labelHeight)}).call(a.fill,r.bgcolor).attr("opacity",0),o.setTranslate(i,0,n.currentValueTotalHeight)}function E(t,e){var r=e._dims,n=r.inputAreaLength-2*c.railInset,i=s.ensureSingle(t,"rect",c.railRectClass);i.attr({width:n,height:c.railWidth,rx:c.railRadius,ry:c.railRadius,"shape-rendering":"crispEdges"}).call(a.stroke,e.bordercolor).call(a.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),o.setTranslate(i,c.railInset,.5*(r.inputAreaWidth-c.railWidth)+r.currentValueTotalHeight)}e.exports=function(t){var e=t._fullLayout,r=function(t,e){for(var r=t[c.name],n=[],i=0;i<r.length;i++){var a=r[i];a.visible&&(a._gd=e,n.push(a))}return n}(e,t),a=e._infolayer.selectAll("g."+c.containerClassName).data(r.length>0?[0]:[]);function s(e){e._commandObserver&&(e._commandObserver.remove(),delete e._commandObserver),i.autoMargin(t,m(e))}if(a.enter().append("g").classed(c.containerClassName,!0).style("cursor","ew-resize"),a.exit().each(function(){n.select(this).selectAll("g."+c.groupClassName).each(s)}).remove(),0!==r.length){var l=a.selectAll("g."+c.groupClassName).data(r,y);l.enter().append("g").classed(c.groupClassName,!0),l.exit().each(s).remove();for(var u=0;u<r.length;u++){var p=r[u];g(t,p)}l.each(function(e){var r=n.select(this);!function(t){var e=t._dims;e.labelSteps=[];for(var r=t._stepCount,n=0;n<r;n+=e.labelStride)e.labelSteps.push({fraction:n/(r-1),step:t._visibleSteps[n]})}(e),i.manageCommandObserver(t,e,e._visibleSteps,function(e){var n=r.data()[0];n.active!==e.index&&(n._dragging||k(t,r,n,e.index,!1,!0))}),function(t,e,r){(r.steps[r.active]||{}).visible||(r.active=r._visibleSteps[0]._index);e.call(v,r).call(E,r).call(b,r).call(A,r).call(C,t,r).call(_,t,r);var n=r._dims;o.setTranslate(e,n.lx+r.pad.l,n.ly+r.pad.t),e.call(M,r,!1),e.call(v,r)}(t,n.select(this),e)})}}},{"../../constants/alignment":144,"../../lib":169,"../../lib/svg_text_utils":190,"../../plot_api/plot_template":203,"../../plots/plots":252,"../color":50,"../drawing":71,"./constants":133,d3:14}],136:[function(t,e,r){"use strict";var n=t("./constants");e.exports={moduleType:"component",name:n.name,layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),draw:t("./draw")}},{"./attributes":132,"./constants":133,"./defaults":134,"./draw":135}],137:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("../../plots/plots"),o=t("../../registry"),s=t("../../lib"),l=t("../drawing"),u=t("../color"),c=t("../../lib/svg_text_utils"),p=t("../../constants/interactions"),h=t("../../constants/alignment").OPPOSITE_SIDE,f=/ [XY][0-9]* /;e.exports={draw:function(t,e,r){var d,m=r.propContainer,y=r.propName,g=r.placeholder,v=r.traceIndex,_=r.avoid||{},x=r.attributes,b=r.transform,w=r.containerGroup,k=t._fullLayout,T=1,A=!1,M=m.title,S=(M&&M.text?M.text:"").trim(),L=M&&M.font?M.font:{},C=L.family,E=L.size,z=L.color;"title.text"===y?d="titleText":-1!==y.indexOf("axis")?d="axisTitleText":y.indexOf(!0)&&(d="colorbarTitleText");var P=t._context.edits[d];""===S?T=0:S.replace(f," % ")===g.replace(f," % ")&&(T=.2,A=!0,P||(S="")),r._meta?S=s.templateString(S,r._meta):k._meta&&(S=s.templateString(S,k._meta));var I=S||P;w||(w=s.ensureSingle(k._infolayer,"g","g-"+e));var D=w.selectAll("text").data(I?[0]:[]);if(D.enter().append("text"),D.text(S).attr("class",e),D.exit().remove(),!I)return w;function O(t){s.syncOrAsync([R,F],t)}function R(e){var r;return b?(r="",b.rotate&&(r+="rotate("+[b.rotate,x.x,x.y]+")"),b.offset&&(r+="translate(0, "+b.offset+")")):r=null,e.attr("transform",r),e.style({"font-family":C,"font-size":n.round(E,2)+"px",fill:u.rgb(z),opacity:T*u.opacity(z),"font-weight":a.fontWeight}).attr(x).call(c.convertToTspans,t),a.previousPromises(t)}function F(t){var e=n.select(t.node().parentNode);if(_&&_.selection&&_.side&&S){e.attr("transform",null);var r=h[_.side],a="left"===_.side||"top"===_.side?-1:1,o=i(_.pad)?_.pad:2,u=l.bBox(e.node()),c={left:0,top:0,right:k.width,bottom:k.height},p=_.maxShift||a*(c[_.side]-u[_.side]),f=0;if(p<0)f=p;else{var d=_.offsetLeft||0,m=_.offsetTop||0;u.left-=d,u.right-=d,u.top-=m,u.bottom-=m,_.selection.each(function(){var t=l.bBox(this);s.bBoxIntersect(u,t,o)&&(f=Math.max(f,a*(t[_.side]-u[r])+o))}),f=Math.min(p,f)}if(f>0||p<0){var y={left:[-f,0],right:[f,0],top:[0,-f],bottom:[0,f]}[_.side];e.attr("transform","translate("+y+")")}}}return D.call(O),P&&(S?D.on(".opacity",null):(T=0,A=!0,D.text(g).on("mouseover.opacity",function(){n.select(this).transition().duration(p.SHOW_PLACEHOLDER).style("opacity",1)}).on("mouseout.opacity",function(){n.select(this).transition().duration(p.HIDE_PLACEHOLDER).style("opacity",0)})),D.call(c.makeEditable,{gd:t}).on("edit",function(e){void 0!==v?o.call("_guiRestyle",t,y,e,v):o.call("_guiRelayout",t,y,e)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(O)}).on("input",function(t){this.text(t||" ").call(c.positionText,x.x,x.y)})),D.classed("js-placeholder",A),w}}},{"../../constants/alignment":144,"../../constants/interactions":146,"../../lib":169,"../../lib/svg_text_utils":190,"../../plots/plots":252,"../../registry":261,"../color":50,"../drawing":71,d3:14,"fast-isnumeric":16}],138:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../color/attributes"),a=t("../../lib/extend").extendFlat,o=t("../../plot_api/edit_types").overrideAll,s=t("../../plots/pad_attributes"),l=t("../../plot_api/plot_template").templatedArray,u=l("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},args2:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}});e.exports=o(l("updatemenu",{_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons:u,x:{valType:"number",min:-2,max:3,dflt:-.05},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"right"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},pad:a(s({editType:"arraydraw"}),{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:i.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")},{"../../lib/extend":162,"../../plot_api/edit_types":196,"../../plot_api/plot_template":203,"../../plots/font_attributes":239,"../../plots/pad_attributes":251,"../color/attributes":49}],139:[function(t,e,r){"use strict";e.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],140:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/array_container_defaults"),a=t("./attributes"),o=t("./constants").name,s=a.buttons;function l(t,e,r){function o(r,i){return n.coerce(t,e,a,r,i)}o("visible",i(t,e,{name:"buttons",handleItemDefaults:u}).length>0)&&(o("active"),o("direction"),o("type"),o("showactive"),o("x"),o("y"),n.noneOrAll(t,e,["x","y"]),o("xanchor"),o("yanchor"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),n.coerceFont(o,"font",r.font),o("bgcolor",r.paper_bgcolor),o("bordercolor"),o("borderwidth"))}function u(t,e){function r(r,i){return n.coerce(t,e,s,r,i)}r("visible","skip"===t.method||Array.isArray(t.args))&&(r("method"),r("args"),r("args2"),r("label"),r("execute"))}e.exports=function(t,e){i(t,e,{name:o,handleItemDefaults:l})}},{"../../lib":169,"../../plots/array_container_defaults":209,"./attributes":138,"./constants":139}],141:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../plots/plots"),a=t("../color"),o=t("../drawing"),s=t("../../lib"),l=t("../../lib/svg_text_utils"),u=t("../../plot_api/plot_template").arrayEditor,c=t("../../constants/alignment").LINE_SPACING,p=t("./constants"),h=t("./scrollbox");function f(t){return t._index}function d(t,e){return+t.attr(p.menuIndexAttrName)===e._index}function m(t,e,r,n,i,a,o,s){e.active=o,u(t.layout,p.name,e).applyUpdate("active",o),"buttons"===e.type?g(t,n,null,null,e):"dropdown"===e.type&&(i.attr(p.menuIndexAttrName,"-1"),y(t,n,i,a,e),s||g(t,n,i,a,e))}function y(t,e,r,n,i){var a=s.ensureSingle(e,"g",p.headerClassName,function(t){t.style("pointer-events","all")}),l=i._dims,u=i.active,c=i.buttons[u]||p.blankHeaderOpts,h={y:i.pad.t,yPad:0,x:i.pad.l,xPad:0,index:0},f={width:l.headerWidth,height:l.headerHeight};a.call(v,i,c,t).call(M,i,h,f),s.ensureSingle(e,"text",p.headerArrowClassName,function(t){t.classed("user-select-none",!0).attr("text-anchor","end").call(o.font,i.font).text(p.arrowSymbol[i.direction])}).attr({x:l.headerWidth-p.arrowOffsetX+i.pad.l,y:l.headerHeight/2+p.textOffsetY+i.pad.t}),a.on("click",function(){r.call(S,String(d(r,i)?-1:i._index)),g(t,e,r,n,i)}),a.on("mouseover",function(){a.call(w)}),a.on("mouseout",function(){a.call(k,i)}),o.setTranslate(e,l.lx,l.ly)}function g(t,e,r,a,o){r||(r=e).attr("pointer-events","all");var l=function(t){return-1==+t.attr(p.menuIndexAttrName)}(r)&&"buttons"!==o.type?[]:o.buttons,u="dropdown"===o.type?p.dropdownButtonClassName:p.buttonClassName,c=r.selectAll("g."+u).data(s.filterVisible(l)),h=c.enter().append("g").classed(u,!0),f=c.exit();"dropdown"===o.type?(h.attr("opacity","0").transition().attr("opacity","1"),f.transition().attr("opacity","0").remove()):f.remove();var d=0,y=0,g=o._dims,_=-1!==["up","down"].indexOf(o.direction);"dropdown"===o.type&&(_?y=g.headerHeight+p.gapButtonHeader:d=g.headerWidth+p.gapButtonHeader),"dropdown"===o.type&&"up"===o.direction&&(y=-p.gapButtonHeader+p.gapButton-g.openHeight),"dropdown"===o.type&&"left"===o.direction&&(d=-p.gapButtonHeader+p.gapButton-g.openWidth);var x={x:g.lx+d+o.pad.l,y:g.ly+y+o.pad.t,yPad:p.gapButton,xPad:p.gapButton,index:0},T={l:x.x+o.borderwidth,t:x.y+o.borderwidth};c.each(function(s,l){var u=n.select(this);u.call(v,o,s,t).call(M,o,x),u.on("click",function(){n.event.defaultPrevented||(s.execute&&(s.args2&&o.active===l?(m(t,o,0,e,r,a,-1),i.executeAPICommand(t,s.method,s.args2)):(m(t,o,0,e,r,a,l),i.executeAPICommand(t,s.method,s.args))),t.emit("plotly_buttonclicked",{menu:o,button:s,active:o.active}))}),u.on("mouseover",function(){u.call(w)}),u.on("mouseout",function(){u.call(k,o),c.call(b,o)})}),c.call(b,o),_?(T.w=Math.max(g.openWidth,g.headerWidth),T.h=x.y-T.t):(T.w=x.x-T.l,T.h=Math.max(g.openHeight,g.headerHeight)),T.direction=o.direction,a&&(c.size()?function(t,e,r,n,i,a){var o,s,l,u=i.direction,c="up"===u||"down"===u,h=i._dims,f=i.active;if(c)for(s=0,l=0;l<f;l++)s+=h.heights[l]+p.gapButton;else for(o=0,l=0;l<f;l++)o+=h.widths[l]+p.gapButton;n.enable(a,o,s),n.hbar&&n.hbar.attr("opacity","0").transition().attr("opacity","1");n.vbar&&n.vbar.attr("opacity","0").transition().attr("opacity","1")}(0,0,0,a,o,T):function(t){var e=!!t.hbar,r=!!t.vbar;e&&t.hbar.transition().attr("opacity","0").each("end",function(){e=!1,r||t.disable()});r&&t.vbar.transition().attr("opacity","0").each("end",function(){r=!1,e||t.disable()})}(a))}function v(t,e,r,n){t.call(_,e).call(x,e,r,n)}function _(t,e){s.ensureSingle(t,"rect",p.itemRectClassName,function(t){t.attr({rx:p.rx,ry:p.ry,"shape-rendering":"crispEdges"})}).call(a.stroke,e.bordercolor).call(a.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px")}function x(t,e,r,n){var i=s.ensureSingle(t,"text",p.itemTextClassName,function(t){t.classed("user-select-none",!0).attr({"text-anchor":"start","data-notex":1})}),a=r.label,u=n._fullLayout._meta;u&&(a=s.templateString(a,u)),i.call(o.font,e.font).text(a).call(l.convertToTspans,n)}function b(t,e){var r=e.active;t.each(function(t,i){var o=n.select(this);i===r&&e.showactive&&o.select("rect."+p.itemRectClassName).call(a.fill,p.activeColor)})}function w(t){t.select("rect."+p.itemRectClassName).call(a.fill,p.hoverColor)}function k(t,e){t.select("rect."+p.itemRectClassName).call(a.fill,e.bgcolor)}function T(t,e){var r=e._dims={width1:0,height1:0,heights:[],widths:[],totalWidth:0,totalHeight:0,openWidth:0,openHeight:0,lx:0,ly:0},a=o.tester.selectAll("g."+p.dropdownButtonClassName).data(s.filterVisible(e.buttons));a.enter().append("g").classed(p.dropdownButtonClassName,!0);var u=-1!==["up","down"].indexOf(e.direction);a.each(function(i,a){var s=n.select(this);s.call(v,e,i,t);var h=s.select("."+p.itemTextClassName),f=h.node()&&o.bBox(h.node()).width,d=Math.max(f+p.textPadX,p.minWidth),m=e.font.size*c,y=l.lineCount(h),g=Math.max(m*y,p.minHeight)+p.textOffsetY;g=Math.ceil(g),d=Math.ceil(d),r.widths[a]=d,r.heights[a]=g,r.height1=Math.max(r.height1,g),r.width1=Math.max(r.width1,d),u?(r.totalWidth=Math.max(r.totalWidth,d),r.openWidth=r.totalWidth,r.totalHeight+=g+p.gapButton,r.openHeight+=g+p.gapButton):(r.totalWidth+=d+p.gapButton,r.openWidth+=d+p.gapButton,r.totalHeight=Math.max(r.totalHeight,g),r.openHeight=r.totalHeight)}),u?r.totalHeight-=p.gapButton:r.totalWidth-=p.gapButton,r.headerWidth=r.width1+p.arrowPadX,r.headerHeight=r.height1,"dropdown"===e.type&&(u?(r.width1+=p.arrowPadX,r.totalHeight=r.height1):r.totalWidth=r.width1,r.totalWidth+=p.arrowPadX),a.remove();var h=r.totalWidth+e.pad.l+e.pad.r,f=r.totalHeight+e.pad.t+e.pad.b,d=t._fullLayout._size;r.lx=d.l+d.w*e.x,r.ly=d.t+d.h*(1-e.y);var m="left";s.isRightAnchor(e)&&(r.lx-=h,m="right"),s.isCenterAnchor(e)&&(r.lx-=h/2,m="center");var y="top";s.isBottomAnchor(e)&&(r.ly-=f,y="bottom"),s.isMiddleAnchor(e)&&(r.ly-=f/2,y="middle"),r.totalWidth=Math.ceil(r.totalWidth),r.totalHeight=Math.ceil(r.totalHeight),r.lx=Math.round(r.lx),r.ly=Math.round(r.ly),i.autoMargin(t,A(e),{x:e.x,y:e.y,l:h*({right:1,center:.5}[m]||0),r:h*({left:1,center:.5}[m]||0),b:f*({top:1,middle:.5}[y]||0),t:f*({bottom:1,middle:.5}[y]||0)})}function A(t){return p.autoMarginIdRoot+t._index}function M(t,e,r,n){n=n||{};var i=t.select("."+p.itemRectClassName),a=t.select("."+p.itemTextClassName),s=e.borderwidth,u=r.index,h=e._dims;o.setTranslate(t,s+r.x,s+r.y);var f=-1!==["up","down"].indexOf(e.direction),d=n.height||(f?h.heights[u]:h.height1);i.attr({x:0,y:0,width:n.width||(f?h.width1:h.widths[u]),height:d});var m=e.font.size*c,y=(l.lineCount(a)-1)*m/2;l.positionText(a,p.textOffsetX,d/2-y+p.textOffsetY),f?r.y+=h.heights[u]+r.yPad:r.x+=h.widths[u]+r.xPad,r.index++}function S(t,e){t.attr(p.menuIndexAttrName,e||"-1").selectAll("g."+p.dropdownButtonClassName).remove()}e.exports=function(t){var e=t._fullLayout,r=s.filterVisible(e[p.name]);function a(e){i.autoMargin(t,A(e))}var o=e._menulayer.selectAll("g."+p.containerClassName).data(r.length>0?[0]:[]);if(o.enter().append("g").classed(p.containerClassName,!0).style("cursor","pointer"),o.exit().each(function(){n.select(this).selectAll("g."+p.headerGroupClassName).each(a)}).remove(),0!==r.length){var l=o.selectAll("g."+p.headerGroupClassName).data(r,f);l.enter().append("g").classed(p.headerGroupClassName,!0);for(var u=s.ensureSingle(o,"g",p.dropdownButtonGroupClassName,function(t){t.style("pointer-events","all")}),c=0;c<r.length;c++){var v=r[c];T(t,v)}var _="updatemenus"+e._uid,x=new h(t,u,_);l.enter().size()&&(u.node().parentNode.appendChild(u.node()),u.call(S)),l.exit().each(function(t){u.call(S),a(t)}).remove(),l.each(function(e){var r=n.select(this),a="dropdown"===e.type?u:null;i.manageCommandObserver(t,e,e.buttons,function(n){m(t,e,e.buttons[n.index],r,a,x,n.index,!0)}),"dropdown"===e.type?(y(t,r,u,x,e),d(u,e)&&g(t,r,u,x,e)):g(t,r,null,null,e)})}}},{"../../constants/alignment":144,"../../lib":169,"../../lib/svg_text_utils":190,"../../plot_api/plot_template":203,"../../plots/plots":252,"../color":50,"../drawing":71,"./constants":139,"./scrollbox":143,d3:14}],142:[function(t,e,r){arguments[4][136][0].apply(r,arguments)},{"./attributes":138,"./constants":139,"./defaults":140,"./draw":141,dup:136}],143:[function(t,e,r){"use strict";e.exports=s;var n=t("d3"),i=t("../color"),a=t("../drawing"),o=t("../../lib");function s(t,e,r){this.gd=t,this.container=e,this.id=r,this.position=null,this.translateX=null,this.translateY=null,this.hbar=null,this.vbar=null,this.bg=this.container.selectAll("rect.scrollbox-bg").data([0]),this.bg.exit().on(".drag",null).on("wheel",null).remove(),this.bg.enter().append("rect").classed("scrollbox-bg",!0).style("pointer-events","all").attr({opacity:0,x:0,y:0,width:0,height:0})}s.barWidth=2,s.barLength=20,s.barRadius=2,s.barPad=1,s.barColor="#808BA4",s.prototype.enable=function(t,e,r){var o=this.gd._fullLayout,l=o.width,u=o.height;this.position=t;var c,p,h,f,d=this.position.l,m=this.position.w,y=this.position.t,g=this.position.h,v=this.position.direction,_="down"===v,x="left"===v,b="up"===v,w=m,k=g;_||x||"right"===v||b||(this.position.direction="down",_=!0),_||b?(p=(c=d)+w,_?(h=y,k=(f=Math.min(h+k,u))-h):k=(f=y+k)-(h=Math.max(f-k,0))):(f=(h=y)+k,x?w=(p=d+w)-(c=Math.max(p-w,0)):(c=d,w=(p=Math.min(c+w,l))-c)),this._box={l:c,t:h,w:w,h:k};var T=m>w,A=s.barLength+2*s.barPad,M=s.barWidth+2*s.barPad,S=d,L=y+g;L+M>u&&(L=u-M);var C=this.container.selectAll("rect.scrollbar-horizontal").data(T?[0]:[]);C.exit().on(".drag",null).remove(),C.enter().append("rect").classed("scrollbar-horizontal",!0).call(i.fill,s.barColor),T?(this.hbar=C.attr({rx:s.barRadius,ry:s.barRadius,x:S,y:L,width:A,height:M}),this._hbarXMin=S+A/2,this._hbarTranslateMax=w-A):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var E=g>k,z=s.barWidth+2*s.barPad,P=s.barLength+2*s.barPad,I=d+m,D=y;I+z>l&&(I=l-z);var O=this.container.selectAll("rect.scrollbar-vertical").data(E?[0]:[]);O.exit().on(".drag",null).remove(),O.enter().append("rect").classed("scrollbar-vertical",!0).call(i.fill,s.barColor),E?(this.vbar=O.attr({rx:s.barRadius,ry:s.barRadius,x:I,y:D,width:z,height:P}),this._vbarYMin=D+P/2,this._vbarTranslateMax=k-P):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var R=this.id,F=c-.5,B=E?p+z+.5:p+.5,N=h-.5,U=T?f+M+.5:f+.5,j=o._topdefs.selectAll("#"+R).data(T||E?[0]:[]);if(j.exit().remove(),j.enter().append("clipPath").attr("id",R).append("rect"),T||E?(this._clipRect=j.select("rect").attr({x:Math.floor(F),y:Math.floor(N),width:Math.ceil(B)-Math.floor(F),height:Math.ceil(U)-Math.floor(N)}),this.container.call(a.setClipUrl,R,this.gd),this.bg.attr({x:d,y:y,width:m,height:g})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(a.setClipUrl,null),delete this._clipRect),T||E){var V=n.behavior.drag().on("dragstart",function(){n.event.sourceEvent.preventDefault()}).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(V);var q=n.behavior.drag().on("dragstart",function(){n.event.sourceEvent.preventDefault(),n.event.sourceEvent.stopPropagation()}).on("drag",this._onBarDrag.bind(this));T&&this.hbar.on(".drag",null).call(q),E&&this.vbar.on(".drag",null).call(q)}this.setTranslate(e,r)},s.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(a.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},s.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=n.event.dx),this.vbar&&(e-=n.event.dy),this.setTranslate(t,e)},s.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=n.event.deltaY),this.vbar&&(e+=n.event.deltaY),this.setTranslate(t,e)},s.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var r=t+this._hbarXMin,i=r+this._hbarTranslateMax;t=(o.constrain(n.event.x,r,i)-r)/(i-r)*(this.position.w-this._box.w)}if(this.vbar){var a=e+this._vbarYMin,s=a+this._vbarTranslateMax;e=(o.constrain(n.event.y,a,s)-a)/(s-a)*(this.position.h-this._box.h)}this.setTranslate(t,e)},s.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=o.constrain(t||0,0,r),e=o.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(a.setTranslate,this._box.l-this.position.l-t,this._box.t-this.position.t-e),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+t-.5),y:Math.floor(this.position.t+e-.5)}),this.hbar){var i=t/r;this.hbar.call(a.setTranslate,t+i*this._hbarTranslateMax,e)}if(this.vbar){var s=e/n;this.vbar.call(a.setTranslate,t,e+s*this._vbarTranslateMax)}}},{"../../lib":169,"../color":50,"../drawing":71,d3:14}],144:[function(t,e,r){"use strict";e.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},FROM_BR:{left:1,center:.5,right:0,bottom:0,middle:.5,top:1},LINE_SPACING:1.3,CAP_SHIFT:.7,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}},{}],145:[function(t,e,r){"use strict";e.exports={FORMAT_LINK:"https://github.com/d3/d3-3.x-api-reference/blob/master/Formatting.md#d3_format",DATE_FORMAT_LINK:"https://github.com/d3/d3-3.x-api-reference/blob/master/Time-Formatting.md#format"}},{}],146:[function(t,e,r){"use strict";e.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}},{}],147:[function(t,e,r){"use strict";e.exports={BADNUM:void 0,FP_SAFE:Number.MAX_VALUE/1e4,ONEAVGYEAR:315576e5,ONEAVGMONTH:26298e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5,ALMOST_EQUAL:1-1e-6,LOG_CLIP:10,MINUS_SIGN:"\u2212"}},{}],148:[function(t,e,r){"use strict";r.xmlns="http://www.w3.org/2000/xmlns/",r.svg="http://www.w3.org/2000/svg",r.xlink="http://www.w3.org/1999/xlink",r.svgAttrs={xmlns:r.svg,"xmlns:xlink":r.xlink}},{}],149:[function(t,e,r){"use strict";r.version="1.52.2",t("es6-promise").polyfill(),t("../build/plotcss"),t("./fonts/mathjax_config")();for(var n=t("./registry"),i=r.register=n.register,a=t("./plot_api"),o=Object.keys(a),s=0;s<o.length;s++){var l=o[s];"_"!==l.charAt(0)&&(r[l]=a[l]),i({moduleType:"apiMethod",name:l,fn:a[l]})}i(t("./traces/scatter")),i([t("./components/fx"),t("./components/legend"),t("./components/annotations"),t("./components/annotations3d"),t("./components/shapes"),t("./components/images"),t("./components/updatemenus"),t("./components/sliders"),t("./components/rangeslider"),t("./components/rangeselector"),t("./components/grid"),t("./components/errorbars"),t("./components/colorscale"),t("./components/colorbar")]),i([t("./locale-en"),t("./locale-en-us")]),window.PlotlyLocales&&Array.isArray(window.PlotlyLocales)&&(i(window.PlotlyLocales),delete window.PlotlyLocales),r.Icons=t("./fonts/ploticon"),r.Plots=t("./plots/plots"),r.Fx=t("./components/fx"),r.Snapshot=t("./snapshot"),r.PlotSchema=t("./plot_api/plot_schema"),r.Queue=t("./lib/queue"),r.d3=t("d3")},{"../build/plotcss":1,"./components/annotations":43,"./components/annotations3d":48,"./components/colorbar":56,"./components/colorscale":62,"./components/errorbars":77,"./components/fx":88,"./components/grid":92,"./components/images":97,"./components/legend":105,"./components/rangeselector":116,"./components/rangeslider":123,"./components/shapes":131,"./components/sliders":136,"./components/updatemenus":142,"./fonts/mathjax_config":150,"./fonts/ploticon":151,"./lib/queue":183,"./locale-en":194,"./locale-en-us":193,"./plot_api":198,"./plot_api/plot_schema":202,"./plots/plots":252,"./registry":261,"./snapshot":266,"./traces/scatter":304,d3:14,"es6-promise":15}],150:[function(t,e,r){"use strict";e.exports=function(){"undefined"!=typeof MathJax&&("local"!==(window.PlotlyConfig||{}).MathJaxConfig&&(MathJax.Hub.Config({messageStyle:"none",skipStartupTypeset:!0,displayAlign:"left",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]}}),MathJax.Hub.Configured()))}},{}],151:[function(t,e,r){"use strict";e.exports={undo:{width:857.1,height:1e3,path:"m857 350q0-87-34-166t-91-137-137-92-166-34q-96 0-183 41t-147 114q-4 6-4 13t5 11l76 77q6 5 14 5 9-1 13-7 41-53 100-82t126-29q58 0 110 23t92 61 61 91 22 111-22 111-61 91-92 61-110 23q-55 0-105-20t-90-57l77-77q17-16 8-38-10-23-33-23h-250q-15 0-25 11t-11 25v250q0 24 22 33 22 10 39-8l72-72q60 57 137 88t159 31q87 0 166-34t137-92 91-137 34-166z",transform:"matrix(1 0 0 -1 0 850)"},home:{width:928.6,height:1e3,path:"m786 296v-267q0-15-11-26t-25-10h-214v214h-143v-214h-214q-15 0-25 10t-11 26v267q0 1 0 2t0 2l321 264 321-264q1-1 1-4z m124 39l-34-41q-5-5-12-6h-2q-7 0-12 3l-386 322-386-322q-7-4-13-4-7 2-12 7l-35 41q-4 5-3 13t6 12l401 334q18 15 42 15t43-15l136-114v109q0 8 5 13t13 5h107q8 0 13-5t5-13v-227l122-102q5-5 6-12t-4-13z",transform:"matrix(1 0 0 -1 0 850)"},"camera-retro":{width:1e3,height:1e3,path:"m518 386q0 8-5 13t-13 5q-37 0-63-27t-26-63q0-8 5-13t13-5 12 5 5 13q0 23 16 38t38 16q8 0 13 5t5 13z m125-73q0-59-42-101t-101-42-101 42-42 101 42 101 101 42 101-42 42-101z m-572-320h858v71h-858v-71z m643 320q0 89-62 152t-152 62-151-62-63-152 63-151 151-63 152 63 62 151z m-571 358h214v72h-214v-72z m-72-107h858v143h-462l-36-71h-360v-72z m929 143v-714q0-30-21-51t-50-21h-858q-29 0-50 21t-21 51v714q0 30 21 51t50 21h858q29 0 50-21t21-51z",transform:"matrix(1 0 0 -1 0 850)"},zoombox:{width:1e3,height:1e3,path:"m1000-25l-250 251c40 63 63 138 63 218 0 224-182 406-407 406-224 0-406-182-406-406s183-406 407-406c80 0 155 22 218 62l250-250 125 125z m-812 250l0 438 437 0 0-438-437 0z m62 375l313 0 0-312-313 0 0 312z",transform:"matrix(1 0 0 -1 0 850)"},pan:{width:1e3,height:1e3,path:"m1000 350l-187 188 0-125-250 0 0 250 125 0-188 187-187-187 125 0 0-250-250 0 0 125-188-188 186-187 0 125 252 0 0-250-125 0 187-188 188 188-125 0 0 250 250 0 0-126 187 188z",transform:"matrix(1 0 0 -1 0 850)"},zoom_plus:{width:875,height:1e3,path:"m1 787l0-875 875 0 0 875-875 0z m687-500l-187 0 0-187-125 0 0 187-188 0 0 125 188 0 0 187 125 0 0-187 187 0 0-125z",transform:"matrix(1 0 0 -1 0 850)"},zoom_minus:{width:875,height:1e3,path:"m0 788l0-876 875 0 0 876-875 0z m688-500l-500 0 0 125 500 0 0-125z",transform:"matrix(1 0 0 -1 0 850)"},autoscale:{width:1e3,height:1e3,path:"m250 850l-187 0-63 0 0-62 0-188 63 0 0 188 187 0 0 62z m688 0l-188 0 0-62 188 0 0-188 62 0 0 188 0 62-62 0z m-875-938l0 188-63 0 0-188 0-62 63 0 187 0 0 62-187 0z m875 188l0-188-188 0 0-62 188 0 62 0 0 62 0 188-62 0z m-125 188l-1 0-93-94-156 156 156 156 92-93 2 0 0 250-250 0 0-2 93-92-156-156-156 156 94 92 0 2-250 0 0-250 0 0 93 93 157-156-157-156-93 94 0 0 0-250 250 0 0 0-94 93 156 157 156-157-93-93 0 0 250 0 0 250z",transform:"matrix(1 0 0 -1 0 850)"},tooltip_basic:{width:1500,height:1e3,path:"m375 725l0 0-375-375 375-374 0-1 1125 0 0 750-1125 0z",transform:"matrix(1 0 0 -1 0 850)"},tooltip_compare:{width:1125,height:1e3,path:"m187 786l0 2-187-188 188-187 0 0 937 0 0 373-938 0z m0-499l0 1-187-188 188-188 0 0 937 0 0 376-938-1z",transform:"matrix(1 0 0 -1 0 850)"},plotlylogo:{width:1542,height:1e3,path:"m0-10h182v-140h-182v140z m228 146h183v-286h-183v286z m225 714h182v-1000h-182v1000z m225-285h182v-715h-182v715z m225 142h183v-857h-183v857z m231-428h182v-429h-182v429z m225-291h183v-138h-183v138z",transform:"matrix(1 0 0 -1 0 850)"},"z-axis":{width:1e3,height:1e3,path:"m833 5l-17 108v41l-130-65 130-66c0 0 0 38 0 39 0-1 36-14 39-25 4-15-6-22-16-30-15-12-39-16-56-20-90-22-187-23-279-23-261 0-341 34-353 59 3 60 228 110 228 110-140-8-351-35-351-116 0-120 293-142 474-142 155 0 477 22 477 142 0 50-74 79-163 96z m-374 94c-58-5-99-21-99-40 0-24 65-43 144-43 79 0 143 19 143 43 0 19-42 34-98 40v216h87l-132 135-133-135h88v-216z m167 515h-136v1c16 16 31 34 46 52l84 109v54h-230v-71h124v-1c-16-17-28-32-44-51l-89-114v-51h245v72z",transform:"matrix(1 0 0 -1 0 850)"},"3d_rotate":{width:1e3,height:1e3,path:"m922 660c-5 4-9 7-14 11-359 263-580-31-580-31l-102 28 58-400c0 1 1 1 2 2 118 108 351 249 351 249s-62 27-100 42c88 83 222 183 347 122 16-8 30-17 44-27-2 1-4 2-6 4z m36-329c0 0 64 229-88 296-62 27-124 14-175-11 157-78 225-208 249-266 8-19 11-31 11-31 2 5 6 15 11 32-5-13-8-20-8-20z m-775-239c70-31 117-50 198-32-121 80-199 346-199 346l-96-15-58-12c0 0 55-226 155-287z m603 133l-317-139c0 0 4-4 19-14 7-5 24-15 24-15s-177-147-389 4c235-287 536-112 536-112l31-22 100 299-4-1z m-298-153c6-4 14-9 24-15 0 0-17 10-24 15z",transform:"matrix(1 0 0 -1 0 850)"},camera:{width:1e3,height:1e3,path:"m500 450c-83 0-150-67-150-150 0-83 67-150 150-150 83 0 150 67 150 150 0 83-67 150-150 150z m400 150h-120c-16 0-34 13-39 29l-31 93c-6 15-23 28-40 28h-340c-16 0-34-13-39-28l-31-94c-6-15-23-28-40-28h-120c-55 0-100-45-100-100v-450c0-55 45-100 100-100h800c55 0 100 45 100 100v450c0 55-45 100-100 100z m-400-550c-138 0-250 112-250 250 0 138 112 250 250 250 138 0 250-112 250-250 0-138-112-250-250-250z m365 380c-19 0-35 16-35 35 0 19 16 35 35 35 19 0 35-16 35-35 0-19-16-35-35-35z",transform:"matrix(1 0 0 -1 0 850)"},movie:{width:1e3,height:1e3,path:"m938 413l-188-125c0 37-17 71-44 94 64 38 107 107 107 187 0 121-98 219-219 219-121 0-219-98-219-219 0-61 25-117 66-156h-115c30 33 49 76 49 125 0 103-84 187-187 187s-188-84-188-187c0-57 26-107 65-141-38-22-65-62-65-109v-250c0-70 56-126 125-126h500c69 0 125 56 125 126l188-126c34 0 62 28 62 63v375c0 35-28 63-62 63z m-750 0c-69 0-125 56-125 125s56 125 125 125 125-56 125-125-56-125-125-125z m406-1c-87 0-157 70-157 157 0 86 70 156 157 156s156-70 156-156-70-157-156-157z",transform:"matrix(1 0 0 -1 0 850)"},question:{width:857.1,height:1e3,path:"m500 82v107q0 8-5 13t-13 5h-107q-8 0-13-5t-5-13v-107q0-8 5-13t13-5h107q8 0 13 5t5 13z m143 375q0 49-31 91t-77 65-95 23q-136 0-207-119-9-14 4-24l74-55q4-4 10-4 9 0 14 7 30 38 48 51 19 14 48 14 27 0 48-15t21-33q0-21-11-34t-38-25q-35-16-65-48t-29-70v-20q0-8 5-13t13-5h107q8 0 13 5t5 13q0 10 12 27t30 28q18 10 28 16t25 19 25 27 16 34 7 45z m214-107q0-117-57-215t-156-156-215-58-216 58-155 156-58 215 58 215 155 156 216 58 215-58 156-156 57-215z",transform:"matrix(1 0 0 -1 0 850)"},disk:{width:857.1,height:1e3,path:"m214-7h429v214h-429v-214z m500 0h72v500q0 8-6 21t-11 20l-157 156q-5 6-19 12t-22 5v-232q0-22-15-38t-38-16h-322q-22 0-37 16t-16 38v232h-72v-714h72v232q0 22 16 38t37 16h465q22 0 38-16t15-38v-232z m-214 518v178q0 8-5 13t-13 5h-107q-7 0-13-5t-5-13v-178q0-8 5-13t13-5h107q7 0 13 5t5 13z m357-18v-518q0-22-15-38t-38-16h-750q-23 0-38 16t-16 38v750q0 22 16 38t38 16h517q23 0 50-12t42-26l156-157q16-15 27-42t11-49z",transform:"matrix(1 0 0 -1 0 850)"},lasso:{width:1031,height:1e3,path:"m1018 538c-36 207-290 336-568 286-277-48-473-256-436-463 10-57 36-108 76-151-13-66 11-137 68-183 34-28 75-41 114-42l-55-70 0 0c-2-1-3-2-4-3-10-14-8-34 5-45 14-11 34-8 45 4 1 1 2 3 2 5l0 0 113 140c16 11 31 24 45 40 4 3 6 7 8 11 48-3 100 0 151 9 278 48 473 255 436 462z m-624-379c-80 14-149 48-197 96 42 42 109 47 156 9 33-26 47-66 41-105z m-187-74c-19 16-33 37-39 60 50-32 109-55 174-68-42-25-95-24-135 8z m360 75c-34-7-69-9-102-8 8 62-16 128-68 170-73 59-175 54-244-5-9 20-16 40-20 61-28 159 121 317 333 354s407-60 434-217c28-159-121-318-333-355z",transform:"matrix(1 0 0 -1 0 850)"},selectbox:{width:1e3,height:1e3,path:"m0 850l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m285 0l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m-857-286l0-143 143 0 0 143-143 0z m857 0l0-143 143 0 0 143-143 0z m-857-285l0-143 143 0 0 143-143 0z m857 0l0-143 143 0 0 143-143 0z m-857-286l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m285 0l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z",transform:"matrix(1 0 0 -1 0 850)"},spikeline:{width:1e3,height:1e3,path:"M512 409c0-57-46-104-103-104-57 0-104 47-104 104 0 57 47 103 104 103 57 0 103-46 103-103z m-327-39l92 0 0 92-92 0z m-185 0l92 0 0 92-92 0z m370-186l92 0 0 93-92 0z m0-184l92 0 0 92-92 0z",transform:"matrix(1.5 0 0 -1.5 0 850)"},pencil:{width:1792,height:1792,path:"M491 1536l91-91-235-235-91 91v107h128v128h107zm523-928q0-22-22-22-10 0-17 7l-542 542q-7 7-7 17 0 22 22 22 10 0 17-7l542-542q7-7 7-17zm-54-192l416 416-832 832h-416v-416zm683 96q0 53-37 90l-166 166-416-416 166-165q36-38 90-38 53 0 91 38l235 234q37 39 37 91z",transform:"matrix(1 0 0 1 0 1)"},newplotlylogo:{name:"newplotlylogo",svg:"<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 132 132'><defs><style>.cls-1 {fill: #119dff;} .cls-2 {fill: #25fefd;} .cls-3 {fill: #fff;}</style></defs><title>plotly-logomark</title><g id='symbol'><rect class='cls-1' width='132' height='132' rx='6' ry='6'/><circle class='cls-2' cx='78' cy='54' r='6'/><circle class='cls-2' cx='102' cy='30' r='6'/><circle class='cls-2' cx='78' cy='30' r='6'/><circle class='cls-2' cx='54' cy='30' r='6'/><circle class='cls-2' cx='30' cy='30' r='6'/><circle class='cls-2' cx='30' cy='54' r='6'/><path class='cls-3' d='M30,72a6,6,0,0,0-6,6v24a6,6,0,0,0,12,0V78A6,6,0,0,0,30,72Z'/><path class='cls-3' d='M78,72a6,6,0,0,0-6,6v24a6,6,0,0,0,12,0V78A6,6,0,0,0,78,72Z'/><path class='cls-3' d='M54,48a6,6,0,0,0-6,6v48a6,6,0,0,0,12,0V54A6,6,0,0,0,54,48Z'/><path class='cls-3' d='M102,48a6,6,0,0,0-6,6v48a6,6,0,0,0,12,0V54A6,6,0,0,0,102,48Z'/></g></svg>"}}},{}],152:[function(t,e,r){"use strict";r.isLeftAnchor=function(t){return"left"===t.xanchor||"auto"===t.xanchor&&t.x<=1/3},r.isCenterAnchor=function(t){return"center"===t.xanchor||"auto"===t.xanchor&&t.x>1/3&&t.x<2/3},r.isRightAnchor=function(t){return"right"===t.xanchor||"auto"===t.xanchor&&t.x>=2/3},r.isTopAnchor=function(t){return"top"===t.yanchor||"auto"===t.yanchor&&t.y>=2/3},r.isMiddleAnchor=function(t){return"middle"===t.yanchor||"auto"===t.yanchor&&t.y>1/3&&t.y<2/3},r.isBottomAnchor=function(t){return"bottom"===t.yanchor||"auto"===t.yanchor&&t.y<=1/3}},{}],153:[function(t,e,r){"use strict";var n=t("./mod"),i=n.mod,a=n.modHalf,o=Math.PI,s=2*o;function l(t){return Math.abs(t[1]-t[0])>s-1e-14}function u(t,e){return a(e-t,s)}function c(t,e){if(l(e))return!0;var r,n;e[0]<e[1]?(r=e[0],n=e[1]):(r=e[1],n=e[0]),(r=i(r,s))>(n=i(n,s))&&(n+=s);var a=i(t,s),o=a+s;return a>=r&&a<=n||o>=r&&o<=n}function p(t,e,r,n,i,a,u){i=i||0,a=a||0;var c,p,h,f,d,m=l([r,n]);function y(t,e){return[t*Math.cos(e)+i,a-t*Math.sin(e)]}m?(c=0,p=o,h=s):r<n?(c=r,h=n):(c=n,h=r),t<e?(f=t,d=e):(f=e,d=t);var g,v=Math.abs(h-c)<=o?0:1;function _(t,e,r){return"A"+[t,t]+" "+[0,v,r]+" "+y(t,e)}return m?g=null===f?"M"+y(d,c)+_(d,p,0)+_(d,h,0)+"Z":"M"+y(f,c)+_(f,p,0)+_(f,h,0)+"ZM"+y(d,c)+_(d,p,1)+_(d,h,1)+"Z":null===f?(g="M"+y(d,c)+_(d,h,0),u&&(g+="L0,0Z")):g="M"+y(f,c)+"L"+y(d,c)+_(d,h,0)+"L"+y(f,h)+_(f,c,1)+"Z",g}e.exports={deg2rad:function(t){return t/180*o},rad2deg:function(t){return t/o*180},angleDelta:u,angleDist:function(t,e){return Math.abs(u(t,e))},isFullCircle:l,isAngleInsideSector:c,isPtInsideSector:function(t,e,r,n){return!!c(e,n)&&(r[0]<r[1]?(i=r[0],a=r[1]):(i=r[1],a=r[0]),t>=i&&t<=a);var i,a},pathArc:function(t,e,r,n,i){return p(null,t,e,r,n,i,0)},pathSector:function(t,e,r,n,i){return p(null,t,e,r,n,i,1)},pathAnnulus:function(t,e,r,n,i,a){return p(t,e,r,n,i,a,1)}}},{"./mod":176}],154:[function(t,e,r){"use strict";var n=Array.isArray,i="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer:{isView:function(){return!1}},a="undefined"==typeof DataView?function(){}:DataView;function o(t){return i.isView(t)&&!(t instanceof a)}function s(t){return n(t)||o(t)}function l(t,e,r){if(s(t)){if(s(t[0])){for(var n=r,i=0;i<t.length;i++)n=e(n,t[i].length);return n}return t.length}return 0}r.isTypedArray=o,r.isArrayOrTypedArray=s,r.isArray1D=function(t){return!s(t[0])},r.ensureArray=function(t,e){return n(t)||(t=[]),t.length=e,t},r.concat=function(){var t,e,r,i,a,o,s,l,u=[],c=!0,p=0;for(r=0;r<arguments.length;r++)(o=(i=arguments[r]).length)&&(e?u.push(i):(e=i,a=o),n(i)?t=!1:(c=!1,p?t!==i.constructor&&(t=!1):t=i.constructor),p+=o);if(!p)return[];if(!u.length)return e;if(c)return e.concat.apply(e,u);if(t){for((s=new t(p)).set(e),r=0;r<u.length;r++)i=u[r],s.set(i,a),a+=i.length;return s}for(s=new Array(p),l=0;l<e.length;l++)s[l]=e[l];for(r=0;r<u.length;r++){for(i=u[r],l=0;l<i.length;l++)s[a+l]=i[l];a+=l}return s},r.maxRowLength=function(t){return l(t,Math.max,0)},r.minRowLength=function(t){return l(t,Math.min,1/0)}},{}],155:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../constants/numerical").BADNUM,a=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g;e.exports=function(t){return"string"==typeof t&&(t=t.replace(a,"")),n(t)?Number(t):i}},{"../constants/numerical":147,"fast-isnumeric":16}],156:[function(t,e,r){"use strict";e.exports=function(t){var e=t._fullLayout;e._glcanvas&&e._glcanvas.size()&&e._glcanvas.each(function(t){t.regl&&t.regl.clear({color:!0,depth:!0})})}},{}],157:[function(t,e,r){"use strict";e.exports=function(t){t._responsiveChartHandler&&(window.removeEventListener("resize",t._responsiveChartHandler),delete t._responsiveChartHandler)}},{}],158:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("tinycolor2"),a=t("../plots/attributes"),o=t("../components/colorscale/scales"),s=t("../constants/interactions").DESELECTDIM,l=t("./nested_property"),u=t("./regex").counter,c=t("./mod").modHalf,p=t("./array").isArrayOrTypedArray;function h(t,e){var n=r.valObjectMeta[e.valType];if(e.arrayOk&&p(t))return!0;if(n.validateFunction)return n.validateFunction(t,e);var i={},a=i,o={set:function(t){a=t}};return n.coerceFunction(t,o,i,e),a!==i}r.valObjectMeta={data_array:{coerceFunction:function(t,e,r){p(t)?e.set(t):void 0!==r&&e.set(r)}},enumerated:{coerceFunction:function(t,e,r,n){n.coerceNumber&&(t=+t),-1===n.values.indexOf(t)?e.set(r):e.set(t)},validateFunction:function(t,e){e.coerceNumber&&(t=+t);for(var r=e.values,n=0;n<r.length;n++){var i=String(r[n]);if("/"===i.charAt(0)&&"/"===i.charAt(i.length-1)){if(new RegExp(i.substr(1,i.length-2)).test(t))return!0}else if(t===r[n])return!0}return!1}},boolean:{coerceFunction:function(t,e,r){!0===t||!1===t?e.set(t):e.set(r)}},number:{coerceFunction:function(t,e,r,i){!n(t)||void 0!==i.min&&t<i.min||void 0!==i.max&&t>i.max?e.set(r):e.set(+t)}},integer:{coerceFunction:function(t,e,r,i){t%1||!n(t)||void 0!==i.min&&t<i.min||void 0!==i.max&&t>i.max?e.set(r):e.set(+t)}},string:{coerceFunction:function(t,e,r,n){if("string"!=typeof t){var i="number"==typeof t;!0!==n.strict&&i?e.set(String(t)):e.set(r)}else n.noBlank&&!t?e.set(r):e.set(t)}},color:{coerceFunction:function(t,e,r){i(t).isValid()?e.set(t):e.set(r)}},colorlist:{coerceFunction:function(t,e,r){Array.isArray(t)&&t.length&&t.every(function(t){return i(t).isValid()})?e.set(t):e.set(r)}},colorscale:{coerceFunction:function(t,e,r){e.set(o.get(t,r))}},angle:{coerceFunction:function(t,e,r){"auto"===t?e.set("auto"):n(t)?e.set(c(+t,360)):e.set(r)}},subplotid:{coerceFunction:function(t,e,r,n){var i=n.regex||u(r);"string"==typeof t&&i.test(t)?e.set(t):e.set(r)},validateFunction:function(t,e){var r=e.dflt;return t===r||"string"==typeof t&&!!u(r).test(t)}},flaglist:{coerceFunction:function(t,e,r,n){if("string"==typeof t)if(-1===(n.extras||[]).indexOf(t)){for(var i=t.split("+"),a=0;a<i.length;){var o=i[a];-1===n.flags.indexOf(o)||i.indexOf(o)<a?i.splice(a,1):a++}i.length?e.set(i.join("+")):e.set(r)}else e.set(t);else e.set(r)}},any:{coerceFunction:function(t,e,r){void 0===t?e.set(r):e.set(t)}},info_array:{coerceFunction:function(t,e,n,i){function a(t,e,n){var i,a={set:function(t){i=t}};return void 0===n&&(n=e.dflt),r.valObjectMeta[e.valType].coerceFunction(t,a,n,e),i}var o=2===i.dimensions||"1-2"===i.dimensions&&Array.isArray(t)&&Array.isArray(t[0]);if(Array.isArray(t)){var s,l,u,c,p,h,f=i.items,d=[],m=Array.isArray(f),y=m&&o&&Array.isArray(f[0]),g=o&&m&&!y,v=m&&!g?f.length:t.length;if(n=Array.isArray(n)?n:[],o)for(s=0;s<v;s++)for(d[s]=[],u=Array.isArray(t[s])?t[s]:[],p=g?f.length:m?f[s].length:u.length,l=0;l<p;l++)c=g?f[l]:m?f[s][l]:f,void 0!==(h=a(u[l],c,(n[s]||[])[l]))&&(d[s][l]=h);else for(s=0;s<v;s++)void 0!==(h=a(t[s],m?f[s]:f,n[s]))&&(d[s]=h);e.set(d)}else e.set(n)},validateFunction:function(t,e){if(!Array.isArray(t))return!1;var r=e.items,n=Array.isArray(r),i=2===e.dimensions;if(!e.freeLength&&t.length!==r.length)return!1;for(var a=0;a<t.length;a++)if(i){if(!Array.isArray(t[a])||!e.freeLength&&t[a].length!==r[a].length)return!1;for(var o=0;o<t[a].length;o++)if(!h(t[a][o],n?r[a][o]:r))return!1}else if(!h(t[a],n?r[a]:r))return!1;return!0}}},r.coerce=function(t,e,n,i,a){var o=l(n,i).get(),s=l(t,i),u=l(e,i),c=s.get(),f=e._template;if(void 0===c&&f&&(c=l(f,i).get(),f=0),void 0===a&&(a=o.dflt),o.arrayOk&&p(c))return u.set(c),c;var d=r.valObjectMeta[o.valType].coerceFunction;d(c,u,a,o);var m=u.get();return f&&m===a&&!h(c,o)&&(d(c=l(f,i).get(),u,a,o),m=u.get()),m},r.coerce2=function(t,e,n,i,a){var o=l(t,i),s=r.coerce(t,e,n,i,a),u=o.get();return null!=u&&s},r.coerceFont=function(t,e,r){var n={};return r=r||{},n.family=t(e+".family",r.family),n.size=t(e+".size",r.size),n.color=t(e+".color",r.color),n},r.coerceHoverinfo=function(t,e,n){var i,o=e._module.attributes,s=o.hoverinfo?o:a,l=s.hoverinfo;if(1===n._dataLength){var u="all"===l.dflt?l.flags.slice():l.dflt.split("+");u.splice(u.indexOf("name"),1),i=u.join("+")}return r.coerce(t,e,s,"hoverinfo",i)},r.coerceSelectionMarkerOpacity=function(t,e){if(t.marker){var r,n,i=t.marker.opacity;if(void 0!==i)p(i)||t.selected||t.unselected||(r=i,n=s*i),e("selected.marker.opacity",r),e("unselected.marker.opacity",n)}},r.validate=h},{"../components/colorscale/scales":65,"../constants/interactions":146,"../plots/attributes":210,"./array":154,"./mod":176,"./nested_property":177,"./regex":184,"fast-isnumeric":16,tinycolor2:33}],159:[function(t,e,r){"use strict";var n,i,a=t("d3"),o=t("fast-isnumeric"),s=t("./loggers"),l=t("./mod").mod,u=t("../constants/numerical"),c=u.BADNUM,p=u.ONEDAY,h=u.ONEHOUR,f=u.ONEMIN,d=u.ONESEC,m=u.EPOCHJD,y=t("../registry"),g=a.time.format.utc,v=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\d)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d:?\d\d)?)?)?)?)?\s*$/m,_=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\di?)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d:?\d\d)?)?)?)?)?\s*$/m,x=(new Date).getFullYear()-70;function b(t){return t&&y.componentsRegistry.calendars&&"string"==typeof t&&"gregorian"!==t}function w(t,e){return String(t+Math.pow(10,e)).substr(1)}r.dateTick0=function(t,e){return b(t)?e?y.getComponentMethod("calendars","CANONICAL_SUNDAY")[t]:y.getComponentMethod("calendars","CANONICAL_TICK")[t]:e?"2000-01-02":"2000-01-01"},r.dfltRange=function(t){return b(t)?y.getComponentMethod("calendars","DFLTRANGE")[t]:["2000-01-01","2001-01-01"]},r.isJSDate=function(t){return"object"==typeof t&&null!==t&&"function"==typeof t.getTime},r.dateTime2ms=function(t,e){if(r.isJSDate(t)){var a=t.getTimezoneOffset()*f,o=(t.getUTCMinutes()-t.getMinutes())*f+(t.getUTCSeconds()-t.getSeconds())*d+(t.getUTCMilliseconds()-t.getMilliseconds());if(o){var s=3*f;a=a-s/2+l(o-a+s/2,s)}return(t=Number(t)-a)>=n&&t<=i?t:c}if("string"!=typeof t&&"number"!=typeof t)return c;t=String(t);var u=b(e),g=t.charAt(0);!u||"G"!==g&&"g"!==g||(t=t.substr(1),e="");var w=u&&"chinese"===e.substr(0,7),k=t.match(w?_:v);if(!k)return c;var T=k[1],A=k[3]||"1",M=Number(k[5]||1),S=Number(k[7]||0),L=Number(k[9]||0),C=Number(k[11]||0);if(u){if(2===T.length)return c;var E;T=Number(T);try{var z=y.getComponentMethod("calendars","getCal")(e);if(w){var P="i"===A.charAt(A.length-1);A=parseInt(A,10),E=z.newDate(T,z.toMonthIndex(T,A,P),M)}else E=z.newDate(T,Number(A),M)}catch(t){return c}return E?(E.toJD()-m)*p+S*h+L*f+C*d:c}T=2===T.length?(Number(T)+2e3-x)%100+x:Number(T),A-=1;var I=new Date(Date.UTC(2e3,A,M,S,L));return I.setUTCFullYear(T),I.getUTCMonth()!==A?c:I.getUTCDate()!==M?c:I.getTime()+C*d},n=r.MIN_MS=r.dateTime2ms("-9999"),i=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(t,e){return r.dateTime2ms(t,e)!==c};var k=90*p,T=3*h,A=5*f;function M(t,e,r,n,i){if((e||r||n||i)&&(t+=" "+w(e,2)+":"+w(r,2),(n||i)&&(t+=":"+w(n,2),i))){for(var a=4;i%10==0;)a-=1,i/=10;t+="."+w(i,a)}return t}r.ms2DateTime=function(t,e,r){if("number"!=typeof t||!(t>=n&&t<=i))return c;e||(e=0);var a,o,s,u,v,_,x=Math.floor(10*l(t+.05,1)),w=Math.round(t-x/10);if(b(r)){var S=Math.floor(w/p)+m,L=Math.floor(l(t,p));try{a=y.getComponentMethod("calendars","getCal")(r).fromJD(S).formatDate("yyyy-mm-dd")}catch(t){a=g("G%Y-%m-%d")(new Date(w))}if("-"===a.charAt(0))for(;a.length<11;)a="-0"+a.substr(1);else for(;a.length<10;)a="0"+a;o=e<k?Math.floor(L/h):0,s=e<k?Math.floor(L%h/f):0,u=e<T?Math.floor(L%f/d):0,v=e<A?L%d*10+x:0}else _=new Date(w),a=g("%Y-%m-%d")(_),o=e<k?_.getUTCHours():0,s=e<k?_.getUTCMinutes():0,u=e<T?_.getUTCSeconds():0,v=e<A?10*_.getUTCMilliseconds()+x:0;return M(a,o,s,u,v)},r.ms2DateTimeLocal=function(t){if(!(t>=n+p&&t<=i-p))return c;var e=Math.floor(10*l(t+.05,1)),r=new Date(Math.round(t-e/10));return M(a.time.format("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+e)},r.cleanDate=function(t,e,n){if(t===c)return e;if(r.isJSDate(t)||"number"==typeof t&&isFinite(t)){if(b(n))return s.error("JS Dates and milliseconds are incompatible with world calendars",t),e;if(!(t=r.ms2DateTimeLocal(+t))&&void 0!==e)return e}else if(!r.isDateTime(t,n))return s.error("unrecognized date",t),e;return t};var S=/%\d?f/g;function L(t,e,r,n){t=t.replace(S,function(t){var r=Math.min(+t.charAt(1)||6,6);return(e/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"});var i=new Date(Math.floor(e+.05));if(b(n))try{t=y.getComponentMethod("calendars","worldCalFmt")(t,e,n)}catch(t){return"Invalid"}return r(t)(i)}var C=[59,59.9,59.99,59.999,59.9999];r.formatDate=function(t,e,r,n,i,a){if(i=b(i)&&i,!e)if("y"===r)e=a.year;else if("m"===r)e=a.month;else{if("d"!==r)return function(t,e){var r=l(t+.05,p),n=w(Math.floor(r/h),2)+":"+w(l(Math.floor(r/f),60),2);if("M"!==e){o(e)||(e=0);var i=(100+Math.min(l(t/d,60),C[e])).toFixed(e).substr(1);e>0&&(i=i.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+i}return n}(t,r)+"\n"+L(a.dayMonthYear,t,n,i);e=a.dayMonth+"\n"+a.year}return L(e,t,n,i)};var E=3*p;r.incrementMonth=function(t,e,r){r=b(r)&&r;var n=l(t,p);if(t=Math.round(t-n),r)try{var i=Math.round(t/p)+m,a=y.getComponentMethod("calendars","getCal")(r),o=a.fromJD(i);return e%12?a.add(o,e,"m"):a.add(o,e/12,"y"),(o.toJD()-m)*p+n}catch(e){s.error("invalid ms "+t+" in calendar "+r)}var u=new Date(t+E);return u.setUTCMonth(u.getUTCMonth()+e)+n-E},r.findExactDates=function(t,e){for(var r,n,i=0,a=0,s=0,l=0,u=b(e)&&y.getComponentMethod("calendars","getCal")(e),c=0;c<t.length;c++)if(n=t[c],o(n)){if(!(n%p))if(u)try{1===(r=u.fromJD(n/p+m)).day()?1===r.month()?i++:a++:s++}catch(t){}else 1===(r=new Date(n)).getUTCDate()?0===r.getUTCMonth()?i++:a++:s++}else l++;s+=a+=i;var h=t.length-l;return{exactYears:i/h,exactMonths:a/h,exactDays:s/h}}},{"../constants/numerical":147,"../registry":261,"./loggers":173,"./mod":176,d3:14,"fast-isnumeric":16}],160:[function(t,e,r){"use strict";var n=t("d3"),i=t("./loggers");function a(t){var e=t&&t.parentNode;e&&e.removeChild(t)}function o(t,e,r){var n="plotly.js-style-"+t,a=document.getElementById(n);a||((a=document.createElement("style")).setAttribute("id",n),a.appendChild(document.createTextNode("")),document.head.appendChild(a));var o=a.sheet;o.insertRule?o.insertRule(e+"{"+r+"}",0):o.addRule?o.addRule(e,r,0):i.warn("addStyleRule failed")}e.exports={getGraphDiv:function(t){var e;if("string"==typeof t){if(null===(e=document.getElementById(t)))throw new Error("No DOM element with id '"+t+"' exists on the page.");return e}if(null==t)throw new Error("DOM element provided is null or undefined");return t},isPlotDiv:function(t){var e=n.select(t);return e.node()instanceof HTMLElement&&e.size()&&e.classed("js-plotly-plot")},removeElement:a,addStyleRule:function(t,e){o("global",t,e)},addRelatedStyleRule:o,deleteRelatedStyleRule:function(t){var e="plotly.js-style-"+t,r=document.getElementById(e);r&&a(r)}}},{"./loggers":173,d3:14}],161:[function(t,e,r){"use strict";var n=t("events").EventEmitter,i={init:function(t){if(t._ev instanceof n)return t;var e=new n,r=new n;return t._ev=e,t._internalEv=r,t.on=e.on.bind(e),t.once=e.once.bind(e),t.removeListener=e.removeListener.bind(e),t.removeAllListeners=e.removeAllListeners.bind(e),t._internalOn=r.on.bind(r),t._internalOnce=r.once.bind(r),t._removeInternalListener=r.removeListener.bind(r),t._removeAllInternalListeners=r.removeAllListeners.bind(r),t.emit=function(n,i){"undefined"!=typeof jQuery&&jQuery(t).trigger(n,i),e.emit(n,i),r.emit(n,i)},t},triggerHandler:function(t,e,r){var n,i;"undefined"!=typeof jQuery&&(n=jQuery(t).triggerHandler(e,r));var a=t._ev;if(!a)return n;var o,s=a._events[e];if(!s)return n;function l(t){return t.listener?(a.removeListener(e,t.listener),t.fired?void 0:(t.fired=!0,t.listener.apply(a,[r]))):t.apply(a,[r])}for(s=Array.isArray(s)?s:[s],o=0;o<s.length-1;o++)l(s[o]);return i=l(s[o]),void 0!==n?n:i},purge:function(t){return delete t._ev,delete t.on,delete t.once,delete t.removeListener,delete t.removeAllListeners,delete t.emit,delete t._ev,delete t._internalEv,delete t._internalOn,delete t._internalOnce,delete t._removeInternalListener,delete t._removeAllInternalListeners,t}};e.exports=i},{events:12}],162:[function(t,e,r){"use strict";var n=t("./is_plain_object.js"),i=Array.isArray;function a(t,e,r,o){var s,l,u,c,p,h,f=t[0],d=t.length;if(2===d&&i(f)&&i(t[1])&&0===f.length){if(function(t,e){var r,n;for(r=0;r<t.length;r++){if(null!==(n=t[r])&&"object"==typeof n)return!1;void 0!==n&&(e[r]=n)}return!0}(t[1],f))return f;f.splice(0,f.length)}for(var m=1;m<d;m++)for(l in s=t[m])u=f[l],c=s[l],o&&i(c)?f[l]=c:e&&c&&(n(c)||(p=i(c)))?(p?(p=!1,h=u&&i(u)?u:[]):h=u&&n(u)?u:{},f[l]=a([h,c],e,r,o)):("undefined"!=typeof c||r)&&(f[l]=c);return f}r.extendFlat=function(){return a(arguments,!1,!1,!1)},r.extendDeep=function(){return a(arguments,!0,!1,!1)},r.extendDeepAll=function(){return a(arguments,!0,!0,!1)},r.extendDeepNoArrays=function(){return a(arguments,!0,!1,!0)}},{"./is_plain_object.js":170}],163:[function(t,e,r){"use strict";e.exports=function(t){for(var e={},r=[],n=0,i=0;i<t.length;i++){var a=t[i];1!==e[a]&&(e[a]=1,r[n++]=a)}return r}},{}],164:[function(t,e,r){"use strict";function n(t){return!0===t.visible}function i(t){var e=t[0].trace;return!0===e.visible&&0!==e._length}e.exports=function(t){for(var e,r=(e=t,Array.isArray(e)&&Array.isArray(e[0])&&e[0][0]&&e[0][0].trace?i:n),a=[],o=0;o<t.length;o++){var s=t[o];r(s)&&a.push(s)}return a}},{}],165:[function(t,e,r){"use strict";var n=t("d3"),i=t("country-regex"),a=t("@turf/area"),o=t("@turf/centroid"),s=t("@turf/bbox"),l=t("./identity"),u=t("./loggers"),c=t("./is_plain_object"),p=t("./nested_property"),h=t("./polygon"),f=Object.keys(i),d={"ISO-3":l,"USA-states":l,"country names":function(t){for(var e=0;e<f.length;e++){var r=f[e],n=new RegExp(i[r]);if(n.test(t.trim().toLowerCase()))return r}return u.log("Unrecognized country name: "+t+"."),!1}};function m(t){var e=t.geojson,r=window.PlotlyGeoAssets||{},n="string"==typeof e?r[e]:e;return c(n)?n:(u.error("Oops ... something went wrong when fetching "+e),!1)}e.exports={locationToFeature:function(t,e,r){if(!e||"string"!=typeof e)return!1;var n,i,a,o=d[t](e);if(o){if("USA-states"===t)for(n=[],a=0;a<r.length;a++)(i=r[a]).properties&&i.properties.gu&&"USA"===i.properties.gu&&n.push(i);else n=r;for(a=0;a<n.length;a++)if((i=n[a]).id===o)return i;u.log(["Location with id",o,"does not have a matching topojson feature at this resolution."].join(" "))}return!1},feature2polygons:function(t){var e,r,n,i,a=t.geometry,o=a.coordinates,s=t.id,l=[];function u(t){for(var e=0;e<t.length-1;e++)if(t[e][0]>0&&t[e+1][0]<0)return e;return null}switch(e="RUS"===s||"FJI"===s?function(t){var e;if(null===u(t))e=t;else for(e=new Array(t.length),i=0;i<t.length;i++)e[i]=[t[i][0]<0?t[i][0]+360:t[i][0],t[i][1]];l.push(h.tester(e))}:"ATA"===s?function(t){var e=u(t);if(null===e)return l.push(h.tester(t));var r=new Array(t.length+1),n=0;for(i=0;i<t.length;i++)i>e?r[n++]=[t[i][0]+360,t[i][1]]:i===e?(r[n++]=t[i],r[n++]=[t[i][0],-90]):r[n++]=t[i];var a=h.tester(r);a.pts.pop(),l.push(a)}:function(t){l.push(h.tester(t))},a.type){case"MultiPolygon":for(r=0;r<o.length;r++)for(n=0;n<o[r].length;n++)e(o[r][n]);break;case"Polygon":for(r=0;r<o.length;r++)e(o[r])}return l},getTraceGeojson:m,extractTraceFeature:function(t){var e=t[0].trace,r=m(e);if(!r)return!1;var n,i={},s=[];for(n=0;n<e._length;n++){var l=t[n];(l.loc||0===l.loc)&&(i[l.loc]=l)}function c(t){var r=p(t,e.featureidkey||"id").get(),n=i[r];if(n){var l=t.geometry;if("Polygon"===l.type||"MultiPolygon"===l.type){var c={type:"Feature",id:r,geometry:l,properties:{}};c.properties.ct=function(t){var e,r=t.geometry;if("MultiPolygon"===r.type)for(var n=r.coordinates,i=0,s=0;s<n.length;s++){var l={type:"Polygon",coordinates:n[s]},u=a.default(l);u>i&&(i=u,e=l)}else e=r;return o.default(e).geometry.coordinates}(c),n.fIn=t,n.fOut=c,s.push(c)}else u.log(["Location",n.loc,"does not have a valid GeoJSON geometry.","Traces with locationmode *geojson-id* only support","*Polygon* and *MultiPolygon* geometries."].join(" "))}delete i[r]}switch(r.type){case"FeatureCollection":var h=r.features;for(n=0;n<h.length;n++)c(h[n]);break;case"Feature":c(r);break;default:return u.warn(["Invalid GeoJSON type",(r.type||"none")+".","Traces with locationmode *geojson-id* only support","*FeatureCollection* and *Feature* types."].join(" ")),!1}for(var f in i)u.log(["Location *"+f+"*","does not have a matching feature with id-key","*"+e.featureidkey+"*."].join(" "));return s},fetchTraceGeoData:function(t){var e=window.PlotlyGeoAssets||{},r=[];function i(t){return new Promise(function(r,i){n.json(t,function(n,a){if(n){delete e[t];var o=404===n.status?'GeoJSON at URL "'+t+'" does not exist.':"Unexpected error while fetching from "+t;return i(new Error(o))}return e[t]=a,r(a)})})}function a(t){return new Promise(function(r,n){var i=0,a=setInterval(function(){return e[t]&&"pending"!==e[t]?(clearInterval(a),r(e[t])):i>100?(clearInterval(a),n("Unexpected error while fetching from "+t)):void i++},50)})}for(var o=0;o<t.length;o++){var s=t[o][0].trace.geojson;"string"==typeof s&&(e[s]?"pending"===e[s]&&r.push(a(s)):(e[s]="pending",r.push(i(s))))}return r},computeBbox:function(t){return s.default(t)}}},{"./identity":168,"./is_plain_object":170,"./loggers":173,"./nested_property":177,"./polygon":181,"@turf/area":7,"@turf/bbox":8,"@turf/centroid":9,"country-regex":13,d3:14}],166:[function(t,e,r){"use strict";var n=t("../constants/numerical").BADNUM;r.calcTraceToLineCoords=function(t){for(var e=t[0].trace.connectgaps,r=[],i=[],a=0;a<t.length;a++){var o=t[a].lonlat;o[0]!==n?i.push(o):!e&&i.length>0&&(r.push(i),i=[])}return i.length>0&&r.push(i),r},r.makeLine=function(t){return 1===t.length?{type:"LineString",coordinates:t[0]}:{type:"MultiLineString",coordinates:t}},r.makePolygon=function(t){if(1===t.length)return{type:"Polygon",coordinates:t};for(var e=new Array(t.length),r=0;r<t.length;r++)e[r]=[t[r]];return{type:"MultiPolygon",coordinates:e}},r.makeBlank=function(){return{type:"Point",coordinates:[]}}},{"../constants/numerical":147}],167:[function(t,e,r){"use strict";var n,i,a,o=t("./mod").mod;function s(t,e,r,n,i,a,o,s){var l=r-t,u=i-t,c=o-i,p=n-e,h=a-e,f=s-a,d=l*f-c*p;if(0===d)return null;var m=(u*f-c*h)/d,y=(u*p-l*h)/d;return y<0||y>1||m<0||m>1?null:{x:t+l*m,y:e+p*m}}function l(t,e,r,n,i){var a=n*t+i*e;if(a<0)return n*n+i*i;if(a>r){var o=n-t,s=i-e;return o*o+s*s}var l=n*e-i*t;return l*l/r}r.segmentsIntersect=s,r.segmentDistance=function(t,e,r,n,i,a,o,u){if(s(t,e,r,n,i,a,o,u))return 0;var c=r-t,p=n-e,h=o-i,f=u-a,d=c*c+p*p,m=h*h+f*f,y=Math.min(l(c,p,d,i-t,a-e),l(c,p,d,o-t,u-e),l(h,f,m,t-i,e-a),l(h,f,m,r-i,n-a));return Math.sqrt(y)},r.getTextLocation=function(t,e,r,s){if(t===i&&s===a||(n={},i=t,a=s),n[r])return n[r];var l=t.getPointAtLength(o(r-s/2,e)),u=t.getPointAtLength(o(r+s/2,e)),c=Math.atan((u.y-l.y)/(u.x-l.x)),p=t.getPointAtLength(o(r,e)),h={x:(4*p.x+l.x+u.x)/6,y:(4*p.y+l.y+u.y)/6,theta:c};return n[r]=h,h},r.clearLocationCache=function(){i=null},r.getVisibleSegment=function(t,e,r){var n,i,a=e.left,o=e.right,s=e.top,l=e.bottom,u=0,c=t.getTotalLength(),p=c;function h(e){var r=t.getPointAtLength(e);0===e?n=r:e===c&&(i=r);var u=r.x<a?a-r.x:r.x>o?r.x-o:0,p=r.y<s?s-r.y:r.y>l?r.y-l:0;return Math.sqrt(u*u+p*p)}for(var f=h(u);f;){if((u+=f+r)>p)return;f=h(u)}for(f=h(p);f;){if(u>(p-=f+r))return;f=h(p)}return{min:u,max:p,len:p-u,total:c,isClosed:0===u&&p===c&&Math.abs(n.x-i.x)<.1&&Math.abs(n.y-i.y)<.1}},r.findPointOnPath=function(t,e,r,n){for(var i,a,o,s=(n=n||{}).pathLength||t.getTotalLength(),l=n.tolerance||.001,u=n.iterationLimit||30,c=t.getPointAtLength(0)[r]>t.getPointAtLength(s)[r]?-1:1,p=0,h=0,f=s;p<u;){if(i=(h+f)/2,o=(a=t.getPointAtLength(i))[r]-e,Math.abs(o)<l)return a;c*o>0?f=i:h=i,p++}return a}},{"./mod":176}],168:[function(t,e,r){"use strict";e.exports=function(t){return t}},{}],169:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("../constants/numerical"),o=a.FP_SAFE,s=a.BADNUM,l=e.exports={};l.nestedProperty=t("./nested_property"),l.keyedContainer=t("./keyed_container"),l.relativeAttr=t("./relative_attr"),l.isPlainObject=t("./is_plain_object"),l.toLogRange=t("./to_log_range"),l.relinkPrivateKeys=t("./relink_private");var u=t("./array");l.isTypedArray=u.isTypedArray,l.isArrayOrTypedArray=u.isArrayOrTypedArray,l.isArray1D=u.isArray1D,l.ensureArray=u.ensureArray,l.concat=u.concat,l.maxRowLength=u.maxRowLength,l.minRowLength=u.minRowLength;var c=t("./mod");l.mod=c.mod,l.modHalf=c.modHalf;var p=t("./coerce");l.valObjectMeta=p.valObjectMeta,l.coerce=p.coerce,l.coerce2=p.coerce2,l.coerceFont=p.coerceFont,l.coerceHoverinfo=p.coerceHoverinfo,l.coerceSelectionMarkerOpacity=p.coerceSelectionMarkerOpacity,l.validate=p.validate;var h=t("./dates");l.dateTime2ms=h.dateTime2ms,l.isDateTime=h.isDateTime,l.ms2DateTime=h.ms2DateTime,l.ms2DateTimeLocal=h.ms2DateTimeLocal,l.cleanDate=h.cleanDate,l.isJSDate=h.isJSDate,l.formatDate=h.formatDate,l.incrementMonth=h.incrementMonth,l.dateTick0=h.dateTick0,l.dfltRange=h.dfltRange,l.findExactDates=h.findExactDates,l.MIN_MS=h.MIN_MS,l.MAX_MS=h.MAX_MS;var f=t("./search");l.findBin=f.findBin,l.sorterAsc=f.sorterAsc,l.sorterDes=f.sorterDes,l.distinctVals=f.distinctVals,l.roundUp=f.roundUp,l.sort=f.sort,l.findIndexOfMin=f.findIndexOfMin;var d=t("./stats");l.aggNums=d.aggNums,l.len=d.len,l.mean=d.mean,l.median=d.median,l.midRange=d.midRange,l.variance=d.variance,l.stdev=d.stdev,l.interp=d.interp;var m=t("./matrix");l.init2dArray=m.init2dArray,l.transposeRagged=m.transposeRagged,l.dot=m.dot,l.translationMatrix=m.translationMatrix,l.rotationMatrix=m.rotationMatrix,l.rotationXYMatrix=m.rotationXYMatrix,l.apply2DTransform=m.apply2DTransform,l.apply2DTransform2=m.apply2DTransform2;var y=t("./angles");l.deg2rad=y.deg2rad,l.rad2deg=y.rad2deg,l.angleDelta=y.angleDelta,l.angleDist=y.angleDist,l.isFullCircle=y.isFullCircle,l.isAngleInsideSector=y.isAngleInsideSector,l.isPtInsideSector=y.isPtInsideSector,l.pathArc=y.pathArc,l.pathSector=y.pathSector,l.pathAnnulus=y.pathAnnulus;var g=t("./anchor_utils");l.isLeftAnchor=g.isLeftAnchor,l.isCenterAnchor=g.isCenterAnchor,l.isRightAnchor=g.isRightAnchor,l.isTopAnchor=g.isTopAnchor,l.isMiddleAnchor=g.isMiddleAnchor,l.isBottomAnchor=g.isBottomAnchor;var v=t("./geometry2d");l.segmentsIntersect=v.segmentsIntersect,l.segmentDistance=v.segmentDistance,l.getTextLocation=v.getTextLocation,l.clearLocationCache=v.clearLocationCache,l.getVisibleSegment=v.getVisibleSegment,l.findPointOnPath=v.findPointOnPath;var _=t("./extend");l.extendFlat=_.extendFlat,l.extendDeep=_.extendDeep,l.extendDeepAll=_.extendDeepAll,l.extendDeepNoArrays=_.extendDeepNoArrays;var x=t("./loggers");l.log=x.log,l.warn=x.warn,l.error=x.error;var b=t("./regex");l.counterRegex=b.counter;var w=t("./throttle");l.throttle=w.throttle,l.throttleDone=w.done,l.clearThrottle=w.clear;var k=t("./dom");function T(t){var e={};for(var r in t)for(var n=t[r],i=0;i<n.length;i++)e[n[i]]=+r;return e}l.getGraphDiv=k.getGraphDiv,l.isPlotDiv=k.isPlotDiv,l.removeElement=k.removeElement,l.addStyleRule=k.addStyleRule,l.addRelatedStyleRule=k.addRelatedStyleRule,l.deleteRelatedStyleRule=k.deleteRelatedStyleRule,l.clearResponsive=t("./clear_responsive"),l.makeTraceGroups=t("./make_trace_groups"),l._=t("./localize"),l.notifier=t("./notifier"),l.filterUnique=t("./filter_unique"),l.filterVisible=t("./filter_visible"),l.pushUnique=t("./push_unique"),l.cleanNumber=t("./clean_number"),l.ensureNumber=function(t){return i(t)?(t=Number(t))<-o||t>o?s:i(t)?Number(t):s:s},l.isIndex=function(t,e){return!(void 0!==e&&t>=e)&&(i(t)&&t>=0&&t%1==0)},l.noop=t("./noop"),l.identity=t("./identity"),l.repeat=function(t,e){for(var r=new Array(e),n=0;n<e;n++)r[n]=t;return r},l.swapAttrs=function(t,e,r,n){r||(r="x"),n||(n="y");for(var i=0;i<e.length;i++){var a=e[i],o=l.nestedProperty(t,a.replace("?",r)),s=l.nestedProperty(t,a.replace("?",n)),u=o.get();o.set(s.get()),s.set(u)}},l.raiseToTop=function(t){t.parentNode.appendChild(t)},l.cancelTransition=function(t){return t.transition().duration(0)},l.constrain=function(t,e,r){return e>r?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},l.bBoxIntersect=function(t,e,r){return r=r||0,t.left<=e.right+r&&e.left<=t.right+r&&t.top<=e.bottom+r&&e.top<=t.bottom+r},l.simpleMap=function(t,e,r,n){for(var i=t.length,a=new Array(i),o=0;o<i;o++)a[o]=e(t[o],r,n);return a},l.randstr=function t(e,r,n,i){if(n||(n=16),void 0===r&&(r=24),r<=0)return"0";var a,o,s=Math.log(Math.pow(2,r))/Math.log(n),u="";for(a=2;s===1/0;a*=2)s=Math.log(Math.pow(2,r/a))/Math.log(n)*a;var c=s-Math.floor(s);for(a=0;a<Math.floor(s);a++)u=Math.floor(Math.random()*n).toString(n)+u;c&&(o=Math.pow(n,c),u=Math.floor(Math.random()*o).toString(n)+u);var p=parseInt(u,n);return e&&e[u]||p!==1/0&&p>=Math.pow(2,r)?i>10?(l.warn("randstr failed uniqueness"),u):t(e,r,n,(i||0)+1):u},l.OptionControl=function(t,e){t||(t={}),e||(e="opt");var r={optionList:[],_newoption:function(n){n[e]=t,r[n.name]=n,r.optionList.push(n)}};return r["_"+e]=t,r},l.smooth=function(t,e){if((e=Math.round(e)||0)<2)return t;var r,n,i,a,o=t.length,s=2*o,l=2*e-1,u=new Array(l),c=new Array(o);for(r=0;r<l;r++)u[r]=(1-Math.cos(Math.PI*(r+1)/e))/(2*e);for(r=0;r<o;r++){for(a=0,n=0;n<l;n++)(i=r+n+1-e)<-o?i-=s*Math.round(i/s):i>=s&&(i-=s*Math.floor(i/s)),i<0?i=-1-i:i>=o&&(i=s-1-i),a+=t[i]*u[n];c[r]=a}return c},l.syncOrAsync=function(t,e,r){var n;function i(){return l.syncOrAsync(t,e,r)}for(;t.length;)if((n=(0,t.splice(0,1)[0])(e))&&n.then)return n.then(i).then(void 0,l.promiseError);return r&&r(e)},l.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},l.noneOrAll=function(t,e,r){if(t){var n,i=!1,a=!0;for(n=0;n<r.length;n++)null!=t[r[n]]?i=!0:a=!1;if(i&&!a)for(n=0;n<r.length;n++)t[r[n]]=e[r[n]]}},l.mergeArray=function(t,e,r,n){var i="function"==typeof n;if(l.isArrayOrTypedArray(t))for(var a=Math.min(t.length,e.length),o=0;o<a;o++){var s=t[o];e[o][r]=i?n(s):s}},l.mergeArrayCastPositive=function(t,e,r){return l.mergeArray(t,e,r,function(t){var e=+t;return isFinite(e)&&e>0?e:0})},l.fillArray=function(t,e,r,n){if(n=n||l.identity,l.isArrayOrTypedArray(t))for(var i=0;i<e.length;i++)e[i][r]=n(t[i])},l.castOption=function(t,e,r,n){n=n||l.identity;var i=l.nestedProperty(t,r).get();return l.isArrayOrTypedArray(i)?Array.isArray(e)&&l.isArrayOrTypedArray(i[e[0]])?n(i[e[0]][e[1]]):n(i[e]):i},l.extractOption=function(t,e,r,n){if(r in t)return t[r];var i=l.nestedProperty(e,n).get();return Array.isArray(i)?void 0:i},l.tagSelected=function(t,e,r){var n,i,a=e.selectedpoints,o=e._indexToPoints;o&&(n=T(o));for(var s=0;s<a.length;s++){var u=a[s];if(l.isIndex(u)||l.isArrayOrTypedArray(u)&&l.isIndex(u[0])&&l.isIndex(u[1])){var c=n?n[u]:u,p=r?r[c]:c;void 0!==(i=p)&&i<t.length&&(t[p].selected=1)}}},l.selIndices2selPoints=function(t){var e=t.selectedpoints,r=t._indexToPoints;if(r){for(var n=T(r),i=[],a=0;a<e.length;a++){var o=e[a];if(l.isIndex(o)){var s=n[o];l.isIndex(s)&&i.push(s)}}return i}return e},l.getTargetArray=function(t,e){var r=e.target;if("string"==typeof r&&r){var n=l.nestedProperty(t,r).get();return!!Array.isArray(n)&&n}return!!Array.isArray(r)&&r},l.minExtend=function(t,e){var r={};"object"!=typeof e&&(e={});var n,i,a,o=Object.keys(t);for(n=0;n<o.length;n++)a=t[i=o[n]],"_"!==i.charAt(0)&&"function"!=typeof a&&("module"===i?r[i]=a:Array.isArray(a)?r[i]="colorscale"===i?a.slice():a.slice(0,3):l.isTypedArray(a)?r[i]=a.subarray(0,3):r[i]=a&&"object"==typeof a?l.minExtend(t[i],e[i]):a);for(o=Object.keys(e),n=0;n<o.length;n++)"object"==typeof(a=e[i=o[n]])&&i in r&&"object"==typeof r[i]||(r[i]=a);return r},l.titleCase=function(t){return t.charAt(0).toUpperCase()+t.substr(1)},l.containsAny=function(t,e){for(var r=0;r<e.length;r++)if(-1!==t.indexOf(e[r]))return!0;return!1},l.isIE=function(){return"undefined"!=typeof window.navigator.msSaveBlob};var A=/MSIE [1-9]\./;l.isIE9orBelow=function(){return l.isIE()&&A.test(window.navigator.userAgent)};var M=/Version\/[\d\.]+.*Safari/;l.isSafari=function(){return M.test(window.navigator.userAgent)},l.isD3Selection=function(t){return t&&"function"==typeof t.classed},l.ensureSingle=function(t,e,r,n){var i=t.select(e+(r?"."+r:""));if(i.size())return i;var a=t.append(e);return r&&a.classed(r,!0),n&&a.call(n),a},l.ensureSingleById=function(t,e,r,n){var i=t.select(e+"#"+r);if(i.size())return i;var a=t.append(e).attr("id",r);return n&&a.call(n),a},l.objectFromPath=function(t,e){for(var r,n=t.split("."),i=r={},a=0;a<n.length;a++){var o=n[a],s=null,l=n[a].match(/(.*)\[([0-9]+)\]/);l?(o=l[1],s=l[2],r=r[o]=[],a===n.length-1?r[s]=e:r[s]={},r=r[s]):(a===n.length-1?r[o]=e:r[o]={},r=r[o])}return i};var S=/^([^\[\.]+)\.(.+)?/,L=/^([^\.]+)\[([0-9]+)\](\.)?(.+)?/;l.expandObjectPaths=function(t){var e,r,n,i,a,o,s;if("object"==typeof t&&!Array.isArray(t))for(r in t)t.hasOwnProperty(r)&&((e=r.match(S))?(i=t[r],n=e[1],delete t[r],t[n]=l.extendDeepNoArrays(t[n]||{},l.objectFromPath(r,l.expandObjectPaths(i))[n])):(e=r.match(L))?(i=t[r],n=e[1],a=parseInt(e[2]),delete t[r],t[n]=t[n]||[],"."===e[3]?(s=e[4],o=t[n][a]=t[n][a]||{},l.extendDeepNoArrays(o,l.objectFromPath(s,l.expandObjectPaths(i)))):t[n][a]=l.expandObjectPaths(i)):t[r]=l.expandObjectPaths(t[r]));return t},l.numSeparate=function(t,e,r){if(r||(r=!1),"string"!=typeof e||0===e.length)throw new Error("Separator string required for formatting!");"number"==typeof t&&(t=String(t));var n=/(\d+)(\d{3})/,i=e.charAt(0),a=e.charAt(1),o=t.split("."),s=o[0],l=o.length>1?i+o[1]:"";if(a&&(o.length>1||s.length>4||r))for(;n.test(s);)s=s.replace(n,"$1"+a+"$2");return s+l},l.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var C=/^\w*$/;l.templateString=function(t,e){var r={};return t.replace(l.TEMPLATE_STRING_REGEX,function(t,n){var i;return C.test(n)?i=e[n]:(r[n]=r[n]||l.nestedProperty(e,n).get,i=r[n]()),l.isValidTextValue(i)?i:""})};var E={max:10,count:0,name:"hovertemplate"};l.hovertemplateString=function(){return I.apply(E,arguments)};var z={max:10,count:0,name:"texttemplate"};l.texttemplateString=function(){return I.apply(z,arguments)};var P=/^[:|\|]/;function I(t,e,r){var i=this,a=arguments;e||(e={});var o={};return t.replace(l.TEMPLATE_STRING_REGEX,function(t,s,u){var c,p,h,f;for(h=3;h<a.length;h++)if(c=a[h]){if(c.hasOwnProperty(s)){p=c[s];break}if(C.test(s)||(p=o[s]||l.nestedProperty(c,s).get())&&(o[s]=p),void 0!==p)break}if(void 0===p&&i)return i.count<i.max&&(l.warn("Variable '"+s+"' in "+i.name+" could not be found!"),p=t),i.count===i.max&&l.warn("Too many "+i.name+" warnings - additional warnings will be suppressed"),i.count++,t;if(u){if(":"===u[0]&&(p=(f=r?r.numberFormat:n.format)(u.replace(P,""))(p)),"|"===u[0]){f=r?r.timeFormat.utc:n.time.format.utc;var d=l.dateTime2ms(p);p=l.formatDate(d,u.replace(P,""),!1,f)}}else e.hasOwnProperty(s+"Label")&&(p=e[s+"Label"]);return p})}l.subplotSort=function(t,e){for(var r=Math.min(t.length,e.length)+1,n=0,i=0,a=0;a<r;a++){var o=t.charCodeAt(a)||0,s=e.charCodeAt(a)||0,l=o>=48&&o<=57,u=s>=48&&s<=57;if(l&&(n=10*n+o-48),u&&(i=10*i+s-48),!l||!u){if(n!==i)return n-i;if(o!==s)return o-s}}return i-n};var D=2e9;l.seedPseudoRandom=function(){D=2e9},l.pseudoRandom=function(){var t=D;return D=(69069*D+1)%4294967296,Math.abs(D-t)<429496729?l.pseudoRandom():D/4294967296},l.fillText=function(t,e,r){var n=Array.isArray(r)?function(t){r.push(t)}:function(t){r.text=t},i=l.extractOption(t,e,"htx","hovertext");if(l.isValidTextValue(i))return n(i);var a=l.extractOption(t,e,"tx","text");return l.isValidTextValue(a)?n(a):void 0},l.isValidTextValue=function(t){return t||0===t},l.formatPercent=function(t,e){e=e||0;for(var r=(Math.round(100*t*Math.pow(10,e))*Math.pow(.1,e)).toFixed(e)+"%",n=0;n<e;n++)-1!==r.indexOf(".")&&(r=(r=r.replace("0%","%")).replace(".%","%"));return r},l.isHidden=function(t){var e=window.getComputedStyle(t).display;return!e||"none"===e},l.getTextTransform=function(t){var e=t.noCenter,r=t.textX,n=t.textY,i=t.targetX,a=t.targetY,o=t.anchorX||0,s=t.anchorY||0,l=t.rotate,u=t.scale;return u?u>1&&(u=1):u=0,"translate("+(i-u*(r+o))+","+(a-u*(n+s))+")"+(u<1?"scale("+u+")":"")+(l?"rotate("+l+(e?"":" "+r+" "+n)+")":"")},l.ensureUniformFontSize=function(t,e){var r=l.extendFlat({},e);return r.size=Math.max(e.size,t._fullLayout.uniformtext.minsize||0),r}},{"../constants/numerical":147,"./anchor_utils":152,"./angles":153,"./array":154,"./clean_number":155,"./clear_responsive":157,"./coerce":158,"./dates":159,"./dom":160,"./extend":162,"./filter_unique":163,"./filter_visible":164,"./geometry2d":167,"./identity":168,"./is_plain_object":170,"./keyed_container":171,"./localize":172,"./loggers":173,"./make_trace_groups":174,"./matrix":175,"./mod":176,"./nested_property":177,"./noop":178,"./notifier":179,"./push_unique":182,"./regex":184,"./relative_attr":185,"./relink_private":186,"./search":187,"./stats":189,"./throttle":191,"./to_log_range":192,d3:14,"fast-isnumeric":16}],170:[function(t,e,r){"use strict";e.exports=function(t){return window&&window.process&&window.process.versions?"[object Object]"===Object.prototype.toString.call(t):"[object Object]"===Object.prototype.toString.call(t)&&Object.getPrototypeOf(t)===Object.prototype}},{}],171:[function(t,e,r){"use strict";var n=t("./nested_property"),i=/^\w*$/;e.exports=function(t,e,r,a){var o,s,l;r=r||"name",a=a||"value";var u={};e&&e.length?(l=n(t,e),s=l.get()):s=t,e=e||"";var c={};if(s)for(o=0;o<s.length;o++)c[s[o][r]]=o;var p=i.test(a),h={set:function(t,e){var i=null===e?4:0;if(!s){if(!l||4===i)return;s=[],l.set(s)}var o=c[t];if(void 0===o){if(4===i)return;i|=3,o=s.length,c[t]=o}else e!==(p?s[o][a]:n(s[o],a).get())&&(i|=2);var f=s[o]=s[o]||{};return f[r]=t,p?f[a]=e:n(f,a).set(e),null!==e&&(i&=-5),u[o]=u[o]|i,h},get:function(t){if(s){var e=c[t];return void 0===e?void 0:p?s[e][a]:n(s[e],a).get()}},rename:function(t,e){var n=c[t];return void 0===n?h:(u[n]=1|u[n],c[e]=n,delete c[t],s[n][r]=e,h)},remove:function(t){var e=c[t];if(void 0===e)return h;var i=s[e];if(Object.keys(i).length>2)return u[e]=2|u[e],h.set(t,null);if(p){for(o=e;o<s.length;o++)u[o]=3|u[o];for(o=e;o<s.length;o++)c[s[o][r]]--;s.splice(e,1),delete c[t]}else n(i,a).set(null),u[e]=6|u[e];return h},constructUpdate:function(){for(var t,i,o={},l=Object.keys(u),c=0;c<l.length;c++)i=l[c],t=e+"["+i+"]",s[i]?(1&u[i]&&(o[t+"."+r]=s[i][r]),2&u[i]&&(o[t+"."+a]=p?4&u[i]?null:s[i][a]:4&u[i]?null:n(s[i],a).get())):o[t]=null;return o}};return h}},{"./nested_property":177}],172:[function(t,e,r){"use strict";var n=t("../registry");e.exports=function(t,e){for(var r=t._context.locale,i=0;i<2;i++){for(var a=t._context.locales,o=0;o<2;o++){var s=(a[r]||{}).dictionary;if(s){var l=s[e];if(l)return l}a=n.localeRegistry}var u=r.split("-")[0];if(u===r)break;r=u}return e}},{"../registry":261}],173:[function(t,e,r){"use strict";var n=t("../plot_api/plot_config").dfltConfig,i=t("./notifier"),a=e.exports={};function o(t,e){if(t&&t.apply)try{return void t.apply(console,e)}catch(t){}for(var r=0;r<e.length;r++)try{t(e[r])}catch(t){console.log(e[r])}}a.log=function(){var t;if(n.logging>1){var e=["LOG:"];for(t=0;t<arguments.length;t++)e.push(arguments[t]);o(console.trace||console.log,e)}if(n.notifyOnLogging>1){var r=[];for(t=0;t<arguments.length;t++)r.push(arguments[t]);i(r.join("<br>"),"long")}},a.warn=function(){var t;if(n.logging>0){var e=["WARN:"];for(t=0;t<arguments.length;t++)e.push(arguments[t]);o(console.trace||console.log,e)}if(n.notifyOnLogging>0){var r=[];for(t=0;t<arguments.length;t++)r.push(arguments[t]);i(r.join("<br>"),"stick")}},a.error=function(){var t;if(n.logging>0){var e=["ERROR:"];for(t=0;t<arguments.length;t++)e.push(arguments[t]);o(console.error,e)}if(n.notifyOnLogging>0){var r=[];for(t=0;t<arguments.length;t++)r.push(arguments[t]);i(r.join("<br>"),"stick")}}},{"../plot_api/plot_config":201,"./notifier":179}],174:[function(t,e,r){"use strict";var n=t("d3");e.exports=function(t,e,r){var i=t.selectAll("g."+r.replace(/\s/g,".")).data(e,function(t){return t[0].trace.uid});i.exit().remove(),i.enter().append("g").attr("class",r),i.order();var a=t.classed("rangeplot")?"nodeRangePlot3":"node3";return i.each(function(t){t[0][a]=n.select(this)}),i}},{d3:14}],175:[function(t,e,r){"use strict";r.init2dArray=function(t,e){for(var r=new Array(t),n=0;n<t;n++)r[n]=new Array(e);return r},r.transposeRagged=function(t){var e,r,n=0,i=t.length;for(e=0;e<i;e++)n=Math.max(n,t[e].length);var a=new Array(n);for(e=0;e<n;e++)for(a[e]=new Array(i),r=0;r<i;r++)a[e][r]=t[r][e];return a},r.dot=function(t,e){if(!t.length||!e.length||t.length!==e.length)return null;var n,i,a=t.length;if(t[0].length)for(n=new Array(a),i=0;i<a;i++)n[i]=r.dot(t[i],e);else if(e[0].length){var o=r.transposeRagged(e);for(n=new Array(o.length),i=0;i<o.length;i++)n[i]=r.dot(t,o[i])}else for(n=0,i=0;i<a;i++)n+=t[i]*e[i];return n},r.translationMatrix=function(t,e){return[[1,0,t],[0,1,e],[0,0,1]]},r.rotationMatrix=function(t){var e=t*Math.PI/180;return[[Math.cos(e),-Math.sin(e),0],[Math.sin(e),Math.cos(e),0],[0,0,1]]},r.rotationXYMatrix=function(t,e,n){return r.dot(r.dot(r.translationMatrix(e,n),r.rotationMatrix(t)),r.translationMatrix(-e,-n))},r.apply2DTransform=function(t){return function(){var e=arguments;3===e.length&&(e=e[0]);var n=1===arguments.length?e[0]:[e[0],e[1]];return r.dot(t,[n[0],n[1],1]).slice(0,2)}},r.apply2DTransform2=function(t){var e=r.apply2DTransform(t);return function(t){return e(t.slice(0,2)).concat(e(t.slice(2,4)))}}},{}],176:[function(t,e,r){"use strict";e.exports={mod:function(t,e){var r=t%e;return r<0?r+e:r},modHalf:function(t,e){return Math.abs(t)>e/2?t-Math.round(t/e)*e:t}}},{}],177:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("./array").isArrayOrTypedArray;function a(t,e){return function(){var r,n,o,s,l,u=t;for(s=0;s<e.length-1;s++){if(-1===(r=e[s])){for(n=!0,o=[],l=0;l<u.length;l++)o[l]=a(u[l],e.slice(s+1))(),o[l]!==o[0]&&(n=!1);return n?o[0]:o}if("number"==typeof r&&!i(u))return;if("object"!=typeof(u=u[r])||null===u)return}if("object"==typeof u&&null!==u&&null!==(o=u[e[s]]))return o}}e.exports=function(t,e){if(n(e))e=String(e);else if("string"!=typeof e||"[-1]"===e.substr(e.length-4))throw"bad property string";for(var r,i,o,s=0,u=e.split(".");s<u.length;){if(r=String(u[s]).match(/^([^\[\]]*)((\[\-?[0-9]*\])+)$/)){if(r[1])u[s]=r[1];else{if(0!==s)throw"bad property string";u.splice(0,1)}for(i=r[2].substr(1,r[2].length-2).split("]["),o=0;o<i.length;o++)s++,u.splice(s,0,Number(i[o]))}s++}return"object"!=typeof t?function(t,e,r){return{set:function(){throw"bad container"},get:function(){},astr:e,parts:r,obj:t}}(t,e,u):{set:l(t,u,e),get:a(t,u),astr:e,parts:u,obj:t}};var o=/(^|\.)args\[/;function s(t,e){return void 0===t||null===t&&!e.match(o)}function l(t,e,r){return function(n){var a,o,l=t,h="",f=[[t,h]],d=s(n,r);for(o=0;o<e.length-1;o++){if("number"==typeof(a=e[o])&&!i(l))throw"array index but container is not an array";if(-1===a){if(d=!c(l,e.slice(o+1),n,r))break;return}if(!p(l,a,e[o+1],d))break;if("object"!=typeof(l=l[a])||null===l)throw"container is not an object";h=u(h,a),f.push([l,h])}if(d){if(o===e.length-1&&(delete l[e[o]],Array.isArray(l)&&+e[o]==l.length-1))for(;l.length&&void 0===l[l.length-1];)l.pop()}else l[e[o]]=n}}function u(t,e){var r=e;return n(e)?r="["+e+"]":t&&(r="."+e),t+r}function c(t,e,r,n){var a,o=i(r),u=!0,c=r,h=n.replace("-1",0),f=!o&&s(r,h),d=e[0];for(a=0;a<t.length;a++)h=n.replace("-1",a),o&&(f=s(c=r[a%r.length],h)),f&&(u=!1),p(t,a,d,f)&&l(t[a],e,n.replace("-1",a))(c);return u}function p(t,e,r,n){if(void 0===t[e]){if(n)return!1;t[e]="number"==typeof r?[]:{}}return!0}},{"./array":154,"fast-isnumeric":16}],178:[function(t,e,r){"use strict";e.exports=function(){}},{}],179:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=[];e.exports=function(t,e){if(-1===a.indexOf(t)){a.push(t);var r=1e3;i(e)?r=e:"long"===e&&(r=3e3);var o=n.select("body").selectAll(".plotly-notifier").data([0]);o.enter().append("div").classed("plotly-notifier",!0),o.selectAll(".notifier-note").data(a).enter().append("div").classed("notifier-note",!0).style("opacity",0).each(function(t){var i=n.select(this);i.append("button").classed("notifier-close",!0).html("&times;").on("click",function(){i.transition().call(s)});for(var a=i.append("p"),o=t.split(/<br\s*\/?>/g),l=0;l<o.length;l++)l&&a.append("br"),a.append("span").text(o[l]);"stick"===e?i.transition().duration(350).style("opacity",1):i.transition().duration(700).style("opacity",1).transition().delay(r).call(s)})}function s(t){t.duration(700).style("opacity",0).each("end",function(t){var e=a.indexOf(t);-1!==e&&a.splice(e,1),n.select(this).remove()})}}},{d3:14,"fast-isnumeric":16}],180:[function(t,e,r){"use strict";var n=t("./setcursor"),i="data-savedcursor";e.exports=function(t,e){var r=t.attr(i);if(e){if(!r){for(var a=(t.attr("class")||"").split(" "),o=0;o<a.length;o++){var s=a[o];0===s.indexOf("cursor-")&&t.attr(i,s.substr(7)).classed(s,!1)}t.attr(i)||t.attr(i,"!!")}n(t,e)}else r&&(t.attr(i,null),"!!"===r?n(t):n(t,r))}},{"./setcursor":188}],181:[function(t,e,r){"use strict";var n=t("./matrix").dot,i=t("../constants/numerical").BADNUM,a=e.exports={};a.tester=function(t){var e,r=t.slice(),n=r[0][0],a=n,o=r[0][1],s=o;for(r.push(r[0]),e=1;e<r.length;e++)n=Math.min(n,r[e][0]),a=Math.max(a,r[e][0]),o=Math.min(o,r[e][1]),s=Math.max(s,r[e][1]);var l,u=!1;5===r.length&&(r[0][0]===r[1][0]?r[2][0]===r[3][0]&&r[0][1]===r[3][1]&&r[1][1]===r[2][1]&&(u=!0,l=function(t){return t[0]===r[0][0]}):r[0][1]===r[1][1]&&r[2][1]===r[3][1]&&r[0][0]===r[3][0]&&r[1][0]===r[2][0]&&(u=!0,l=function(t){return t[1]===r[0][1]}));var c=!0,p=r[0];for(e=1;e<r.length;e++)if(p[0]!==r[e][0]||p[1]!==r[e][1]){c=!1;break}return{xmin:n,xmax:a,ymin:o,ymax:s,pts:r,contains:u?function(t,e){var r=t[0],u=t[1];return!(r===i||r<n||r>a||u===i||u<o||u>s||e&&l(t))}:function(t,e){var l=t[0],u=t[1];if(l===i||l<n||l>a||u===i||u<o||u>s)return!1;var c,p,h,f,d,m=r.length,y=r[0][0],g=r[0][1],v=0;for(c=1;c<m;c++)if(p=y,h=g,y=r[c][0],g=r[c][1],!(l<(f=Math.min(p,y))||l>Math.max(p,y)||u>Math.max(h,g)))if(u<Math.min(h,g))l!==f&&v++;else{if(u===(d=y===p?u:h+(l-p)*(g-h)/(y-p)))return 1!==c||!e;u<=d&&l!==f&&v++}return v%2==1},isRect:u,degenerate:c}},a.isSegmentBent=function(t,e,r,i){var a,o,s,l=t[e],u=[t[r][0]-l[0],t[r][1]-l[1]],c=n(u,u),p=Math.sqrt(c),h=[-u[1]/p,u[0]/p];for(a=e+1;a<r;a++)if(o=[t[a][0]-l[0],t[a][1]-l[1]],(s=n(o,u))<0||s>c||Math.abs(n(o,h))>i)return!0;return!1},a.filter=function(t,e){var r=[t[0]],n=0,i=0;function o(o){t.push(o);var s=r.length,l=n;r.splice(i+1);for(var u=l+1;u<t.length;u++)(u===t.length-1||a.isSegmentBent(t,l,u+1,e))&&(r.push(t[u]),r.length<s-2&&(n=u,i=r.length-1),l=u)}t.length>1&&o(t.pop());return{addPt:o,raw:t,filtered:r}}},{"../constants/numerical":147,"./matrix":175}],182:[function(t,e,r){"use strict";e.exports=function(t,e){if(e instanceof RegExp){for(var r=e.toString(),n=0;n<t.length;n++)if(t[n]instanceof RegExp&&t[n].toString()===r)return t;t.push(e)}else!e&&0!==e||-1!==t.indexOf(e)||t.push(e);return t}},{}],183:[function(t,e,r){"use strict";var n=t("../lib"),i=t("../plot_api/plot_config").dfltConfig;var a={add:function(t,e,r,n,a){var o,s;t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},s=t.undoQueue.index,t.autoplay?t.undoQueue.inSequence||(t.autoplay=!1):(!t.undoQueue.sequence||t.undoQueue.beginSequence?(o={undo:{calls:[],args:[]},redo:{calls:[],args:[]}},t.undoQueue.queue.splice(s,t.undoQueue.queue.length-s,o),t.undoQueue.index+=1):o=t.undoQueue.queue[s-1],t.undoQueue.beginSequence=!1,o&&(o.undo.calls.unshift(e),o.undo.args.unshift(r),o.redo.calls.push(n),o.redo.args.push(a)),t.undoQueue.queue.length>i.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--))},startSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0},stopSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1},undo:function(t){var e,r;if(t.framework&&t.framework.isPolar)t.framework.undo();else if(!(void 0===t.undoQueue||isNaN(t.undoQueue.index)||t.undoQueue.index<=0)){for(t.undoQueue.index--,e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;r<e.undo.calls.length;r++)a.plotDo(t,e.undo.calls[r],e.undo.args[r]);t.undoQueue.inSequence=!1,t.autoplay=!1}},redo:function(t){var e,r;if(t.framework&&t.framework.isPolar)t.framework.redo();else if(!(void 0===t.undoQueue||isNaN(t.undoQueue.index)||t.undoQueue.index>=t.undoQueue.queue.length)){for(e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;r<e.redo.calls.length;r++)a.plotDo(t,e.redo.calls[r],e.redo.args[r]);t.undoQueue.inSequence=!1,t.autoplay=!1,t.undoQueue.index++}}};a.plotDo=function(t,e,r){t.autoplay=!0,r=function(t,e){for(var r,i=[],a=0;a<e.length;a++)r=e[a],i[a]=r===t?r:"object"==typeof r?Array.isArray(r)?n.extendDeep([],r):n.extendDeepAll({},r):r;return i}(t,r),e.apply(null,r)},e.exports=a},{"../lib":169,"../plot_api/plot_config":201}],184:[function(t,e,r){"use strict";r.counter=function(t,e,r,n){var i=(e||"")+(r?"":"$"),a=!1===n?"":"^";return"xy"===t?new RegExp(a+"x([2-9]|[1-9][0-9]+)?y([2-9]|[1-9][0-9]+)?"+i):new RegExp(a+t+"([2-9]|[1-9][0-9]+)?"+i)}},{}],185:[function(t,e,r){"use strict";var n=/^(.*)(\.[^\.\[\]]+|\[\d\])$/,i=/^[^\.\[\]]+$/;e.exports=function(t,e){for(;e;){var r=t.match(n);if(r)t=r[1];else{if(!t.match(i))throw new Error("bad relativeAttr call:"+[t,e]);t=""}if("^"!==e.charAt(0))break;e=e.slice(1)}return t&&"["!==e.charAt(0)?t+"."+e:t+e}},{}],186:[function(t,e,r){"use strict";var n=t("./array").isArrayOrTypedArray,i=t("./is_plain_object");e.exports=function t(e,r){for(var a in r){var o=r[a],s=e[a];if(s!==o)if("_"===a.charAt(0)||"function"==typeof o){if(a in e)continue;e[a]=o}else if(n(o)&&n(s)&&i(o[0])){if("customdata"===a||"ids"===a)continue;for(var l=Math.min(o.length,s.length),u=0;u<l;u++)s[u]!==o[u]&&i(o[u])&&i(s[u])&&t(s[u],o[u])}else i(o)&&i(s)&&(t(s,o),Object.keys(s).length||delete e[a])}}},{"./array":154,"./is_plain_object":170}],187:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("./loggers"),a=t("./identity");function o(t,e){return t<e}function s(t,e){return t<=e}function l(t,e){return t>e}function u(t,e){return t>=e}r.findBin=function(t,e,r){if(n(e.start))return r?Math.ceil((t-e.start)/e.size-1e-9)-1:Math.floor((t-e.start)/e.size+1e-9);var a,c,p=0,h=e.length,f=0,d=h>1?(e[h-1]-e[0])/(h-1):1;for(c=d>=0?r?o:s:r?u:l,t+=1e-9*d*(r?-1:1)*(d>=0?1:-1);p<h&&f++<100;)c(e[a=Math.floor((p+h)/2)],t)?p=a+1:h=a;return f>90&&i.log("Long binary search..."),p-1},r.sorterAsc=function(t,e){return t-e},r.sorterDes=function(t,e){return e-t},r.distinctVals=function(t){var e=t.slice();e.sort(r.sorterAsc);for(var n=e.length-1,i=e[n]-e[0]||1,a=i/(n||1)/1e4,o=[e[0]],s=0;s<n;s++)e[s+1]>e[s]+a&&(i=Math.min(i,e[s+1]-e[s]),o.push(e[s+1]));return{vals:o,minDiff:i}},r.roundUp=function(t,e,r){for(var n,i=0,a=e.length-1,o=0,s=r?0:1,l=r?1:0,u=r?Math.ceil:Math.floor;i<a&&o++<100;)e[n=u((i+a)/2)]<=t?i=n+s:a=n-l;return e[i]},r.sort=function(t,e){for(var r=0,n=0,i=1;i<t.length;i++){var a=e(t[i],t[i-1]);if(a<0?r=1:a>0&&(n=1),r&&n)return t.sort(e)}return n?t:t.reverse()},r.findIndexOfMin=function(t,e){e=e||a;for(var r,n=1/0,i=0;i<t.length;i++){var o=e(t[i]);o<n&&(n=o,r=i)}return r}},{"./identity":168,"./loggers":173,"fast-isnumeric":16}],188:[function(t,e,r){"use strict";e.exports=function(t,e){(t.attr("class")||"").split(" ").forEach(function(e){0===e.indexOf("cursor-")&&t.classed(e,!1)}),e&&t.classed("cursor-"+e,!0)}},{}],189:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("./array").isArrayOrTypedArray;r.aggNums=function(t,e,a,o){var s,l;if((!o||o>a.length)&&(o=a.length),n(e)||(e=!1),i(a[0])){for(l=new Array(o),s=0;s<o;s++)l[s]=r.aggNums(t,e,a[s]);a=l}for(s=0;s<o;s++)n(e)?n(a[s])&&(e=t(+e,+a[s])):e=a[s];return e},r.len=function(t){return r.aggNums(function(t){return t+1},0,t)},r.mean=function(t,e){return e||(e=r.len(t)),r.aggNums(function(t,e){return t+e},0,t)/e},r.midRange=function(t){if(void 0!==t&&0!==t.length)return(r.aggNums(Math.max,null,t)+r.aggNums(Math.min,null,t))/2},r.variance=function(t,e,i){return e||(e=r.len(t)),n(i)||(i=r.mean(t,e)),r.aggNums(function(t,e){return t+Math.pow(e-i,2)},0,t)/e},r.stdev=function(t,e,n){return Math.sqrt(r.variance(t,e,n))},r.median=function(t){var e=t.slice().sort();return r.interp(e,.5)},r.interp=function(t,e){if(!n(e))throw"n should be a finite number";if((e=e*t.length-.5)<0)return t[0];if(e>t.length-1)return t[t.length-1];var r=e%1;return r*t[Math.ceil(e)]+(1-r)*t[Math.floor(e)]}},{"./array":154,"fast-isnumeric":16}],190:[function(t,e,r){"use strict";var n=t("d3"),i=t("../lib"),a=t("../constants/xmlns_namespaces"),o=t("../constants/alignment").LINE_SPACING;function s(t,e){return t.node().getBoundingClientRect()[e]}var l=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(t,e,M){var S=t.text(),C=!t.attr("data-notex")&&"undefined"!=typeof MathJax&&S.match(l),E=n.select(t.node().parentNode);if(!E.empty()){var z=t.attr("class")?t.attr("class").split(" ")[0]:"text";return z+="-math",E.selectAll("svg."+z).remove(),E.selectAll("g."+z+"-group").remove(),t.style("display",null).attr({"data-unformatted":S,"data-math":"N"}),C?(e&&e._promises||[]).push(new Promise(function(e){t.style("display","none");var r=parseInt(t.node().style.fontSize,10),a={fontSize:r};!function(t,e,r){var a,o,s,l;MathJax.Hub.Queue(function(){return o=i.extendDeepAll({},MathJax.Hub.config),s=MathJax.Hub.processSectionDelay,void 0!==MathJax.Hub.processSectionDelay&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]},displayAlign:"left"})},function(){if("SVG"!==(a=MathJax.Hub.config.menuSettings.renderer))return MathJax.Hub.setRenderer("SVG")},function(){var r="math-output-"+i.randstr({},64);return l=n.select("body").append("div").attr({id:r}).style({visibility:"hidden",position:"absolute"}).style({"font-size":e.fontSize+"px"}).text(t.replace(u,"\\lt ").replace(c,"\\gt ")),MathJax.Hub.Typeset(l.node())},function(){var e=n.select("body").select("#MathJax_SVG_glyphs");if(l.select(".MathJax_SVG").empty()||!l.select("svg").node())i.log("There was an error in the tex syntax.",t),r();else{var o=l.select("svg").node().getBoundingClientRect();r(l.select(".MathJax_SVG"),e,o)}if(l.remove(),"SVG"!==a)return MathJax.Hub.setRenderer(a)},function(){return void 0!==s&&(MathJax.Hub.processSectionDelay=s),MathJax.Hub.Config(o)})}(C[2],a,function(n,i,a){E.selectAll("svg."+z).remove(),E.selectAll("g."+z+"-group").remove();var o=n&&n.select("svg");if(!o||!o.node())return P(),void e();var l=E.append("g").classed(z+"-group",!0).attr({"pointer-events":"none","data-unformatted":S,"data-math":"Y"});l.node().appendChild(o.node()),i&&i.node()&&o.node().insertBefore(i.node().cloneNode(!0),o.node().firstChild),o.attr({class:z,height:a.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var u=t.node().style.fill||"black",c=o.select("g");c.attr({fill:u,stroke:u});var p=s(c,"width"),h=s(c,"height"),f=+t.attr("x")-p*{start:0,middle:.5,end:1}[t.attr("text-anchor")||"start"],d=-(r||s(t,"height"))/4;"y"===z[0]?(l.attr({transform:"rotate("+[-90,+t.attr("x"),+t.attr("y")]+") translate("+[-p/2,d-h/2]+")"}),o.attr({x:+t.attr("x"),y:+t.attr("y")})):"l"===z[0]?o.attr({x:t.attr("x"),y:d-h/2}):"a"===z[0]&&0!==z.indexOf("atitle")?o.attr({x:0,y:d}):o.attr({x:f,y:+t.attr("y")+d-h/2}),M&&M.call(t,l),e(l)})})):P(),t}function P(){E.empty()||(z=t.attr("class")+"-math",E.select("svg."+z).remove()),t.text("").style("white-space","pre"),function(t,e){e=e.replace(y," ");var r,s=!1,l=[],u=-1;function c(){u++;var e=document.createElementNS(a.svg,"tspan");n.select(e).attr({class:"line",dy:u*o+"em"}),t.appendChild(e),r=e;var i=l;if(l=[{node:e}],i.length>1)for(var s=1;s<i.length;s++)M(i[s])}function M(t){var e,i=t.type,o={};if("a"===i){e="a";var s=t.target,u=t.href,c=t.popup;u&&(o={"xlink:xlink:show":"_blank"===s||"_"!==s.charAt(0)?"new":"replace",target:s,"xlink:xlink:href":u},c&&(o.onclick='window.open(this.href.baseVal,this.target.baseVal,"'+c+'");return false;'))}else e="tspan";t.style&&(o.style=t.style);var p=document.createElementNS(a.svg,e);if("sup"===i||"sub"===i){S(r,d),r.appendChild(p);var m=document.createElementNS(a.svg,"tspan");S(m,d),n.select(m).attr("dy",f[i]),o.dy=h[i],r.appendChild(p),r.appendChild(m)}else r.appendChild(p);n.select(p).attr(o),r=t.node=p,l.push(t)}function S(t,e){t.appendChild(document.createTextNode(e))}function C(t){if(1!==l.length){var n=l.pop();t!==n.type&&i.log("Start tag <"+n.type+"> doesnt match end tag <"+t+">. Pretending it did match.",e),r=l[l.length-1].node}else i.log("Ignoring unexpected end tag </"+t+">.",e)}_.test(e)?c():(r=t,l=[{node:t}]);for(var E=e.split(g),z=0;z<E.length;z++){var P=E[z],I=P.match(v),D=I&&I[2].toLowerCase(),O=p[D];if("br"===D)c();else if(void 0===O)S(r,L(P));else if(I[1])C(D);else{var R=I[4],F={type:D},B=T(R,x);if(B?(B=B.replace(A,"$1 fill:"),O&&(B+=";"+O)):O&&(B=O),B&&(F.style=B),"a"===D){s=!0;var N=T(R,b);if(N){var U=document.createElement("a");U.href=N,-1!==m.indexOf(U.protocol)&&(F.href=encodeURI(decodeURI(N)),F.target=T(R,w)||"_blank",F.popup=T(R,k))}}M(F)}}return s}(t.node(),S)&&t.style("pointer-events","all"),r.positionText(t),M&&M.call(t)}};var u=/(<|&lt;|&#60;)/g,c=/(>|&gt;|&#62;)/g;var p={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},h={sub:"0.3em",sup:"-0.6em"},f={sub:"-0.21em",sup:"0.42em"},d="\u200b",m=["http:","https:","mailto:","",void 0,":"],y=r.NEWLINES=/(\r\n?|\n)/g,g=/(<[^<>]*>)/,v=/<(\/?)([^ >]*)(\s+(.*))?>/i,_=/<br(\s+.*)?>/i;r.BR_TAG_ALL=/<br(\s+.*)?>/gi;var x=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,b=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,w=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,k=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function T(t,e){if(!t)return null;var r=t.match(e),n=r&&(r[3]||r[4]);return n&&L(n)}var A=/(^|;)\s*color:/;r.plainText=function(t,e){for(var r=void 0!==(e=e||{}).len&&-1!==e.len?e.len:1/0,n=void 0!==e.allowedTags?e.allowedTags:["br"],i="...".length,a=t.split(g),o=[],s="",l=0,u=0;u<a.length;u++){var c=a[u],p=c.match(v),h=p&&p[2].toLowerCase();if(h)-1!==n.indexOf(h)&&(o.push(c),s=h);else{var f=c.length;if(l+f<r)o.push(c),l+=f;else if(l<r){var d=r-l;s&&("br"!==s||d<=i||f<=i)&&o.pop(),r>i?o.push(c.substr(0,d-i)+"..."):o.push(c.substr(0,d));break}s=""}}return o.join("")};var M={mu:"\u03bc",amp:"&",lt:"<",gt:">",nbsp:"\xa0",times:"\xd7",plusmn:"\xb1",deg:"\xb0"},S=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function L(t){return t.replace(S,function(t,e){return("#"===e.charAt(0)?function(t){if(t>1114111)return;var e=String.fromCodePoint;if(e)return e(t);var r=String.fromCharCode;return t<=65535?r(t):r(55232+(t>>10),t%1024+56320)}("x"===e.charAt(1)?parseInt(e.substr(2),16):parseInt(e.substr(1),10)):M[e])||t})}function C(t,e,r){var n,i,a,o=r.horizontalAlign,s=r.verticalAlign||"top",l=t.node().getBoundingClientRect(),u=e.node().getBoundingClientRect();return i="bottom"===s?function(){return l.bottom-n.height}:"middle"===s?function(){return l.top+(l.height-n.height)/2}:function(){return l.top},a="right"===o?function(){return l.right-n.width}:"center"===o?function(){return l.left+(l.width-n.width)/2}:function(){return l.left},function(){return n=this.node().getBoundingClientRect(),this.style({top:i()-u.top+"px",left:a()-u.left+"px","z-index":1e3}),this}}r.convertEntities=L,r.lineCount=function(t){return t.selectAll("tspan.line").size()||1},r.positionText=function(t,e,r){return t.each(function(){var t=n.select(this);function i(e,r){return void 0===r?null===(r=t.attr(e))&&(t.attr(e,0),r=0):t.attr(e,r),r}var a=i("x",e),o=i("y",r);"text"===this.nodeName&&t.selectAll("tspan.line").attr({x:a,y:o})})},r.makeEditable=function(t,e){var r=e.gd,i=e.delegate,a=n.dispatch("edit","input","cancel"),o=i||t;if(t.style({"pointer-events":i?"none":"all"}),1!==t.size())throw new Error("boo");function s(){!function(){var i=n.select(r).select(".svg-container"),o=i.append("div"),s=t.node().style,u=parseFloat(s.fontSize||12),c=e.text;void 0===c&&(c=t.attr("data-unformatted"));o.classed("plugin-editable editable",!0).style({position:"absolute","font-family":s.fontFamily||"Arial","font-size":u,color:e.fill||s.fill||"black",opacity:1,"background-color":e.background||"transparent",outline:"#ffffff33 1px solid",margin:[-u/8+1,0,0,-1].join("px ")+"px",padding:"0","box-sizing":"border-box"}).attr({contenteditable:!0}).text(c).call(C(t,i,e)).on("blur",function(){r._editing=!1,t.text(this.textContent).style({opacity:1});var e,i=n.select(this).attr("class");(e=i?"."+i.split(" ")[0]+"-math-group":"[class*=-math-group]")&&n.select(t.node().parentNode).select(e).style({opacity:0});var o=this.textContent;n.select(this).transition().duration(0).remove(),n.select(document).on("mouseup",null),a.edit.call(t,o)}).on("focus",function(){var t=this;r._editing=!0,n.select(document).on("mouseup",function(){if(n.event.target===t)return!1;document.activeElement===o.node()&&o.node().blur()})}).on("keyup",function(){27===n.event.which?(r._editing=!1,t.style({opacity:1}),n.select(this).style({opacity:0}).on("blur",function(){return!1}).transition().remove(),a.cancel.call(t,this.textContent)):(a.input.call(t,this.textContent),n.select(this).call(C(t,i,e)))}).on("keydown",function(){13===n.event.which&&this.blur()}).call(l)}(),t.style({opacity:0});var i,s=o.attr("class");(i=s?"."+s.split(" ")[0]+"-math-group":"[class*=-math-group]")&&n.select(t.node().parentNode).select(i).style({opacity:0})}function l(t){var e=t.node(),r=document.createRange();r.selectNodeContents(e);var n=window.getSelection();n.removeAllRanges(),n.addRange(r),e.focus()}return e.immediate?s():o.on("click",s),n.rebind(t,a,"on")}},{"../constants/alignment":144,"../constants/xmlns_namespaces":148,"../lib":169,d3:14}],191:[function(t,e,r){"use strict";var n={};function i(t){t&&null!==t.timer&&(clearTimeout(t.timer),t.timer=null)}r.throttle=function(t,e,r){var a=n[t],o=Date.now();if(!a){for(var s in n)n[s].ts<o-6e4&&delete n[s];a=n[t]={ts:0,timer:null}}function l(){r(),a.ts=Date.now(),a.onDone&&(a.onDone(),a.onDone=null)}i(a),o>a.ts+e?l():a.timer=setTimeout(function(){l(),a.timer=null},e)},r.done=function(t){var e=n[t];return e&&e.timer?new Promise(function(t){var r=e.onDone;e.onDone=function(){r&&r(),t(),e.onDone=null}}):Promise.resolve()},r.clear=function(t){if(t)i(n[t]),delete n[t];else for(var e in n)r.clear(e)}},{}],192:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.exports=function(t,e){if(t>0)return Math.log(t)/Math.LN10;var r=Math.log(Math.min(e[0],e[1]))/Math.LN10;return n(r)||(r=Math.log(Math.max(e[0],e[1]))/Math.LN10-6),r}},{"fast-isnumeric":16}],193:[function(t,e,r){"use strict";e.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}},{}],194:[function(t,e,r){"use strict";e.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}}},{}],195:[function(t,e,r){"use strict";var n=t("../registry");e.exports=function(t){for(var e,r,i=n.layoutArrayContainers,a=n.layoutArrayRegexes,o=t.split("[")[0],s=0;s<a.length;s++)if((r=t.match(a[s]))&&0===r.index){e=r[0];break}if(e||(e=i[i.indexOf(o)]),!e)return!1;var l=t.substr(e.length);return l?!!(r=l.match(/^\[(0|[1-9][0-9]*)\](\.(.+))?$/))&&{array:e,index:Number(r[1]),property:r[3]||""}:{array:e,index:"",property:""}}},{"../registry":261}],196:[function(t,e,r){"use strict";var n=t("../lib"),i=n.extendFlat,a=n.isPlainObject,o={valType:"flaglist",extras:["none"],flags:["calc","clearAxisTypes","plot","style","markerSize","colorbars"]},s={valType:"flaglist",extras:["none"],flags:["calc","plot","legend","ticks","axrange","layoutstyle","modebar","camera","arraydraw","colorbars"]},l=o.flags.slice().concat(["fullReplot"]),u=s.flags.slice().concat("layoutReplot");function c(t){for(var e={},r=0;r<t.length;r++)e[t[r]]=!1;return e}function p(t,e,r){var n=i({},t);for(var o in n){var s=n[o];a(s)&&(n[o]=h(s,e,r,o))}return"from-root"===r&&(n.editType=e),n}function h(t,e,r,n){if(t.valType){var a=i({},t);if(a.editType=e,Array.isArray(t.items)){a.items=new Array(t.items.length);for(var o=0;o<t.items.length;o++)a.items[o]=h(t.items[o],e,"from-root")}return a}return p(t,e,"_"===n.charAt(0)?"nested":"from-root")}e.exports={traces:o,layout:s,traceFlags:function(){return c(l)},layoutFlags:function(){return c(u)},update:function(t,e){var r=e.editType;if(r&&"none"!==r)for(var n=r.split("+"),i=0;i<n.length;i++)t[n[i]]=!0},overrideAll:p}},{"../lib":169}],197:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("gl-mat4/fromQuat"),a=t("../registry"),o=t("../lib"),s=t("../plots/plots"),l=t("../plots/cartesian/axis_ids"),u=t("../components/color"),c=l.cleanId,p=l.getFromTrace,h=a.traceIs;function f(t,e){var r=t[e],n=e.charAt(0);r&&"paper"!==r&&(t[e]=c(r,n))}function d(t){function e(e,r){var n=t[e],i=t.title&&t.title[r];n&&!i&&(t.title||(t.title={}),t.title[r]=t[e],delete t[e])}t&&("string"!=typeof t.title&&"number"!=typeof t.title||(t.title={text:t.title}),e("titlefont","font"),e("titleposition","position"),e("titleside","side"),e("titleoffset","offset"))}function m(t){if(!o.isPlainObject(t))return!1;var e=t.name;return delete t.name,delete t.showlegend,("string"==typeof e||"number"==typeof e)&&String(e)}function y(t,e,r,n){if(r&&!n)return t;if(n&&!r)return e;if(!t.trim())return e;if(!e.trim())return t;var i,a=Math.min(t.length,e.length);for(i=0;i<a&&t.charAt(i)===e.charAt(i);i++);return t.substr(0,i).trim()}function g(t){var e="middle",r="center";return"string"==typeof t&&(-1!==t.indexOf("top")?e="top":-1!==t.indexOf("bottom")&&(e="bottom"),-1!==t.indexOf("left")?r="left":-1!==t.indexOf("right")&&(r="right")),e+" "+r}function v(t,e){return e in t&&"object"==typeof t[e]&&0===Object.keys(t[e]).length}r.clearPromiseQueue=function(t){Array.isArray(t._promises)&&t._promises.length>0&&o.log("Clearing previous rejected promises from queue."),t._promises=[]},r.cleanLayout=function(t){var e,n;t||(t={}),t.xaxis1&&(t.xaxis||(t.xaxis=t.xaxis1),delete t.xaxis1),t.yaxis1&&(t.yaxis||(t.yaxis=t.yaxis1),delete t.yaxis1),t.scene1&&(t.scene||(t.scene=t.scene1),delete t.scene1);var a=(s.subplotsRegistry.cartesian||{}).attrRegex,l=(s.subplotsRegistry.polar||{}).attrRegex,p=(s.subplotsRegistry.ternary||{}).attrRegex,h=(s.subplotsRegistry.gl3d||{}).attrRegex,m=Object.keys(t);for(e=0;e<m.length;e++){var y=m[e];if(a&&a.test(y)){var g=t[y];g.anchor&&"free"!==g.anchor&&(g.anchor=c(g.anchor)),g.overlaying&&(g.overlaying=c(g.overlaying)),g.type||(g.isdate?g.type="date":g.islog?g.type="log":!1===g.isdate&&!1===g.islog&&(g.type="linear")),"withzero"!==g.autorange&&"tozero"!==g.autorange||(g.autorange=!0,g.rangemode="tozero"),delete g.islog,delete g.isdate,delete g.categories,v(g,"domain")&&delete g.domain,void 0!==g.autotick&&(void 0===g.tickmode&&(g.tickmode=g.autotick?"auto":"linear"),delete g.autotick),d(g)}else if(l&&l.test(y)){d(t[y].radialaxis)}else if(p&&p.test(y)){var _=t[y];d(_.aaxis),d(_.baxis),d(_.caxis)}else if(h&&h.test(y)){var x=t[y],b=x.cameraposition;if(Array.isArray(b)&&4===b[0].length){var w=b[0],k=b[1],T=b[2],A=i([],w),M=[];for(n=0;n<3;++n)M[n]=k[n]+T*A[2+4*n];x.camera={eye:{x:M[0],y:M[1],z:M[2]},center:{x:k[0],y:k[1],z:k[2]},up:{x:0,y:0,z:1}},delete x.cameraposition}d(x.xaxis),d(x.yaxis),d(x.zaxis)}}var S=Array.isArray(t.annotations)?t.annotations.length:0;for(e=0;e<S;e++){var L=t.annotations[e];o.isPlainObject(L)&&(L.ref&&("paper"===L.ref?(L.xref="paper",L.yref="paper"):"data"===L.ref&&(L.xref="x",L.yref="y"),delete L.ref),f(L,"xref"),f(L,"yref"))}var C=Array.isArray(t.shapes)?t.shapes.length:0;for(e=0;e<C;e++){var E=t.shapes[e];o.isPlainObject(E)&&(f(E,"xref"),f(E,"yref"))}var z=t.legend;return z&&(z.x>3?(z.x=1.02,z.xanchor="left"):z.x<-2&&(z.x=-.02,z.xanchor="right"),z.y>3?(z.y=1.02,z.yanchor="bottom"):z.y<-2&&(z.y=-.02,z.yanchor="top")),d(t),"rotate"===t.dragmode&&(t.dragmode="orbit"),u.clean(t),t.template&&t.template.layout&&r.cleanLayout(t.template.layout),t},r.cleanData=function(t){for(var e=0;e<t.length;e++){var n,i=t[e];if("histogramy"===i.type&&"xbins"in i&&!("ybins"in i)&&(i.ybins=i.xbins,delete i.xbins),i.error_y&&"opacity"in i.error_y){var l=u.defaults,p=i.error_y.color||(h(i,"bar")?u.defaultLine:l[e%l.length]);i.error_y.color=u.addOpacity(u.rgb(p),u.opacity(p)*i.error_y.opacity),delete i.error_y.opacity}if("bardir"in i&&("h"!==i.bardir||!h(i,"bar")&&"histogram"!==i.type.substr(0,9)||(i.orientation="h",r.swapXYData(i)),delete i.bardir),"histogramy"===i.type&&r.swapXYData(i),"histogramx"!==i.type&&"histogramy"!==i.type||(i.type="histogram"),"scl"in i&&!("colorscale"in i)&&(i.colorscale=i.scl,delete i.scl),"reversescl"in i&&!("reversescale"in i)&&(i.reversescale=i.reversescl,delete i.reversescl),i.xaxis&&(i.xaxis=c(i.xaxis,"x")),i.yaxis&&(i.yaxis=c(i.yaxis,"y")),h(i,"gl3d")&&i.scene&&(i.scene=s.subplotsRegistry.gl3d.cleanId(i.scene)),!h(i,"pie-like")&&!h(i,"bar-like"))if(Array.isArray(i.textposition))for(n=0;n<i.textposition.length;n++)i.textposition[n]=g(i.textposition[n]);else i.textposition&&(i.textposition=g(i.textposition));var f=a.getModule(i);if(f&&f.colorbar){var _=f.colorbar.container,x=_?i[_]:i;x&&x.colorscale&&("YIGnBu"===x.colorscale&&(x.colorscale="YlGnBu"),"YIOrRd"===x.colorscale&&(x.colorscale="YlOrRd"))}if("surface"===i.type&&o.isPlainObject(i.contours)){var b=["x","y","z"];for(n=0;n<b.length;n++){var w=i.contours[b[n]];o.isPlainObject(w)&&(w.highlightColor&&(w.highlightcolor=w.highlightColor,delete w.highlightColor),w.highlightWidth&&(w.highlightwidth=w.highlightWidth,delete w.highlightWidth))}}if("candlestick"===i.type||"ohlc"===i.type){var k=!1!==(i.increasing||{}).showlegend,T=!1!==(i.decreasing||{}).showlegend,A=m(i.increasing),M=m(i.decreasing);if(!1!==A&&!1!==M){var S=y(A,M,k,T);S&&(i.name=S)}else!A&&!M||i.name||(i.name=A||M)}if(Array.isArray(i.transforms)){var L=i.transforms;for(n=0;n<L.length;n++){var C=L[n];if(o.isPlainObject(C))switch(C.type){case"filter":C.filtersrc&&(C.target=C.filtersrc,delete C.filtersrc),C.calendar&&(C.valuecalendar||(C.valuecalendar=C.calendar),delete C.calendar);break;case"groupby":if(C.styles=C.styles||C.style,C.styles&&!Array.isArray(C.styles)){var E=C.styles,z=Object.keys(E);C.styles=[];for(var P=0;P<z.length;P++)C.styles.push({target:z[P],value:E[z[P]]})}}}}v(i,"line")&&delete i.line,"marker"in i&&(v(i.marker,"line")&&delete i.marker.line,v(i,"marker")&&delete i.marker),u.clean(i),i.autobinx&&(delete i.autobinx,delete i.xbins),i.autobiny&&(delete i.autobiny,delete i.ybins),d(i),i.colorbar&&d(i.colorbar),i.marker&&i.marker.colorbar&&d(i.marker.colorbar),i.line&&i.line.colorbar&&d(i.line.colorbar),i.aaxis&&d(i.aaxis),i.baxis&&d(i.baxis)}},r.swapXYData=function(t){var e;if(o.swapAttrs(t,["?","?0","d?","?bins","nbins?","autobin?","?src","error_?"]),Array.isArray(t.z)&&Array.isArray(t.z[0])&&(t.transpose?delete t.transpose:t.transpose=!0),t.error_x&&t.error_y){var r=t.error_y,n="copy_ystyle"in r?r.copy_ystyle:!(r.color||r.thickness||r.width);o.swapAttrs(t,["error_?.copy_ystyle"]),n&&o.swapAttrs(t,["error_?.color","error_?.thickness","error_?.width"])}if("string"==typeof t.hoverinfo){var i=t.hoverinfo.split("+");for(e=0;e<i.length;e++)"x"===i[e]?i[e]="y":"y"===i[e]&&(i[e]="x");t.hoverinfo=i.join("+")}},r.coerceTraceIndices=function(t,e){if(n(e))return[e];if(!Array.isArray(e)||!e.length)return t.data.map(function(t,e){return e});if(Array.isArray(e)){for(var r=[],i=0;i<e.length;i++)o.isIndex(e[i],t.data.length)?r.push(e[i]):o.warn("trace index (",e[i],") is not a number or is out of bounds");return r}return e},r.manageArrayContainers=function(t,e,r){var i=t.obj,a=t.parts,s=a.length,l=a[s-1],u=n(l);if(u&&null===e){var c=a.slice(0,s-1).join(".");o.nestedProperty(i,c).get().splice(l,1)}else u&&void 0===t.get()?(void 0===t.get()&&(r[t.astr]=null),t.set(e)):t.set(e)};var _=/(\.[^\[\]\.]+|\[[^\[\]\.]+\])$/;function x(t){var e=t.search(_);if(e>0)return t.substr(0,e)}r.hasParent=function(t,e){for(var r=x(e);r;){if(r in t)return!0;r=x(r)}return!1};var b=["x","y","z"];r.clearAxisTypes=function(t,e,r){for(var n=0;n<e.length;n++)for(var i=t._fullData[n],a=0;a<3;a++){var s=p(t,i,b[a]);if(s&&"log"!==s.type){var l=s._name,u=s._id.substr(1);if("scene"===u.substr(0,5)){if(void 0!==r[u])continue;l=u+"."+l}var c=l+".type";void 0===r[l]&&void 0===r[c]&&o.nestedProperty(t.layout,c).set(null)}}}},{"../components/color":50,"../lib":169,"../plots/cartesian/axis_ids":216,"../plots/plots":252,"../registry":261,"fast-isnumeric":16,"gl-mat4/fromQuat":17}],198:[function(t,e,r){"use strict";var n=t("./plot_api");r.plot=n.plot,r.newPlot=n.newPlot,r.restyle=n.restyle,r.relayout=n.relayout,r.redraw=n.redraw,r.update=n.update,r._guiRestyle=n._guiRestyle,r._guiRelayout=n._guiRelayout,r._guiUpdate=n._guiUpdate,r._storeDirectGUIEdit=n._storeDirectGUIEdit,r.react=n.react,r.extendTraces=n.extendTraces,r.prependTraces=n.prependTraces,r.addTraces=n.addTraces,r.deleteTraces=n.deleteTraces,r.moveTraces=n.moveTraces,r.purge=n.purge,r.addFrames=n.addFrames,r.deleteFrames=n.deleteFrames,r.animate=n.animate,r.setPlotConfig=n.setPlotConfig,r.toImage=t("./to_image"),r.validate=t("./validate"),r.downloadImage=t("../snapshot/download");var i=t("./template_api");r.makeTemplate=i.makeTemplate,r.validateTemplate=i.validateTemplate},{"../snapshot/download":263,"./plot_api":200,"./template_api":205,"./to_image":206,"./validate":207}],199:[function(t,e,r){"use strict";var n=t("../lib/is_plain_object"),i=t("../lib/noop"),a=t("../lib/loggers"),o=t("../lib/search").sorterAsc,s=t("../registry");r.containerArrayMatch=t("./container_array_match");var l=r.isAddVal=function(t){return"add"===t||n(t)},u=r.isRemoveVal=function(t){return null===t||"remove"===t};r.applyContainerArrayChanges=function(t,e,r,n,c){var p=e.astr,h=s.getComponentMethod(p,"supplyLayoutDefaults"),f=s.getComponentMethod(p,"draw"),d=s.getComponentMethod(p,"drawOne"),m=n.replot||n.recalc||h===i||f===i,y=t.layout,g=t._fullLayout;if(r[""]){Object.keys(r).length>1&&a.warn("Full array edits are incompatible with other edits",p);var v=r[""][""];if(u(v))e.set(null);else{if(!Array.isArray(v))return a.warn("Unrecognized full array edit value",p,v),!0;e.set(v)}return!m&&(h(y,g),f(t),!0)}var _,x,b,w,k,T,A,M,S=Object.keys(r).map(Number).sort(o),L=e.get(),C=L||[],E=c(g,p).get(),z=[],P=-1,I=C.length;for(_=0;_<S.length;_++)if(w=r[b=S[_]],k=Object.keys(w),T=w[""],A=l(T),b<0||b>C.length-(A?0:1))a.warn("index out of range",p,b);else if(void 0!==T)k.length>1&&a.warn("Insertion & removal are incompatible with edits to the same index.",p,b),u(T)?z.push(b):A?("add"===T&&(T={}),C.splice(b,0,T),E&&E.splice(b,0,{})):a.warn("Unrecognized full object edit value",p,b,T),-1===P&&(P=b);else for(x=0;x<k.length;x++)M=p+"["+b+"].",c(C[b],k[x],M).set(w[k[x]]);for(_=z.length-1;_>=0;_--)C.splice(z[_],1),E&&E.splice(z[_],1);if(C.length?L||e.set(C):e.set(null),m)return!1;if(h(y,g),d!==i){var D;if(-1===P)D=S;else{for(I=Math.max(C.length,I),D=[],_=0;_<S.length&&!((b=S[_])>=P);_++)D.push(b);for(_=P;_<I;_++)D.push(_)}for(_=0;_<D.length;_++)d(t,D[_])}else f(t);return!0}},{"../lib/is_plain_object":170,"../lib/loggers":173,"../lib/noop":178,"../lib/search":187,"../registry":261,"./container_array_match":195}],200:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("has-hover"),o=t("../lib"),s=o.nestedProperty,l=t("../lib/events"),u=t("../lib/queue"),c=t("../registry"),p=t("./plot_schema"),h=t("../plots/plots"),f=t("../plots/polar/legacy"),d=t("../plots/cartesian/axes"),m=t("../components/drawing"),y=t("../components/color"),g=t("../plots/cartesian/graph_interact").initInteractions,v=t("../constants/xmlns_namespaces"),_=t("../lib/svg_text_utils"),x=t("../plots/cartesian/select").clearSelect,b=t("./plot_config").dfltConfig,w=t("./manage_arrays"),k=t("./helpers"),T=t("./subroutines"),A=t("./edit_types"),M=t("../plots/cartesian/constants").AX_NAME_PATTERN,S=0,L=5;function C(t){var e=t._fullLayout;e._redrawFromAutoMarginCount?e._redrawFromAutoMarginCount--:t.emit("plotly_afterplot")}function E(t,e){try{t._fullLayout._paper.style("background",e)}catch(t){o.error(t)}}function z(t,e){E(t,y.combine(e,"white"))}function P(t,e){if(!t._context){t._context=o.extendDeep({},b);var r=n.select("base");t._context._baseUrl=r.size()&&r.attr("href")?window.location.href.split("#")[0]:""}var i,s,l,u=t._context;if(e){for(s=Object.keys(e),i=0;i<s.length;i++)"editable"!==(l=s[i])&&"edits"!==l&&l in u&&("setBackground"===l&&"opaque"===e[l]?u[l]=z:u[l]=e[l]);e.plot3dPixelRatio&&!u.plotGlPixelRatio&&(u.plotGlPixelRatio=u.plot3dPixelRatio);var c=e.editable;if(void 0!==c)for(u.editable=c,s=Object.keys(u.edits),i=0;i<s.length;i++)u.edits[s[i]]=c;if(e.edits)for(s=Object.keys(e.edits),i=0;i<s.length;i++)(l=s[i])in u.edits&&(u.edits[l]=e.edits[l]);u._exportedPlot=e._exportedPlot}u.staticPlot&&(u.editable=!1,u.edits={},u.autosizable=!1,u.scrollZoom=!1,u.doubleClick=!1,u.showTips=!1,u.showLink=!1,u.displayModeBar=!1),"hover"!==u.displayModeBar||a||(u.displayModeBar=!0),"transparent"!==u.setBackground&&"function"==typeof u.setBackground||(u.setBackground=E),u._hasZeroHeight=u._hasZeroHeight||0===t.clientHeight,u._hasZeroWidth=u._hasZeroWidth||0===t.clientWidth;var p=u.scrollZoom,h=u._scrollZoom={};if(!0===p)h.cartesian=1,h.gl3d=1,h.geo=1,h.mapbox=1;else if("string"==typeof p){var f=p.split("+");for(i=0;i<f.length;i++)h[f[i]]=1}else!1!==p&&(h.gl3d=1,h.geo=1,h.mapbox=1)}function I(t,e){var r,n,i=e+1,a=[];for(r=0;r<t.length;r++)(n=t[r])<0?a.push(i+n):a.push(n);return a}function D(t,e,r){var n,i;for(n=0;n<e.length;n++){if((i=e[n])!==parseInt(i,10))throw new Error("all values in "+r+" must be integers");if(i>=t.data.length||i<-t.data.length)throw new Error(r+" must be valid indices for gd.data.");if(e.indexOf(i,n+1)>-1||i>=0&&e.indexOf(-t.data.length+i)>-1||i<0&&e.indexOf(t.data.length+i)>-1)throw new Error("each index in "+r+" must be unique.")}}function O(t,e,r){if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if("undefined"==typeof e)throw new Error("currentIndices is a required argument.");if(Array.isArray(e)||(e=[e]),D(t,e,"currentIndices"),"undefined"==typeof r||Array.isArray(r)||(r=[r]),"undefined"!=typeof r&&D(t,r,"newIndices"),"undefined"!=typeof r&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function R(t,e,r,n,a){!function(t,e,r,n){var i=o.isPlainObject(n);if(!Array.isArray(t.data))throw new Error("gd.data must be an array");if(!o.isPlainObject(e))throw new Error("update must be a key:value object");if("undefined"==typeof r)throw new Error("indices must be an integer or array of integers");for(var a in D(t,r,"indices"),e){if(!Array.isArray(e[a])||e[a].length!==r.length)throw new Error("attribute "+a+" must be an array of length equal to indices array length");if(i&&(!(a in n)||!Array.isArray(n[a])||n[a].length!==e[a].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 corrispondence with the keys and number of traces in the update object")}}(t,e,r,n);for(var l=function(t,e,r,n){var a,l,u,c,p,h=o.isPlainObject(n),f=[];for(var d in Array.isArray(r)||(r=[r]),r=I(r,t.data.length-1),e)for(var m=0;m<r.length;m++){if(a=t.data[r[m]],l=(u=s(a,d)).get(),c=e[d][m],!o.isArrayOrTypedArray(c))throw new Error("attribute: "+d+" index: "+m+" must be an array");if(!o.isArrayOrTypedArray(l))throw new Error("cannot extend missing or non-array attribute: "+d);if(l.constructor!==c.constructor)throw new Error("cannot extend array with an array of a different type: "+d);p=h?n[d][m]:n,i(p)||(p=-1),f.push({prop:u,target:l,insert:c,maxp:Math.floor(p)})}return f}(t,e,r,n),u={},c={},p=0;p<l.length;p++){var h=l[p].prop,f=l[p].maxp,d=a(l[p].target,l[p].insert,f);h.set(d[0]),Array.isArray(u[h.astr])||(u[h.astr]=[]),u[h.astr].push(d[1]),Array.isArray(c[h.astr])||(c[h.astr]=[]),c[h.astr].push(l[p].target.length)}return{update:u,maxPoints:c}}function F(t,e){var r=new t.constructor(t.length+e.length);return r.set(t),r.set(e,t.length),r}function B(t,e,n,i){t=o.getGraphDiv(t),k.clearPromiseQueue(t);var a={};if("string"==typeof e)a[e]=n;else{if(!o.isPlainObject(e))return o.warn("Restyle fail.",e,n,i),Promise.reject();a=o.extendFlat({},e),void 0===i&&(i=n)}Object.keys(a).length&&(t.changed=!0);var s=k.coerceTraceIndices(t,i),l=V(t,a,s),c=l.flags;c.calc&&(t.calcdata=void 0),c.clearAxisTypes&&k.clearAxisTypes(t,s,{});var p=[];c.fullReplot?p.push(r.plot):(p.push(h.previousPromises),h.supplyDefaults(t),c.markerSize&&(h.doCalcdata(t),Z(p)),c.style&&p.push(T.doTraceStyle),c.colorbars&&p.push(T.doColorBars),p.push(C)),p.push(h.rehover,h.redrag),u.add(t,B,[t,l.undoit,l.traces],B,[t,l.redoit,l.traces]);var f=o.syncOrAsync(p,t);return f&&f.then||(f=Promise.resolve()),f.then(function(){return t.emit("plotly_restyle",l.eventData),t})}function N(t){return void 0===t?null:t}function U(t,e){return e?function(e,r,n){var i=s(e,r),a=i.set;return i.set=function(e){j((n||"")+r,i.get(),e,t),a(e)},i}:s}function j(t,e,r,n){if(Array.isArray(e)||Array.isArray(r))for(var i=Array.isArray(e)?e:[],a=Array.isArray(r)?r:[],s=Math.max(i.length,a.length),l=0;l<s;l++)j(t+"["+l+"]",i[l],a[l],n);else if(o.isPlainObject(e)||o.isPlainObject(r)){var u=o.isPlainObject(e)?e:{},c=o.isPlainObject(r)?r:{},p=o.extendFlat({},u,c);for(var h in p)j(t+"."+h,u[h],c[h],n)}else void 0===n[t]&&(n[t]=N(e))}function V(t,e,r){var n,i=t._fullLayout,a=t._fullData,l=t.data,u=i._guiEditing,f=U(i._preGUI,u),m=o.extendDeepAll({},e);q(e);var y,g=A.traceFlags(),v={},_={};function x(){return r.map(function(){})}function b(t){var e=d.id2name(t);-1===y.indexOf(e)&&y.push(e)}function w(t){return"LAYOUT"+t+".autorange"}function T(t){return"LAYOUT"+t+".range"}function M(t){for(var e=t;e<a.length;e++)if(a[e]._input===l[t])return a[e]}function S(n,a,o){if(Array.isArray(n))n.forEach(function(t){S(t,a,o)});else if(!(n in e||k.hasParent(e,n))){var s;if("LAYOUT"===n.substr(0,6))s=f(t.layout,n.replace("LAYOUT",""));else{var c=r[o];s=U(i._tracePreGUI[M(c)._fullInput.uid],u)(l[c],n)}n in _||(_[n]=x()),void 0===_[n][o]&&(_[n][o]=N(s.get())),void 0!==a&&s.set(a)}}function L(t){return function(e){return a[e][t]}}function C(t){return function(e,n){return!1===e?a[r[n]][t]:null}}for(var E in e){if(k.hasParent(e,E))throw new Error("cannot set "+E+" and a parent attribute simultaneously");var z,P,I,D,O,R,F=e[E];if("autobinx"!==E&&"autobiny"!==E||(E=E.charAt(E.length-1)+"bins",F=Array.isArray(F)?F.map(C(E)):!1===F?r.map(L(E)):null),v[E]=F,"LAYOUT"!==E.substr(0,6)){for(_[E]=x(),n=0;n<r.length;n++){if(z=l[r[n]],P=M(r[n]),D=(I=U(i._tracePreGUI[P._fullInput.uid],u)(z,E)).get(),void 0!==(O=Array.isArray(F)?F[n%F.length]:F)){var B=I.parts[I.parts.length-1],j=E.substr(0,E.length-B.length-1),V=j?j+".":"",G=j?s(P,j).get():P;if((R=p.getTraceValObject(P,I.parts))&&R.impliedEdits&&null!==O)for(var H in R.impliedEdits)S(o.relativeAttr(E,H),R.impliedEdits[H],n);else if("thicknessmode"!==B&&"lenmode"!==B||D===O||"fraction"!==O&&"pixels"!==O||!G){if("type"===E&&("pie"===O!=("pie"===D)||"funnelarea"===O!=("funnelarea"===D))){var Z="x",X="y";"bar"!==O&&"bar"!==D||"h"!==z.orientation||(Z="y",X="x"),o.swapAttrs(z,["?","?src"],"labels",Z),o.swapAttrs(z,["d?","?0"],"label",Z),o.swapAttrs(z,["?","?src"],"values",X),"pie"===D||"funnelarea"===D?(s(z,"marker.color").set(s(z,"marker.colors").get()),i._pielayer.selectAll("g.trace").remove()):c.traceIs(z,"cartesian")&&s(z,"marker.colors").set(s(z,"marker.color").get())}}else{var W=i._size,Y=G.orient,K="top"===Y||"bottom"===Y;if("thicknessmode"===B){var J=K?W.h:W.w;S(V+"thickness",G.thickness*("fraction"===O?1/J:J),n)}else{var $=K?W.w:W.h;S(V+"len",G.len*("fraction"===O?1/$:$),n)}}_[E][n]=N(D);if(-1!==["swapxy","swapxyaxes","orientation","orientationaxes"].indexOf(E)){if("orientation"===E){I.set(O);var Q=z.x&&!z.y?"h":"v";if((I.get()||Q)===P.orientation)continue}else"orientationaxes"===E&&(z.orientation={v:"h",h:"v"}[P.orientation]);k.swapXYData(z),g.calc=g.clearAxisTypes=!0}else-1!==h.dataArrayContainers.indexOf(I.parts[0])?(k.manageArrayContainers(I,O,_),g.calc=!0):(R?R.arrayOk&&!c.traceIs(P,"regl")&&(o.isArrayOrTypedArray(O)||o.isArrayOrTypedArray(D))?g.calc=!0:A.update(g,R):g.calc=!0,I.set(O))}}if(-1!==["swapxyaxes","orientationaxes"].indexOf(E)&&d.swap(t,r),"orientationaxes"===E){var tt=s(t.layout,"hovermode");"x"===tt.get()?tt.set("y"):"y"===tt.get()&&tt.set("x")}if(-1!==["orientation","type"].indexOf(E)){for(y=[],n=0;n<r.length;n++){var et=l[r[n]];c.traceIs(et,"cartesian")&&(b(et.xaxis||"x"),b(et.yaxis||"y"))}S(y.map(w),!0,0),S(y.map(T),[0,1],0)}}else I=f(t.layout,E.replace("LAYOUT","")),_[E]=[N(I.get())],I.set(Array.isArray(F)?F[0]:F),g.calc=!0}return(g.calc||g.plot)&&(g.fullReplot=!0),{flags:g,undoit:_,redoit:v,traces:r,eventData:o.extendDeepNoArrays([],[m,r])}}function q(t){var e,r,n,i=o.counterRegex("axis",".title",!1,!1),a=/colorbar\.title$/,s=Object.keys(t);for(e=0;e<s.length;e++)r=s[e],n=t[r],"title"!==r&&!i.test(r)&&!a.test(r)||"string"!=typeof n&&"number"!=typeof n?r.indexOf("titlefont")>-1?l(r,r.replace("titlefont","title.font")):r.indexOf("titleposition")>-1?l(r,r.replace("titleposition","title.position")):r.indexOf("titleside")>-1?l(r,r.replace("titleside","title.side")):r.indexOf("titleoffset")>-1&&l(r,r.replace("titleoffset","title.offset")):l(r,r.replace("title","title.text"));function l(e,r){t[r]=t[e],delete t[e]}}function G(t,e,r){if(t=o.getGraphDiv(t),k.clearPromiseQueue(t),t.framework&&t.framework.isPolar)return Promise.resolve(t);var n={};if("string"==typeof e)n[e]=r;else{if(!o.isPlainObject(e))return o.warn("Relayout fail.",e,r),Promise.reject();n=o.extendFlat({},e)}Object.keys(n).length&&(t.changed=!0);var i=K(t,n),a=i.flags;a.calc&&(t.calcdata=void 0);var s=[h.previousPromises];a.layoutReplot?s.push(T.layoutReplot):Object.keys(n).length&&(H(t,a,i)||h.supplyDefaults(t),a.legend&&s.push(T.doLegend),a.layoutstyle&&s.push(T.layoutStyles),a.axrange&&Z(s,i.rangesAltered),a.ticks&&s.push(T.doTicksRelayout),a.modebar&&s.push(T.doModeBar),a.camera&&s.push(T.doCamera),a.colorbars&&s.push(T.doColorBars),s.push(C)),s.push(h.rehover,h.redrag),u.add(t,G,[t,i.undoit],G,[t,i.redoit]);var l=o.syncOrAsync(s,t);return l&&l.then||(l=Promise.resolve(t)),l.then(function(){return t.emit("plotly_relayout",i.eventData),t})}function H(t,e,r){var n=t._fullLayout;if(!e.axrange)return!1;for(var i in e)if("axrange"!==i&&e[i])return!1;for(var a in r.rangesAltered){var o=d.id2name(a),s=t.layout[o],l=n[o];if(l.autorange=s.autorange,l.range=s.range.slice(),l.cleanRange(),l._matchGroup)for(var u in l._matchGroup)if(u!==a){var c=n[d.id2name(u)];c.autorange=l.autorange,c.range=l.range.slice(),c._input.range=l.range.slice()}}return!0}function Z(t,e){var r=e?function(t){var r=[],n=!0;for(var i in e){var a=d.getFromId(t,i);if(r.push(i),a._matchGroup)for(var o in a._matchGroup)e[o]||r.push(o);a.automargin&&(n=!1)}return d.draw(t,r,{skipTitle:n})}:function(t){return d.draw(t,"redraw")};t.push(x,T.doAutoRangeAndConstraints,r,T.drawData,T.finalDraw)}var X=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,W=/^[xyz]axis[0-9]*\.autorange$/,Y=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function K(t,e){var r,n,i,a=t.layout,l=t._fullLayout,u=l._guiEditing,h=U(l._preGUI,u),f=Object.keys(e),m=d.list(t),y=o.extendDeepAll({},e),g={};for(q(e),f=Object.keys(e),n=0;n<f.length;n++)if(0===f[n].indexOf("allaxes")){for(i=0;i<m.length;i++){var v=m[i]._id.substr(1),_=-1!==v.indexOf("scene")?v+".":"",x=f[n].replace("allaxes",_+m[i]._name);e[x]||(e[x]=e[f[n]])}delete e[f[n]]}var b=A.layoutFlags(),T={},S={};function L(t,r){if(Array.isArray(t))t.forEach(function(t){L(t,r)});else if(!(t in e||k.hasParent(e,t))){var n=h(a,t);t in S||(S[t]=N(n.get())),void 0!==r&&n.set(r)}}var C,E={};function z(t){var e=d.name2id(t.split(".")[0]);return E[e]=1,e}for(var P in e){if(k.hasParent(e,P))throw new Error("cannot set "+P+" and a parent attribute simultaneously");for(var I=h(a,P),D=e[P],O=I.parts.length-1;O>0&&"string"!=typeof I.parts[O];)O--;var R=I.parts[O],F=I.parts[O-1]+"."+R,B=I.parts.slice(0,O).join("."),j=s(t.layout,B).get(),V=s(l,B).get(),G=I.get();if(void 0!==D){T[P]=D,S[P]="reverse"===R?D:N(G);var H=p.getLayoutValObject(l,I.parts);if(H&&H.impliedEdits&&null!==D)for(var Z in H.impliedEdits)L(o.relativeAttr(P,Z),H.impliedEdits[Z]);if(-1!==["width","height"].indexOf(P))if(D){L("autosize",null);var K="height"===P?"width":"height";L(K,l[K])}else l[P]=t._initialAutoSize[P];else if("autosize"===P)L("width",D?null:l.width),L("height",D?null:l.height);else if(F.match(X))z(F),s(l,B+"._inputRange").set(null);else if(F.match(W)){z(F),s(l,B+"._inputRange").set(null);var $=s(l,B).get();$._inputDomain&&($._input.domain=$._inputDomain.slice())}else F.match(Y)&&s(l,B+"._inputDomain").set(null);if("type"===R){var Q=j,tt="linear"===V.type&&"log"===D,et="log"===V.type&&"linear"===D;if(tt||et){if(Q&&Q.range)if(V.autorange)tt&&(Q.range=Q.range[1]>Q.range[0]?[1,2]:[2,1]);else{var rt=Q.range[0],nt=Q.range[1];tt?(rt<=0&&nt<=0&&L(B+".autorange",!0),rt<=0?rt=nt/1e6:nt<=0&&(nt=rt/1e6),L(B+".range[0]",Math.log(rt)/Math.LN10),L(B+".range[1]",Math.log(nt)/Math.LN10)):(L(B+".range[0]",Math.pow(10,rt)),L(B+".range[1]",Math.pow(10,nt)))}else L(B+".autorange",!0);Array.isArray(l._subplots.polar)&&l._subplots.polar.length&&l[I.parts[0]]&&"radialaxis"===I.parts[1]&&delete l[I.parts[0]]._subplot.viewInitial["radialaxis.range"],c.getComponentMethod("annotations","convertCoords")(t,V,D,L),c.getComponentMethod("images","convertCoords")(t,V,D,L)}else L(B+".autorange",!0),L(B+".range",null);s(l,B+"._inputRange").set(null)}else if(R.match(M)){var it=s(l,P).get(),at=(D||{}).type;at&&"-"!==at||(at="linear"),c.getComponentMethod("annotations","convertCoords")(t,it,at,L),c.getComponentMethod("images","convertCoords")(t,it,at,L)}var ot=w.containerArrayMatch(P);if(ot){r=ot.array,n=ot.index;var st=ot.property,lt=H||{editType:"calc"};""!==n&&""===st&&(w.isAddVal(D)?S[P]=null:w.isRemoveVal(D)?S[P]=(s(a,r).get()||[])[n]:o.warn("unrecognized full object value",e)),A.update(b,lt),g[r]||(g[r]={});var ut=g[r][n];ut||(ut=g[r][n]={}),ut[st]=D,delete e[P]}else"reverse"===R?(j.range?j.range.reverse():(L(B+".autorange",!0),j.range=[1,0]),V.autorange?b.calc=!0:b.plot=!0):(l._has("scatter-like")&&l._has("regl")&&"dragmode"===P&&("lasso"===D||"select"===D)&&"lasso"!==G&&"select"!==G?b.plot=!0:l._has("gl2d")?b.plot=!0:H?A.update(b,H):b.calc=!0,I.set(D))}}for(r in g){w.applyContainerArrayChanges(t,h(a,r),g[r],b,h)||(b.plot=!0)}var ct=l._axisConstraintGroups||[];for(C in E)for(n=0;n<ct.length;n++){var pt=ct[n];if(pt[C])for(var ht in b.calc=!0,pt)E[ht]||(d.getFromId(t,ht)._constraintShrinkable=!0)}return(J(t)||e.height||e.width)&&(b.plot=!0),(b.plot||b.calc)&&(b.layoutReplot=!0),{flags:b,rangesAltered:E,undoit:S,redoit:T,eventData:y}}function J(t){var e=t._fullLayout,r=e.width,n=e.height;return t.layout.autosize&&h.plotAutoSize(t,t.layout,e),e.width!==r||e.height!==n}function $(t,e,n,i){if(t=o.getGraphDiv(t),k.clearPromiseQueue(t),t.framework&&t.framework.isPolar)return Promise.resolve(t);o.isPlainObject(e)||(e={}),o.isPlainObject(n)||(n={}),Object.keys(e).length&&(t.changed=!0),Object.keys(n).length&&(t.changed=!0);var a=k.coerceTraceIndices(t,i),s=V(t,o.extendFlat({},e),a),l=s.flags,c=K(t,o.extendFlat({},n)),p=c.flags;(l.calc||p.calc)&&(t.calcdata=void 0),l.clearAxisTypes&&k.clearAxisTypes(t,a,n);var f=[];p.layoutReplot?f.push(T.layoutReplot):l.fullReplot?f.push(r.plot):(f.push(h.previousPromises),H(t,p,c)||h.supplyDefaults(t),l.style&&f.push(T.doTraceStyle),(l.colorbars||p.colorbars)&&f.push(T.doColorBars),p.legend&&f.push(T.doLegend),p.layoutstyle&&f.push(T.layoutStyles),p.axrange&&Z(f,c.rangesAltered),p.ticks&&f.push(T.doTicksRelayout),p.modebar&&f.push(T.doModeBar),p.camera&&f.push(T.doCamera),f.push(C)),f.push(h.rehover,h.redrag),u.add(t,$,[t,s.undoit,c.undoit,s.traces],$,[t,s.redoit,c.redoit,s.traces]);var d=o.syncOrAsync(f,t);return d&&d.then||(d=Promise.resolve(t)),d.then(function(){return t.emit("plotly_update",{data:s.eventData,layout:c.eventData}),t})}function Q(t){return function(e){e._fullLayout._guiEditing=!0;var r=t.apply(null,arguments);return e._fullLayout._guiEditing=!1,r}}var tt=[{pattern:/^hiddenlabels/,attr:"legend.uirevision"},{pattern:/^((x|y)axis\d*)\.((auto)?range|title\.text)/},{pattern:/axis\d*\.showspikes$/,attr:"modebar.uirevision"},{pattern:/(hover|drag)mode$/,attr:"modebar.uirevision"},{pattern:/^(scene\d*)\.camera/},{pattern:/^(geo\d*)\.(projection|center|fitbounds)/},{pattern:/^(ternary\d*\.[abc]axis)\.(min|title\.text)$/},{pattern:/^(polar\d*\.radialaxis)\.((auto)?range|angle|title\.text)/},{pattern:/^(polar\d*\.angularaxis)\.rotation/},{pattern:/^(mapbox\d*)\.(center|zoom|bearing|pitch)/},{pattern:/^legend\.(x|y)$/,attr:"editrevision"},{pattern:/^(shapes|annotations)/,attr:"editrevision"},{pattern:/^title\.text$/,attr:"editrevision"}],et=[{pattern:/^selectedpoints$/,attr:"selectionrevision"},{pattern:/(^|value\.)visible$/,attr:"legend.uirevision"},{pattern:/^dimensions\[\d+\]\.constraintrange/},{pattern:/^node\.(x|y|groups)/},{pattern:/^level$/},{pattern:/(^|value\.)name$/},{pattern:/colorbar\.title\.text$/},{pattern:/colorbar\.(x|y)$/,attr:"editrevision"}];function rt(t,e){for(var r=0;r<e.length;r++){var n=e[r],i=t.match(n.pattern);if(i)return{head:i[1],attr:n.attr}}}function nt(t,e){var r=s(e,t).get();if(void 0!==r)return r;var n=t.split(".");for(n.pop();n.length>1;)if(n.pop(),void 0!==(r=s(e,n.join(".")+".uirevision").get()))return r;return e.uirevision}function it(t,e){for(var r=0;r<e.length;r++)if(e[r]._fullInput.uid===t)return r;return-1}function at(t,e,r){for(var n=0;n<e.length;n++)if(e[n].uid===t)return n;return!e[r]||e[r].uid?-1:r}function ot(t,e){var r=o.isPlainObject(t),n=Array.isArray(t);return r||n?(r&&o.isPlainObject(e)||n&&Array.isArray(e))&&JSON.stringify(t)===JSON.stringify(e):t===e}function st(t,e,r,n){var i,a,l,u=n.getValObject,c=n.flags,p=n.immutable,h=n.inArray,f=n.arrayIndex;function d(){var t=i.editType;h&&-1!==t.indexOf("arraydraw")?o.pushUnique(c.arrays[h],f):(A.update(c,i),"none"!==t&&c.nChanges++,n.transition&&i.anim&&c.nChangesAnim++,(X.test(l)||W.test(l))&&(c.rangesAltered[r[0]]=1),Y.test(l)&&s(e,"_inputDomain").set(null),"datarevision"===a&&(c.newDataRevision=1))}function m(t){return"data_array"===t.valType||t.arrayOk}for(a in t){if(c.calc&&!n.transition)return;var y=t[a],g=e[a],v=r.concat(a);if(l=v.join("."),"_"!==a.charAt(0)&&"function"!=typeof y&&y!==g){if(("tick0"===a||"dtick"===a)&&"geo"!==r[0]){var _=e.tickmode;if("auto"===_||"array"===_||!_)continue}if(("range"!==a||!e.autorange)&&("zmin"!==a&&"zmax"!==a||"contourcarpet"!==e.type)&&(i=u(v))&&(!i._compareAsJSON||JSON.stringify(y)!==JSON.stringify(g))){var x,b=i.valType,w=m(i),k=Array.isArray(y),T=Array.isArray(g);if(k&&T){var M="_input_"+a,S=t[M],L=e[M];if(Array.isArray(S)&&S===L)continue}if(void 0===g)w&&k?c.calc=!0:d();else if(i._isLinkedToArray){var C=[],E=!1;h||(c.arrays[a]=C);var z=Math.min(y.length,g.length),P=Math.max(y.length,g.length);if(z!==P){if("arraydraw"!==i.editType){d();continue}E=!0}for(x=0;x<z;x++)st(y[x],g[x],v.concat(x),o.extendFlat({inArray:a,arrayIndex:x},n));if(E)for(x=z;x<P;x++)C.push(x)}else!b&&o.isPlainObject(y)?st(y,g,v,n):w?k&&T?(p&&(c.calc=!0),(p||n.newDataRevision)&&d()):k!==T?c.calc=!0:d():k&&T&&y.length===g.length&&String(y)===String(g)||d()}}}for(a in e)if(!(a in t||"_"===a.charAt(0)||"function"==typeof e[a])){if(m(i=u(r.concat(a)))&&Array.isArray(e[a]))return void(c.calc=!0);d()}}function lt(t){var e=n.select(t),r=t._fullLayout;if(r._container=e.selectAll(".plot-container").data([0]),r._container.enter().insert("div",":first-child").classed("plot-container",!0).classed("plotly",!0),r._paperdiv=r._container.selectAll(".svg-container").data([0]),r._paperdiv.enter().append("div").classed("svg-container",!0).style("position","relative"),r._glcontainer=r._paperdiv.selectAll(".gl-container").data([{}]),r._glcontainer.enter().append("div").classed("gl-container",!0),r._paperdiv.selectAll(".main-svg").remove(),r._paperdiv.select(".modebar-container").remove(),r._paper=r._paperdiv.insert("svg",":first-child").classed("main-svg",!0),r._toppaper=r._paperdiv.append("svg").classed("main-svg",!0),r._modebardiv=r._paperdiv.append("div"),r._hoverpaper=r._paperdiv.append("svg").classed("main-svg",!0),!r._uid){var i={};n.selectAll("defs").each(function(){this.id&&(i[this.id.split("-")[1]]=1)}),r._uid=o.randstr(i)}r._paperdiv.selectAll(".main-svg").attr(v.svgAttrs),r._defs=r._paper.append("defs").attr("id","defs-"+r._uid),r._clips=r._defs.append("g").classed("clips",!0),r._topdefs=r._toppaper.append("defs").attr("id","topdefs-"+r._uid),r._topclips=r._topdefs.append("g").classed("clips",!0),r._bgLayer=r._paper.append("g").classed("bglayer",!0),r._draggers=r._paper.append("g").classed("draglayer",!0);var a=r._paper.append("g").classed("layer-below",!0);r._imageLowerLayer=a.append("g").classed("imagelayer",!0),r._shapeLowerLayer=a.append("g").classed("shapelayer",!0),r._cartesianlayer=r._paper.append("g").classed("cartesianlayer",!0),r._polarlayer=r._paper.append("g").classed("polarlayer",!0),r._ternarylayer=r._paper.append("g").classed("ternarylayer",!0),r._geolayer=r._paper.append("g").classed("geolayer",!0),r._funnelarealayer=r._paper.append("g").classed("funnelarealayer",!0),r._pielayer=r._paper.append("g").classed("pielayer",!0),r._treemaplayer=r._paper.append("g").classed("treemaplayer",!0),r._sunburstlayer=r._paper.append("g").classed("sunburstlayer",!0),r._indicatorlayer=r._toppaper.append("g").classed("indicatorlayer",!0),r._glimages=r._paper.append("g").classed("glimages",!0);var s=r._toppaper.append("g").classed("layer-above",!0);r._imageUpperLayer=s.append("g").classed("imagelayer",!0),r._shapeUpperLayer=s.append("g").classed("shapelayer",!0),r._infolayer=r._toppaper.append("g").classed("infolayer",!0),r._menulayer=r._toppaper.append("g").classed("menulayer",!0),r._zoomlayer=r._toppaper.append("g").classed("zoomlayer",!0),r._hoverlayer=r._hoverpaper.append("g").classed("hoverlayer",!0),r._modebardiv.classed("modebar-container",!0).style("position","absolute").style("top","0px").style("right","0px"),t.emit("plotly_framework")}r.animate=function(t,e,r){if(t=o.getGraphDiv(t),!o.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t+". It's likely that you've failed to create a plot before animating it. For more details, see https://plot.ly/javascript/animations/");var n=t._transitionData;n._frameQueue||(n._frameQueue=[]);var i=(r=h.supplyAnimationDefaults(r)).transition,a=r.frame;function s(t){return Array.isArray(i)?t>=i.length?i[0]:i[t]:i}function l(t){return Array.isArray(a)?t>=a.length?a[0]:a[t]:a}function u(t,e){var r=0;return function(){if(t&&++r===e)return t()}}return void 0===n._frameWaitingCnt&&(n._frameWaitingCnt=0),new Promise(function(a,c){function p(){n._currentFrame&&n._currentFrame.onComplete&&n._currentFrame.onComplete();var e=n._currentFrame=n._frameQueue.shift();if(e){var r=e.name?e.name.toString():null;t._fullLayout._currentFrame=r,n._lastFrameAt=Date.now(),n._timeToNext=e.frameOpts.duration,h.transition(t,e.frame.data,e.frame.layout,k.coerceTraceIndices(t,e.frame.traces),e.frameOpts,e.transitionOpts).then(function(){e.onComplete&&e.onComplete()}),t.emit("plotly_animatingframe",{name:r,frame:e.frame,animation:{frame:e.frameOpts,transition:e.transitionOpts}})}else t.emit("plotly_animated"),window.cancelAnimationFrame(n._animationRaf),n._animationRaf=null}function f(){t.emit("plotly_animating"),n._lastFrameAt=-1/0,n._timeToNext=0,n._runningTransitions=0,n._currentFrame=null;var e=function(){n._animationRaf=window.requestAnimationFrame(e),Date.now()-n._lastFrameAt>n._timeToNext&&p()};e()}var d,m,y=0;function g(t){return Array.isArray(i)?y>=i.length?t.transitionOpts=i[y]:t.transitionOpts=i[0]:t.transitionOpts=i,y++,t}var v=[],_=null==e,x=Array.isArray(e);if(_||x||!o.isPlainObject(e)){if(_||-1!==["string","number"].indexOf(typeof e))for(d=0;d<n._frames.length;d++)(m=n._frames[d])&&(_||String(m.group)===String(e))&&v.push({type:"byname",name:String(m.name),data:g({name:m.name})});else if(x)for(d=0;d<e.length;d++){var b=e[d];-1!==["number","string"].indexOf(typeof b)?(b=String(b),v.push({type:"byname",name:b,data:g({name:b})})):o.isPlainObject(b)&&v.push({type:"object",data:g(o.extendFlat({},b))})}}else v.push({type:"object",data:g(o.extendFlat({},e))});for(d=0;d<v.length;d++)if("byname"===(m=v[d]).type&&!n._frameHash[m.data.name])return o.warn('animate failure: frame not found: "'+m.data.name+'"'),void c();-1!==["next","immediate"].indexOf(r.mode)&&function(){if(0!==n._frameQueue.length){for(;n._frameQueue.length;){var e=n._frameQueue.pop();e.onInterrupt&&e.onInterrupt()}t.emit("plotly_animationinterrupted",[])}}(),"reverse"===r.direction&&v.reverse();var w=t._fullLayout._currentFrame;if(w&&r.fromcurrent){var T=-1;for(d=0;d<v.length;d++)if("byname"===(m=v[d]).type&&m.name===w){T=d;break}if(T>0&&T<v.length-1){var A=[];for(d=0;d<v.length;d++)m=v[d],("byname"!==v[d].type||d>T)&&A.push(m);v=A}}v.length>0?function(e){if(0!==e.length){for(var i=0;i<e.length;i++){var o;o="byname"===e[i].type?h.computeFrame(t,e[i].name):e[i].data;var p=l(i),d=s(i);d.duration=Math.min(d.duration,p.duration);var m={frame:o,name:e[i].name,frameOpts:p,transitionOpts:d};i===e.length-1&&(m.onComplete=u(a,2),m.onInterrupt=c),n._frameQueue.push(m)}"immediate"===r.mode&&(n._lastFrameAt=-1/0),n._animationRaf||f()}}(v):(t.emit("plotly_animated"),a())})},r.addFrames=function(t,e,r){if(t=o.getGraphDiv(t),null==e)return Promise.resolve();if(!o.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t+". It's likely that you've failed to create a plot before adding frames. For more details, see https://plot.ly/javascript/animations/");var n,i,a,s,l=t._transitionData._frames,c=t._transitionData._frameHash;if(!Array.isArray(e))throw new Error("addFrames failure: frameList must be an Array of frame definitions"+e);var p=l.length+2*e.length,f=[],d={};for(n=e.length-1;n>=0;n--)if(o.isPlainObject(e[n])){var m=e[n].name,y=(c[m]||d[m]||{}).name,g=e[n].name,v=c[y]||d[y];y&&g&&"number"==typeof g&&v&&S<L&&(S++,o.warn('addFrames: overwriting frame "'+(c[y]||d[y]).name+'" with a frame whose name of type "number" also equates to "'+y+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),S===L&&o.warn("addFrames: This API call has yielded too many of these warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),d[m]={name:m},f.push({frame:h.supplyFrameDefaults(e[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:p+n})}f.sort(function(t,e){return t.index>e.index?-1:t.index<e.index?1:0});var _=[],x=[],b=l.length;for(n=f.length-1;n>=0;n--){if("number"==typeof(i=f[n].frame).name&&o.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!i.name)for(;c[i.name="frame "+t._transitionData._counter++];);if(c[i.name]){for(a=0;a<l.length&&(l[a]||{}).name!==i.name;a++);_.push({type:"replace",index:a,value:i}),x.unshift({type:"replace",index:a,value:l[a]})}else s=Math.max(0,Math.min(f[n].index,b)),_.push({type:"insert",index:s,value:i}),x.unshift({type:"delete",index:s}),b++}var w=h.modifyFrames,k=h.modifyFrames,T=[t,x],A=[t,_];return u&&u.add(t,w,T,k,A),h.modifyFrames(t,_)},r.deleteFrames=function(t,e){if(t=o.getGraphDiv(t),!o.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t);var r,n,i=t._transitionData._frames,a=[],s=[];if(!e)for(e=[],r=0;r<i.length;r++)e.push(r);for((e=e.slice()).sort(),r=e.length-1;r>=0;r--)n=e[r],a.push({type:"delete",index:n}),s.unshift({type:"insert",index:n,value:i[n]});var l=h.modifyFrames,c=h.modifyFrames,p=[t,s],f=[t,a];return u&&u.add(t,l,p,c,f),h.modifyFrames(t,a)},r.addTraces=function t(e,n,i){e=o.getGraphDiv(e);var a,s,l=[],c=r.deleteTraces,p=t,h=[e,l],f=[e,n];for(function(t,e,r){var n,i;if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if("undefined"==typeof e)throw new Error("traces must be defined.");for(Array.isArray(e)||(e=[e]),n=0;n<e.length;n++)if("object"!=typeof(i=e[n])||Array.isArray(i)||null===i)throw new Error("all values in traces array must be non-array objects");if("undefined"==typeof r||Array.isArray(r)||(r=[r]),"undefined"!=typeof r&&r.length!==e.length)throw new Error("if indices is specified, traces.length must equal indices.length")}(e,n,i),Array.isArray(n)||(n=[n]),n=n.map(function(t){return o.extendFlat({},t)}),k.cleanData(n),a=0;a<n.length;a++)e.data.push(n[a]);for(a=0;a<n.length;a++)l.push(-n.length+a);if("undefined"==typeof i)return s=r.redraw(e),u.add(e,c,h,p,f),s;Array.isArray(i)||(i=[i]);try{O(e,l,i)}catch(t){throw e.data.splice(e.data.length-n.length,n.length),t}return u.startSequence(e),u.add(e,c,h,p,f),s=r.moveTraces(e,l,i),u.stopSequence(e),s},r.deleteTraces=function t(e,n){e=o.getGraphDiv(e);var i,a,s=[],l=r.addTraces,c=t,p=[e,s,n],h=[e,n];if("undefined"==typeof n)throw new Error("indices must be an integer or array of integers.");for(Array.isArray(n)||(n=[n]),D(e,n,"indices"),(n=I(n,e.data.length-1)).sort(o.sorterDes),i=0;i<n.length;i+=1)a=e.data.splice(n[i],1)[0],s.push(a);var f=r.redraw(e);return u.add(e,l,p,c,h),f},r.extendTraces=function t(e,n,i,a){var s=R(e=o.getGraphDiv(e),n,i,a,function(t,e,r){var n,i;if(o.isTypedArray(t))if(r<0){var a=new t.constructor(0),s=F(t,e);r<0?(n=s,i=a):(n=a,i=s)}else if(n=new t.constructor(r),i=new t.constructor(t.length+e.length-r),r===e.length)n.set(e),i.set(t);else if(r<e.length){var l=e.length-r;n.set(e.subarray(l)),i.set(t),i.set(e.subarray(0,l),t.length)}else{var u=r-e.length,c=t.length-u;n.set(t.subarray(c)),n.set(e,u),i.set(t.subarray(0,c))}else n=t.concat(e),i=r>=0&&r<n.length?n.splice(0,n.length-r):[];return[n,i]}),l=r.redraw(e),c=[e,s.update,i,s.maxPoints];return u.add(e,r.prependTraces,c,t,arguments),l},r.moveTraces=function t(e,n,i){var a,s=[],l=[],c=t,p=t,h=[e=o.getGraphDiv(e),i,n],f=[e,n,i];if(O(e,n,i),n=Array.isArray(n)?n:[n],"undefined"==typeof i)for(i=[],a=0;a<n.length;a++)i.push(-n.length+a);for(i=Array.isArray(i)?i:[i],n=I(n,e.data.length-1),i=I(i,e.data.length-1),a=0;a<e.data.length;a++)-1===n.indexOf(a)&&s.push(e.data[a]);for(a=0;a<n.length;a++)l.push({newIndex:i[a],trace:e.data[n[a]]});for(l.sort(function(t,e){return t.newIndex-e.newIndex}),a=0;a<l.length;a+=1)s.splice(l[a].newIndex,0,l[a].trace);e.data=s;var d=r.redraw(e);return u.add(e,c,h,p,f),d},r.prependTraces=function t(e,n,i,a){var s=R(e=o.getGraphDiv(e),n,i,a,function(t,e,r){var n,i;if(o.isTypedArray(t))if(r<=0){var a=new t.constructor(0),s=F(e,t);r<0?(n=s,i=a):(n=a,i=s)}else if(n=new t.constructor(r),i=new t.constructor(t.length+e.length-r),r===e.length)n.set(e),i.set(t);else if(r<e.length){var l=e.length-r;n.set(e.subarray(0,l)),i.set(e.subarray(l)),i.set(t,l)}else{var u=r-e.length;n.set(e),n.set(t.subarray(0,u),e.length),i.set(t.subarray(u))}else n=e.concat(t),i=r>=0&&r<n.length?n.splice(r,n.length):[];return[n,i]}),l=r.redraw(e),c=[e,s.update,i,s.maxPoints];return u.add(e,r.extendTraces,c,t,arguments),l},r.newPlot=function(t,e,n,i){return t=o.getGraphDiv(t),h.cleanPlot([],{},t._fullData||[],t._fullLayout||{}),h.purge(t),r.plot(t,e,n,i)},r.plot=function(t,e,i,a){var s;if(t=o.getGraphDiv(t),l.init(t),o.isPlainObject(e)){var u=e;e=u.data,i=u.layout,a=u.config,s=u.frames}if(!1===l.triggerHandler(t,"plotly_beforeplot",[e,i,a]))return Promise.reject();e||i||o.isPlotDiv(t)||o.warn("Calling Plotly.plot as if redrawing but this container doesn't yet have a plot.",t),P(t,a),i||(i={}),n.select(t).classed("js-plotly-plot",!0),m.makeTester(),Array.isArray(t._promises)||(t._promises=[]);var p=0===(t.data||[]).length&&Array.isArray(e);Array.isArray(e)&&(k.cleanData(e),p?t.data=e:t.data.push.apply(t.data,e),t.empty=!1),t.layout&&!p||(t.layout=k.cleanLayout(i)),h.supplyDefaults(t);var y=t._fullLayout,v=y._has("cartesian");if(!y._has("polar")&&e&&e[0]&&e[0].r)return o.log("Legacy polar charts are deprecated!"),function(t,e,r){var i=n.select(t).selectAll(".plot-container").data([0]);i.enter().insert("div",":first-child").classed("plot-container plotly",!0);var a=i.selectAll(".svg-container").data([0]);a.enter().append("div").classed("svg-container",!0).style("position","relative"),a.html(""),e&&(t.data=e),r&&(t.layout=r),f.manager.fillLayout(t),a.style({width:t._fullLayout.width+"px",height:t._fullLayout.height+"px"}),t.framework=f.manager.framework(t),t.framework({data:t.data,layout:t.layout},a.node()),t.framework.setUndoPoint();var s=t.framework.svg(),l=1,u=t._fullLayout.title?t._fullLayout.title.text:"";""!==u&&u||(l=0);var c=function(){this.call(_.convertToTspans,t)},p=s.select(".title-group text").call(c);if(t._context.edits.titleText){var d=o._(t,"Click to enter Plot title");u&&u!==d||(l=.2,p.attr({"data-unformatted":d}).text(d).style({opacity:l}).on("mouseover.opacity",function(){n.select(this).transition().duration(100).style("opacity",1)}).on("mouseout.opacity",function(){n.select(this).transition().duration(1e3).style("opacity",0)}));var m=function(){this.call(_.makeEditable,{gd:t}).on("edit",function(e){t.framework({layout:{title:{text:e}}}),this.text(e).call(c),this.call(m)}).on("cancel",function(){var t=this.attr("data-unformatted");this.text(t).call(c)})};p.call(m)}return t._context.setBackground(t,t._fullLayout.paper_bgcolor),h.addLinks(t),Promise.resolve()}(t,e,i);y._replotting=!0,p&&lt(t),t.framework!==lt&&(t.framework=lt,lt(t)),m.initGradients(t),p&&d.saveShowSpikeInitial(t);var x=!t.calcdata||t.calcdata.length!==(t._fullData||[]).length;x&&h.doCalcdata(t);for(var b=0;b<t.calcdata.length;b++)t.calcdata[b][0].trace=t._fullData[b];t._context.responsive?t._responsiveChartHandler||(t._responsiveChartHandler=function(){o.isHidden(t)||h.resize(t)},window.addEventListener("resize",t._responsiveChartHandler)):o.clearResponsive(t);var w=o.extendFlat({},y._size),A=0;function M(){if(h.clearAutoMarginIds(t),T.drawMarginPushers(t),d.allowAutoMargin(t),y._has("pie"))for(var e=t._fullData,r=0;r<e.length;r++){var n=e[r];"pie"===n.type&&n.automargin&&h.allowAutoMargin(t,"pie."+n.uid+".automargin")}return h.doAutoMargin(t),h.previousPromises(t)}function S(){t._transitioning||(T.doAutoRangeAndConstraints(t),p&&d.saveRangeInitial(t),c.getComponentMethod("rangeslider","calcAutorange")(t))}var L=[h.previousPromises,function(){if(s)return r.addFrames(t,s)},function e(){for(var r=y._basePlotModules,n=0;n<r.length;n++)r[n].drawFramework&&r[n].drawFramework(t);if(!y._glcanvas&&y._has("gl")&&(y._glcanvas=y._glcontainer.selectAll(".gl-canvas").data([{key:"contextLayer",context:!0,pick:!1},{key:"focusLayer",context:!1,pick:!1},{key:"pickLayer",context:!1,pick:!0}],function(t){return t.key}),y._glcanvas.enter().append("canvas").attr("class",function(t){return"gl-canvas gl-canvas-"+t.key.replace("Layer","")}).style({position:"absolute",top:0,left:0,overflow:"visible","pointer-events":"none"})),y._glcanvas){y._glcanvas.attr("width",y.width).attr("height",y.height);var i=y._glcanvas.data()[0].regl;if(i&&(Math.floor(y.width)!==i._gl.drawingBufferWidth||Math.floor(y.height)!==i._gl.drawingBufferHeight)){var a="WebGL context buffer and canvas dimensions do not match due to browser/WebGL bug.";if(!A)return o.log(a+" Clearing graph and plotting again."),h.cleanPlot([],{},t._fullData,y),h.supplyDefaults(t),y=t._fullLayout,h.doCalcdata(t),A++,e();o.error(a)}}return"h"===y.modebar.orientation?y._modebardiv.style("height",null).style("width","100%"):y._modebardiv.style("width",null).style("height",y.height+"px"),h.previousPromises(t)},M,function(){if(h.didMarginChange(w,y._size))return o.syncOrAsync([M,T.layoutStyles],t)}];v&&L.push(function(){if(x)return o.syncOrAsync([c.getComponentMethod("shapes","calcAutorange"),c.getComponentMethod("annotations","calcAutorange"),S],t);S()}),L.push(T.layoutStyles),v&&L.push(function(){return d.draw(t,p?"":"redraw")}),L.push(T.drawData,T.finalDraw,g,h.addLinks,h.rehover,h.redrag,h.doAutoMargin,h.previousPromises);var E=o.syncOrAsync(L,t);return E&&E.then||(E=Promise.resolve()),E.then(function(){return C(t),t})},r.purge=function(t){var e=(t=o.getGraphDiv(t))._fullLayout||{},r=t._fullData||[];return h.cleanPlot([],{},r,e),h.purge(t),l.purge(t),e._container&&e._container.remove(),delete t._context,t},r.react=function(t,e,n,i){var a,l;t=o.getGraphDiv(t),k.clearPromiseQueue(t);var u=t._fullData,f=t._fullLayout;if(o.isPlotDiv(t)&&u&&f){if(o.isPlainObject(e)){var d=e;e=d.data,n=d.layout,i=d.config,a=d.frames}var m=!1;if(i){var y=o.extendDeep({},t._context);t._context=void 0,P(t,i),m=function t(e,r){var n;for(n in e)if("_"!==n.charAt(0)){var i=e[n],a=r[n];if(i!==a)if(o.isPlainObject(i)&&o.isPlainObject(a)){if(t(i,a))return!0}else{if(!Array.isArray(i)||!Array.isArray(a))return!0;if(i.length!==a.length)return!0;for(var s=0;s<i.length;s++)if(i[s]!==a[s]){if(!o.isPlainObject(i[s])||!o.isPlainObject(a[s]))return!0;if(t(i[s],a[s]))return!0}}}}(y,t._context)}t.data=e||[],k.cleanData(t.data),t.layout=n||{},k.cleanLayout(t.layout),function(t,e,r,n){var i,a,l,u,c,p,h,f,d=n._preGUI,m=[],y={};for(i in d){if(c=rt(i,tt)){if(a=c.attr||c.head+".uirevision",(u=(l=s(n,a).get())&&nt(a,e))&&u===l&&(null===(p=d[i])&&(p=void 0),ot(f=(h=s(e,i)).get(),p))){void 0===f&&"autorange"===i.substr(i.length-9)&&m.push(i.substr(0,i.length-10)),h.set(N(s(n,i).get()));continue}}else o.warn("unrecognized GUI edit: "+i);delete d[i],"range["===i.substr(i.length-8,6)&&(y[i.substr(0,i.length-9)]=1)}for(var g=0;g<m.length;g++){var v=m[g];if(y[v]){var _=s(e,v).get();_&&delete _.autorange}}var x=n._tracePreGUI;for(var b in x){var w,k=x[b],T=null;for(i in k){if(!T){var A=it(b,r);if(A<0){delete x[b];break}var M=at(b,t,(w=r[A]._fullInput).index);if(M<0){delete x[b];break}T=t[M]}if(c=rt(i,et)){if(c.attr?u=(l=s(n,c.attr).get())&&nt(c.attr,e):(l=w.uirevision,void 0===(u=T.uirevision)&&(u=e.uirevision)),u&&u===l&&(null===(p=k[i])&&(p=void 0),ot(f=(h=s(T,i)).get(),p))){h.set(N(s(w,i).get()));continue}}else o.warn("unrecognized GUI edit: "+i+" in trace uid "+b);delete k[i]}}}(t.data,t.layout,u,f),h.supplyDefaults(t,{skipUpdateCalc:!0});var g=t._fullData,v=t._fullLayout,_=void 0===v.datarevision,x=v.transition,b=function(t,e,r,n,i){var a=A.layoutFlags();return a.arrays={},a.rangesAltered={},a.nChanges=0,a.nChangesAnim=0,st(e,r,[],{getValObject:function(t){return p.getLayoutValObject(r,t)},flags:a,immutable:n,transition:i,gd:t}),(a.plot||a.calc)&&(a.layoutReplot=!0),i&&a.nChanges&&a.nChangesAnim&&(a.anim=a.nChanges===a.nChangesAnim?"all":"some"),a}(t,f,v,_,x),w=b.newDataRevision,M=function(t,e,r,n,i,a){var o=e.length===r.length;if(!i&&!o)return{fullReplot:!0,calc:!0};var s,l,u=A.traceFlags();u.arrays={},u.nChanges=0,u.nChangesAnim=0;var c={getValObject:function(t){var e=p.getTraceValObject(l,t);return!l._module.animatable&&e.anim&&(e.anim=!1),e},flags:u,immutable:n,transition:i,newDataRevision:a,gd:t},f={};for(s=0;s<e.length;s++)if(r[s]){if(l=r[s]._fullInput,h.hasMakesDataTransform(l)&&(l=r[s]),f[l.uid])continue;f[l.uid]=1,st(e[s]._fullInput,l,[],c)}return(u.calc||u.plot)&&(u.fullReplot=!0),i&&u.nChanges&&u.nChangesAnim&&(u.anim=u.nChanges===u.nChangesAnim&&o?"all":"some"),u}(t,u,g,_,x,w);J(t)&&(b.layoutReplot=!0),M.calc||b.calc?t.calcdata=void 0:h.supplyDefaultsUpdateCalc(t.calcdata,g);var S=[];if(a&&(t._transitionData={},h.createTransitionData(t),S.push(function(){return r.addFrames(t,a)})),v.transition&&!m&&(M.anim||b.anim))h.doCalcdata(t),T.doAutoRangeAndConstraints(t),S.push(function(){return h.transitionFromReact(t,M,b,f)});else if(M.fullReplot||b.layoutReplot||m)t._fullLayout._skipDefaults=!0,S.push(r.plot);else{for(var L in b.arrays){var E=b.arrays[L];if(E.length){var z=c.getComponentMethod(L,"drawOne");if(z!==o.noop)for(var I=0;I<E.length;I++)z(t,E[I]);else{var D=c.getComponentMethod(L,"draw");if(D===o.noop)throw new Error("cannot draw components: "+L);D(t)}}}S.push(h.previousPromises),M.style&&S.push(T.doTraceStyle),(M.colorbars||b.colorbars)&&S.push(T.doColorBars),b.legend&&S.push(T.doLegend),b.layoutstyle&&S.push(T.layoutStyles),b.axrange&&Z(S),b.ticks&&S.push(T.doTicksRelayout),b.modebar&&S.push(T.doModeBar),b.camera&&S.push(T.doCamera),S.push(C)}S.push(h.rehover,h.redrag),(l=o.syncOrAsync(S,t))&&l.then||(l=Promise.resolve(t))}else l=r.newPlot(t,e,n,i);return l.then(function(){return t.emit("plotly_react",{data:e,layout:n}),t})},r.redraw=function(t){if(t=o.getGraphDiv(t),!o.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t);return k.cleanData(t.data),k.cleanLayout(t.layout),t.calcdata=void 0,r.plot(t).then(function(){return t.emit("plotly_redraw"),t})},r.relayout=G,r.restyle=B,r.setPlotConfig=function(t){return o.extendFlat(b,t)},r.update=$,r._guiRelayout=Q(G),r._guiRestyle=Q(B),r._guiUpdate=Q($),r._storeDirectGUIEdit=function(t,e,r){for(var n in r)j(n,s(t,n).get(),r[n],e)}},{"../components/color":50,"../components/drawing":71,"../constants/xmlns_namespaces":148,"../lib":169,"../lib/events":161,"../lib/queue":183,"../lib/svg_text_utils":190,"../plots/cartesian/axes":213,"../plots/cartesian/constants":219,"../plots/cartesian/graph_interact":222,"../plots/cartesian/select":230,"../plots/plots":252,"../plots/polar/legacy":255,"../registry":261,"./edit_types":196,"./helpers":197,"./manage_arrays":199,"./plot_config":201,"./plot_schema":202,"./subroutines":204,d3:14,"fast-isnumeric":16,"has-hover":18}],201:[function(t,e,r){"use strict";var n={staticPlot:{valType:"boolean",dflt:!1},plotlyServerURL:{valType:"string",dflt:"https://plot.ly"},editable:{valType:"boolean",dflt:!1},edits:{annotationPosition:{valType:"boolean",dflt:!1},annotationTail:{valType:"boolean",dflt:!1},annotationText:{valType:"boolean",dflt:!1},axisTitleText:{valType:"boolean",dflt:!1},colorbarPosition:{valType:"boolean",dflt:!1},colorbarTitleText:{valType:"boolean",dflt:!1},legendPosition:{valType:"boolean",dflt:!1},legendText:{valType:"boolean",dflt:!1},shapePosition:{valType:"boolean",dflt:!1},titleText:{valType:"boolean",dflt:!1}},autosizable:{valType:"boolean",dflt:!1},responsive:{valType:"boolean",dflt:!1},fillFrame:{valType:"boolean",dflt:!1},frameMargins:{valType:"number",dflt:0,min:0,max:.5},scrollZoom:{valType:"flaglist",flags:["cartesian","gl3d","geo","mapbox"],extras:[!0,!1],dflt:"gl3d+geo+mapbox"},doubleClick:{valType:"enumerated",values:[!1,"reset","autosize","reset+autosize"],dflt:"reset+autosize"},doubleClickDelay:{valType:"number",dflt:300,min:0},showAxisDragHandles:{valType:"boolean",dflt:!0},showAxisRangeEntryBoxes:{valType:"boolean",dflt:!0},showTips:{valType:"boolean",dflt:!0},showLink:{valType:"boolean",dflt:!1},linkText:{valType:"string",dflt:"Edit chart",noBlank:!0},sendData:{valType:"boolean",dflt:!0},showSources:{valType:"any",dflt:!1},displayModeBar:{valType:"enumerated",values:["hover",!0,!1],dflt:"hover"},showSendToCloud:{valType:"boolean",dflt:!1},showEditInChartStudio:{valType:"boolean",dflt:!1},modeBarButtonsToRemove:{valType:"any",dflt:[]},modeBarButtonsToAdd:{valType:"any",dflt:[]},modeBarButtons:{valType:"any",dflt:!1},toImageButtonOptions:{valType:"any",dflt:{}},displaylogo:{valType:"boolean",dflt:!0},watermark:{valType:"boolean",dflt:!1},plotGlPixelRatio:{valType:"number",dflt:2,min:1,max:4},setBackground:{valType:"any",dflt:"transparent"},topojsonURL:{valType:"string",noBlank:!0,dflt:"https://cdn.plot.ly/"},mapboxAccessToken:{valType:"string",dflt:null},logging:{valType:"integer",min:0,max:2,dflt:1},notifyOnLogging:{valType:"integer",min:0,max:2,dflt:0},queueLength:{valType:"integer",min:0,dflt:0},globalTransforms:{valType:"any",dflt:[]},locale:{valType:"string",dflt:"en-US"},locales:{valType:"any",dflt:{}}},i={};!function t(e,r){for(var n in e){var i=e[n];i.valType?r[n]=i.dflt:(r[n]||(r[n]={}),t(i,r[n]))}}(n,i),e.exports={configAttributes:n,dfltConfig:i}},{}],202:[function(t,e,r){"use strict";var n=t("../registry"),i=t("../lib"),a=t("../plots/attributes"),o=t("../plots/layout_attributes"),s=t("../plots/frame_attributes"),l=t("../plots/animation_attributes"),u=t("./plot_config").configAttributes,c=t("../plots/polar/legacy/area_attributes"),p=t("../plots/polar/legacy/axis_attributes"),h=t("./edit_types"),f=i.extendFlat,d=i.extendDeepAll,m=i.isPlainObject,y=i.isArrayOrTypedArray,g=i.nestedProperty,v=i.valObjectMeta,_="_isSubplotObj",x="_isLinkedToArray",b=[_,x,"_arrayAttrRegexps","_deprecated"];function w(t,e,r){if(!t)return!1;if(t._isLinkedToArray)if(k(e[r]))r++;else if(r<e.length)return!1;for(;r<e.length;r++){var n=t[e[r]];if(!m(n))break;if(t=n,r===e.length-1)break;if(t._isLinkedToArray){if(!k(e[++r]))return!1}else if("info_array"===t.valType){var i=e[++r];if(!k(i))return!1;var a=t.items;if(Array.isArray(a)){if(i>=a.length)return!1;if(2===t.dimensions){if(r++,e.length===r)return t;var o=e[r];if(!k(o))return!1;t=a[i][o]}else t=a[i]}else t=a}}return t}function k(t){return t===Math.round(t)&&t>=0}function T(){var t,e,r={};for(t in d(r,o),n.subplotsRegistry){if((e=n.subplotsRegistry[t]).layoutAttributes)if(Array.isArray(e.attr))for(var i=0;i<e.attr.length;i++)S(r,e,e.attr[i]);else S(r,e,"subplot"===e.attr?e.name:e.attr)}for(t in r=function(t){return f(t,{radialaxis:p.radialaxis,angularaxis:p.angularaxis}),f(t,p.layout),t}(r),n.componentsRegistry){var a=(e=n.componentsRegistry[t]).schema;if(a&&(a.subplots||a.layout)){var s=a.subplots;if(s&&s.xaxis&&!s.yaxis)for(var l in s.xaxis)delete r.yaxis[l]}else"colorscale"===e.name?d(r,e.layoutAttributes):e.layoutAttributes&&L(r,e.layoutAttributes,e.name)}return{layoutAttributes:M(r)}}function A(){var t={frames:d({},s)};return M(t),t.frames}function M(t){return function(t){r.crawl(t,function(t,e,n){r.isValObject(t)?"data_array"===t.valType?(t.role="data",n[e+"src"]={valType:"string",editType:"none"}):!0===t.arrayOk&&(n[e+"src"]={valType:"string",editType:"none"}):m(t)&&(t.role="object")})}(t),function(t){r.crawl(t,function(t,e,r){if(!t)return;var n=t[x];if(!n)return;delete t[x],r[e]={items:{}},r[e].items[n]=t,r[e].role="object"})}(t),function(t){!function t(e){for(var r in e)if(m(e[r]))t(e[r]);else if(Array.isArray(e[r]))for(var n=0;n<e[r].length;n++)t(e[r][n]);else e[r]instanceof RegExp&&(e[r]=e[r].toString())}(t)}(t),t}function S(t,e,r){var n=g(t,r),i=d({},e.layoutAttributes);i[_]=!0,n.set(i)}function L(t,e,r){var n=g(t,r);n.set(d(n.get()||{},e))}r.IS_SUBPLOT_OBJ=_,r.IS_LINKED_TO_ARRAY=x,r.DEPRECATED="_deprecated",r.UNDERSCORE_ATTRS=b,r.get=function(){var t={};n.allTypes.concat("area").forEach(function(e){t[e]=function(t){var e,i;"area"===t?(e={attributes:c},i={}):(e=n.modules[t]._module,i=e.basePlotModule);var o={type:null},s=d({},a),l=d({},e.attributes);r.crawl(l,function(t,e,r,n,i){g(s,i).set(void 0),void 0===t&&g(l,i).set(void 0)}),d(o,s),n.traceIs(t,"noOpacity")&&delete o.opacity;n.traceIs(t,"showLegend")||(delete o.showlegend,delete o.legendgroup);n.traceIs(t,"noHover")&&(delete o.hoverinfo,delete o.hoverlabel);e.selectPoints||delete o.selectedpoints;d(o,l),i.attributes&&d(o,i.attributes);o.type=t;var u={meta:e.meta||{},categories:e.categories||{},animatable:Boolean(e.animatable),type:t,attributes:M(o)};if(e.layoutAttributes){var p={};d(p,e.layoutAttributes),u.layoutAttributes=M(p)}e.animatable||r.crawl(u,function(t){r.isValObject(t)&&"anim"in t&&delete t.anim});return u}(e)});var e={};return Object.keys(n.transformsRegistry).forEach(function(t){e[t]=function(t){var e=n.transformsRegistry[t],r=d({},e.attributes);return Object.keys(n.componentsRegistry).forEach(function(e){var i=n.componentsRegistry[e];i.schema&&i.schema.transforms&&i.schema.transforms[t]&&Object.keys(i.schema.transforms[t]).forEach(function(e){L(r,i.schema.transforms[t][e],e)})}),{attributes:M(r)}}(t)}),{defs:{valObjects:v,metaKeys:b.concat(["description","role","editType","impliedEdits"]),editType:{traces:h.traces,layout:h.layout},impliedEdits:{}},traces:t,layout:T(),transforms:e,frames:A(),animation:M(l),config:M(u)}},r.crawl=function(t,e,n,i){var a=n||0;i=i||"",Object.keys(t).forEach(function(n){var o=t[n];if(-1===b.indexOf(n)){var s=(i?i+".":"")+n;e(o,n,t,a,s),r.isValObject(o)||m(o)&&"impliedEdits"!==n&&r.crawl(o,e,a+1,s)}})},r.isValObject=function(t){return t&&void 0!==t.valType},r.findArrayAttributes=function(t){var e,n,i=[],o=[],s=[];function l(t,r,a,l){o=o.slice(0,l).concat([r]),s=s.slice(0,l).concat([t&&t._isLinkedToArray]),t&&("data_array"===t.valType||!0===t.arrayOk)&&!("colorbar"===o[l-1]&&("ticktext"===r||"tickvals"===r))&&function t(e,r,a){var l=e[o[r]];var u=a+o[r];if(r===o.length-1)y(l)&&i.push(n+u);else if(s[r]){if(Array.isArray(l))for(var c=0;c<l.length;c++)m(l[c])&&t(l[c],r+1,u+"["+c+"].")}else m(l)&&t(l,r+1,u+".")}(e,0,"")}e=t,n="",r.crawl(a,l),t._module&&t._module.attributes&&r.crawl(t._module.attributes,l);var u=t.transforms;if(u)for(var c=0;c<u.length;c++){var p=u[c],h=p._module;h&&(n="transforms["+c+"].",e=p,r.crawl(h.attributes,l))}return i},r.getTraceValObject=function(t,e){var r,i,o=e[0],s=1;if("transforms"===o){if(1===e.length)return a.transforms;var l=t.transforms;if(!Array.isArray(l)||!l.length)return!1;var u=e[1];if(!k(u)||u>=l.length)return!1;i=(r=(n.transformsRegistry[l[u].type]||{}).attributes)&&r[e[2]],s=3}else if("area"===t.type)i=c[o];else{var p=t._module;if(p||(p=(n.modules[t.type||a.type.dflt]||{})._module),!p)return!1;if(!(i=(r=p.attributes)&&r[o])){var h=p.basePlotModule;h&&h.attributes&&(i=h.attributes[o])}i||(i=a[o])}return w(i,e,s)},r.getLayoutValObject=function(t,e){return w(function(t,e){var r,i,a,s,l=t._basePlotModules;if(l){var u;for(r=0;r<l.length;r++){if((a=l[r]).attrRegex&&a.attrRegex.test(e)){if(a.layoutAttrOverrides)return a.layoutAttrOverrides;!u&&a.layoutAttributes&&(u=a.layoutAttributes)}var c=a.baseLayoutAttrOverrides;if(c&&e in c)return c[e]}if(u)return u}var h=t._modules;if(h)for(r=0;r<h.length;r++)if((s=h[r].layoutAttributes)&&e in s)return s[e];for(i in n.componentsRegistry){if("colorscale"===(a=n.componentsRegistry[i]).name&&0===e.indexOf("coloraxis"))return a.layoutAttributes[e];if(!a.schema&&e===a.name)return a.layoutAttributes}if(e in o)return o[e];if("radialaxis"===e||"angularaxis"===e)return p[e];return p.layout[e]||!1}(t,e[0]),e,1)}},{"../lib":169,"../plots/animation_attributes":208,"../plots/attributes":210,"../plots/frame_attributes":240,"../plots/layout_attributes":243,"../plots/polar/legacy/area_attributes":253,"../plots/polar/legacy/axis_attributes":254,"../registry":261,"./edit_types":196,"./plot_config":201}],203:[function(t,e,r){"use strict";var n=t("../lib"),i=t("../plots/attributes"),a="templateitemname",o={name:{valType:"string",editType:"none"}};function s(t){return t&&"string"==typeof t}function l(t){var e=t.length-1;return"s"!==t.charAt(e)&&n.warn("bad argument to arrayDefaultKey: "+t),t.substr(0,t.length-1)+"defaults"}o[a]={valType:"string",editType:"calc"},r.templatedArray=function(t,e){return e._isLinkedToArray=t,e.name=o.name,e[a]=o[a],e},r.traceTemplater=function(t){var e,r,a={};for(e in t)r=t[e],Array.isArray(r)&&r.length&&(a[e]=0);return{newTrace:function(o){var s={type:e=n.coerce(o,{},i,"type"),_template:null};if(e in a){r=t[e];var l=a[e]%r.length;a[e]++,s._template=r[l]}return s}}},r.newContainer=function(t,e,r){var i=t._template,a=i&&(i[e]||r&&i[r]);return n.isPlainObject(a)||(a=null),t[e]={_template:a}},r.arrayTemplater=function(t,e,r){var n=t._template,i=n&&n[l(e)],o=n&&n[e];Array.isArray(o)&&o.length||(o=[]);var u={};return{newItem:function(t){var e={name:t.name,_input:t},n=e[a]=t[a];if(!s(n))return e._template=i,e;for(var l=0;l<o.length;l++){var c=o[l];if(c.name===n)return u[n]=1,e._template=c,e}return e[r]=t[r]||!1,e._template=!1,e},defaultItems:function(){for(var t=[],e=0;e<o.length;e++){var r=o[e],n=r.name;if(s(n)&&!u[n]){var i={_template:r,name:n,_input:{_templateitemname:n}};i[a]=r[a],t.push(i),u[n]=1}}return t}}},r.arrayDefaultKey=l,r.arrayEditor=function(t,e,r){var i=(n.nestedProperty(t,e).get()||[]).length,o=r._index,s=o>=i&&(r._input||{})._templateitemname;s&&(o=i);var l,u=e+"["+o+"]";function c(){l={},s&&(l[u]={},l[u][a]=s)}function p(t,e){s?n.nestedProperty(l[u],t).set(e):l[u+"."+t]=e}function h(){var t=l;return c(),t}return c(),{modifyBase:function(t,e){l[t]=e},modifyItem:p,getUpdateObj:h,applyUpdate:function(e,r){e&&p(e,r);var i=h();for(var a in i)n.nestedProperty(t,a).set(i[a])}}}},{"../lib":169,"../plots/attributes":210}],204:[function(t,e,r){"use strict";var n=t("d3"),i=t("../registry"),a=t("../plots/plots"),o=t("../lib"),s=t("../lib/clear_gl_canvases"),l=t("../components/color"),u=t("../components/drawing"),c=t("../components/titles"),p=t("../components/modebar"),h=t("../plots/cartesian/axes"),f=t("../constants/alignment"),d=t("../plots/cartesian/constraints"),m=d.enforce,y=d.clean,g=t("../plots/cartesian/autorange").doAutoRange,v="start",_="middle",x="end";function b(t,e,r){for(var n=0;n<r.length;n++){var i=r[n][0],a=r[n][1];if(!(i[0]>=t[1]||i[1]<=t[0])&&(a[0]<e[1]&&a[1]>e[0]))return!0}return!1}function w(t){var e,i,s,c,d,m,y=t._fullLayout,g=y._size,v=g.p,_=h.list(t,"",!0);if(y._paperdiv.style({width:t._context.responsive&&y.autosize&&!t._context._hasZeroWidth&&!t.layout.width?"100%":y.width+"px",height:t._context.responsive&&y.autosize&&!t._context._hasZeroHeight&&!t.layout.height?"100%":y.height+"px"}).selectAll(".main-svg").call(u.setSize,y.width,y.height),t._context.setBackground(t,y.paper_bgcolor),r.drawMainTitle(t),p.manage(t),!y._has("cartesian"))return a.previousPromises(t);function x(t,e,r){var n=t._lw/2;return"x"===t._id.charAt(0)?e?"top"===r?e._offset-v-n:e._offset+e._length+v+n:g.t+g.h*(1-(t.position||0))+n%1:e?"right"===r?e._offset+e._length+v+n:e._offset-v-n:g.l+g.w*(t.position||0)+n%1}for(e=0;e<_.length;e++){var w=(c=_[e])._anchorAxis;c._linepositions={},c._lw=u.crispRound(t,c.linewidth,1),c._mainLinePosition=x(c,w,c.side),c._mainMirrorPosition=c.mirror&&w?x(c,w,f.OPPOSITE_SIDE[c.side]):null}var T=[],M=[],S=[],L=1===l.opacity(y.paper_bgcolor)&&1===l.opacity(y.plot_bgcolor)&&y.paper_bgcolor===y.plot_bgcolor;for(i in y._plots)if((s=y._plots[i]).mainplot)s.bg&&s.bg.remove(),s.bg=void 0;else{var C=s.xaxis.domain,E=s.yaxis.domain,z=s.plotgroup;if(b(C,E,S)){var P=z.node(),I=s.bg=o.ensureSingle(z,"rect","bg");P.insertBefore(I.node(),P.childNodes[0]),M.push(i)}else z.select("rect.bg").remove(),S.push([C,E]),L||(T.push(i),M.push(i))}var D,O,R,F,B,N,U,j,V,q,G,H,Z,X=y._bgLayer.selectAll(".bg").data(T);for(X.enter().append("rect").classed("bg",!0),X.exit().remove(),X.each(function(t){y._plots[t].bg=n.select(this)}),e=0;e<M.length;e++)s=y._plots[M[e]],d=s.xaxis,m=s.yaxis,s.bg&&s.bg.call(u.setRect,d._offset-v,m._offset-v,d._length+2*v,m._length+2*v).call(l.fill,y.plot_bgcolor).style("stroke-width",0);if(!y._hasOnlyLargeSploms)for(i in y._plots){s=y._plots[i],d=s.xaxis,m=s.yaxis;var W,Y,K=s.clipId="clip"+y._uid+i+"plot",J=o.ensureSingleById(y._clips,"clipPath",K,function(t){t.classed("plotclip",!0).append("rect")});s.clipRect=J.select("rect").attr({width:d._length,height:m._length}),u.setTranslate(s.plot,d._offset,m._offset),s._hasClipOnAxisFalse?(W=null,Y=K):(W=K,Y=null),u.setClipUrl(s.plot,W,t),s.layerClipId=Y}function $(t){return"M"+D+","+t+"H"+O}function Q(t){return"M"+d._offset+","+t+"h"+d._length}function tt(t){return"M"+t+","+j+"V"+U}function et(t){return"M"+t+","+m._offset+"v"+m._length}function rt(t,e,r){if(!t.showline||i!==t._mainSubplot)return"";if(!t._anchorAxis)return r(t._mainLinePosition);var n=e(t._mainLinePosition);return t.mirror&&(n+=e(t._mainMirrorPosition)),n}for(i in y._plots){s=y._plots[i],d=s.xaxis,m=s.yaxis;var nt="M0,0";k(d,i)&&(B=A(d,"left",m,_),D=d._offset-(B?v+B:0),N=A(d,"right",m,_),O=d._offset+d._length+(N?v+N:0),R=x(d,m,"bottom"),F=x(d,m,"top"),!(Z=!d._anchorAxis||i!==d._mainSubplot)||"allticks"!==d.mirror&&"all"!==d.mirror||(d._linepositions[i]=[R,F]),nt=rt(d,$,Q),Z&&d.showline&&("all"===d.mirror||"allticks"===d.mirror)&&(nt+=$(R)+$(F)),s.xlines.style("stroke-width",d._lw+"px").call(l.stroke,d.showline?d.linecolor:"rgba(0,0,0,0)")),s.xlines.attr("d",nt);var it="M0,0";k(m,i)&&(G=A(m,"bottom",d,_),U=m._offset+m._length+(G?v:0),H=A(m,"top",d,_),j=m._offset-(H?v:0),V=x(m,d,"left"),q=x(m,d,"right"),!(Z=!m._anchorAxis||i!==m._mainSubplot)||"allticks"!==m.mirror&&"all"!==m.mirror||(m._linepositions[i]=[V,q]),it=rt(m,tt,et),Z&&m.showline&&("all"===m.mirror||"allticks"===m.mirror)&&(it+=tt(V)+tt(q)),s.ylines.style("stroke-width",m._lw+"px").call(l.stroke,m.showline?m.linecolor:"rgba(0,0,0,0)")),s.ylines.attr("d",it)}return h.makeClipPaths(t),a.previousPromises(t)}function k(t,e){return(t.ticks||t.showline)&&(e===t._mainSubplot||"all"===t.mirror||"allticks"===t.mirror)}function T(t,e,r){if(!r.showline||!r._lw)return!1;if("all"===r.mirror||"allticks"===r.mirror)return!0;var n=r._anchorAxis;if(!n)return!1;var i=f.FROM_BL[e];return r.side===e?n.domain[i]===t.domain[i]:r.mirror&&n.domain[1-i]===t.domain[1-i]}function A(t,e,r,n){if(T(t,e,r))return r._lw;for(var i=0;i<n.length;i++){var a=n[i];if(a._mainAxis===r._mainAxis&&T(t,e,a))return a._lw}return 0}function M(t,e){var r=t.title,n=t._size,i=0;switch(e===v?i=r.pad.l:e===x&&(i=-r.pad.r),r.xref){case"paper":return n.l+n.w*r.x+i;case"container":default:return t.width*r.x+i}}function S(t,e){var r=t.title,n=t._size,i=0;if("0em"!==e&&e?e===f.CAP_SHIFT+"em"&&(i=r.pad.t):i=-r.pad.b,"auto"===r.y)return n.t/2;switch(r.yref){case"paper":return n.t+n.h-n.h*r.y+i;case"container":default:return t.height-t.height*r.y+i}}r.layoutStyles=function(t){return o.syncOrAsync([a.doAutoMargin,w],t)},r.drawMainTitle=function(t){var e=t._fullLayout,r=function(t){var e=t.title,r=_;o.isRightAnchor(e)?r=x:o.isLeftAnchor(e)&&(r=v);return r}(e),n=function(t){var e=t.title,r="0em";o.isTopAnchor(e)?r=f.CAP_SHIFT+"em":o.isMiddleAnchor(e)&&(r=f.MID_SHIFT+"em");return r}(e);c.draw(t,"gtitle",{propContainer:e,propName:"title.text",placeholder:e._dfltTitle.plot,attributes:{x:M(e,r),y:S(e,n),"text-anchor":r,dy:n}})},r.doTraceStyle=function(t){var e,n=t.calcdata,o=[];for(e=0;e<n.length;e++){var l=n[e],u=l[0]||{},c=u.trace||{},p=c._module||{},h=p.arraysToCalcdata;h&&h(l,c);var f=p.editStyle;f&&o.push({fn:f,cd0:u})}if(o.length){for(e=0;e<o.length;e++){var d=o[e];d.fn(t,d.cd0)}s(t),r.redrawReglTraces(t)}return a.style(t),i.getComponentMethod("legend","draw")(t),a.previousPromises(t)},r.doColorBars=function(t){return i.getComponentMethod("colorbar","draw")(t),a.previousPromises(t)},r.layoutReplot=function(t){var e=t.layout;return t.layout=void 0,i.call("plot",t,"",e)},r.doLegend=function(t){return i.getComponentMethod("legend","draw")(t),a.previousPromises(t)},r.doTicksRelayout=function(t){return h.draw(t,"redraw"),t._fullLayout._hasOnlyLargeSploms&&(i.subplotsRegistry.splom.updateGrid(t),s(t),r.redrawReglTraces(t)),r.drawMainTitle(t),a.previousPromises(t)},r.doModeBar=function(t){var e=t._fullLayout;p.manage(t);for(var r=0;r<e._basePlotModules.length;r++){var n=e._basePlotModules[r].updateFx;n&&n(t)}return a.previousPromises(t)},r.doCamera=function(t){for(var e=t._fullLayout,r=e._subplots.gl3d,n=0;n<r.length;n++){var i=e[r[n]];i._scene.setViewport(i)}},r.drawData=function(t){var e=t._fullLayout;s(t);for(var n=e._basePlotModules,o=0;o<n.length;o++)n[o].plot(t);return r.redrawReglTraces(t),a.style(t),i.getComponentMethod("shapes","draw")(t),i.getComponentMethod("annotations","draw")(t),i.getComponentMethod("images","draw")(t),e._replotting=!1,a.previousPromises(t)},r.redrawReglTraces=function(t){var e=t._fullLayout;if(e._has("regl")){var r,n,i=t._fullData,a=[],s=[];for(e._hasOnlyLargeSploms&&e._splomGrid.draw(),r=0;r<i.length;r++){var l=i[r];!0===l.visible&&0!==l._length&&("splom"===l.type?e._splomScenes[l.uid].draw():"scattergl"===l.type?o.pushUnique(a,l.xaxis+l.yaxis):"scatterpolargl"===l.type&&o.pushUnique(s,l.subplot))}for(r=0;r<a.length;r++)(n=e._plots[a[r]])._scene&&n._scene.draw();for(r=0;r<s.length;r++)(n=e[s[r]]._subplot)._scene&&n._scene.draw()}},r.doAutoRangeAndConstraints=function(t){for(var e,r,n=t._fullLayout,i=h.list(t,"",!0),a=n._axisMatchGroups||[],s={},l=0;l<i.length;l++)e=i[l],y(t,e),g(t,e),s[e._id]=1;m(t);t:for(var u=0;u<a.length;u++){var c,p=a[u],f=null;for(c in p)if(s[(e=h.getFromId(t,c))._id]){if(!1===e.autorange)continue t;r=o.simpleMap(e.range,e.r2l),f?f[0]<f[1]?(f[0]=Math.min(f[0],r[0]),f[1]=Math.max(f[1],r[1])):(f[0]=Math.max(f[0],r[0]),f[1]=Math.min(f[1],r[1])):f=r}for(c in p)(e=h.getFromId(t,c)).range=o.simpleMap(f,e.l2r),e._input.range=e.range.slice(),e.setScale()}},r.finalDraw=function(t){i.getComponentMethod("rangeslider","draw")(t),i.getComponentMethod("rangeselector","draw")(t)},r.drawMarginPushers=function(t){i.getComponentMethod("legend","draw")(t),i.getComponentMethod("rangeselector","draw")(t),i.getComponentMethod("sliders","draw")(t),i.getComponentMethod("updatemenus","draw")(t),i.getComponentMethod("colorbar","draw")(t)}},{"../components/color":50,"../components/drawing":71,"../components/modebar":108,"../components/titles":137,"../constants/alignment":144,"../lib":169,"../lib/clear_gl_canvases":156,"../plots/cartesian/autorange":212,"../plots/cartesian/axes":213,"../plots/cartesian/constraints":220,"../plots/plots":252,"../registry":261,d3:14}],205:[function(t,e,r){"use strict";var n=t("../lib"),i=n.isPlainObject,a=t("./plot_schema"),o=t("../plots/plots"),s=t("../plots/attributes"),l=t("./plot_template"),u=t("./plot_config").dfltConfig;function c(t,e){t=n.extendDeep({},t);var r,a,o=Object.keys(t).sort();function s(e,r,n){if(i(r)&&i(e))c(e,r);else if(Array.isArray(r)&&Array.isArray(e)){var o=l.arrayTemplater({_template:t},n);for(a=0;a<r.length;a++){var s=r[a],u=o.newItem(s)._template;u&&c(u,s)}var p=o.defaultItems();for(a=0;a<p.length;a++)r.push(p[a]._template);for(a=0;a<r.length;a++)delete r[a].templateitemname}}for(r=0;r<o.length;r++){var u=o[r],h=t[u];if(u in e?s(h,e[u],u):e[u]=h,p(u)===u)for(var f in e){var d=p(f);f===d||d!==u||f in t||s(h,e[f],u)}}}function p(t){return t.replace(/[0-9]+$/,"")}function h(t,e,r,a,o){var s=o&&r(o);for(var u in t){var c=t[u],d=f(t,u,a),m=f(t,u,o),y=r(m);if(!y){var g=p(u);g!==u&&(y=r(m=f(t,g,o)))}if((!s||s!==y)&&!(!y||y._noTemplating||"data_array"===y.valType||y.arrayOk&&Array.isArray(c)))if(!y.valType&&i(c))h(c,e,r,d,m);else if(y._isLinkedToArray&&Array.isArray(c))for(var v=!1,_=0,x={},b=0;b<c.length;b++){var w=c[b];if(i(w)){var k=w.name;if(k)x[k]||(h(w,e,r,f(c,_,d),f(c,_,m)),_++,x[k]=1);else if(!v){var T=f(t,l.arrayDefaultKey(u),a),A=f(c,_,d);h(w,e,r,A,f(c,_,m));var M=n.nestedProperty(e,A);n.nestedProperty(e,T).set(M.get()),M.set(null),v=!0}}}else{n.nestedProperty(e,d).set(c)}}}function f(t,e,r){return r?Array.isArray(t)?r+"["+e+"]":r+"."+e:e}function d(t){for(var e=0;e<t.length;e++)if(i(t[e]))return!0}function m(t){var e;switch(t.code){case"data":e="The template has no key data.";break;case"layout":e="The template has no key layout.";break;case"missing":e=t.path?"There are no templates for item "+t.path+" with name "+t.templateitemname:"There are no templates for trace "+t.index+", of type "+t.traceType+".";break;case"unused":e=t.path?"The template item at "+t.path+" was not used in constructing the plot.":t.dataCount?"Some of the templates of type "+t.traceType+" were not used. The template has "+t.templateCount+" traces, the data only has "+t.dataCount+" of this type.":"The template has "+t.templateCount+" traces of type "+t.traceType+" but there are none in the data.";break;case"reused":e="Some of the templates of type "+t.traceType+" were used more than once. The template has "+t.templateCount+" traces, the data has "+t.dataCount+" of this type."}return t.msg=e,t}r.makeTemplate=function(t){t=n.isPlainObject(t)?t:n.getGraphDiv(t),t=n.extendDeep({_context:u},{data:t.data,layout:t.layout}),o.supplyDefaults(t);var e=t.data||[],r=t.layout||{};r._basePlotModules=t._fullLayout._basePlotModules,r._modules=t._fullLayout._modules;var l={data:{},layout:{}};e.forEach(function(t){var e={};h(t,e,function(t,e){return a.getTraceValObject(t,n.nestedProperty({},e).parts)}.bind(null,t));var r=n.coerce(t,{},s,"type"),i=l.data[r];i||(i=l.data[r]=[]),i.push(e)}),h(r,l.layout,function(t,e){return a.getLayoutValObject(t,n.nestedProperty({},e).parts)}.bind(null,r)),delete l.layout.template;var p=r.template;if(i(p)){var f,d,m,y,g,v,_=p.layout;i(_)&&c(_,l.layout);var x=p.data;if(i(x)){for(d in l.data)if(m=x[d],Array.isArray(m)){for(v=(g=l.data[d]).length,y=m.length,f=0;f<v;f++)c(m[f%y],g[f]);for(f=v;f<y;f++)g.push(n.extendDeep({},m[f]))}for(d in x)d in l.data||(l.data[d]=n.extendDeep([],x[d]))}}return l},r.validateTemplate=function(t,e){var r=n.extendDeep({},{_context:u,data:t.data,layout:t.layout}),a=r.layout||{};i(e)||(e=a.template||{});var s=e.layout,l=e.data,c=[];r.layout=a,r.layout.template=e,o.supplyDefaults(r);var h=r._fullLayout,y=r._fullData,g={};if(i(s)?(!function t(e,r){for(var n in e)if("_"!==n.charAt(0)&&i(e[n])){var a,o=p(n),s=[];for(a=0;a<r.length;a++)s.push(f(e,n,r[a])),o!==n&&s.push(f(e,o,r[a]));for(a=0;a<s.length;a++)g[s[a]]=1;t(e[n],s)}}(h,["layout"]),function t(e,r){for(var n in e)if(-1===n.indexOf("defaults")&&i(e[n])){var a=f(e,n,r);g[a]?t(e[n],a):c.push({code:"unused",path:a})}}(s,"layout")):c.push({code:"layout"}),i(l)){for(var v,_={},x=0;x<y.length;x++){var b=y[x];_[v=b.type]=(_[v]||0)+1,b._fullInput._template||c.push({code:"missing",index:b._fullInput.index,traceType:v})}for(v in l){var w=l[v].length,k=_[v]||0;w>k?c.push({code:"unused",traceType:v,templateCount:w,dataCount:k}):k>w&&c.push({code:"reused",traceType:v,templateCount:w,dataCount:k})}}else c.push({code:"data"});if(function t(e,r){for(var n in e)if("_"!==n.charAt(0)){var a=e[n],o=f(e,n,r);i(a)?(Array.isArray(e)&&!1===a._template&&a.templateitemname&&c.push({code:"missing",path:o,templateitemname:a.templateitemname}),t(a,o)):Array.isArray(a)&&d(a)&&t(a,o)}}({data:y,layout:h},""),c.length)return c.map(m)}},{"../lib":169,"../plots/attributes":210,"../plots/plots":252,"./plot_config":201,"./plot_schema":202,"./plot_template":203}],206:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("./plot_api"),a=t("../lib"),o=t("../snapshot/helpers"),s=t("../snapshot/tosvg"),l=t("../snapshot/svgtoimg"),u={format:{valType:"enumerated",values:["png","jpeg","webp","svg"],dflt:"png"},width:{valType:"number",min:1},height:{valType:"number",min:1},scale:{valType:"number",min:0,dflt:1},setBackground:{valType:"any",dflt:!1},imageDataOnly:{valType:"boolean",dflt:!1}};e.exports=function(t,e){var r,c,p,h;function f(t){return!(t in e)||a.validate(e[t],u[t])}if(e=e||{},a.isPlainObject(t)?(r=t.data||[],c=t.layout||{},p=t.config||{},h={}):(t=a.getGraphDiv(t),r=a.extendDeep([],t.data),c=a.extendDeep({},t.layout),p=t._context,h=t._fullLayout||{}),!f("width")&&null!==e.width||!f("height")&&null!==e.height)throw new Error("Height and width should be pixel values.");if(!f("format"))throw new Error("Image format is not jpeg, png, svg or webp.");var d={};function m(t,r){return a.coerce(e,d,u,t,r)}var y=m("format"),g=m("width"),v=m("height"),_=m("scale"),x=m("setBackground"),b=m("imageDataOnly"),w=document.createElement("div");w.style.position="absolute",w.style.left="-5000px",document.body.appendChild(w);var k=a.extendFlat({},c);g?k.width=g:null===e.width&&n(h.width)&&(k.width=h.width),v?k.height=v:null===e.height&&n(h.height)&&(k.height=h.height);var T=a.extendFlat({},p,{_exportedPlot:!0,staticPlot:!0,setBackground:x}),A=o.getRedrawFunc(w);function M(){return new Promise(function(t){setTimeout(t,o.getDelay(w._fullLayout))})}function S(){return new Promise(function(t,e){var r=s(w,y,_),n=w._fullLayout.width,u=w._fullLayout.height;if(i.purge(w),document.body.removeChild(w),"svg"===y)return t(b?r:o.encodeSVG(r));var c=document.createElement("canvas");c.id=a.randstr(),l({format:y,width:n,height:u,scale:_,canvas:c,svg:r,promise:!0}).then(t).catch(e)})}return new Promise(function(t,e){i.plot(w,r,k,T).then(A).then(M).then(S).then(function(e){t(function(t){return b?t.replace(o.IMAGE_URL_PREFIX,""):t}(e))}).catch(function(t){e(t)})})}},{"../lib":169,"../snapshot/helpers":265,"../snapshot/svgtoimg":267,"../snapshot/tosvg":269,"./plot_api":200,"fast-isnumeric":16}],207:[function(t,e,r){"use strict";var n=t("../lib"),i=t("../plots/plots"),a=t("./plot_schema"),o=t("./plot_config").dfltConfig,s=n.isPlainObject,l=Array.isArray,u=n.isArrayOrTypedArray;function c(t,e,r,i,a,o){o=o||[];for(var p=Object.keys(t),h=0;h<p.length;h++){var y=p[h];if("transforms"!==y){var g=o.slice();g.push(y);var v=t[y],_=e[y],x=m(r,y),b=(x||{}).valType,w="info_array"===b,k="colorscale"===b,T=(x||{}).items;if(d(r,y))if(s(v)&&s(_)&&"any"!==b)c(v,_,x,i,a,g);else if(w&&l(v)){v.length>_.length&&i.push(f("unused",a,g.concat(_.length)));var A,M,S,L,C,E=_.length,z=Array.isArray(T);if(z&&(E=Math.min(E,T.length)),2===x.dimensions)for(M=0;M<E;M++)if(l(v[M])){v[M].length>_[M].length&&i.push(f("unused",a,g.concat(M,_[M].length)));var P=_[M].length;for(A=0;A<(z?Math.min(P,T[M].length):P);A++)S=z?T[M][A]:T,L=v[M][A],C=_[M][A],n.validate(L,S)?C!==L&&C!==+L&&i.push(f("dynamic",a,g.concat(M,A),L,C)):i.push(f("value",a,g.concat(M,A),L))}else i.push(f("array",a,g.concat(M),v[M]));else for(M=0;M<E;M++)S=z?T[M]:T,L=v[M],C=_[M],n.validate(L,S)?C!==L&&C!==+L&&i.push(f("dynamic",a,g.concat(M),L,C)):i.push(f("value",a,g.concat(M),L))}else if(x.items&&!w&&l(v)){var I,D,O=T[Object.keys(T)[0]],R=[];for(I=0;I<_.length;I++){var F=_[I]._index||I;if((D=g.slice()).push(F),s(v[F])&&s(_[I])){R.push(F);var B=v[F],N=_[I];s(B)&&!1!==B.visible&&!1===N.visible?i.push(f("invisible",a,D)):c(B,N,O,i,a,D)}}for(I=0;I<v.length;I++)(D=g.slice()).push(I),s(v[I])?-1===R.indexOf(I)&&i.push(f("unused",a,D)):i.push(f("object",a,D,v[I]))}else!s(v)&&s(_)?i.push(f("object",a,g,v)):u(v)||!u(_)||w||k?y in e?n.validate(v,x)?"enumerated"===x.valType&&(x.coerceNumber&&v!==+_||v!==_)&&i.push(f("dynamic",a,g,v,_)):i.push(f("value",a,g,v)):i.push(f("unused",a,g,v)):i.push(f("array",a,g,v));else i.push(f("schema",a,g))}}return i}e.exports=function(t,e){var r,u,p=a.get(),h=[],d={_context:n.extendFlat({},o)};l(t)?(d.data=n.extendDeep([],t),r=t):(d.data=[],r=[],h.push(f("array","data"))),s(e)?(d.layout=n.extendDeep({},e),u=e):(d.layout={},u={},arguments.length>1&&h.push(f("object","layout"))),i.supplyDefaults(d);for(var m=d._fullData,y=r.length,g=0;g<y;g++){var v=r[g],_=["data",g];if(s(v)){var x=m[g],b=x.type,w=p.traces[b].attributes;w.type={valType:"enumerated",values:[b]},!1===x.visible&&!1!==v.visible&&h.push(f("invisible",_)),c(v,x,w,h,_);var k=v.transforms,T=x.transforms;if(k){l(k)||h.push(f("array",_,["transforms"])),_.push("transforms");for(var A=0;A<k.length;A++){var M=["transforms",A],S=k[A].type;if(s(k[A])){var L=p.transforms[S]?p.transforms[S].attributes:{};L.type={valType:"enumerated",values:Object.keys(p.transforms)},c(k[A],T[A],L,h,_,M)}else h.push(f("object",_,M))}}}else h.push(f("object",_))}return c(u,d._fullLayout,function(t,e){for(var r=t.layout.layoutAttributes,i=0;i<e.length;i++){var a=e[i],o=t.traces[a.type],s=o.layoutAttributes;s&&(a.subplot?n.extendFlat(r[o.attributes.subplot.dflt],s):n.extendFlat(r,s))}return r}(p,m),h,"layout"),0===h.length?void 0:h};var p={object:function(t,e){return("layout"===t&&""===e?"The layout argument":"data"===t[0]&&""===e?"Trace "+t[1]+" in the data argument":h(t)+"key "+e)+" must be linked to an object container"},array:function(t,e){return("data"===t?"The data argument":h(t)+"key "+e)+" must be linked to an array container"},schema:function(t,e){return h(t)+"key "+e+" is not part of the schema"},unused:function(t,e,r){var n=s(r)?"container":"key";return h(t)+n+" "+e+" did not get coerced"},dynamic:function(t,e,r,n){return[h(t)+"key",e,"(set to '"+r+"')","got reset to","'"+n+"'","during defaults."].join(" ")},invisible:function(t,e){return(e?h(t)+"item "+e:"Trace "+t[1])+" got defaulted to be not visible"},value:function(t,e,r){return[h(t)+"key "+e,"is set to an invalid value ("+r+")"].join(" ")}};function h(t){return l(t)?"In data trace "+t[1]+", ":"In "+t+", "}function f(t,e,r,i,a){var o,s;r=r||"",l(e)?(o=e[0],s=e[1]):(o=e,s=null);var u=function(t){if(!l(t))return String(t);for(var e="",r=0;r<t.length;r++){var n=t[r];"number"==typeof n?e=e.substr(0,e.length-1)+"["+n+"]":e+=n,r<t.length-1&&(e+=".")}return e}(r),c=p[t](e,u,i,a);return n.log(c),{code:t,container:o,trace:s,path:r,astr:u,msg:c}}function d(t,e){var r=g(e),n=r.keyMinusId,i=r.id;return!!(n in t&&t[n]._isSubplotObj&&i)||e in t}function m(t,e){return e in t?t[e]:t[g(e).keyMinusId]}var y=n.counterRegex("([a-z]+)");function g(t){var e=t.match(y);return{keyMinusId:e&&e[1],id:e&&e[2]}}},{"../lib":169,"../plots/plots":252,"./plot_config":201,"./plot_schema":202}],208:[function(t,e,r){"use strict";e.exports={mode:{valType:"enumerated",dflt:"afterall",values:["immediate","next","afterall"]},direction:{valType:"enumerated",values:["forward","reverse"],dflt:"forward"},fromcurrent:{valType:"boolean",dflt:!1},frame:{duration:{valType:"number",min:0,dflt:500},redraw:{valType:"boolean",dflt:!0}},transition:{duration:{valType:"number",min:0,dflt:500,editType:"none"},easing:{valType:"enumerated",dflt:"cubic-in-out",values:["linear","quad","cubic","sin","exp","circle","elastic","back","bounce","linear-in","quad-in","cubic-in","sin-in","exp-in","circle-in","elastic-in","back-in","bounce-in","linear-out","quad-out","cubic-out","sin-out","exp-out","circle-out","elastic-out","back-out","bounce-out","linear-in-out","quad-in-out","cubic-in-out","sin-in-out","exp-in-out","circle-in-out","elastic-in-out","back-in-out","bounce-in-out"],editType:"none"},ordering:{valType:"enumerated",values:["layout first","traces first"],dflt:"layout first",editType:"none"}}}},{}],209:[function(t,e,r){"use strict";var n=t("../lib"),i=t("../plot_api/plot_template");e.exports=function(t,e,r){var a,o,s=r.name,l=r.inclusionAttr||"visible",u=e[s],c=n.isArrayOrTypedArray(t[s])?t[s]:[],p=e[s]=[],h=i.arrayTemplater(e,s,l);for(a=0;a<c.length;a++){var f=c[a];n.isPlainObject(f)?o=h.newItem(f):(o=h.newItem({}))[l]=!1,o._index=a,!1!==o[l]&&r.handleItemDefaults(f,o,e,r),p.push(o)}var d=h.defaultItems();for(a=0;a<d.length;a++)(o=d[a])._index=p.length,r.handleItemDefaults({},o,e,r,{}),p.push(o);if(n.isArrayOrTypedArray(u)){var m=Math.min(u.length,p.length);for(a=0;a<m;a++)n.relinkPrivateKeys(p[a],u[a])}return p}},{"../lib":169,"../plot_api/plot_template":203}],210:[function(t,e,r){"use strict";var n=t("../components/fx/attributes");e.exports={type:{valType:"enumerated",values:[],dflt:"scatter",editType:"calc+clearAxisTypes",_noTemplating:!0},visible:{valType:"enumerated",values:[!0,!1,"legendonly"],dflt:!0,editType:"calc"},showlegend:{valType:"boolean",dflt:!0,editType:"style"},legendgroup:{valType:"string",dflt:"",editType:"style"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"style"},name:{valType:"string",editType:"style"},uid:{valType:"string",editType:"plot",anim:!0},ids:{valType:"data_array",editType:"calc",anim:!0},customdata:{valType:"data_array",editType:"calc"},meta:{valType:"any",arrayOk:!0,editType:"plot"},selectedpoints:{valType:"any",editType:"calc"},hoverinfo:{valType:"flaglist",flags:["x","y","z","text","name"],extras:["all","none","skip"],arrayOk:!0,dflt:"all",editType:"none"},hoverlabel:n.hoverlabel,stream:{token:{valType:"string",noBlank:!0,strict:!0,editType:"calc"},maxpoints:{valType:"number",min:0,max:1e4,dflt:500,editType:"calc"},editType:"calc"},transforms:{_isLinkedToArray:"transform",editType:"calc"},uirevision:{valType:"any",editType:"none"}}},{"../components/fx/attributes":80}],211:[function(t,e,r){"use strict";e.exports={xaxis:{valType:"subplotid",dflt:"x",editType:"calc+clearAxisTypes"},yaxis:{valType:"subplotid",dflt:"y",editType:"calc+clearAxisTypes"}}},{}],212:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../constants/numerical").FP_SAFE,o=t("../../registry");function s(t,e){var r,n,a=[],o=l(e),s=u(t,e),c=s.min,p=s.max;if(0===c.length||0===p.length)return i.simpleMap(e.range,e.r2l);var h=c[0].val,f=p[0].val;for(r=1;r<c.length&&h===f;r++)h=Math.min(h,c[r].val);for(r=1;r<p.length&&h===f;r++)f=Math.max(f,p[r].val);var d=!1;if(e.range){var m=i.simpleMap(e.range,e.r2l);d=m[1]<m[0]}"reversed"===e.autorange&&(d=!0,e.autorange=!0);var y,g,v,_,x,b,w=e.rangemode,k="tozero"===w,T="nonnegative"===w,A=e._length,M=A/10,S=0;for(r=0;r<c.length;r++)for(y=c[r],n=0;n<p.length;n++)(b=(g=p[n]).val-y.val)>0&&((x=A-o(y)-o(g))>M?b/x>S&&(v=y,_=g,S=b/x):b/A>S&&(v={val:y.val,pad:0},_={val:g.val,pad:0},S=b/A));if(h===f){var L=h-1,C=h+1;if(k)if(0===h)a=[0,1];else{var E=(h>0?p:c).reduce(function(t,e){return Math.max(t,o(e))},0),z=h/(1-Math.min(.5,E/A));a=h>0?[0,z]:[z,0]}else a=T?[Math.max(0,L),Math.max(1,C)]:[L,C]}else k?(v.val>=0&&(v={val:0,pad:0}),_.val<=0&&(_={val:0,pad:0})):T&&(v.val-S*o(v)<0&&(v={val:0,pad:0}),_.val<=0&&(_={val:1,pad:0})),S=(_.val-v.val)/(A-o(v)-o(_)),a=[v.val-S*o(v),_.val+S*o(_)];return d&&a.reverse(),i.simpleMap(a,e.l2r||Number)}function l(t){var e=t._length/20;return"domain"===t.constrain&&t._inputDomain&&(e*=(t._inputDomain[1]-t._inputDomain[0])/(t.domain[1]-t.domain[0])),function(t){return t.pad+(t.extrapad?e:0)}}function u(t,e){var r,n,i,a=e._id,o=t._fullData,s=t._fullLayout,l=[],u=[];function h(t,e){for(r=0;r<e.length;r++){var o=t[e[r]],s=(o._extremes||{})[a];if(!0===o.visible&&s){for(n=0;n<s.min.length;n++)i=s.min[n],c(l,i.val,i.pad,{extrapad:i.extrapad});for(n=0;n<s.max.length;n++)i=s.max[n],p(u,i.val,i.pad,{extrapad:i.extrapad})}}}return h(o,e._traceIndices),h(s.annotations||[],e._annIndices||[]),h(s.shapes||[],e._shapeIndices||[]),{min:l,max:u}}function c(t,e,r,n){h(t,e,r,n,d)}function p(t,e,r,n){h(t,e,r,n,m)}function h(t,e,r,n,i){for(var a=n.tozero,o=n.extrapad,s=!0,l=0;l<t.length&&s;l++){var u=t[l];if(i(u.val,e)&&u.pad>=r&&(u.extrapad||!o)){s=!1;break}i(e,u.val)&&u.pad<=r&&(o||!u.extrapad)&&(t.splice(l,1),l--)}if(s){var c=a&&0===e;t.push({val:e,pad:c?0:r,extrapad:!c&&o})}}function f(t){return n(t)&&Math.abs(t)<a}function d(t,e){return t<=e}function m(t,e){return t>=e}e.exports={getAutoRange:s,makePadFn:l,doAutoRange:function(t,e){if(e.setScale(),e.autorange){e.range=s(t,e),e._r=e.range.slice(),e._rl=i.simpleMap(e._r,e.r2l);var r=e._input,n={};n[e._attr+".range"]=e.range,n[e._attr+".autorange"]=e.autorange,o.call("_storeDirectGUIEdit",t.layout,t._fullLayout._preGUI,n),r.range=e.range.slice(),r.autorange=e.autorange}var a=e._anchorAxis;if(a&&a.rangeslider){var l=a.rangeslider[e._name];l&&"auto"===l.rangemode&&(l.range=s(t,e)),a._input.rangeslider[e._name]=i.extendFlat({},l)}},findExtremes:function(t,e,r){r||(r={});t._m||t.setScale();var i,o,s,l,u,h,d,m,y,g=[],v=[],_=e.length,x=r.padded||!1,b=r.tozero&&("linear"===t.type||"-"===t.type),w="log"===t.type,k=!1,T=r.vpadLinearized||!1;function A(t){if(Array.isArray(t))return k=!0,function(e){return Math.max(Number(t[e]||0),0)};var e=Math.max(Number(t||0),0);return function(){return e}}var M=A((t._m>0?r.ppadplus:r.ppadminus)||r.ppad||0),S=A((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),L=A(r.vpadplus||r.vpad),C=A(r.vpadminus||r.vpad);if(!k){if(m=1/0,y=-1/0,w)for(i=0;i<_;i++)(o=e[i])<m&&o>0&&(m=o),o>y&&o<a&&(y=o);else for(i=0;i<_;i++)(o=e[i])<m&&o>-a&&(m=o),o>y&&o<a&&(y=o);e=[m,y],_=2}var E={tozero:b,extrapad:x};function z(r){s=e[r],n(s)&&(h=M(r),d=S(r),T?(l=t.c2l(s)-C(r),u=t.c2l(s)+L(r)):(m=s-C(r),y=s+L(r),w&&m<y/10&&(m=y/10),l=t.c2l(m),u=t.c2l(y)),b&&(l=Math.min(0,l),u=Math.max(0,u)),f(l)&&c(g,l,d,E),f(u)&&p(v,u,h,E))}var P=Math.min(6,_);for(i=0;i<P;i++)z(i);for(i=_-1;i>=P;i--)z(i);return{min:g,max:v,opts:r}},concatExtremes:u}},{"../../constants/numerical":147,"../../lib":169,"../../registry":261,"fast-isnumeric":16}],213:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("../../plots/plots"),o=t("../../registry"),s=t("../../lib"),l=t("../../lib/svg_text_utils"),u=t("../../components/titles"),c=t("../../components/color"),p=t("../../components/drawing"),h=t("./layout_attributes"),f=t("./clean_ticks"),d=t("../../constants/numerical"),m=d.ONEAVGYEAR,y=d.ONEAVGMONTH,g=d.ONEDAY,v=d.ONEHOUR,_=d.ONEMIN,x=d.ONESEC,b=d.MINUS_SIGN,w=d.BADNUM,k=t("../../constants/alignment"),T=k.MID_SHIFT,A=k.CAP_SHIFT,M=k.LINE_SPACING,S=k.OPPOSITE_SIDE,L=e.exports={};L.setConvert=t("./set_convert");var C=t("./axis_autotype"),E=t("./axis_ids");L.id2name=E.id2name,L.name2id=E.name2id,L.cleanId=E.cleanId,L.list=E.list,L.listIds=E.listIds,L.getFromId=E.getFromId,L.getFromTrace=E.getFromTrace;var z=t("./autorange");L.getAutoRange=z.getAutoRange,L.findExtremes=z.findExtremes,L.coerceRef=function(t,e,r,n,i,a){var o=n.charAt(n.length-1),l=r._fullLayout._subplots[o+"axis"],u=n+"ref",c={};return i||(i=l[0]||a),a||(a=i),c[u]={valType:"enumerated",values:l.concat(a?[a]:[]),dflt:i},s.coerce(t,e,c,u)},L.coercePosition=function(t,e,r,n,i,a){var o,l;if("paper"===n||"pixel"===n)o=s.ensureNumber,l=r(i,a);else{var u=L.getFromId(e,n);l=r(i,a=u.fraction2r(a)),o=u.cleanPos}t[i]=o(l)},L.cleanPosition=function(t,e,r){return("paper"===r||"pixel"===r?s.ensureNumber:L.getFromId(e,r).cleanPos)(t)},L.redrawComponents=function(t,e){e=e||L.listIds(t);var r=t._fullLayout;function n(n,i,a,s){for(var l=o.getComponentMethod(n,i),u={},c=0;c<e.length;c++)for(var p=r[L.id2name(e[c])][a],h=0;h<p.length;h++){var f=p[h];if(!u[f]&&(l(t,f),u[f]=1,s))return}}n("annotations","drawOne","_annIndices"),n("shapes","drawOne","_shapeIndices"),n("images","draw","_imgIndices",!0)};var P=L.getDataConversions=function(t,e,r,n){var i,a="x"===r||"y"===r||"z"===r?r:n;if(Array.isArray(a)){if(i={type:C(n),_categories:[]},L.setConvert(i),"category"===i.type)for(var o=0;o<n.length;o++)i.d2c(n[o])}else i=L.getFromTrace(t,e,a);return i?{d2c:i.d2c,c2d:i.c2d}:"ids"===a?{d2c:D,c2d:D}:{d2c:I,c2d:I}};function I(t){return+t}function D(t){return String(t)}L.getDataToCoordFunc=function(t,e,r,n){return P(t,e,r,n).d2c},L.counterLetter=function(t){var e=t.charAt(0);return"x"===e?"y":"y"===e?"x":void 0},L.minDtick=function(t,e,r,n){-1===["log","category","multicategory"].indexOf(t.type)&&n?void 0===t._minDtick?(t._minDtick=e,t._forceTick0=r):t._minDtick&&((t._minDtick/e+1e-6)%1<2e-6&&((r-t._forceTick0)/e%1+1.000001)%1<2e-6?(t._minDtick=e,t._forceTick0=r):((e/t._minDtick+1e-6)%1>2e-6||((r-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},L.saveRangeInitial=function(t,e){for(var r=L.list(t,"",!0),n=!1,i=0;i<r.length;i++){var a=r[i],o=void 0===a._rangeInitial,s=o||!(a.range[0]===a._rangeInitial[0]&&a.range[1]===a._rangeInitial[1]);(o&&!1===a.autorange||e&&s)&&(a._rangeInitial=a.range.slice(),n=!0)}return n},L.saveShowSpikeInitial=function(t,e){for(var r=L.list(t,"",!0),n=!1,i="on",a=0;a<r.length;a++){var o=r[a],s=void 0===o._showSpikeInitial,l=s||!(o.showspikes===o._showspikes);(s||e&&l)&&(o._showSpikeInitial=o.showspikes,n=!0),"on"!==i||o.showspikes||(i="off")}return t._fullLayout._cartesianSpikesEnabled=i,n},L.autoBin=function(t,e,r,n,a,o){var l,u=s.aggNums(Math.min,null,t),c=s.aggNums(Math.max,null,t);if("category"===e.type||"multicategory"===e.type)return{start:u-.5,end:c+.5,size:Math.max(1,Math.round(o)||1),_dataSpan:c-u};if(a||(a=e.calendar),l="log"===e.type?{type:"linear",range:[u,c]}:{type:e.type,range:s.simpleMap([u,c],e.c2r,0,a),calendar:a},L.setConvert(l),o=o&&f.dtick(o,l.type))l.dtick=o,l.tick0=f.tick0(void 0,l.type,a);else{var p;if(r)p=(c-u)/r;else{var h=s.distinctVals(t),d=Math.pow(10,Math.floor(Math.log(h.minDiff)/Math.LN10)),m=d*s.roundUp(h.minDiff/d,[.9,1.9,4.9,9.9],!0);p=Math.max(m,2*s.stdev(t)/Math.pow(t.length,n?.25:.4)),i(p)||(p=1)}L.autoTicks(l,p)}var y,v=l.dtick,_=L.tickIncrement(L.tickFirst(l),v,"reverse",a);if("number"==typeof v)y=(_=function(t,e,r,n,a){var o=0,s=0,l=0,u=0;function c(e){return(1+100*(e-t)/r.dtick)%100<2}for(var p=0;p<e.length;p++)e[p]%1==0?l++:i(e[p])||u++,c(e[p])&&o++,c(e[p]+r.dtick/2)&&s++;var h=e.length-u;if(l===h&&"date"!==r.type)r.dtick<1?t=n-.5*r.dtick:(t-=.5)+r.dtick<n&&(t+=r.dtick);else if(s<.1*h&&(o>.3*h||c(n)||c(a))){var f=r.dtick/2;t+=t+f<n?f:-f}return t}(_,t,l,u,c))+(1+Math.floor((c-_)/v))*v;else for("M"===l.dtick.charAt(0)&&(_=function(t,e,r,n,i){var a=s.findExactDates(e,i);if(a.exactDays>.8){var o=Number(r.substr(1));a.exactYears>.8&&o%12==0?t=L.tickIncrement(t,"M6","reverse")+1.5*g:a.exactMonths>.8?t=L.tickIncrement(t,"M1","reverse")+15.5*g:t-=g/2;var l=L.tickIncrement(t,r);if(l<=n)return l}return t}(_,t,v,u,a)),y=_,0;y<=c;)y=L.tickIncrement(y,v,!1,a),0;return{start:e.c2r(_,0,a),end:e.c2r(y,0,a),size:v,_dataSpan:c-u}},L.prepTicks=function(t){var e=s.simpleMap(t.range,t.r2l);if("auto"===t.tickmode||!t.dtick){var r,n=t.nticks;n||("category"===t.type||"multicategory"===t.type?(r=t.tickfont?1.2*(t.tickfont.size||12):15,n=t._length/r):(r="y"===t._id.charAt(0)?40:80,n=s.constrain(t._length/r,4,9)+1),"radialaxis"===t._name&&(n*=2)),"array"===t.tickmode&&(n*=100),L.autoTicks(t,Math.abs(e[1]-e[0])/n),t._minDtick>0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t.l2r(t._forceTick0))}t.tick0||(t.tick0="date"===t.type?"2000-01-01":0),"date"===t.type&&t.dtick<.1&&(t.dtick=.1),q(t)},L.calcTicks=function(t){L.prepTicks(t);var e=s.simpleMap(t.range,t.r2l);if("array"===t.tickmode)return function(t){var e=t.tickvals,r=t.ticktext,n=new Array(e.length),i=s.simpleMap(t.range,t.r2l),a=1.0001*i[0]-1e-4*i[1],o=1.0001*i[1]-1e-4*i[0],l=Math.min(a,o),u=Math.max(a,o),c=0;Array.isArray(r)||(r=[]);var p="category"===t.type?t.d2l_noadd:t.d2l;"log"===t.type&&"L"!==String(t.dtick).charAt(0)&&(t.dtick="L"+Math.pow(10,Math.floor(Math.min(t.range[0],t.range[1]))-1));for(var h=0;h<e.length;h++){var f=p(e[h]);f>l&&f<u&&(void 0===r[h]?n[c]=L.tickText(t,f):n[c]=G(t,f,String(r[h])),c++)}c<e.length&&n.splice(c,e.length-c);return n}(t);t._tmin=L.tickFirst(t);var r=1.0001*e[0]-1e-4*e[1],n=1.0001*e[1]-1e-4*e[0],a=e[1]<e[0];if(t._tmin<r!==a)return[];var o=[];"category"!==t.type&&"multicategory"!==t.type||(n=a?Math.max(-.5,n):Math.min(t._categories.length-.5,n));for(var l="log"===t.type&&!(i(t.dtick)||"L"===t.dtick.charAt(0)),u=null,c=Math.max(1e3,t._length||0),p=t._tmin;(a?p>=n:p<=n)&&!(o.length>c||p===u);p=L.tickIncrement(p,t.dtick,a,t.calendar)){u=p;var h=!1;l&&p!==(0|p)&&(h=!0),o.push({minor:h,value:p})}ot(t)&&360===Math.abs(e[1]-e[0])&&o.pop(),t._tmax=(o[o.length-1]||{}).value,t._prevDateHead="",t._inCalcTicks=!0;for(var f=new Array(o.length),d=0;d<o.length;d++)f[d]=L.tickText(t,o[d].value,!1,o[d].minor);return t._inCalcTicks=!1,f};var O=[2,5,10],R=[1,2,3,6,12],F=[1,2,5,10,15,30],B=[1,2,3,7,14],N=[-.046,0,.301,.477,.602,.699,.778,.845,.903,.954,1],U=[-.301,0,.301,.699,1],j=[15,30,45,90,180];function V(t,e,r){return e*s.roundUp(t/e,r)}function q(t){var e=t.dtick;if(t._tickexponent=0,i(e)||"string"==typeof e||(e=1),"category"!==t.type&&"multicategory"!==t.type||(t._tickround=null),"date"===t.type){var r=t.r2l(t.tick0),n=t.l2r(r).replace(/(^-|i)/g,""),a=n.length;if("M"===String(e).charAt(0))a>10||"01-01"!==n.substr(5)?t._tickround="d":t._tickround=+e.substr(1)%12==0?"y":"m";else if(e>=g&&a<=10||e>=15*g)t._tickround="d";else if(e>=_&&a<=16||e>=v)t._tickround="M";else if(e>=x&&a<=19||e>=_)t._tickround="S";else{var o=t.l2r(r+e).replace(/^-/,"").length;t._tickround=Math.max(a,o)-20,t._tickround<0&&(t._tickround=4)}}else if(i(e)||"L"===e.charAt(0)){var s=t.range.map(t.r2d||Number);i(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var l=Math.max(Math.abs(s[0]),Math.abs(s[1])),u=Math.floor(Math.log(l)/Math.LN10+.01);Math.abs(u)>3&&(Z(t.exponentformat)&&!X(u)?t._tickexponent=3*Math.round((u-1)/3):t._tickexponent=u)}else t._tickround=null}function G(t,e,r){var n=t.tickfont||{};return{x:e,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}L.autoTicks=function(t,e){var r;function n(t){return Math.pow(t,Math.floor(Math.log(e)/Math.LN10))}if("date"===t.type){t.tick0=s.dateTick0(t.calendar);var a=2*e;a>m?(e/=m,r=n(10),t.dtick="M"+12*V(e,r,O)):a>y?(e/=y,t.dtick="M"+V(e,1,R)):a>g?(t.dtick=V(e,g,B),t.tick0=s.dateTick0(t.calendar,!0)):a>v?t.dtick=V(e,v,R):a>_?t.dtick=V(e,_,F):a>x?t.dtick=V(e,x,F):(r=n(10),t.dtick=V(e,r,O))}else if("log"===t.type){t.tick0=0;var o=s.simpleMap(t.range,t.r2l);if(e>.7)t.dtick=Math.ceil(e);else if(Math.abs(o[1]-o[0])<1){var l=1.5*Math.abs((o[1]-o[0])/e);e=Math.abs(Math.pow(10,o[1])-Math.pow(10,o[0]))/l,r=n(10),t.dtick="L"+V(e,r,O)}else t.dtick=e>.3?"D2":"D1"}else"category"===t.type||"multicategory"===t.type?(t.tick0=0,t.dtick=Math.ceil(Math.max(e,1))):ot(t)?(t.tick0=0,r=1,t.dtick=V(e,r,j)):(t.tick0=0,r=n(10),t.dtick=V(e,r,O));if(0===t.dtick&&(t.dtick=1),!i(t.dtick)&&"string"!=typeof t.dtick){var u=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(u)}},L.tickIncrement=function(t,e,r,a){var o=r?-1:1;if(i(e))return t+o*e;var l=e.charAt(0),u=o*Number(e.substr(1));if("M"===l)return s.incrementMonth(t,u,a);if("L"===l)return Math.log(Math.pow(10,t)+u)/Math.LN10;if("D"===l){var c="D2"===e?U:N,p=t+.01*o,h=s.roundUp(s.mod(p,1),c,r);return Math.floor(p)+Math.log(n.round(Math.pow(10,h),1))/Math.LN10}throw"unrecognized dtick "+String(e)},L.tickFirst=function(t){var e=t.r2l||Number,r=s.simpleMap(t.range,e),a=r[1]<r[0],o=a?Math.floor:Math.ceil,l=1.0001*r[0]-1e-4*r[1],u=t.dtick,c=e(t.tick0);if(i(u)){var p=o((l-c)/u)*u+c;return"category"!==t.type&&"multicategory"!==t.type||(p=s.constrain(p,0,t._categories.length-1)),p}var h=u.charAt(0),f=Number(u.substr(1));if("M"===h){for(var d,m,y,g=0,v=c;g<10;){if(((d=L.tickIncrement(v,u,a,t.calendar))-l)*(v-l)<=0)return a?Math.min(v,d):Math.max(v,d);m=(l-(v+d)/2)/(d-v),y=h+(Math.abs(Math.round(m))||1)*f,v=L.tickIncrement(v,y,m<0?!a:a,t.calendar),g++}return s.error("tickFirst did not converge",t),v}if("L"===h)return Math.log(o((Math.pow(10,l)-c)/f)*f+c)/Math.LN10;if("D"===h){var _="D2"===u?U:N,x=s.roundUp(s.mod(l,1),_,a);return Math.floor(l)+Math.log(n.round(Math.pow(10,x),1))/Math.LN10}throw"unrecognized dtick "+String(u)},L.tickText=function(t,e,r,n){var a,o=G(t,e),l="array"===t.tickmode,u=r||l,c=t.type,p="category"===c?t.d2l_noadd:t.d2l;if(l&&Array.isArray(t.ticktext)){var h=s.simpleMap(t.range,t.r2l),f=Math.abs(h[1]-h[0])/1e4;for(a=0;a<t.ticktext.length&&!(Math.abs(e-p(t.tickvals[a]))<f);a++);if(a<t.ticktext.length)return o.text=String(t.ticktext[a]),o}function d(n){if(void 0===n)return!0;if(r)return"none"===n;var i={first:t._tmin,last:t._tmax}[n];return"all"!==n&&e!==i}var m=r?"never":"none"!==t.exponentformat&&d(t.showexponent)?"hide":"";if("date"===c?function(t,e,r,n){var a=t._tickround,o=r&&t.hoverformat||L.getTickFormat(t);n&&(a=i(a)?4:{y:"m",m:"d",d:"M",M:"S",S:4}[a]);var l,u=s.formatDate(e.x,o,a,t._dateFormat,t.calendar,t._extraFormat),c=u.indexOf("\n");-1!==c&&(l=u.substr(c+1),u=u.substr(0,c));n&&("00:00:00"===u||"00:00"===u?(u=l,l=""):8===u.length&&(u=u.replace(/:00$/,"")));l&&(r?"d"===a?u+=", "+l:u=l+(u?", "+u:""):t._inCalcTicks&&l===t._prevDateHead||(u+="<br>"+l,t._prevDateHead=l));e.text=u}(t,o,r,u):"log"===c?function(t,e,r,n,a){var o=t.dtick,l=e.x,u=t.tickformat,c="string"==typeof o&&o.charAt(0);"never"===a&&(a="");n&&"L"!==c&&(o="L3",c="L");if(u||"L"===c)e.text=W(Math.pow(10,l),t,a,n);else if(i(o)||"D"===c&&s.mod(l+.01,1)<.1){var p=Math.round(l),h=Math.abs(p),f=t.exponentformat;"power"===f||Z(f)&&X(p)?(e.text=0===p?1:1===p?"10":"10<sup>"+(p>1?"":b)+h+"</sup>",e.fontSize*=1.25):("e"===f||"E"===f)&&h>2?e.text="1"+f+(p>0?"+":b)+h:(e.text=W(Math.pow(10,l),t,"","fakehover"),"D1"===o&&"y"===t._id.charAt(0)&&(e.dy-=e.fontSize/6))}else{if("D"!==c)throw"unrecognized dtick "+String(o);e.text=String(Math.round(Math.pow(10,s.mod(l,1)))),e.fontSize*=.75}if("D1"===t.dtick){var d=String(e.text).charAt(0);"0"!==d&&"1"!==d||("y"===t._id.charAt(0)?e.dx-=e.fontSize/4:(e.dy+=e.fontSize/2,e.dx+=(t.range[1]>t.range[0]?1:-1)*e.fontSize*(l<0?.5:.25)))}}(t,o,0,u,m):"category"===c?function(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r="");e.text=String(r)}(t,o):"multicategory"===c?function(t,e,r){var n=Math.round(e.x),i=t._categories[n]||[],a=void 0===i[1]?"":String(i[1]),o=void 0===i[0]?"":String(i[0]);r?e.text=o+" - "+a:(e.text=a,e.text2=o)}(t,o,r):ot(t)?function(t,e,r,n,i){if("radians"!==t.thetaunit||r)e.text=W(e.x,t,i,n);else{var a=e.x/180;if(0===a)e.text="0";else{var o=function(t){function e(t,e){return Math.abs(t-e)<=1e-6}var r=function(t){var r=1;for(;!e(Math.round(t*r)/r,t);)r*=10;return r}(t),n=t*r,i=Math.abs(function t(r,n){return e(n,0)?r:t(n,r%n)}(n,r));return[Math.round(n/i),Math.round(r/i)]}(a);if(o[1]>=100)e.text=W(s.deg2rad(e.x),t,i,n);else{var l=e.x<0;1===o[1]?1===o[0]?e.text="\u03c0":e.text=o[0]+"\u03c0":e.text=["<sup>",o[0],"</sup>","\u2044","<sub>",o[1],"</sub>","\u03c0"].join(""),l&&(e.text=b+e.text)}}}}(t,o,r,u,m):function(t,e,r,n,i){"never"===i?i="":"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(i="hide");e.text=W(e.x,t,i,n)}(t,o,0,u,m),n||(t.tickprefix&&!d(t.showtickprefix)&&(o.text=t.tickprefix+o.text),t.ticksuffix&&!d(t.showticksuffix)&&(o.text+=t.ticksuffix)),"boundaries"===t.tickson||t.showdividers){var y=function(e){var r=t.l2p(e);return r>=0&&r<=t._length?e:null};o.xbnd=[y(o.x-.5),y(o.x+t.dtick-.5)]}return o},L.hoverLabelText=function(t,e,r){if(r!==w&&r!==e)return L.hoverLabelText(t,e)+" - "+L.hoverLabelText(t,r);var n="log"===t.type&&e<=0,i=L.tickText(t,t.c2l(n?-e:e),"hover").text;return n?0===e?"0":b+i:i};var H=["f","p","n","\u03bc","m","","k","M","G","T"];function Z(t){return"SI"===t||"B"===t}function X(t){return t>14||t<-15}function W(t,e,r,n){var a=t<0,o=e._tickround,l=r||e.exponentformat||"B",u=e._tickexponent,c=L.getTickFormat(e),p=e.separatethousands;if(n){var h={exponentformat:l,dtick:"none"===e.showexponent?e.dtick:i(t)&&Math.abs(t)||1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};q(h),o=(Number(h._tickround)||0)+4,u=h._tickexponent,e.hoverformat&&(c=e.hoverformat)}if(c)return e._numFormat(c)(t).replace(/-/g,b);var f,d=Math.pow(10,-o)/2;if("none"===l&&(u=0),(t=Math.abs(t))<d)t="0",a=!1;else{if(t+=d,u&&(t*=Math.pow(10,-u),o+=u),0===o)t=String(Math.floor(t));else if(o<0){t=(t=String(Math.round(t))).substr(0,t.length+o);for(var m=o;m<0;m++)t+="0"}else{var y=(t=String(t)).indexOf(".")+1;y&&(t=t.substr(0,y+o).replace(/\.?0+$/,""))}t=s.numSeparate(t,e._separators,p)}u&&"hide"!==l&&(Z(l)&&X(u)&&(l="power"),f=u<0?b+-u:"power"!==l?"+"+u:String(u),"e"===l||"E"===l?t+=l+f:"power"===l?t+="\xd710<sup>"+f+"</sup>":"B"===l&&9===u?t+="B":Z(l)&&(t+=H[u/3+5]));return a?b+t:t}function Y(t,e){for(var r=[],n={},i=0;i<e.length;i++){var a=e[i];n[a.text2]?n[a.text2].push(a.x):n[a.text2]=[a.x]}for(var o in n)r.push(G(t,s.interp(n[o],.5),o));return r}function K(t){return[t.text,t.x,t.axInfo,t.font,t.fontSize,t.fontColor].join("_")}function J(t){var e=t.title.font.size,r=(t.title.text.match(l.BR_TAG_ALL)||[]).length;return t.title.hasOwnProperty("standoff")?r?e*(A+r*M):e*A:r?e*(r+1)*M:e}function $(t,e){var r=t.l2p(e);return r>1&&r<t._length-1}function Q(t){var e=n.select(t),r=e.select(".text-math-group");return r.empty()?e.select("text"):r}function tt(t){return t._id+".automargin"}function et(t){return tt(t)+".mirror"}function rt(t){return t._id+".rangeslider"}function nt(t,e){for(var r=0;r<e.length;r++)-1===t.indexOf(e[r])&&t.push(e[r])}function it(t,e,r){var n,i,a=[],o=[],l=t.layout;for(n=0;n<e.length;n++)a.push(L.getFromId(t,e[n]));for(n=0;n<r.length;n++)o.push(L.getFromId(t,r[n]));var u=Object.keys(h),c=["anchor","domain","overlaying","position","side","tickangle","editType"],p=["linear","log"];for(n=0;n<u.length;n++){var f=u[n],d=a[0][f],m=o[0][f],y=!0,g=!1,v=!1;if("_"!==f.charAt(0)&&"function"!=typeof d&&-1===c.indexOf(f)){for(i=1;i<a.length&&y;i++){var _=a[i][f];"type"===f&&-1!==p.indexOf(d)&&-1!==p.indexOf(_)&&d!==_?g=!0:_!==d&&(y=!1)}for(i=1;i<o.length&&y;i++){var x=o[i][f];"type"===f&&-1!==p.indexOf(m)&&-1!==p.indexOf(x)&&m!==x?v=!0:o[i][f]!==m&&(y=!1)}y&&(g&&(l[a[0]._name].type="linear"),v&&(l[o[0]._name].type="linear"),at(l,f,a,o,t._fullLayout._dfltTitle))}}for(n=0;n<t._fullLayout.annotations.length;n++){var b=t._fullLayout.annotations[n];-1!==e.indexOf(b.xref)&&-1!==r.indexOf(b.yref)&&s.swapAttrs(l.annotations[n],["?"])}}function at(t,e,r,n,i){var a,o=s.nestedProperty,l=o(t[r[0]._name],e).get(),u=o(t[n[0]._name],e).get();for("title"===e&&(l&&l.text===i.x&&(l.text=i.y),u&&u.text===i.y&&(u.text=i.x)),a=0;a<r.length;a++)o(t,r[a]._name+"."+e).set(u);for(a=0;a<n.length;a++)o(t,n[a]._name+"."+e).set(l)}function ot(t){return"angularaxis"===t._id}L.getTickFormat=function(t){var e,r,n,i,a,o,s,l;function u(t){return"string"!=typeof t?t:Number(t.replace("M",""))*y}function c(t,e){var r=["L","D"];if(typeof t==typeof e){if("number"==typeof t)return t-e;var n=r.indexOf(t.charAt(0)),i=r.indexOf(e.charAt(0));return n===i?Number(t.replace(/(L|D)/g,""))-Number(e.replace(/(L|D)/g,"")):n-i}return"number"==typeof t?1:-1}function p(t,e){var r=null===e[0],n=null===e[1],i=c(t,e[0])>=0,a=c(t,e[1])<=0;return(r||i)&&(n||a)}if(t.tickformatstops&&t.tickformatstops.length>0)switch(t.type){case"date":case"linear":for(e=0;e<t.tickformatstops.length;e++)if((n=t.tickformatstops[e]).enabled&&(i=t.dtick,a=n.dtickrange,o=void 0,s=void 0,l=void 0,o=u||function(t){return t},s=a[0],l=a[1],(!s&&"number"!=typeof s||o(s)<=o(i))&&(!l&&"number"!=typeof l||o(l)>=o(i)))){r=n;break}break;case"log":for(e=0;e<t.tickformatstops.length;e++)if((n=t.tickformatstops[e]).enabled&&p(t.dtick,n.dtickrange)){r=n;break}}return r?r.value:t.tickformat},L.getSubplots=function(t,e){var r=t._fullLayout._subplots,n=r.cartesian.concat(r.gl2d||[]),i=e?L.findSubplotsWithAxis(n,e):n;return i.sort(function(t,e){var r=t.substr(1).split("y"),n=e.substr(1).split("y");return r[0]===n[0]?+r[1]-+n[1]:+r[0]-+n[0]}),i},L.findSubplotsWithAxis=function(t,e){for(var r=new RegExp("x"===e._id.charAt(0)?"^"+e._id+"y":e._id+"$"),n=[],i=0;i<t.length;i++){var a=t[i];r.test(a)&&n.push(a)}return n},L.makeClipPaths=function(t){var e=t._fullLayout;if(!e._hasOnlyLargeSploms){var r,i,a={_offset:0,_length:e.width,_id:""},o={_offset:0,_length:e.height,_id:""},s=L.list(t,"x",!0),l=L.list(t,"y",!0),u=[];for(r=0;r<s.length;r++)for(u.push({x:s[r],y:o}),i=0;i<l.length;i++)0===r&&u.push({x:a,y:l[i]}),u.push({x:s[r],y:l[i]});var c=e._clips.selectAll(".axesclip").data(u,function(t){return t.x._id+t.y._id});c.enter().append("clipPath").classed("axesclip",!0).attr("id",function(t){return"clip"+e._uid+t.x._id+t.y._id}).append("rect"),c.exit().remove(),c.each(function(t){n.select(this).select("rect").attr({x:t.x._offset||0,y:t.y._offset||0,width:t.x._length||1,height:t.y._length||1})})}},L.draw=function(t,e,r){var n=t._fullLayout;"redraw"===e&&n._paper.selectAll("g.subplot").each(function(t){var e=t[0],r=n._plots[e],i=r.xaxis,a=r.yaxis;r.xaxislayer.selectAll("."+i._id+"tick").remove(),r.yaxislayer.selectAll("."+a._id+"tick").remove(),r.xaxislayer.selectAll("."+i._id+"tick2").remove(),r.yaxislayer.selectAll("."+a._id+"tick2").remove(),r.xaxislayer.selectAll("."+i._id+"divider").remove(),r.yaxislayer.selectAll("."+a._id+"divider").remove(),r.gridlayer&&r.gridlayer.selectAll("path").remove(),r.zerolinelayer&&r.zerolinelayer.selectAll("path").remove(),n._infolayer.select(".g-"+i._id+"title").remove(),n._infolayer.select(".g-"+a._id+"title").remove()});var i=e&&"redraw"!==e?e:L.listIds(t);return s.syncOrAsync(i.map(function(e){return function(){if(e){var n=L.getFromId(t,e),i=L.drawOne(t,n,r);return n._r=n.range.slice(),n._rl=s.simpleMap(n._r,n.r2l),i}}}))},L.drawOne=function(t,e,r){var n,i,l;r=r||{},e.setScale();var h=t._fullLayout,f=e._id,d=f.charAt(0),m=L.counterLetter(f),y=h._plots[e._mainSubplot];if(y){var g=y[d+"axislayer"],v=e._mainLinePosition,_=e._mainMirrorPosition,x=e._vals=L.calcTicks(e),b=[e.mirror,v,_].join("_");for(n=0;n<x.length;n++)x[n].axInfo=b;e._selections={},e._tickAngles&&(e._prevTickAngles=e._tickAngles),e._tickAngles={},e._depth=null;var w={};if(e.visible){var k,T,A=L.makeTransFn(e);if("boundaries"===e.tickson){var C=function(t,e){var r,n=[],i=function(t,e){var r=t.xbnd[e];null!==r&&n.push(s.extendFlat({},t,{x:r}))};if(e.length){for(r=0;r<e.length;r++)i(e[r],0);i(e[r-1],1)}return n}(0,x);T=L.clipEnds(e,C),k="inside"===e.ticks?T:C}else T=L.clipEnds(e,x),k="inside"===e.ticks?T:x;var E=e._gridVals=T,z=function(t,e){var r,n,i=[],a=function(t,e){var r=t.xbnd[e];null!==r&&i.push(s.extendFlat({},t,{x:r}))};if(t.showdividers&&e.length){for(r=0;r<e.length;r++){var o=e[r];o.text2!==n&&a(o,0),n=o.text2}a(e[r-1],1)}return i}(e,x);if(!h._hasOnlyLargeSploms){var P=e._subplotsWith,I={};for(n=0;n<P.length;n++){i=P[n];var D=(l=h._plots[i])[m+"axis"],O=D._mainAxis._id;if(!I[O]){I[O]=1;var R="x"===d?"M0,"+D._offset+"v"+D._length:"M"+D._offset+",0h"+D._length;L.drawGrid(t,e,{vals:E,counterAxis:D,layer:l.gridlayer.select("."+f),path:R,transFn:A}),L.drawZeroLine(t,e,{counterAxis:D,layer:l.zerolinelayer,path:R,transFn:A})}}}var F=L.getTickSigns(e),B=[];if(e.ticks){var N,U,j,V=L.makeTickPath(e,v,F[2]);if(e._anchorAxis&&e.mirror&&!0!==e.mirror?(N=L.makeTickPath(e,_,F[3]),U=V+N):(N="",U=V),e.showdividers&&"outside"===e.ticks&&"boundaries"===e.tickson){var q={};for(n=0;n<z.length;n++)q[z[n].x]=1;j=function(t){return q[t.x]?N:U}}else j=U;L.drawTicks(t,e,{vals:k,layer:g,path:j,transFn:A}),"allticks"===e.mirror&&(B=Object.keys(e._linepositions||{}))}for(n=0;n<B.length;n++){i=B[n],l=h._plots[i];var G=e._linepositions[i]||[],H=L.makeTickPath(e,G[0],F[0])+L.makeTickPath(e,G[1],F[1]);L.drawTicks(t,e,{vals:k,layer:l[d+"axislayer"],path:H,transFn:A})}var Z=[];if(Z.push(function(){return L.drawLabels(t,e,{vals:x,layer:g,transFn:A,labelFns:L.makeLabelFns(e,v)})}),"multicategory"===e.type){var X={x:2,y:10}[d];Z.push(function(){var r={x:"height",y:"width"}[d],n=$()[r]+X+(e._tickAngles[f+"tick"]?e.tickfont.size*M:0);return L.drawLabels(t,e,{vals:Y(e,x),layer:g,cls:f+"tick2",repositionOnUpdate:!0,secondary:!0,transFn:A,labelFns:L.makeLabelFns(e,v+n*F[4])})}),Z.push(function(){return e._depth=F[4]*($("tick2")[e.side]-v),function(t,e,r){var n=e._id+"divider",i=r.vals,a=r.layer.selectAll("path."+n).data(i,K);a.exit().remove(),a.enter().insert("path",":first-child").classed(n,1).classed("crisp",1).call(c.stroke,e.dividercolor).style("stroke-width",p.crispRound(t,e.dividerwidth,1)+"px"),a.attr("transform",r.transFn).attr("d",r.path)}(t,e,{vals:z,layer:g,path:L.makeTickPath(e,v,F[4],e._depth),transFn:A})})}else e.title.hasOwnProperty("standoff")&&Z.push(function(){e._depth=F[4]*($()[e.side]-v)});var W=o.getComponentMethod("rangeslider","isVisible")(e);return Z.push(function(){var r,n,i,s,l=e.side.charAt(0),u=S[e.side].charAt(0),c=L.getPxPosition(t,e),p="outside"===e.ticks?e.ticklen:0;if((e.automargin||W)&&("multicategory"===e.type?r=$("tick2"):(r=$(),"x"===d&&"b"===l&&(e._depth=Math.max(r.width>0?r.bottom-c:0,p)))),e.automargin){n={x:0,y:0,r:0,l:0,t:0,b:0};var f=[0,1];if("x"===d){if("b"===l?n[l]=e._depth:(n[l]=e._depth=Math.max(r.width>0?c-r.top:0,p),f.reverse()),r.width>0){var y=r.right-(e._offset+e._length);y>0&&(n.xr=1,n.r=y);var g=e._offset-r.left;g>0&&(n.xl=0,n.l=g)}}else if("l"===l?n[l]=e._depth=Math.max(r.height>0?c-r.left:0,p):(n[l]=e._depth=Math.max(r.height>0?r.right-c:0,p),f.reverse()),r.height>0){var v=r.bottom-(e._offset+e._length);v>0&&(n.yb=0,n.b=v);var _=e._offset-r.top;_>0&&(n.yt=1,n.t=_)}n[m]="free"===e.anchor?e.position:e._anchorAxis.domain[f[0]],e.title.text!==h._dfltTitle[d]&&(n[l]+=J(e)+(e.title.standoff||0)),e.mirror&&"free"!==e.anchor&&((i={x:0,y:0,r:0,l:0,t:0,b:0})[u]=e.linewidth,e.mirror&&!0!==e.mirror&&(i[u]+=p),!0===e.mirror||"ticks"===e.mirror?i[m]=e._anchorAxis.domain[f[1]]:"all"!==e.mirror&&"allticks"!==e.mirror||(i[m]=[e._counterDomainMin,e._counterDomainMax][f[1]]))}W&&(s=o.getComponentMethod("rangeslider","autoMarginOpts")(t,e)),a.autoMargin(t,tt(e),n),a.autoMargin(t,et(e),i),a.autoMargin(t,rt(e),s)}),r.skipTitle||W&&"bottom"===e.side||Z.push(function(){return function(t,e){var r,n=t._fullLayout,i=e._id,a=i.charAt(0),o=e.title.font.size;if(e.title.hasOwnProperty("standoff"))r=e._depth+e.title.standoff+J(e);else{if("multicategory"===e.type)r=e._depth;else{r=10+1.5*o+(e.linewidth?e.linewidth-1:0)}r+="x"===a?"top"===e.side?o*(e.showticklabels?1:0):o*(e.showticklabels?1.5:.5):"right"===e.side?o*(e.showticklabels?1:.5):o*(e.showticklabels?.5:0)}var s,l,c,h,f=L.getPxPosition(t,e);"x"===a?(l=e._offset+e._length/2,c="top"===e.side?f-r:f+r):(c=e._offset+e._length/2,l="right"===e.side?f+r:f-r,s={rotate:"-90",offset:0});if("multicategory"!==e.type){var d=e._selections[e._id+"tick"];if(h={selection:d,side:e.side},d&&d.node()&&d.node().parentNode){var m=p.getTranslate(d.node().parentNode);h.offsetLeft=m.x,h.offsetTop=m.y}e.title.hasOwnProperty("standoff")&&(h.pad=0)}return u.draw(t,i+"title",{propContainer:e,propName:e._name+".title.text",placeholder:n._dfltTitle[a],avoid:h,transform:s,attributes:{x:l,y:c,"text-anchor":"middle"}})}(t,e)}),s.syncOrAsync(Z)}}function $(t){var r=f+(t||"tick");return w[r]||(w[r]=function(t,e){var r,n,i,a;t._selections[e].size()?(r=1/0,n=-1/0,i=1/0,a=-1/0,t._selections[e].each(function(){var t=Q(this),e=p.bBox(t.node().parentNode);r=Math.min(r,e.top),n=Math.max(n,e.bottom),i=Math.min(i,e.left),a=Math.max(a,e.right)})):(r=0,n=0,i=0,a=0);return{top:r,bottom:n,left:i,right:a,height:n-r,width:a-i}}(e,r)),w[r]}},L.getTickSigns=function(t){var e=t._id.charAt(0),r={x:"top",y:"right"}[e],n=t.side===r?1:-1,i=[-1,1,n,-n];return"inside"!==t.ticks==("x"===e)&&(i=i.map(function(t){return-t})),t.side&&i.push({l:-1,t:-1,r:1,b:1}[t.side.charAt(0)]),i},L.makeTransFn=function(t){var e=t._id.charAt(0),r=t._offset;return"x"===e?function(e){return"translate("+(r+t.l2p(e.x))+",0)"}:function(e){return"translate(0,"+(r+t.l2p(e.x))+")"}},L.makeTickPath=function(t,e,r,n){n=void 0!==n?n:t.ticklen;var i=t._id.charAt(0),a=(t.linewidth||1)/2;return"x"===i?"M0,"+(e+a*r)+"v"+n*r:"M"+(e+a*r)+",0h"+n*r},L.makeLabelFns=function(t,e,r){var n=t._id.charAt(0),a="boundaries"!==t.tickson&&"outside"===t.ticks,o=0,l=0;if(a&&(o+=t.ticklen),r&&"outside"===t.ticks){var u=s.deg2rad(r);o=t.ticklen*Math.cos(u)+1,l=t.ticklen*Math.sin(u)}t.showticklabels&&(a||t.showline)&&(o+=.2*t.tickfont.size);var c,p,h,f,d={labelStandoff:o+=(t.linewidth||1)/2,labelShift:l};return"x"===n?(f="bottom"===t.side?1:-1,c=l*f,p=e+o*f,h="bottom"===t.side?1:-.2,d.xFn=function(t){return t.dx+c},d.yFn=function(t){return t.dy+p+t.fontSize*h},d.anchorFn=function(t,e){return i(e)&&0!==e&&180!==e?e*f<0?"end":"start":"middle"},d.heightFn=function(e,r,n){return r<-60||r>60?-.5*n:"top"===t.side?-n:0}):"y"===n&&(f="right"===t.side?1:-1,c=o,p=-l*f,h=90===Math.abs(t.tickangle)?.5:0,d.xFn=function(t){return t.dx+e+(c+t.fontSize*h)*f},d.yFn=function(t){return t.dy+p+t.fontSize*T},d.anchorFn=function(e,r){return i(r)&&90===Math.abs(r)?"middle":"right"===t.side?"start":"end"},d.heightFn=function(e,r,n){return(r*="left"===t.side?1:-1)<-30?-n:r<30?-.5*n:0}),d},L.drawTicks=function(t,e,r){r=r||{};var n=e._id+"tick",i=r.layer.selectAll("path."+n).data(e.ticks?r.vals:[],K);i.exit().remove(),i.enter().append("path").classed(n,1).classed("ticks",1).classed("crisp",!1!==r.crisp).call(c.stroke,e.tickcolor).style("stroke-width",p.crispRound(t,e.tickwidth,1)+"px").attr("d",r.path),i.attr("transform",r.transFn)},L.drawGrid=function(t,e,r){r=r||{};var n=e._id+"grid",i=r.vals,a=r.counterAxis;if(!1===e.showgrid)i=[];else if(a&&L.shouldShowZeroLine(t,e,a))for(var o="array"===e.tickmode,s=0;s<i.length;s++){var l=i[s].x;if(o?!l:Math.abs(l)<e.dtick/100){if(i=i.slice(0,s).concat(i.slice(s+1)),!o)break;s--}}var u=r.layer.selectAll("path."+n).data(i,K);u.exit().remove(),u.enter().append("path").classed(n,1).classed("crisp",!1!==r.crisp),e._gw=p.crispRound(t,e.gridwidth,1),u.attr("transform",r.transFn).attr("d",r.path).call(c.stroke,e.gridcolor||"#ddd").style("stroke-width",e._gw+"px"),"function"==typeof r.path&&u.attr("d",r.path)},L.drawZeroLine=function(t,e,r){r=r||r;var n=e._id+"zl",i=L.shouldShowZeroLine(t,e,r.counterAxis),a=r.layer.selectAll("path."+n).data(i?[{x:0,id:e._id}]:[]);a.exit().remove(),a.enter().append("path").classed(n,1).classed("zl",1).classed("crisp",!1!==r.crisp).each(function(){r.layer.selectAll("path").sort(function(t,e){return E.idSort(t.id,e.id)})}),a.attr("transform",r.transFn).attr("d",r.path).call(c.stroke,e.zerolinecolor||c.defaultLine).style("stroke-width",p.crispRound(t,e.zerolinewidth,e._gw||1)+"px")},L.drawLabels=function(t,e,r){r=r||{};var a=t._fullLayout,o=e._id,u=o.charAt(0),c=r.cls||o+"tick",h=r.vals,f=r.labelFns,d=r.secondary?0:e.tickangle,m=(e._prevTickAngles||{})[c],y=r.layer.selectAll("g."+c).data(e.showticklabels?h:[],K),g=[];function v(t,e){t.each(function(t){var a=n.select(this),o=a.select(".text-math-group"),s=f.anchorFn(t,e),u=r.transFn.call(a.node(),t)+(i(e)&&0!=+e?" rotate("+e+","+f.xFn(t)+","+(f.yFn(t)-t.fontSize/2)+")":""),c=l.lineCount(a),h=M*t.fontSize,d=f.heightFn(t,i(e)?+e:0,(c-1)*h);if(d&&(u+=" translate(0, "+d+")"),o.empty())a.select("text").attr({transform:u,"text-anchor":s});else{var m=p.bBox(o.node()).width*{end:-.5,start:.5}[s];o.attr("transform",u+(m?"translate("+m+",0)":""))}})}y.enter().append("g").classed(c,1).append("text").attr("text-anchor","middle").each(function(e){var r=n.select(this),i=t._promises.length;r.call(l.positionText,f.xFn(e),f.yFn(e)).call(p.font,e.font,e.fontSize,e.fontColor).text(e.text).call(l.convertToTspans,t),t._promises[i]?g.push(t._promises.pop().then(function(){v(r,d)})):v(r,d)}),y.exit().remove(),r.repositionOnUpdate&&y.each(function(t){n.select(this).select("text").call(l.positionText,f.xFn(t),f.yFn(t))}),v(y,m+1?m:d);var _=null;e._selections&&(e._selections[c]=y);var x=[function(){return g.length&&Promise.all(g)}];e.automargin&&a._redrawFromAutoMarginCount&&90===m?(_=90,x.push(function(){v(y,m)})):x.push(function(){if(v(y,d),h.length&&"x"===u&&!i(d)&&("log"!==e.type||"D"!==String(e.dtick).charAt(0))){_=0;var t,n=0,a=[];if(y.each(function(t){n=Math.max(n,t.fontSize);var r=e.l2p(t.x),i=Q(this),o=p.bBox(i.node());a.push({top:0,bottom:10,height:10,left:r-o.width/2,right:r+o.width/2+2,width:o.width+2})}),"boundaries"!==e.tickson&&!e.showdividers||r.secondary){var o=h.length,l=Math.abs((h[o-1].x-h[0].x)*e._m)/(o-1)<2.5*n||"multicategory"===e.type;for(t=0;t<a.length-1;t++)if(s.bBoxIntersect(a[t],a[t+1])){_=l?90:30;break}}else{var c=2;for(e.ticks&&(c+=e.tickwidth/2),t=0;t<a.length;t++){var f=h[t].xbnd,m=a[t];if(null!==f[0]&&m.left-e.l2p(f[0])<c||null!==f[1]&&e.l2p(f[1])-m.right<c){_=90;break}}}_&&v(y,_)}}),e._tickAngles&&x.push(function(){e._tickAngles[c]=null===_?i(d)?d:0:_});var b=s.syncOrAsync(x);return b&&b.then&&t._promises.push(b),b},L.getPxPosition=function(t,e){var r,n=t._fullLayout._size,i=e._id.charAt(0),a=e.side;return"free"!==e.anchor?r=e._anchorAxis:"x"===i?r={_offset:n.t+(1-(e.position||0))*n.h,_length:0}:"y"===i&&(r={_offset:n.l+(e.position||0)*n.w,_length:0}),"top"===a||"left"===a?r._offset:"bottom"===a||"right"===a?r._offset+r._length:void 0},L.shouldShowZeroLine=function(t,e,r){var n=s.simpleMap(e.range,e.r2l);return n[0]*n[1]<=0&&e.zeroline&&("linear"===e.type||"-"===e.type)&&($(e,0)||!function(t,e,r,n){var i=r._mainAxis;if(!i)return;var a=t._fullLayout,o=e._id.charAt(0),s=L.counterLetter(e._id),l=e._offset+(Math.abs(n[0])<Math.abs(n[1])==("x"===o)?0:e._length);function u(t){if(!t.showline||!t.linewidth)return!1;var r=Math.max((t.linewidth+e.zerolinewidth)/2,1);function n(t){return"number"==typeof t&&Math.abs(t-l)<r}if(n(t._mainLinePosition)||n(t._mainMirrorPosition))return!0;var i=t._linepositions||{};for(var a in i)if(n(i[a][0])||n(i[a][1]))return!0}var c=a._plots[r._mainSubplot];if(!(c.mainplotinfo||c).overlays.length)return u(r);for(var p=L.list(t,s),h=0;h<p.length;h++){var f=p[h];if(f._mainAxis===i&&u(f))return!0}}(t,e,r,n)||function(t,e){for(var r=t._fullData,n=e._mainSubplot,i=e._id.charAt(0),a=0;a<r.length;a++){var s=r[a];if(!0===s.visible&&s.xaxis+s.yaxis===n){if(o.traceIs(s,"bar-like")&&s.orientation==={x:"h",y:"v"}[i])return!0;if(s.fill&&s.fill.charAt(s.fill.length-1)===i)return!0}}return!1}(t,e))},L.clipEnds=function(t,e){return e.filter(function(e){return $(t,e.x)})},L.allowAutoMargin=function(t){for(var e=L.list(t,"",!0),r=0;r<e.length;r++){var n=e[r];n.automargin&&(a.allowAutoMargin(t,tt(n)),n.mirror&&a.allowAutoMargin(t,et(n))),o.getComponentMethod("rangeslider","isVisible")(n)&&a.allowAutoMargin(t,rt(n))}},L.swap=function(t,e){for(var r=function(t,e){var r,n,i=[];for(r=0;r<e.length;r++){var a=[],o=t._fullData[e[r]].xaxis,s=t._fullData[e[r]].yaxis;if(o&&s){for(n=0;n<i.length;n++)-1===i[n].x.indexOf(o)&&-1===i[n].y.indexOf(s)||a.push(n);if(a.length){var l,u=i[a[0]];if(a.length>1)for(n=1;n<a.length;n++)l=i[a[n]],nt(u.x,l.x),nt(u.y,l.y);nt(u.x,[o]),nt(u.y,[s])}else i.push({x:[o],y:[s]})}}return i}(t,e),n=0;n<r.length;n++)it(t,r[n].x,r[n].y)}},{"../../components/color":50,"../../components/drawing":71,"../../components/titles":137,"../../constants/alignment":144,"../../constants/numerical":147,"../../lib":169,"../../lib/svg_text_utils":190,"../../plots/plots":252,"../../registry":261,"./autorange":212,"./axis_autotype":214,"./axis_ids":216,"./clean_ticks":218,"./layout_attributes":225,"./set_convert":231,d3:14,"fast-isnumeric":16}],214:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../constants/numerical").BADNUM;e.exports=function(t,e,r){return!(r=r||{}).noMultiCategory&&(o=t,i.isArrayOrTypedArray(o[0])&&i.isArrayOrTypedArray(o[1]))?"multicategory":function(t,e){for(var r=Math.max(1,(t.length-1)/1e3),a=0,o=0,s={},l=0;l<t.length;l+=r){var u=t[Math.round(l)],c=String(u);s[c]||(s[c]=1,i.isDateTime(u,e)&&(a+=1),n(u)&&(o+=1))}return a>2*o}(t,e)?"date":function(t){for(var e=Math.max(1,(t.length-1)/1e3),r=0,n=0,o={},s=0;s<t.length;s+=e){var l=t[Math.round(s)],u=String(l);o[u]||(o[u]=1,"boolean"==typeof l?n++:i.cleanNumber(l)!==a?r++:"string"==typeof l&&n++)}return n>2*r}(t)?"category":function(t){if(!t)return!1;for(var e=0;e<t.length;e++)if(n(t[e]))return!0;return!1}(t)?"linear":"-";var o}},{"../../constants/numerical":147,"../../lib":169,"fast-isnumeric":16}],215:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("./layout_attributes"),o=t("./tick_value_defaults"),s=t("./tick_mark_defaults"),l=t("./tick_label_defaults"),u=t("./category_order_defaults"),c=t("./line_grid_defaults"),p=t("./set_convert");e.exports=function(t,e,r,h,f){var d=h.letter,m=h.font||{},y=h.splomStash||{},g=r("visible",!h.visibleDflt),v=e.type;"date"===v&&n.getComponentMethod("calendars","handleDefaults")(t,e,"calendar",h.calendar);p(e,f);var _=!e.isValidRange(t.range);_&&h.reverseDflt&&(_="reversed"),!r("autorange",_)||"linear"!==v&&"-"!==v||r("rangemode"),r("range"),e.cleanRange(),u(t,e,r,h),"category"===v||h.noHover||r("hoverformat");var x=r("color"),b=x!==a.color.dflt?x:m.color,w=y.label||f._dfltTitle[d];if(l(t,e,r,v,h,{pass:1}),!g)return e;r("title.text",w),i.coerceFont(r,"title.font",{family:m.family,size:Math.round(1.2*m.size),color:b}),o(t,e,r,v),l(t,e,r,v,h,{pass:2}),s(t,e,r,h),c(t,e,r,{dfltColor:x,bgColor:h.bgColor,showGrid:h.showGrid,attributes:a}),(e.showline||e.ticks)&&r("mirror"),h.automargin&&r("automargin");var k,T="multicategory"===e.type;h.noTickson||"category"!==e.type&&!T||!e.ticks&&!e.showgrid||(T&&(k="boundaries"),r("tickson",k));T&&(r("showdividers")&&(r("dividercolor"),r("dividerwidth")));return e}},{"../../lib":169,"../../registry":261,"./category_order_defaults":217,"./layout_attributes":225,"./line_grid_defaults":227,"./set_convert":231,"./tick_label_defaults":232,"./tick_mark_defaults":233,"./tick_value_defaults":234}],216:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("./constants");r.id2name=function(t){if("string"==typeof t&&t.match(i.AX_ID_PATTERN)){var e=t.substr(1);return"1"===e&&(e=""),t.charAt(0)+"axis"+e}},r.name2id=function(t){if(t.match(i.AX_NAME_PATTERN)){var e=t.substr(5);return"1"===e&&(e=""),t.charAt(0)+e}},r.cleanId=function(t,e){if(t.match(i.AX_ID_PATTERN)&&(!e||t.charAt(0)===e)){var r=t.substr(1).replace(/^0+/,"");return"1"===r&&(r=""),t.charAt(0)+r}},r.list=function(t,e,n){var i=t._fullLayout;if(!i)return[];var a,o=r.listIds(t,e),s=new Array(o.length);for(a=0;a<o.length;a++){var l=o[a];s[a]=i[l.charAt(0)+"axis"+l.substr(1)]}if(!n){var u=i._subplots.gl3d||[];for(a=0;a<u.length;a++){var c=i[u[a]];e?s.push(c[e+"axis"]):s.push(c.xaxis,c.yaxis,c.zaxis)}}return s},r.listIds=function(t,e){var r=t._fullLayout;if(!r)return[];var n=r._subplots;return e?n[e+"axis"]:n.xaxis.concat(n.yaxis)},r.getFromId=function(t,e,n){var i=t._fullLayout;return"x"===n?e=e.replace(/y[0-9]*/,""):"y"===n&&(e=e.replace(/x[0-9]*/,"")),i[r.id2name(e)]},r.getFromTrace=function(t,e,i){var a=t._fullLayout,o=null;if(n.traceIs(e,"gl3d")){var s=e.scene;"scene"===s.substr(0,5)&&(o=a[s][i+"axis"])}else o=r.getFromId(t,e[i+"axis"]||i);return o},r.idSort=function(t,e){var r=t.charAt(0),n=e.charAt(0);return r!==n?r>n?1:-1:+(t.substr(1)||1)-+(e.substr(1)||1)},r.getAxisGroup=function(t,e){for(var r=t._axisMatchGroups,n=0;n<r.length;n++){if(r[n][e])return"g"+n}return e}},{"../../registry":261,"./constants":219}],217:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){if("category"===e.type){var i,a=t.categoryarray,o=Array.isArray(a)&&a.length>0;o&&(i="array");var s,l=r("categoryorder",i);"array"===l&&(s=r("categoryarray")),o||"array"!==l||(l=e.categoryorder="trace"),"trace"===l?e._initialCategories=[]:"array"===l?e._initialCategories=s.slice():(s=function(t,e){var r,n,i,a=e.dataAttr||t._id.charAt(0),o={};if(e.axData)r=e.axData;else for(r=[],n=0;n<e.data.length;n++){var s=e.data[n];s[a+"axis"]===t._id&&r.push(s)}for(n=0;n<r.length;n++){var l=r[n][a];for(i=0;i<l.length;i++){var u=l[i];null!=u&&(o[u]=1)}}return Object.keys(o)}(e,n).sort(),"category ascending"===l?e._initialCategories=s:"category descending"===l&&(e._initialCategories=s.reverse()))}}},{}],218:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../constants/numerical").ONEDAY;r.dtick=function(t,e){var r="log"===e,i="date"===e,o="category"===e,s=i?a:1;if(!t)return s;if(n(t))return(t=Number(t))<=0?s:o?Math.max(1,Math.round(t)):i?Math.max(.1,t):t;if("string"!=typeof t||!i&&!r)return s;var l=t.charAt(0),u=t.substr(1);return(u=n(u)?Number(u):0)<=0||!(i&&"M"===l&&u===Math.round(u)||r&&"L"===l||r&&"D"===l&&(1===u||2===u))?s:t},r.tick0=function(t,e,r,a){return"date"===e?i.cleanDate(t,i.dateTick0(r)):"D1"!==a&&"D2"!==a?n(t)?Number(t):0:void 0}},{"../../constants/numerical":147,"../../lib":169,"fast-isnumeric":16}],219:[function(t,e,r){"use strict";var n=t("../../lib/regex").counter;e.exports={idRegex:{x:n("x"),y:n("y")},attrRegex:n("[xy]axis"),xAxisMatch:n("xaxis"),yAxisMatch:n("yaxis"),AX_ID_PATTERN:/^[xyz][0-9]*$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,SUBPLOT_PATTERN:/^x([0-9]*)y([0-9]*)$/,MINDRAG:8,MINSELECT:12,MINZOOM:20,DRAGGERSIZE:20,BENDPX:1.5,REDRAWDELAY:50,SELECTDELAY:100,SELECTID:"-select",DFLTRANGEX:[-1,6],DFLTRANGEY:[-1,4],traceLayerClasses:["imagelayer","heatmaplayer","contourcarpetlayer","contourlayer","funnellayer","waterfalllayer","barlayer","carpetlayer","violinlayer","boxlayer","ohlclayer","scattercarpetlayer","scatterlayer"],clipOnAxisFalseQuery:[".scatterlayer",".barlayer",".funnellayer",".waterfalllayer"],layerValue2layerClass:{"above traces":"above","below traces":"below"}}},{"../../lib/regex":184}],220:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./axis_ids").id2name,a=t("./scale_zoom"),o=t("./autorange").makePadFn,s=t("./autorange").concatExtremes,l=t("../../constants/numerical").ALMOST_EQUAL,u=t("../../constants/alignment").FROM_BL;function c(t,e,r,n,a){var o,s,l,u,c="range"!==a,p=n[i(e)].type,h=[];for(s=0;s<r.length;s++)if((l=r[s])!==e&&(u=n[i(l)]).type===p)if(u.fixedrange){if(c&&u.anchor){n[i(u.anchor)].fixedrange&&h.push(l)}}else h.push(l);for(o=0;o<t.length;o++)if(t[o][e]){var f=t[o],d=[];for(s=0;s<h.length;s++)f[l=h[s]]||d.push(l);return{linkableAxes:d,thisGroup:f}}return{linkableAxes:h,thisGroup:null}}function p(t,e,r,n,i){var a,o,s,l,u;null===e?((e={})[r]=1,u=t.length,t.push(e)):u=t.indexOf(e);var c=Object.keys(e);for(a=0;a<t.length;a++)if(s=t[a],a!==u&&s[n]){var p=s[n];for(o=0;o<c.length;o++)s[l=c[o]]=p*i*e[l];return void t.splice(u,1)}if(1!==i)for(o=0;o<c.length;o++)e[c[o]]*=i;e[n]=1}function h(t,e){var r=t._inputDomain,n=u[t.constraintoward],i=r[0]+(r[1]-r[0])*n;t.domain=t._input.domain=[i+(r[0]-i)/e,i+(r[1]-i)/e],t.setScale()}r.handleConstraintDefaults=function(t,e,r,i){var a,o,s,l,u=i.allAxisIds,h=i.layoutOut,f=i.scaleanchorDflt,d=i.constrainDflt,m=h._axisConstraintGroups,y=h._axisMatchGroups,g=e._id,v=g.charAt(0),_=((h._splomAxes||{})[v]||{})[g]||{},x=e._id,b=x.charAt(0),w=r("constrain",d);if(n.coerce(t,e,{constraintoward:{valType:"enumerated",values:"x"===b?["left","center","right"]:["bottom","middle","top"],dflt:"x"===b?"center":"middle"}},"constraintoward"),!t.matches&&!_.matches||e.fixedrange||(o=c(y,x,u,h),a=n.coerce(t,e,{matches:{valType:"enumerated",values:o.linkableAxes||[],dflt:_.matches}},"matches")),a||e.fixedrange&&"domain"!==w||!t.scaleanchor&&!f||(l=c(m,x,u,h,w),s=n.coerce(t,e,{scaleanchor:{valType:"enumerated",values:l.linkableAxes||[]}},"scaleanchor",f)),a?(delete e.constrain,p(y,o.thisGroup,x,a,1)):-1!==u.indexOf(t.matches)&&n.warn("ignored "+e._name+'.matches: "'+t.matches+'" to avoid either an infinite loop or because the target axis has fixed range.'),s){var k=r("scaleratio");k||(k=e.scaleratio=1),p(m,l.thisGroup,x,s,k)}else-1!==u.indexOf(t.scaleanchor)&&n.warn("ignored "+e._name+'.scaleanchor: "'+t.scaleanchor+'" to avoid either an infinite loop and possibly inconsistent scaleratios, or because the target axis has fixed range or this axis declares a *matches* constraint.')},r.enforce=function(t){var e,r,n,u,c,p,f,d=t._fullLayout,m=d._axisConstraintGroups||[];for(e=0;e<m.length;e++){var y=m[e],g=Object.keys(y),v=1/0,_=0,x=1/0,b={},w={},k=!1;for(r=0;r<g.length;r++)w[n=g[r]]=u=d[i(n)],u._inputDomain?u.domain=u._inputDomain.slice():u._inputDomain=u.domain.slice(),u._inputRange||(u._inputRange=u.range.slice()),u.setScale(),b[n]=c=Math.abs(u._m)/y[n],v=Math.min(v,c),"domain"!==u.constrain&&u._constraintShrinkable||(x=Math.min(x,c)),delete u._constraintShrinkable,_=Math.max(_,c),"domain"===u.constrain&&(k=!0);if(!(v>l*_)||k)for(r=0;r<g.length;r++)if(c=b[n=g[r]],p=(u=w[n]).constrain,c!==x||"domain"===p)if(f=c/x,"range"===p)a(u,f);else{var T=u._inputDomain,A=(u.domain[1]-u.domain[0])/(T[1]-T[0]),M=(u.r2l(u.range[1])-u.r2l(u.range[0]))/(u.r2l(u._inputRange[1])-u.r2l(u._inputRange[0]));if((f/=A)*M<1){u.domain=u._input.domain=T.slice(),a(u,f);continue}if(M<1&&(u.range=u._input.range=u._inputRange.slice(),f*=M),u.autorange){var S=u.r2l(u.range[0]),L=u.r2l(u.range[1]),C=(S+L)/2,E=C,z=C,P=Math.abs(L-C),I=C-P*f*1.0001,D=C+P*f*1.0001,O=o(u);h(u,f);var R,F,B=Math.abs(u._m),N=s(t,u),U=N.min,j=N.max;for(F=0;F<U.length;F++)(R=U[F].val-O(U[F])/B)>I&&R<E&&(E=R);for(F=0;F<j.length;F++)(R=j[F].val+O(j[F])/B)<D&&R>z&&(z=R);f/=(z-E)/(2*P),E=u.l2r(E),z=u.l2r(z),u.range=u._input.range=S<L?[E,z]:[z,E]}h(u,f)}}},r.clean=function(t,e){if(e._inputDomain){for(var r=!1,n=e._id,i=t._fullLayout._axisConstraintGroups,a=0;a<i.length;a++)if(i[a][n]){r=!0;break}r&&"domain"===e.constrain||(e._input.domain=e.domain=e._inputDomain,delete e._inputDomain)}}},{"../../constants/alignment":144,"../../constants/numerical":147,"../../lib":169,"./autorange":212,"./axis_ids":216,"./scale_zoom":229}],221:[function(t,e,r){"use strict";var n=t("d3"),i=t("tinycolor2"),a=t("has-passive-events"),o=t("../../registry"),s=t("../../lib"),l=t("../../lib/svg_text_utils"),u=t("../../components/color"),c=t("../../components/drawing"),p=t("../../components/fx"),h=t("./axes"),f=t("../../lib/setcursor"),d=t("../../components/dragelement"),m=t("../../constants/alignment").FROM_TL,y=t("../../lib/clear_gl_canvases"),g=t("../../plot_api/subroutines").redrawReglTraces,v=t("../plots"),_=t("./axis_ids").getFromId,x=t("./select").prepSelect,b=t("./select").clearSelect,w=t("./select").selectOnClick,k=t("./scale_zoom"),T=t("./constants"),A=T.MINDRAG,M=T.MINZOOM,S=!0;function L(t,e,r,n){var i=s.ensureSingle(t.draglayer,e,r,function(e){e.classed("drag",!0).style({fill:"transparent","stroke-width":0}).attr("data-subplot",t.id)});return i.call(f,n),i.node()}function C(t,e,r,i,a,o,s){var l=L(t,"rect",e,r);return n.select(l).call(c.setRect,i,a,o,s),l}function E(t,e){for(var r=0;r<t.length;r++)if(!t[r].fixedrange)return e;return""}function z(t,e,r,n,i){for(var a=0;a<t.length;a++){var o=t[a];if(!o.fixedrange){var s=o._rl[0],l=o._rl[1]-s;n[o._name+".range[0]"]=o.l2r(s+l*e),n[o._name+".range[1]"]=o.l2r(s+l*r)}}if(i&&i.length){var u=(e+(1-r))/2;z(i,u,1-u,n,[])}}function P(t,e){for(var r=0;r<t.length;r++){var n=t[r];n.fixedrange||(n.range=[n.l2r(n._rl[0]-e/n._m),n.l2r(n._rl[1]-e/n._m)])}}function I(t){return 1-(t>=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function D(t,e,r,n,i){return t.append("path").attr("class","zoombox").style({fill:e>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform","translate("+r+", "+n+")").attr("d",i+"Z")}function O(t,e,r){return t.append("path").attr("class","zoombox-corners").style({fill:u.background,stroke:u.defaultLine,"stroke-width":1,opacity:0}).attr("transform","translate("+e+", "+r+")").attr("d","M0,0Z")}function R(t,e,r,n,i,a){t.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),F(t,e,i,a)}function F(t,e,r,n){r||(t.transition().style("fill",n>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),e.transition().style("opacity",1).duration(200))}function B(t){n.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function N(t){S&&t.data&&t._context.showTips&&(s.notifier(s._(t,"Double-click to zoom back out"),"long"),S=!1)}function U(t){return"lasso"===t||"select"===t}function j(t){var e=Math.floor(Math.min(t.b-t.t,t.r-t.l,M)/2);return"M"+(t.l-3.5)+","+(t.t-.5+e)+"h3v"+-e+"h"+e+"v-3h-"+(e+3)+"ZM"+(t.r+3.5)+","+(t.t-.5+e)+"h-3v"+-e+"h"+-e+"v-3h"+(e+3)+"ZM"+(t.r+3.5)+","+(t.b+.5-e)+"h-3v"+e+"h"+-e+"v3h"+(e+3)+"ZM"+(t.l-3.5)+","+(t.b+.5-e)+"h3v"+e+"h"+e+"v3h-"+(e+3)+"Z"}function V(t,e,r,n){for(var i,a,o,l,u=!1,c={},p={},h=0;h<e.length;h++){var f=e[h];for(i in r)if(f[i]){for(o in f)("x"===o.charAt(0)?r:n)[o]||(c[o]=i);for(a in n)f[a]&&(u=!0)}for(a in n)if(f[a])for(l in f)("x"===l.charAt(0)?r:n)[l]||(p[l]=a)}u&&(s.extendFlat(c,p),p={});var d={},m=[];for(o in c){var y=_(t,o);m.push(y),d[y._id]=y}var g={},v=[];for(l in p){var x=_(t,l);v.push(x),g[x._id]=x}return{xaHash:d,yaHash:g,xaxes:m,yaxes:v,xLinks:c,yLinks:p,isSubplotConstrained:u}}function q(t,e){if(a){var r=void 0!==t.onwheel?"wheel":"mousewheel";t._onwheel&&t.removeEventListener(r,t._onwheel),t._onwheel=e,t.addEventListener(r,e,{passive:!1})}else void 0!==t.onwheel?t.onwheel=e:void 0!==t.onmousewheel&&(t.onmousewheel=e)}function G(t){var e=[];for(var r in t)e.push(t[r]);return e}e.exports={makeDragBox:function(t,e,r,a,u,f,S,L){var F,H,Z,X,W,Y,K,J,$,Q,tt,et,rt,nt,it,at,ot,st,lt,ut,ct,pt=t._fullLayout._zoomlayer,ht=S+L==="nsew",ft=1===(S+L).length;function dt(){if(F=e.xaxis,H=e.yaxis,$=F._length,Q=H._length,K=F._offset,J=H._offset,(Z={})[F._id]=F,(X={})[H._id]=H,S&&L)for(var r=e.overlays,n=0;n<r.length;n++){var i=r[n].xaxis;Z[i._id]=i;var a=r[n].yaxis;X[a._id]=a}W=G(Z),Y=G(X),rt=E(W,L),nt=E(Y,S),it=!nt&&!rt,tt=V(t,t._fullLayout._axisConstraintGroups,Z,X),et=V(t,t._fullLayout._axisMatchGroups,Z,X),at=L||tt.isSubplotConstrained||et.isSubplotConstrained,ot=S||tt.isSubplotConstrained||et.isSubplotConstrained;var o=t._fullLayout;st=o._has("scattergl"),lt=o._has("splom"),ut=o._has("svg")}dt();var mt=function(t,e,r){return t?"nsew"===t?r?"":"pan"===e?"move":"crosshair":t.toLowerCase()+"-resize":"pointer"}(nt+rt,t._fullLayout.dragmode,ht),yt=C(e,S+L+"drag",mt,r,a,u,f);if(it&&!ht)return yt.onmousedown=null,yt.style.pointerEvents="none",yt;var gt,vt,_t,xt,bt,wt,kt,Tt,At,Mt,St={element:yt,gd:t,plotinfo:e};function Lt(){St.plotinfo.selection=!1,b(t)}function Ct(r,i){var a=t._fullLayout.clickmode;if(B(t),2!==r||ft||function(){if(!t._transitioningWithDuration){var e=t._context.doubleClick,r=[];rt&&(r=r.concat(W)),nt&&(r=r.concat(Y)),et.xaxes&&(r=r.concat(et.xaxes)),et.yaxes&&(r=r.concat(et.yaxes));var n,i,a,s={};if("reset+autosize"===e)for(e="autosize",i=0;i<r.length;i++)if((n=r[i])._rangeInitial&&(n.range[0]!==n._rangeInitial[0]||n.range[1]!==n._rangeInitial[1])||!n._rangeInitial&&!n.autorange){e="reset";break}if("autosize"===e)for(i=0;i<r.length;i++)(n=r[i]).fixedrange||(s[n._name+".autorange"]=!0);else if("reset"===e)for((rt||tt.isSubplotConstrained)&&(r=r.concat(tt.xaxes)),nt&&!tt.isSubplotConstrained&&(r=r.concat(tt.yaxes)),tt.isSubplotConstrained&&(rt?nt||(r=r.concat(Y)):r=r.concat(W)),i=0;i<r.length;i++)(n=r[i]).fixedrange||(n._rangeInitial?(a=n._rangeInitial,s[n._name+".range[0]"]=a[0],s[n._name+".range[1]"]=a[1]):s[n._name+".autorange"]=!0);t.emit("plotly_doubleclick",null),o.call("_guiRelayout",t,s)}}(),ht)a.indexOf("select")>-1&&w(i,t,W,Y,e.id,St),a.indexOf("event")>-1&&p.click(t,i,e.id);else if(1===r&&ft){var s=S?H:F,u="s"===S||"w"===L?0:1,c=s._name+".range["+u+"]",h=function(t,e){var r,i=t.range[e],a=Math.abs(i-t.range[1-e]);return"date"===t.type?i:"log"===t.type?(r=Math.ceil(Math.max(0,-Math.log(a)/Math.LN10))+3,n.format("."+r+"g")(Math.pow(10,i))):(r=Math.floor(Math.log(Math.abs(i))/Math.LN10)-Math.floor(Math.log(a)/Math.LN10)+4,n.format("."+String(r)+"g")(i))}(s,u),f="left",d="middle";if(s.fixedrange)return;S?(d="n"===S?"top":"bottom","right"===s.side&&(f="right")):"e"===L&&(f="right"),t._context.showAxisRangeEntryBoxes&&n.select(yt).call(l.makeEditable,{gd:t,immediate:!0,background:t._fullLayout.paper_bgcolor,text:String(h),fill:s.tickfont?s.tickfont.color:"#444",horizontalAlign:f,verticalAlign:d}).on("edit",function(e){var r=s.d2r(e);void 0!==r&&o.call("_guiRelayout",t,c,r)})}}function Et(e,r){if(t._transitioningWithDuration)return!1;var n=Math.max(0,Math.min($,e+gt)),i=Math.max(0,Math.min(Q,r+vt)),a=Math.abs(n-gt),o=Math.abs(i-vt);function s(){kt="",_t.r=_t.l,_t.t=_t.b,At.attr("d","M0,0Z")}if(_t.l=Math.min(gt,n),_t.r=Math.max(gt,n),_t.t=Math.min(vt,i),_t.b=Math.max(vt,i),tt.isSubplotConstrained)a>M||o>M?(kt="xy",a/$>o/Q?(o=a*Q/$,vt>i?_t.t=vt-o:_t.b=vt+o):(a=o*$/Q,gt>n?_t.l=gt-a:_t.r=gt+a),At.attr("d",j(_t))):s();else if(et.isSubplotConstrained)if(a>M||o>M){kt="xy";var l=Math.min(_t.l/$,(Q-_t.b)/Q),u=Math.max(_t.r/$,(Q-_t.t)/Q);_t.l=l*$,_t.r=u*$,_t.b=(1-l)*Q,_t.t=(1-u)*Q,At.attr("d",j(_t))}else s();else!nt||o<Math.min(Math.max(.6*a,A),M)?a<A||!rt?s():(_t.t=0,_t.b=Q,kt="x",At.attr("d",function(t,e){return"M"+(t.l-.5)+","+(e-M-.5)+"h-3v"+(2*M+1)+"h3ZM"+(t.r+.5)+","+(e-M-.5)+"h3v"+(2*M+1)+"h-3Z"}(_t,vt))):!rt||a<Math.min(.6*o,M)?(_t.l=0,_t.r=$,kt="y",At.attr("d",function(t,e){return"M"+(e-M-.5)+","+(t.t-.5)+"v-3h"+(2*M+1)+"v3ZM"+(e-M-.5)+","+(t.b+.5)+"v3h"+(2*M+1)+"v-3Z"}(_t,gt))):(kt="xy",At.attr("d",j(_t)));_t.w=_t.r-_t.l,_t.h=_t.b-_t.t,kt&&(Mt=!0),t._dragged=Mt,R(Tt,At,_t,bt,wt,xt),zt(),t.emit("plotly_relayouting",ct),wt=!0}function zt(){ct={},"xy"!==kt&&"x"!==kt||(z(W,_t.l/$,_t.r/$,ct,tt.xaxes),Bt("x",ct)),"xy"!==kt&&"y"!==kt||(z(Y,(Q-_t.b)/Q,(Q-_t.t)/Q,ct,tt.yaxes),Bt("y",ct))}function Pt(){zt(),B(t),Ut(),N(t)}St.prepFn=function(e,r,n){var a=St.dragmode,o=t._fullLayout.dragmode;o!==a&&(St.dragmode=o),dt(),it||(ht?e.shiftKey?"pan"===o?o="zoom":U(o)||(o="pan"):e.ctrlKey&&(o="pan"):o="pan"),St.minDrag="lasso"===o?1:void 0,U(o)?(St.xaxes=W,St.yaxes=Y,x(e,r,n,St,o)):(St.clickFn=Ct,U(a)&&Lt(),it||("zoom"===o?(St.moveFn=Et,St.doneFn=Pt,St.minDrag=1,function(e,r,n){var a=yt.getBoundingClientRect();gt=r-a.left,vt=n-a.top,_t={l:gt,r:gt,w:0,t:vt,b:vt,h:0},xt=t._hmpixcount?t._hmlumcount/t._hmpixcount:i(t._fullLayout.plot_bgcolor).getLuminance(),wt=!1,kt="xy",Mt=!1,Tt=D(pt,xt,K,J,bt="M0,0H"+$+"V"+Q+"H0V0"),At=O(pt,K,J)}(0,r,n)):"pan"===o&&(St.moveFn=Ft,St.doneFn=Ut))),t._fullLayout._redrag=function(){var e=t._dragdata;e&&e.element===yt&&(U(t._fullLayout.dragmode)||(dt(),jt([0,0,$,Q]),St.moveFn(e.dx,e.dy)))}},d.init(St);var It=[0,0,$,Q],Dt=null,Ot=T.REDRAWDELAY,Rt=e.mainplot?t._fullLayout._plots[e.mainplot]:e;function Ft(e,r){if(!t._transitioningWithDuration){if(t._fullLayout._replotting=!0,"ew"===rt||"ns"===nt)return rt&&(P(W,e),Bt("x")),nt&&(P(Y,r),Bt("y")),jt([rt?-e:0,nt?-r:0,$,Q]),Nt(),void t.emit("plotly_relayouting",ct);if(tt.isSubplotConstrained&&rt&&nt){var n="w"===rt==("n"===nt)?1:-1,i=(e/$+n*r/Q)/2;e=i*$,r=n*i*Q}"w"===rt?e=l(W,0,e):"e"===rt?e=l(W,1,-e):rt||(e=0),"n"===nt?r=l(Y,1,r):"s"===nt?r=l(Y,0,-r):nt||(r=0);var a="w"===rt?e:0,o="n"===nt?r:0;if(tt.isSubplotConstrained){var s;if(!rt&&1===nt.length){for(s=0;s<W.length;s++)W[s].range=W[s]._r.slice(),k(W[s],1-r/Q);a=(e=r*$/Q)/2}if(!nt&&1===rt.length){for(s=0;s<Y.length;s++)Y[s].range=Y[s]._r.slice(),k(Y[s],1-e/$);o=(r=e*Q/$)/2}}Bt("x"),Bt("y"),jt([a,o,$-e,Q-r]),Nt(),t.emit("plotly_relayouting",ct)}function l(t,e,r){for(var n,i,a=1-e,o=0;o<t.length;o++){var s=t[o];if(!s.fixedrange){n=s,i=s._rl[a]+(s._rl[e]-s._rl[a])/I(r/s._length);var l=s.l2r(i);!1!==l&&void 0!==l&&(s.range[e]=l)}}return n._length*(n._rl[e]-i)/(n._rl[e]-n._rl[a])}}function Bt(t,e){for(var r=et.isSubplotConstrained?{x:Y,y:W}[t]:et[t+"axes"],n=et.isSubplotConstrained?{x:W,y:Y}[t]:[],i=0;i<r.length;i++){var a=r[i],o=a._id,s=et.xLinks[o]||et.yLinks[o],l=n[0]||Z[s]||X[s];l&&(e?(e[a._name+".range[0]"]=e[l._name+".range[0]"],e[a._name+".range[1]"]=e[l._name+".range[1]"]):a.range=l.range.slice())}}function Nt(){var e,r=[];function n(t){for(e=0;e<t.length;e++)t[e].fixedrange||r.push(t[e]._id)}for(at&&(n(W),n(tt.xaxes),n(et.xaxes)),ot&&(n(Y),n(tt.yaxes),n(et.yaxes)),ct={},e=0;e<r.length;e++){var i=r[e],a=_(t,i);h.drawOne(t,a,{skipTitle:!0}),ct[a._name+".range[0]"]=a.range[0],ct[a._name+".range[1]"]=a.range[1]}h.redrawComponents(t,r)}function Ut(){jt([0,0,$,Q]),s.syncOrAsync([v.previousPromises,function(){t._fullLayout._replotting=!1,o.call("_guiRelayout",t,ct)}],t)}function jt(e){var r,n,i,a,l=t._fullLayout,u=l._plots,p=l._subplots.cartesian;if(lt&&o.subplotsRegistry.splom.drag(t),st)for(r=0;r<p.length;r++)if(i=(n=u[p[r]]).xaxis,a=n.yaxis,n._scene){var h=s.simpleMap(i.range,i.r2l),f=s.simpleMap(a.range,a.r2l);n._scene.update({range:[h[0],f[0],h[1],f[1]]})}if((lt||st)&&(y(t),g(t)),ut){var d=e[2]/F._length,m=e[3]/H._length;for(r=0;r<p.length;r++){i=(n=u[p[r]]).xaxis,a=n.yaxis;var v,_,x,b,w=at&&!i.fixedrange&&Z[i._id],k=ot&&!a.fixedrange&&X[a._id];if(w?(v=d,x=L?e[0]:Gt(i,v)):et.xaHash[i._id]?(v=d,x=e[0]*i._length/F._length):et.yaHash[i._id]?(v=m,x="ns"===nt?-e[1]*i._length/H._length:Gt(i,v,{n:"top",s:"bottom"}[nt])):x=qt(i,v=Vt(i,d,m)),k?(_=m,b=S?e[1]:Gt(a,_)):et.yaHash[a._id]?(_=m,b=e[1]*a._length/H._length):et.xaHash[a._id]?(_=d,b="ew"===rt?-e[0]*a._length/F._length:Gt(a,_,{e:"right",w:"left"}[rt])):b=qt(a,_=Vt(a,d,m)),v||_){v||(v=1),_||(_=1);var T=i._offset-x/v,A=a._offset-b/_;n.clipRect.call(c.setTranslate,x,b).call(c.setScale,v,_),n.plot.call(c.setTranslate,T,A).call(c.setScale,1/v,1/_),v===n.xScaleFactor&&_===n.yScaleFactor||(c.setPointGroupScale(n.zoomScalePts,v,_),c.setTextPointsScale(n.zoomScaleTxt,v,_)),c.hideOutsideRangePoints(n.clipOnAxisFalseTraces,n),n.xScaleFactor=v,n.yScaleFactor=_}}}}function Vt(t,e,r){return t.fixedrange?0:at&&tt.xaHash[t._id]?e:ot&&(tt.isSubplotConstrained?tt.xaHash:tt.yaHash)[t._id]?r:0}function qt(t,e){return e?(t.range=t._r.slice(),k(t,e),Gt(t,e)):0}function Gt(t,e,r){return t._length*(1-e)*m[r||t.constraintoward||"middle"]}return S.length*L.length!=1&&q(yt,function(e){if(t._context._scrollZoom.cartesian||t._fullLayout._enablescrollzoom){if(Lt(),t._transitioningWithDuration)return e.preventDefault(),void e.stopPropagation();dt(),clearTimeout(Dt);var r=-e.deltaY;if(isFinite(r)||(r=e.wheelDelta/10),isFinite(r)){var n,i=Math.exp(-Math.min(Math.max(r,-20),20)/200),a=Rt.draglayer.select(".nsewdrag").node().getBoundingClientRect(),o=(e.clientX-a.left)/a.width,l=(a.bottom-e.clientY)/a.height;if(at){for(L||(o=.5),n=0;n<W.length;n++)u(W[n],o,i);Bt("x"),It[2]*=i,It[0]+=It[2]*o*(1/i-1)}if(ot){for(S||(l=.5),n=0;n<Y.length;n++)u(Y[n],l,i);Bt("y"),It[3]*=i,It[1]+=It[3]*(1-l)*(1/i-1)}jt(It),Nt(),t.emit("plotly_relayouting",ct),Dt=setTimeout(function(){It=[0,0,$,Q],Ut()},Ot),e.preventDefault()}else s.log("Did not find wheel motion attributes: ",e)}function u(t,e,r){if(!t.fixedrange){var n=s.simpleMap(t.range,t.r2l),i=n[0]+(n[1]-n[0])*e;t.range=n.map(function(e){return t.l2r(i+(e-i)*r)})}}}),yt},makeDragger:L,makeRectDragger:C,makeZoombox:D,makeCorners:O,updateZoombox:R,xyCorners:j,transitionZoombox:F,removeZoombox:B,showDoubleClickNotifier:N,attachWheelEventHandler:q}},{"../../components/color":50,"../../components/dragelement":68,"../../components/drawing":71,"../../components/fx":88,"../../constants/alignment":144,"../../lib":169,"../../lib/clear_gl_canvases":156,"../../lib/setcursor":188,"../../lib/svg_text_utils":190,"../../plot_api/subroutines":204,"../../registry":261,"../plots":252,"./axes":213,"./axis_ids":216,"./constants":219,"./scale_zoom":229,"./select":230,d3:14,"has-passive-events":19,tinycolor2:33}],222:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../components/fx"),a=t("../../components/dragelement"),o=t("../../lib/setcursor"),s=t("./dragbox").makeDragBox,l=t("./constants").DRAGGERSIZE;r.initInteractions=function(t){var e=t._fullLayout;if(t._context.staticPlot)n.select(t).selectAll(".drag").remove();else if(e._has("cartesian")||e._has("splom")){Object.keys(e._plots||{}).sort(function(t,r){if((e._plots[t].mainplot&&!0)===(e._plots[r].mainplot&&!0)){var n=t.split("y"),i=r.split("y");return n[0]===i[0]?Number(n[1]||1)-Number(i[1]||1):Number(n[0]||1)-Number(i[0]||1)}return e._plots[t].mainplot?1:-1}).forEach(function(r){var n=e._plots[r],o=n.xaxis,u=n.yaxis;if(!n.mainplot){var c=s(t,n,o._offset,u._offset,o._length,u._length,"ns","ew");c.onmousemove=function(e){t._fullLayout._rehover=function(){t._fullLayout._hoversubplot===r&&t._fullLayout._plots[r]&&i.hover(t,e,r)},i.hover(t,e,r),t._fullLayout._lasthover=c,t._fullLayout._hoversubplot=r},c.onmouseout=function(e){t._dragging||(t._fullLayout._hoversubplot=null,a.unhover(t,e))},t._context.showAxisDragHandles&&(s(t,n,o._offset-l,u._offset-l,l,l,"n","w"),s(t,n,o._offset+o._length,u._offset-l,l,l,"n","e"),s(t,n,o._offset-l,u._offset+u._length,l,l,"s","w"),s(t,n,o._offset+o._length,u._offset+u._length,l,l,"s","e"))}if(t._context.showAxisDragHandles){if(r===o._mainSubplot){var p=o._mainLinePosition;"top"===o.side&&(p-=l),s(t,n,o._offset+.1*o._length,p,.8*o._length,l,"","ew"),s(t,n,o._offset,p,.1*o._length,l,"","w"),s(t,n,o._offset+.9*o._length,p,.1*o._length,l,"","e")}if(r===u._mainSubplot){var h=u._mainLinePosition;"right"!==u.side&&(h-=l),s(t,n,h,u._offset+.1*u._length,l,.8*u._length,"ns",""),s(t,n,h,u._offset+.9*u._length,l,.1*u._length,"s",""),s(t,n,h,u._offset,l,.1*u._length,"n","")}}});var o=e._hoverlayer.node();o.onmousemove=function(r){r.target=t._fullLayout._lasthover,i.hover(t,r,e._hoversubplot)},o.onclick=function(e){e.target=t._fullLayout._lasthover,i.click(t,e)},o.onmousedown=function(e){t._fullLayout._lasthover.onmousedown(e)},r.updateFx(t)}},r.updateFx=function(t){var e=t._fullLayout,r="pan"===e.dragmode?"move":"crosshair";o(e._draggers,r)}},{"../../components/dragelement":68,"../../components/fx":88,"../../lib/setcursor":188,"./constants":219,"./dragbox":221,d3:14}],223:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib");e.exports=function(t){return function(e,r){var a=e[t];if(Array.isArray(a))for(var o=n.subplotsRegistry.cartesian,s=o.idRegex,l=r._subplots,u=l.xaxis,c=l.yaxis,p=l.cartesian,h=r._has("cartesian")||r._has("gl2d"),f=0;f<a.length;f++){var d=a[f];if(i.isPlainObject(d)){var m=d.xref,y=d.yref,g=s.x.test(m),v=s.y.test(y);if(g||v){h||i.pushUnique(r._basePlotModules,o);var _=!1;g&&-1===u.indexOf(m)&&(u.push(m),_=!0),v&&-1===c.indexOf(y)&&(c.push(y),_=!0),_&&g&&v&&p.push(m+y)}}}}}},{"../../lib":169,"../../registry":261}],224:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../registry"),a=t("../../lib"),o=t("../plots"),s=t("../../components/drawing"),l=t("../get_data").getModuleCalcData,u=t("./axis_ids"),c=t("./constants"),p=t("../../constants/xmlns_namespaces"),h=a.ensureSingle;function f(t,e,r){return a.ensureSingle(t,e,r,function(t){t.datum(r)})}function d(t,e,r,a,o){for(var u,p,h,f=c.traceLayerClasses,d=t._fullLayout,m=d._modules,y=[],g=[],v=0;v<m.length;v++){var _=(u=m[v]).name,x=i.modules[_].categories;if(x.svg){var b=u.layerName||_+"layer",w=u.plot;h=(p=l(r,w))[0],r=p[1],h.length&&y.push({i:f.indexOf(b),className:b,plotMethod:w,cdModule:h}),x.zoomScale&&g.push("."+b)}}y.sort(function(t,e){return t.i-e.i});var k=e.plot.selectAll("g.mlayer").data(y,function(t){return t.className});if(k.enter().append("g").attr("class",function(t){return t.className}).classed("mlayer",!0).classed("rangeplot",e.isRangePlot),k.exit().remove(),k.order(),k.each(function(r){var i=n.select(this),l=r.className;r.plotMethod(t,e,r.cdModule,i,a,o),-1===c.clipOnAxisFalseQuery.indexOf("."+l)&&s.setClipUrl(i,e.layerClipId,t)}),d._has("scattergl")&&(u=i.getModule("scattergl"),h=l(r,u)[0],u.plot(t,e,h)),!t._context.staticPlot&&(e._hasClipOnAxisFalse&&(e.clipOnAxisFalseTraces=e.plot.selectAll(c.clipOnAxisFalseQuery.join(",")).selectAll(".trace")),g.length)){var T=e.plot.selectAll(g.join(",")).selectAll(".trace");e.zoomScalePts=T.selectAll("path.point"),e.zoomScaleTxt=T.selectAll(".textpoint")}}function m(t,e){var r=e.plotgroup,n=e.id,i=c.layerValue2layerClass[e.xaxis.layer],a=c.layerValue2layerClass[e.yaxis.layer],o=t._fullLayout._hasOnlyLargeSploms;if(e.mainplot){var s=e.mainplotinfo,l=s.plotgroup,p=n+"-x",d=n+"-y";e.gridlayer=s.gridlayer,e.zerolinelayer=s.zerolinelayer,h(s.overlinesBelow,"path",p),h(s.overlinesBelow,"path",d),h(s.overaxesBelow,"g",p),h(s.overaxesBelow,"g",d),e.plot=h(s.overplot,"g",n),h(s.overlinesAbove,"path",p),h(s.overlinesAbove,"path",d),h(s.overaxesAbove,"g",p),h(s.overaxesAbove,"g",d),e.xlines=l.select(".overlines-"+i).select("."+p),e.ylines=l.select(".overlines-"+a).select("."+d),e.xaxislayer=l.select(".overaxes-"+i).select("."+p),e.yaxislayer=l.select(".overaxes-"+a).select("."+d)}else if(o)e.xlines=h(r,"path","xlines-above"),e.ylines=h(r,"path","ylines-above"),e.xaxislayer=h(r,"g","xaxislayer-above"),e.yaxislayer=h(r,"g","yaxislayer-above");else{var m=h(r,"g","layer-subplot");e.shapelayer=h(m,"g","shapelayer"),e.imagelayer=h(m,"g","imagelayer"),e.gridlayer=h(r,"g","gridlayer"),e.zerolinelayer=h(r,"g","zerolinelayer"),h(r,"path","xlines-below"),h(r,"path","ylines-below"),e.overlinesBelow=h(r,"g","overlines-below"),h(r,"g","xaxislayer-below"),h(r,"g","yaxislayer-below"),e.overaxesBelow=h(r,"g","overaxes-below"),e.plot=h(r,"g","plot"),e.overplot=h(r,"g","overplot"),e.xlines=h(r,"path","xlines-above"),e.ylines=h(r,"path","ylines-above"),e.overlinesAbove=h(r,"g","overlines-above"),h(r,"g","xaxislayer-above"),h(r,"g","yaxislayer-above"),e.overaxesAbove=h(r,"g","overaxes-above"),e.xlines=r.select(".xlines-"+i),e.ylines=r.select(".ylines-"+a),e.xaxislayer=r.select(".xaxislayer-"+i),e.yaxislayer=r.select(".yaxislayer-"+a)}o||(f(e.gridlayer,"g",e.xaxis._id),f(e.gridlayer,"g",e.yaxis._id),e.gridlayer.selectAll("g").map(function(t){return t[0]}).sort(u.idSort)),e.xlines.style("fill","none").classed("crisp",!0),e.ylines.style("fill","none").classed("crisp",!0)}function y(t,e){if(t){var r={};for(var i in t.each(function(t){var i=t[0];n.select(this).remove(),g(i,e),r[i]=!0}),e._plots)for(var a=e._plots[i].overlays||[],o=0;o<a.length;o++){var s=a[o];r[s.id]&&s.plot.selectAll(".trace").remove()}}}function g(t,e){e._draggers.selectAll("g."+t).remove(),e._defs.select("#clip"+e._uid+t+"plot").remove()}r.name="cartesian",r.attr=["xaxis","yaxis"],r.idRoot=["x","y"],r.idRegex=c.idRegex,r.attrRegex=c.attrRegex,r.attributes=t("./attributes"),r.layoutAttributes=t("./layout_attributes"),r.supplyLayoutDefaults=t("./layout_defaults"),r.transitionAxes=t("./transition_axes"),r.finalizeSubplots=function(t,e){var r,n,i,o=e._subplots,s=o.xaxis,l=o.yaxis,p=o.cartesian,h=p.concat(o.gl2d||[]),f={},d={};for(r=0;r<h.length;r++){var m=h[r].split("y");f[m[0]]=1,d["y"+m[1]]=1}for(r=0;r<s.length;r++)f[n=s[r]]||(i=(t[u.id2name(n)]||{}).anchor,c.idRegex.y.test(i)||(i="y"),p.push(n+i),h.push(n+i),d[i]||(d[i]=1,a.pushUnique(l,i)));for(r=0;r<l.length;r++)d[i=l[r]]||(n=(t[u.id2name(i)]||{}).anchor,c.idRegex.x.test(n)||(n="x"),p.push(n+i),h.push(n+i),f[n]||(f[n]=1,a.pushUnique(s,n)));if(!h.length){for(var y in n="",i="",t){if(c.attrRegex.test(y))"x"===y.charAt(0)?(!n||+y.substr(5)<+n.substr(5))&&(n=y):(!i||+y.substr(5)<+i.substr(5))&&(i=y)}n=n?u.name2id(n):"x",i=i?u.name2id(i):"y",s.push(n),l.push(i),p.push(n+i)}},r.plot=function(t,e,r,n){var i,a=t._fullLayout,o=a._subplots.cartesian,s=t.calcdata;if(!Array.isArray(e))for(e=[],i=0;i<s.length;i++)e.push(i);for(i=0;i<o.length;i++){for(var l,u=o[i],c=a._plots[u],p=[],h=0;h<s.length;h++){var f=s[h],m=f[0].trace;m.xaxis+m.yaxis===u&&((-1!==e.indexOf(m.index)||m.carpet)&&(l&&l[0].trace.xaxis+l[0].trace.yaxis===u&&-1!==["tonextx","tonexty","tonext"].indexOf(m.fill)&&-1===p.indexOf(l)&&p.push(l),p.push(f)),l=f)}d(t,c,p,r,n)}},r.clean=function(t,e,r,n){var i,a,o,s=n._plots||{},l=e._plots||{},c=n._subplots||{};if(n._hasOnlyLargeSploms&&!e._hasOnlyLargeSploms)for(o in s)(i=s[o]).plotgroup&&i.plotgroup.remove();var p=n._has&&n._has("gl"),h=e._has&&e._has("gl");if(p&&!h)for(o in s)(i=s[o])._scene&&i._scene.destroy();if(c.xaxis&&c.yaxis){var f=u.listIds({_fullLayout:n});for(a=0;a<f.length;a++){var d=f[a];e[u.id2name(d)]||n._infolayer.selectAll(".g-"+d+"title").remove()}}var m=n._has&&n._has("cartesian"),v=e._has&&e._has("cartesian");if(m&&!v)y(n._cartesianlayer.selectAll(".subplot"),n),n._defs.selectAll(".axesclip").remove(),delete n._axisConstraintGroups;else if(c.cartesian)for(a=0;a<c.cartesian.length;a++){var _=c.cartesian[a];if(!l[_]){var x="."+_+",."+_+"-x,."+_+"-y";n._cartesianlayer.selectAll(x).remove(),g(_,n)}}},r.drawFramework=function(t){var e=t._fullLayout,r=function(t){var e,r,n,i,a,o,s=t._fullLayout,l=s._subplots.cartesian,u=l.length,c=[],p=[];for(e=0;e<u;e++){n=l[e],i=s._plots[n],a=i.xaxis,o=i.yaxis;var h=a._mainAxis,f=o._mainAxis,d=h._id+f._id,m=s._plots[d];i.overlays=[],d!==n&&m?(i.mainplot=d,i.mainplotinfo=m,p.push(n)):(i.mainplot=void 0,i.mainPlotinfo=void 0,c.push(n))}for(e=0;e<p.length;e++)n=p[e],(i=s._plots[n]).mainplotinfo.overlays.push(i);var y=c.concat(p),g=new Array(u);for(e=0;e<u;e++){n=y[e],i=s._plots[n],a=i.xaxis,o=i.yaxis;var v=[n,a.layer,o.layer,a.overlaying||"",o.overlaying||""];for(r=0;r<i.overlays.length;r++)v.push(i.overlays[r].id);g[e]=v}return g}(t),i=e._cartesianlayer.selectAll(".subplot").data(r,String);i.enter().append("g").attr("class",function(t){return"subplot "+t[0]}),i.order(),i.exit().call(y,e),i.each(function(r){var i=r[0],a=e._plots[i];a.plotgroup=n.select(this),m(t,a),a.draglayer=h(e._draggers,"g",i)})},r.rangePlot=function(t,e,r){m(t,e),d(t,e,r),o.style(t)},r.toSVG=function(t){var e=t._fullLayout._glimages,r=n.select(t).selectAll(".svg-container");r.filter(function(t,e){return e===r.size()-1}).selectAll(".gl-canvas-context, .gl-canvas-focus").each(function(){var t=this.toDataURL("image/png");e.append("svg:image").attr({xmlns:p.svg,"xlink:href":t,preserveAspectRatio:"none",x:0,y:0,width:this.width,height:this.height})})},r.updateFx=t("./graph_interact").updateFx},{"../../components/drawing":71,"../../constants/xmlns_namespaces":148,"../../lib":169,"../../registry":261,"../get_data":241,"../plots":252,"./attributes":211,"./axis_ids":216,"./constants":219,"./graph_interact":222,"./layout_attributes":225,"./layout_defaults":226,"./transition_axes":235,d3:14}],225:[function(t,e,r){"use strict";var n=t("../font_attributes"),i=t("../../components/color/attributes"),a=t("../../components/drawing/attributes").dash,o=t("../../lib/extend").extendFlat,s=t("../../plot_api/plot_template").templatedArray,l=(t("../../constants/docs").FORMAT_LINK,t("../../constants/docs").DATE_FORMAT_LINK,t("./constants"));e.exports={visible:{valType:"boolean",editType:"plot"},color:{valType:"color",dflt:i.defaultLine,editType:"ticks"},title:{text:{valType:"string",editType:"ticks"},font:n({editType:"ticks"}),standoff:{valType:"number",min:0,editType:"ticks"},editType:"ticks"},type:{valType:"enumerated",values:["-","linear","log","date","category","multicategory"],dflt:"-",editType:"calc",_noTemplating:!0},autorange:{valType:"enumerated",values:[!0,!1,"reversed"],dflt:!0,editType:"axrange",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},rangemode:{valType:"enumerated",values:["normal","tozero","nonnegative"],dflt:"normal",editType:"plot"},range:{valType:"info_array",items:[{valType:"any",editType:"axrange",impliedEdits:{"^autorange":!1},anim:!0},{valType:"any",editType:"axrange",impliedEdits:{"^autorange":!1},anim:!0}],editType:"axrange",impliedEdits:{autorange:!1},anim:!0},fixedrange:{valType:"boolean",dflt:!1,editType:"calc"},scaleanchor:{valType:"enumerated",values:[l.idRegex.x.toString(),l.idRegex.y.toString()],editType:"plot"},scaleratio:{valType:"number",min:0,dflt:1,editType:"plot"},constrain:{valType:"enumerated",values:["range","domain"],dflt:"range",editType:"plot"},constraintoward:{valType:"enumerated",values:["left","center","right","top","middle","bottom"],editType:"plot"},matches:{valType:"enumerated",values:[l.idRegex.x.toString(),l.idRegex.y.toString()],editType:"calc"},tickmode:{valType:"enumerated",values:["auto","linear","array"],editType:"ticks",impliedEdits:{tick0:void 0,dtick:void 0}},nticks:{valType:"integer",min:0,dflt:0,editType:"ticks"},tick0:{valType:"any",editType:"ticks",impliedEdits:{tickmode:"linear"}},dtick:{valType:"any",editType:"ticks",impliedEdits:{tickmode:"linear"}},tickvals:{valType:"data_array",editType:"ticks"},ticktext:{valType:"data_array",editType:"ticks"},ticks:{valType:"enumerated",values:["outside","inside",""],editType:"ticks"},tickson:{valType:"enumerated",values:["labels","boundaries"],dflt:"labels",editType:"ticks"},mirror:{valType:"enumerated",values:[!0,"ticks",!1,"all","allticks"],dflt:!1,editType:"ticks+layoutstyle"},ticklen:{valType:"number",min:0,dflt:5,editType:"ticks"},tickwidth:{valType:"number",min:0,dflt:1,editType:"ticks"},tickcolor:{valType:"color",dflt:i.defaultLine,editType:"ticks"},showticklabels:{valType:"boolean",dflt:!0,editType:"ticks"},automargin:{valType:"boolean",dflt:!1,editType:"ticks"},showspikes:{valType:"boolean",dflt:!1,editType:"modebar"},spikecolor:{valType:"color",dflt:null,editType:"none"},spikethickness:{valType:"number",dflt:3,editType:"none"},spikedash:o({},a,{dflt:"dash",editType:"none"}),spikemode:{valType:"flaglist",flags:["toaxis","across","marker"],dflt:"toaxis",editType:"none"},spikesnap:{valType:"enumerated",values:["data","cursor"],dflt:"data",editType:"none"},tickfont:n({editType:"ticks"}),tickangle:{valType:"angle",dflt:"auto",editType:"ticks"},tickprefix:{valType:"string",dflt:"",editType:"ticks"},showtickprefix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"ticks"},ticksuffix:{valType:"string",dflt:"",editType:"ticks"},showticksuffix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"ticks"},showexponent:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"ticks"},exponentformat:{valType:"enumerated",values:["none","e","E","power","SI","B"],dflt:"B",editType:"ticks"},separatethousands:{valType:"boolean",dflt:!1,editType:"ticks"},tickformat:{valType:"string",dflt:"",editType:"ticks"},tickformatstops:s("tickformatstop",{enabled:{valType:"boolean",dflt:!0,editType:"ticks"},dtickrange:{valType:"info_array",items:[{valType:"any",editType:"ticks"},{valType:"any",editType:"ticks"}],editType:"ticks"},value:{valType:"string",dflt:"",editType:"ticks"},editType:"ticks"}),hoverformat:{valType:"string",dflt:"",editType:"none"},showline:{valType:"boolean",dflt:!1,editType:"ticks+layoutstyle"},linecolor:{valType:"color",dflt:i.defaultLine,editType:"layoutstyle"},linewidth:{valType:"number",min:0,dflt:1,editType:"ticks+layoutstyle"},showgrid:{valType:"boolean",editType:"ticks"},gridcolor:{valType:"color",dflt:i.lightLine,editType:"ticks"},gridwidth:{valType:"number",min:0,dflt:1,editType:"ticks"},zeroline:{valType:"boolean",editType:"ticks"},zerolinecolor:{valType:"color",dflt:i.defaultLine,editType:"ticks"},zerolinewidth:{valType:"number",dflt:1,editType:"ticks"},showdividers:{valType:"boolean",dflt:!0,editType:"ticks"},dividercolor:{valType:"color",dflt:i.defaultLine,editType:"ticks"},dividerwidth:{valType:"number",dflt:1,editType:"ticks"},anchor:{valType:"enumerated",values:["free",l.idRegex.x.toString(),l.idRegex.y.toString()],editType:"plot"},side:{valType:"enumerated",values:["top","bottom","left","right"],editType:"plot"},overlaying:{valType:"enumerated",values:["free",l.idRegex.x.toString(),l.idRegex.y.toString()],editType:"plot"},layer:{valType:"enumerated",values:["above traces","below traces"],dflt:"above traces",editType:"plot"},domain:{valType:"info_array",items:[{valType:"number",min:0,max:1,editType:"plot"},{valType:"number",min:0,max:1,editType:"plot"}],dflt:[0,1],editType:"plot"},position:{valType:"number",min:0,max:1,dflt:0,editType:"plot"},categoryorder:{valType:"enumerated",values:["trace","category ascending","category descending","array","total ascending","total descending","min ascending","min descending","max ascending","max descending","sum ascending","sum descending","mean ascending","mean descending","median ascending","median descending"],dflt:"trace",editType:"calc"},categoryarray:{valType:"data_array",editType:"calc"},uirevision:{valType:"any",editType:"none"},editType:"calc",_deprecated:{autotick:{valType:"boolean",editType:"ticks"},title:{valType:"string",editType:"ticks"},titlefont:n({editType:"ticks"})}}},{"../../components/color/attributes":49,"../../components/drawing/attributes":70,"../../constants/docs":145,"../../lib/extend":162,"../../plot_api/plot_template":203,"../font_attributes":239,"./constants":219}],226:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../components/color"),a=t("../../plot_api/plot_template"),o=t("../layout_attributes"),s=t("./layout_attributes"),l=t("./type_defaults"),u=t("./axis_defaults"),c=t("./constraints").handleConstraintDefaults,p=t("./position_defaults"),h=t("./axis_ids"),f=h.id2name,d=h.name2id,m=t("./constants").AX_ID_PATTERN,y=t("../../registry"),g=y.traceIs,v=y.getComponentMethod;function _(t,e,r){Array.isArray(t[e])?t[e].push(r):t[e]=[r]}e.exports=function(t,e,r){var h,y,x={},b={},w={},k={},T={},A={},M={},S={},L={},C={};for(h=0;h<r.length;h++){var E=r[h];if(g(E,"cartesian")||g(E,"gl2d")){var z,P;if(E.xaxis)z=f(E.xaxis),_(x,z,E);else if(E.xaxes)for(y=0;y<E.xaxes.length;y++)_(x,f(E.xaxes[y]),E);if(E.yaxis)P=f(E.yaxis),_(x,P,E);else if(E.yaxes)for(y=0;y<E.yaxes.length;y++)_(x,f(E.yaxes[y]),E);if("funnel"===E.type?"h"===E.orientation?(z&&(b[z]=!0),P&&(M[P]=!0)):P&&(w[P]=!0):"image"===E.type?(P&&(S[P]=!0),z&&(S[z]=!0)):(P&&(T[P]=!0,A[P]=!0),g(E,"carpet")&&("carpet"!==E.type||E._cheater)||z&&(k[z]=!0)),"carpet"===E.type&&E._cheater&&z&&(b[z]=!0),g(E,"2dMap")&&(L[z]=!0,L[P]=!0),g(E,"oriented"))C["h"===E.orientation?P:z]=!0}}var I=e._subplots,D=I.xaxis,O=I.yaxis,R=n.simpleMap(D,f),F=n.simpleMap(O,f),B=R.concat(F),N=i.background;D.length&&O.length&&(N=n.coerce(t,e,o,"plot_bgcolor"));var U,j,V,q,G,H=i.combine(N,e.paper_bgcolor);function Z(){var t=x[U]||[];G._traceIndices=t.map(function(t){return t._expandedIndex}),G._annIndices=[],G._shapeIndices=[],G._imgIndices=[],G._subplotsWith=[],G._counterAxes=[],G._name=G._attr=U,G._id=j}function X(t,e){return n.coerce(q,G,s,t,e)}function W(t,e){return n.coerce2(q,G,s,t,e)}function Y(t){return"x"===t?O:D}function K(e,r){for(var n="x"===e?R:F,i=[],a=0;a<n.length;a++){var o=n[a];o===r||(t[o]||{}).overlaying||i.push(d(o))}return i}var J={x:Y("x"),y:Y("y")},$=J.x.concat(J.y),Q={},tt=[];function et(){var t=q.matches;m.test(t)&&-1===$.indexOf(t)&&(Q[t]=q.type,tt=Object.keys(Q))}for(h=0;h<B.length;h++){U=B[h],j=d(U),V=U.charAt(0),n.isPlainObject(t[U])||(t[U]={}),q=t[U],G=a.newContainer(e,U,V+"axis"),Z();var rt="x"===V&&!k[U]&&b[U]||"y"===V&&!T[U]&&w[U],nt="y"===V&&(!A[U]&&M[U]||S[U]),it={letter:V,font:e.font,outerTicks:L[U],showGrid:!C[U],data:x[U]||[],bgColor:H,calendar:e.calendar,automargin:!0,visibleDflt:rt,reverseDflt:nt,splomStash:((e._splomAxes||{})[V]||{})[j]};X("uirevision",e.uirevision),l(q,G,X,it),u(q,G,X,it,e);var at=W("spikecolor"),ot=W("spikethickness"),st=W("spikedash"),lt=W("spikemode"),ut=W("spikesnap");X("showspikes",!!(at||ot||st||lt||ut))||(delete G.spikecolor,delete G.spikethickness,delete G.spikedash,delete G.spikemode,delete G.spikesnap),p(q,G,X,{letter:V,counterAxes:J[V],overlayableAxes:K(V,U),grid:e.grid}),X("title.standoff"),et(),G._input=q}for(h=0;h<tt.length;){j=tt[h++],V=(U=f(j)).charAt(0),n.isPlainObject(t[U])||(t[U]={}),q=t[U],G=a.newContainer(e,U,V+"axis"),Z();var ct={letter:V,font:e.font,outerTicks:L[U],showGrid:!C[U],data:[],bgColor:H,calendar:e.calendar,automargin:!0,visibleDflt:!1,reverseDflt:!1,splomStash:((e._splomAxes||{})[V]||{})[j]};X("uirevision",e.uirevision),G.type=Q[j]||"linear",u(q,G,X,ct,e),p(q,G,X,{letter:V,counterAxes:J[V],overlayableAxes:K(V,U),grid:e.grid}),X("fixedrange"),et(),G._input=q}var pt=v("rangeslider","handleDefaults"),ht=v("rangeselector","handleDefaults");for(h=0;h<R.length;h++)U=R[h],q=t[U],G=e[U],pt(t,e,U),"date"===G.type&&ht(q,G,e,F,G.calendar),X("fixedrange");for(h=0;h<F.length;h++){U=F[h],q=t[U],G=e[U];var ft=e[f(G.anchor)];X("fixedrange",v("rangeslider","isVisible")(ft))}var dt=e._axisConstraintGroups=[],mt=e._axisMatchGroups=[],yt=$.concat(tt),gt=B.concat(n.simpleMap(tt,f));for(h=0;h<gt.length;h++){var vt,_t;V=(U=gt[h]).charAt(0),q=t[U],G=e[U],vt="y"===V&&!q.hasOwnProperty("scaleanchor")&&S[U]?G.anchor:void 0,_t=!q.hasOwnProperty("constrain")&&S[U]?"domain":void 0,c(q,G,X,{allAxisIds:yt,layoutOut:e,scaleanchorDflt:vt,constrainDflt:_t})}for(h=0;h<mt.length;h++){var xt=mt[h],bt=null,wt=null;for(j in xt)(G=e[f(j)]).matches||(bt=G.range,wt=G.autorange);if(null===bt||null===wt)for(j in xt){bt=(G=e[f(j)]).range,wt=G.autorange;break}for(j in xt)(G=e[f(j)]).matches&&(G.range=bt.slice(),G.autorange=wt),G._matchGroup=xt;if(dt.length)for(j in xt)for(y=0;y<dt.length;y++){var kt=dt[y];for(var Tt in kt)j===Tt&&(n.warn("Axis "+Tt+" is set with both a *scaleanchor* and *matches* constraint; ignoring the scale constraint."),delete kt[Tt],Object.keys(kt).length<2&&dt.splice(y,1))}}}},{"../../components/color":50,"../../lib":169,"../../plot_api/plot_template":203,"../../registry":261,"../layout_attributes":243,"./axis_defaults":215,"./axis_ids":216,"./constants":219,"./constraints":220,"./layout_attributes":225,"./position_defaults":228,"./type_defaults":236}],227:[function(t,e,r){"use strict";var n=t("tinycolor2").mix,i=t("../../components/color/attributes").lightFraction,a=t("../../lib");e.exports=function(t,e,r,o){var s=(o=o||{}).dfltColor;function l(r,n){return a.coerce2(t,e,o.attributes,r,n)}var u=l("linecolor",s),c=l("linewidth");r("showline",o.showLine||!!u||!!c)||(delete e.linecolor,delete e.linewidth);var p=l("gridcolor",n(s,o.bgColor,o.blend||i).toRgbString()),h=l("gridwidth");if(r("showgrid",o.showGrid||!!p||!!h)||(delete e.gridcolor,delete e.gridwidth),!o.noZeroLine){var f=l("zerolinecolor",s),d=l("zerolinewidth");r("zeroline",o.showGrid||!!f||!!d)||(delete e.zerolinecolor,delete e.zerolinewidth)}}},{"../../components/color/attributes":49,"../../lib":169,tinycolor2:33}],228:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib");e.exports=function(t,e,r,a){var o,s,l,u,c=a.counterAxes||[],p=a.overlayableAxes||[],h=a.letter,f=a.grid;f&&(s=f._domains[h][f._axisMap[e._id]],o=f._anchors[e._id],s&&(l=f[h+"side"].split(" ")[0],u=f.domain[h]["right"===l||"top"===l?1:0])),s=s||[0,1],o=o||(n(t.position)?"free":c[0]||"free"),l=l||("x"===h?"bottom":"left"),u=u||0,"free"===i.coerce(t,e,{anchor:{valType:"enumerated",values:["free"].concat(c),dflt:o}},"anchor")&&r("position",u),i.coerce(t,e,{side:{valType:"enumerated",values:"x"===h?["bottom","top"]:["left","right"],dflt:l}},"side");var d=!1;if(p.length&&(d=i.coerce(t,e,{overlaying:{valType:"enumerated",values:[!1].concat(p),dflt:!1}},"overlaying")),!d){var m=r("domain",s);m[0]>m[1]-1/4096&&(e.domain=s),i.noneOrAll(t.domain,e.domain,s)}return r("layer"),e}},{"../../lib":169,"fast-isnumeric":16}],229:[function(t,e,r){"use strict";var n=t("../../constants/alignment").FROM_BL;e.exports=function(t,e,r){void 0===r&&(r=n[t.constraintoward||"center"]);var i=[t.r2l(t.range[0]),t.r2l(t.range[1])],a=i[0]+(i[1]-i[0])*r;t.range=t._input.range=[t.l2r(a+(i[0]-a)*e),t.l2r(a+(i[1]-a)*e)]}},{"../../constants/alignment":144}],230:[function(t,e,r){"use strict";var n=t("polybooljs"),i=t("../../registry"),a=t("../../components/color"),o=t("../../components/fx"),s=t("../../lib"),l=t("../../lib/polygon"),u=t("../../lib/throttle"),c=t("../../components/fx/helpers").makeEventData,p=t("./axis_ids").getFromId,h=t("../../lib/clear_gl_canvases"),f=t("../../plot_api/subroutines").redrawReglTraces,d=t("./constants"),m=d.MINSELECT,y=l.filter,g=l.tester;function v(t){return t._id}function _(t,e,r,n,i,a,o){var s,l,u,c,p,h,f,d,m,y=e._hoverdata,g=e._fullLayout.clickmode.indexOf("event")>-1,v=[];if(function(t){return t&&Array.isArray(t)&&!0!==t[0].hoverOnBox}(y)){k(t,e,a);var _=function(t,e){var r,n,i=t[0],a=-1,o=[];for(n=0;n<e.length;n++)if(r=e[n],i.fullData._expandedIndex===r.cd[0].trace._expandedIndex){if(!0===i.hoverOnBox)break;void 0!==i.pointNumber?a=i.pointNumber:void 0!==i.binNumber&&(a=i.binNumber,o=i.pointNumbers);break}return{pointNumber:a,pointNumbers:o,searchInfo:r}}(y,s=A(e,r,n,i));if(_.pointNumbers.length>0?function(t,e){var r,n,i,a=[];for(i=0;i<t.length;i++)(r=t[i]).cd[0].trace.selectedpoints&&r.cd[0].trace.selectedpoints.length>0&&a.push(r);if(1===a.length&&a[0]===e.searchInfo&&(n=e.searchInfo.cd[0].trace).selectedpoints.length===e.pointNumbers.length){for(i=0;i<e.pointNumbers.length;i++)if(n.selectedpoints.indexOf(e.pointNumbers[i])<0)return!1;return!0}return!1}(s,_):function(t){var e,r,n,i=0;for(n=0;n<t.length;n++)if(e=t[n],(r=e.cd[0].trace).selectedpoints){if(r.selectedpoints.length>1)return!1;if((i+=r.selectedpoints.length)>1)return!1}return 1===i}(s)&&(h=S(_))){for(o&&o.remove(),m=0;m<s.length;m++)(l=s[m])._module.selectPoints(l,!1);L(e,s),T(a),g&&e.emit("plotly_deselect",null)}else{for(f=t.shiftKey&&(void 0!==h?h:S(_)),u=function(t,e,r){return{pointNumber:t,searchInfo:e,subtract:r}}(_.pointNumber,_.searchInfo,f),c=w(a.selectionDefs.concat([u])),m=0;m<s.length;m++)if(p=C(s[m]._module.selectPoints(s[m],c),s[m]),v.length)for(var x=0;x<p.length;x++)v.push(p[x]);else v=p;L(e,s,d={points:v}),u&&a&&a.selectionDefs.push(u),o&&M(a.mergedPolygons,o),g&&e.emit("plotly_selected",d)}}}function x(t){return"pointNumber"in t&&"searchInfo"in t}function b(t){return{xmin:0,xmax:0,ymin:0,ymax:0,pts:[],contains:function(e,r,n,i){var a=t.searchInfo.cd[0].trace._expandedIndex;return i.cd[0].trace._expandedIndex===a&&n===t.pointNumber},isRect:!1,degenerate:!1,subtract:t.subtract}}function w(t){for(var e=[],r=x(t[0])?0:t[0][0][0],n=r,i=x(t[0])?0:t[0][0][1],a=i,o=0;o<t.length;o++)if(x(t[o]))e.push(b(t[o]));else{var s=l.tester(t[o]);s.subtract=t[o].subtract,e.push(s),r=Math.min(r,s.xmin),n=Math.max(n,s.xmax),i=Math.min(i,s.ymin),a=Math.max(a,s.ymax)}return{xmin:r,xmax:n,ymin:i,ymax:a,pts:[],contains:function(t,r,n,i){for(var a=!1,o=0;o<e.length;o++)e[o].contains(t,r,n,i)&&(a=!1===e[o].subtract);return a},isRect:!1,degenerate:!1}}function k(t,e,r){var n=e._fullLayout,i=r.plotinfo,a=n._lastSelectedSubplot&&n._lastSelectedSubplot===i.id,o=t.shiftKey||t.altKey;a&&o&&i.selection&&i.selection.selectionDefs&&!r.selectionDefs?(r.selectionDefs=i.selection.selectionDefs,r.mergedPolygons=i.selection.mergedPolygons):o&&i.selection||T(r),a||(E(e),n._lastSelectedSubplot=i.id)}function T(t){var e=t.plotinfo;e.selection={},e.selection.selectionDefs=t.selectionDefs=[],e.selection.mergedPolygons=t.mergedPolygons=[]}function A(t,e,r,n){var i,a,o,s=[],l=e.map(v),u=r.map(v);for(o=0;o<t.calcdata.length;o++)if(!0===(a=(i=t.calcdata[o])[0].trace).visible&&a._module&&a._module.selectPoints)if(!n||a.subplot!==n&&a.geo!==n)if("splom"===a.type&&a._xaxes[l[0]]&&a._yaxes[u[0]]){var c=f(a._module,i,e[0],r[0]);c.scene=t._fullLayout._splomScenes[a.uid],s.push(c)}else if("sankey"===a.type){var h=f(a._module,i,e[0],r[0]);s.push(h)}else{if(-1===l.indexOf(a.xaxis))continue;if(-1===u.indexOf(a.yaxis))continue;s.push(f(a._module,i,p(t,a.xaxis),p(t,a.yaxis)))}else s.push(f(a._module,i,e[0],r[0]));return s;function f(t,e,r,n){return{_module:t,cd:e,xaxis:r,yaxis:n}}}function M(t,e){var r,n,i=[];for(r=0;r<t.length;r++){var a=t[r];i.push(a.join("L")+"L"+a[0])}n=t.length>0?"M"+i.join("M")+"Z":"M0,0Z",e.attr("d",n)}function S(t){var e=t.searchInfo.cd[0].trace,r=t.pointNumber,n=t.pointNumbers,i=n.length>0?n[0]:r;return!!e.selectedpoints&&e.selectedpoints.indexOf(i)>-1}function L(t,e,r){var n,a,o,s;for(n=0;n<e.length;n++){var l=e[n].cd[0].trace._fullInput,u=t._fullLayout._tracePreGUI[l.uid]||{};void 0===u.selectedpoints&&(u.selectedpoints=l._input.selectedpoints||null)}if(r){var c=r.points||[];for(n=0;n<e.length;n++)(s=e[n].cd[0].trace)._input.selectedpoints=s._fullInput.selectedpoints=[],s._fullInput!==s&&(s.selectedpoints=[]);for(n=0;n<c.length;n++){var p=c[n],d=p.data,m=p.fullData;p.pointIndices?([].push.apply(d.selectedpoints,p.pointIndices),s._fullInput!==s&&[].push.apply(m.selectedpoints,p.pointIndices)):(d.selectedpoints.push(p.pointIndex),s._fullInput!==s&&m.selectedpoints.push(p.pointIndex))}}else for(n=0;n<e.length;n++)delete(s=e[n].cd[0].trace).selectedpoints,delete s._input.selectedpoints,s._fullInput!==s&&delete s._fullInput.selectedpoints;var y=!1;for(n=0;n<e.length;n++){s=(o=(a=e[n]).cd)[0].trace,i.traceIs(s,"regl")&&(y=!0);var g=a._module,v=g.styleOnSelect||g.style;v&&(v(t,o,o[0].node3),o[0].nodeRangePlot3&&v(t,o,o[0].nodeRangePlot3))}y&&(h(t),f(t))}function C(t,e){if(Array.isArray(t))for(var r=e.cd,n=e.cd[0].trace,i=0;i<t.length;i++)t[i]=c(t[i],n,r);return t}function E(t){var e=(t._fullLayout||{})._zoomlayer;e&&e.selectAll(".select-outline").remove()}e.exports={prepSelect:function(t,e,r,i,l){var c,p,h,f,v,x,b,S=i.gd,E=S._fullLayout,z=E._zoomlayer,P=i.element.getBoundingClientRect(),I=i.plotinfo,D=I.xaxis._offset,O=I.yaxis._offset,R=e-P.left,F=r-P.top,B=R,N=F,U="M"+R+","+F,j=i.xaxes[0]._length,V=i.yaxes[0]._length,q=i.xaxes.concat(i.yaxes),G=t.altKey;k(t,S,i),"lasso"===l&&(c=y([[R,F]],d.BENDPX));var H=z.selectAll("path.select-outline-"+I.id).data([1,2]);H.enter().append("path").attr("class",function(t){return"select-outline select-outline-"+t+" select-outline-"+I.id}).attr("transform","translate("+D+", "+O+")").attr("d",U+"Z");var Z,X=z.append("path").attr("class","zoombox-corners").style({fill:a.background,stroke:a.defaultLine,"stroke-width":1}).attr("transform","translate("+D+", "+O+")").attr("d","M0,0Z"),W=E._uid+d.SELECTID,Y=[],K=A(S,i.xaxes,i.yaxes,i.subplot);function J(t,e){return"log"===t.type?t.p2d(e):t.p2r(e)}function $(t){var e="y"===t._id.charAt(0)?1:0;return function(r){return J(t,r[e])}}function Q(t,e){return t-e}Z=I.fillRangeItems?I.fillRangeItems:"select"===l?function(t,e){var r=t.range={};for(v=0;v<q.length;v++){var n=q[v],i=n._id.charAt(0);r[n._id]=[J(n,e[i+"min"]),J(n,e[i+"max"])].sort(Q)}}:function(t,e,r){var n=t.lassoPoints={};for(v=0;v<q.length;v++){var i=q[v];n[i._id]=r.filtered.map($(i))}},i.moveFn=function(t,e){B=Math.max(0,Math.min(j,t+R)),N=Math.max(0,Math.min(V,e+F));var r=Math.abs(B-R),a=Math.abs(N-F);if("select"===l){var o=E.selectdirection;"h"===(o="any"===E.selectdirection?a<Math.min(.6*r,m)?"h":r<Math.min(.6*a,m)?"v":"d":E.selectdirection)?((f=[[R,0],[R,V],[B,V],[B,0]]).xmin=Math.min(R,B),f.xmax=Math.max(R,B),f.ymin=Math.min(0,V),f.ymax=Math.max(0,V),X.attr("d","M"+f.xmin+","+(F-m)+"h-4v"+2*m+"h4ZM"+(f.xmax-1)+","+(F-m)+"h4v"+2*m+"h-4Z")):"v"===o?((f=[[0,F],[0,N],[j,N],[j,F]]).xmin=Math.min(0,j),f.xmax=Math.max(0,j),f.ymin=Math.min(F,N),f.ymax=Math.max(F,N),X.attr("d","M"+(R-m)+","+f.ymin+"v-4h"+2*m+"v4ZM"+(R-m)+","+(f.ymax-1)+"v4h"+2*m+"v-4Z")):"d"===o&&((f=[[R,F],[R,N],[B,N],[B,F]]).xmin=Math.min(R,B),f.xmax=Math.max(R,B),f.ymin=Math.min(F,N),f.ymax=Math.max(F,N),X.attr("d","M0,0Z"))}else"lasso"===l&&(c.addPt([B,N]),f=c.filtered);i.selectionDefs&&i.selectionDefs.length?(h=function(t,e,r){return r?n.difference({regions:t,inverted:!1},{regions:[e],inverted:!1}).regions:n.union({regions:t,inverted:!1},{regions:[e],inverted:!1}).regions}(i.mergedPolygons,f,G),f.subtract=G,p=w(i.selectionDefs.concat([f]))):(h=[f],p=g(f)),M(h,H),u.throttle(W,d.SELECTDELAY,function(){var t;Y=[];var e,r=[];for(v=0;v<K.length;v++)if(e=(x=K[v])._module.selectPoints(x,p),r.push(e),t=C(e,x),Y.length)for(var n=0;n<t.length;n++)Y.push(t[n]);else Y=t;L(S,K,b={points:Y}),Z(b,f,c),i.gd.emit("plotly_selecting",b)})},i.clickFn=function(t,e){var r=E.clickmode;X.remove(),u.done(W).then(function(){if(u.clear(W),2===t){for(H.remove(),v=0;v<K.length;v++)(x=K[v])._module.selectPoints(x,!1);L(S,K),T(i),S.emit("plotly_deselect",null)}else r.indexOf("select")>-1&&_(e,S,i.xaxes,i.yaxes,i.subplot,i,H),"event"===r&&S.emit("plotly_selected",void 0);o.click(S,e)}).catch(s.error)},i.doneFn=function(){X.remove(),u.done(W).then(function(){u.clear(W),i.gd.emit("plotly_selected",b),f&&i.selectionDefs&&(f.subtract=G,i.selectionDefs.push(f),i.mergedPolygons.length=0,[].push.apply(i.mergedPolygons,h)),i.doneFnCompleted&&i.doneFnCompleted(Y)}).catch(s.error)}},clearSelect:E,selectOnClick:_}},{"../../components/color":50,"../../components/fx":88,"../../components/fx/helpers":85,"../../lib":169,"../../lib/clear_gl_canvases":156,"../../lib/polygon":181,"../../lib/throttle":191,"../../plot_api/subroutines":204,"../../registry":261,"./axis_ids":216,"./constants":219,polybooljs:24}],231:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("../../lib"),o=a.cleanNumber,s=a.ms2DateTime,l=a.dateTime2ms,u=a.ensureNumber,c=a.isArrayOrTypedArray,p=t("../../constants/numerical"),h=p.FP_SAFE,f=p.BADNUM,d=p.LOG_CLIP,m=t("./constants"),y=t("./axis_ids");function g(t){return Math.pow(10,t)}function v(t){return null!=t}e.exports=function(t,e){e=e||{};var r=t._id||"x",p=r.charAt(0);function _(e,r){if(e>0)return Math.log(e)/Math.LN10;if(e<=0&&r&&t.range&&2===t.range.length){var n=t.range[0],i=t.range[1];return.5*(n+i-2*d*Math.abs(n-i))}return f}function x(e,r,n){var o=l(e,n||t.calendar);if(o===f){if(!i(e))return f;e=+e;var s=Math.floor(10*a.mod(e+.05,1)),u=Math.round(e-s/10);o=l(new Date(u))+s/10}return o}function b(e,r,n){return s(e,r,n||t.calendar)}function w(e){return t._categories[Math.round(e)]}function k(e){if(v(e)){if(void 0===t._categoriesMap&&(t._categoriesMap={}),void 0!==t._categoriesMap[e])return t._categoriesMap[e];t._categories.push("number"==typeof e?String(e):e);var r=t._categories.length-1;return t._categoriesMap[e]=r,r}return f}function T(e){if(t._categoriesMap)return t._categoriesMap[e]}function A(t){var e=T(t);return void 0!==e?e:i(t)?+t:void 0}function M(e){return i(e)?n.round(t._b+t._m*e,2):f}function S(e){return(e-t._b)/t._m}t.c2l="log"===t.type?_:u,t.l2c="log"===t.type?g:u,t.l2p=M,t.p2l=S,t.c2p="log"===t.type?function(t,e){return M(_(t,e))}:M,t.p2c="log"===t.type?function(t){return g(S(t))}:S,-1!==["linear","-"].indexOf(t.type)?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=o,t.c2d=t.c2r=t.l2d=t.l2r=u,t.d2p=t.r2p=function(e){return t.l2p(o(e))},t.p2d=t.p2r=S,t.cleanPos=u):"log"===t.type?(t.d2r=t.d2l=function(t,e){return _(o(t),e)},t.r2d=t.r2c=function(t){return g(o(t))},t.d2c=t.r2l=o,t.c2d=t.l2r=u,t.c2r=_,t.l2d=g,t.d2p=function(e,r){return t.l2p(t.d2r(e,r))},t.p2d=function(t){return g(S(t))},t.r2p=function(e){return t.l2p(o(e))},t.p2r=S,t.cleanPos=u):"date"===t.type?(t.d2r=t.r2d=a.identity,t.d2c=t.r2c=t.d2l=t.r2l=x,t.c2d=t.c2r=t.l2d=t.l2r=b,t.d2p=t.r2p=function(e,r,n){return t.l2p(x(e,0,n))},t.p2d=t.p2r=function(t,e,r){return b(S(t),e,r)},t.cleanPos=function(e){return a.cleanDate(e,f,t.calendar)}):"category"===t.type?(t.d2c=t.d2l=k,t.r2d=t.c2d=t.l2d=w,t.d2r=t.d2l_noadd=A,t.r2c=function(e){var r=A(e);return void 0!==r?r:t.fraction2r(.5)},t.l2r=t.c2r=u,t.r2l=A,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return w(S(t))},t.r2p=t.d2p,t.p2r=S,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:u(t)}):"multicategory"===t.type&&(t.r2d=t.c2d=t.l2d=w,t.d2r=t.d2l_noadd=A,t.r2c=function(e){var r=A(e);return void 0!==r?r:t.fraction2r(.5)},t.r2c_just_indices=T,t.l2r=t.c2r=u,t.r2l=A,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return w(S(t))},t.r2p=t.d2p,t.p2r=S,t.cleanPos=function(t){return Array.isArray(t)||"string"==typeof t&&""!==t?t:u(t)},t.setupMultiCategory=function(n){var i,o,s=t._traceIndices,l=e._axisMatchGroups;if(l&&l.length&&0===t._categories.length)for(i=0;i<l.length;i++){var u=l[i];if(u[r])for(var h in u)if(h!==r){var f=e[y.id2name(h)];s=s.concat(f._traceIndices)}}var d=[[0,{}],[0,{}]],m=[];for(i=0;i<s.length;i++){var g=n[s[i]];if(p in g){var _=g[p],x=g._length||a.minRowLength(_);if(c(_[0])&&c(_[1]))for(o=0;o<x;o++){var b=_[0][o],w=_[1][o];v(b)&&v(w)&&(m.push([b,w]),b in d[0][1]||(d[0][1][b]=d[0][0]++),w in d[1][1]||(d[1][1][w]=d[1][0]++))}}}for(m.sort(function(t,e){var r=d[0][1],n=r[t[0]]-r[e[0]];if(n)return n;var i=d[1][1];return i[t[1]]-i[e[1]]}),i=0;i<m.length;i++)k(m[i])}),t.fraction2r=function(e){var r=t.r2l(t.range[0]),n=t.r2l(t.range[1]);return t.l2r(r+e*(n-r))},t.r2fraction=function(e){var r=t.r2l(t.range[0]),n=t.r2l(t.range[1]);return(t.r2l(e)-r)/(n-r)},t.cleanRange=function(e,r){r||(r={}),e||(e="range");var n,o,s=a.nestedProperty(t,e).get();if(o=(o="date"===t.type?a.dfltRange(t.calendar):"y"===p?m.DFLTRANGEY:r.dfltRange||m.DFLTRANGEX).slice(),"tozero"!==t.rangemode&&"nonnegative"!==t.rangemode||(o[0]=0),s&&2===s.length)for("date"!==t.type||t.autorange||(s[0]=a.cleanDate(s[0],f,t.calendar),s[1]=a.cleanDate(s[1],f,t.calendar)),n=0;n<2;n++)if("date"===t.type){if(!a.isDateTime(s[n],t.calendar)){t[e]=o;break}if(t.r2l(s[0])===t.r2l(s[1])){var l=a.constrain(t.r2l(s[0]),a.MIN_MS+1e3,a.MAX_MS-1e3);s[0]=t.l2r(l-1e3),s[1]=t.l2r(l+1e3);break}}else{if(!i(s[n])){if(!i(s[1-n])){t[e]=o;break}s[n]=s[1-n]*(n?10:.1)}if(s[n]<-h?s[n]=-h:s[n]>h&&(s[n]=h),s[0]===s[1]){var u=Math.max(1,Math.abs(1e-6*s[0]));s[0]-=u,s[1]+=u}}else a.nestedProperty(t,e).set(o)},t.setScale=function(r){var n=e._size;if(t.overlaying){var i=y.getFromId({_fullLayout:e},t.overlaying);t.domain=i.domain}var a=r&&t._r?"_r":"range",o=t.calendar;t.cleanRange(a);var s=t.r2l(t[a][0],o),l=t.r2l(t[a][1],o);if("y"===p?(t._offset=n.t+(1-t.domain[1])*n.h,t._length=n.h*(t.domain[1]-t.domain[0]),t._m=t._length/(s-l),t._b=-t._m*l):(t._offset=n.l+t.domain[0]*n.w,t._length=n.w*(t.domain[1]-t.domain[0]),t._m=t._length/(l-s),t._b=-t._m*s),!isFinite(t._m)||!isFinite(t._b)||t._length<0)throw e._replotting=!1,new Error("Something went wrong with axis scaling")},t.makeCalcdata=function(e,r){var n,i,o,s,l=t.type,u="date"===l&&e[r+"calendar"];if(r in e){if(n=e[r],s=e._length||a.minRowLength(n),a.isTypedArray(n)&&("linear"===l||"log"===l)){if(s===n.length)return n;if(n.subarray)return n.subarray(0,s)}if("multicategory"===l)return function(t,e){for(var r=new Array(e),n=0;n<e;n++){var i=(t[0]||[])[n],a=(t[1]||[])[n];r[n]=T([i,a])}return r}(n,s);for(i=new Array(s),o=0;o<s;o++)i[o]=t.d2c(n[o],0,u)}else{var c=r+"0"in e?t.d2c(e[r+"0"],0,u):0,p=e["d"+r]?Number(e["d"+r]):1;for(n=e[{x:"y",y:"x"}[r]],s=e._length||n.length,i=new Array(s),o=0;o<s;o++)i[o]=c+o*p}return i},t.isValidRange=function(e){return Array.isArray(e)&&2===e.length&&i(t.r2l(e[0]))&&i(t.r2l(e[1]))},t.isPtWithinRange=function(e,r){var n=t.c2l(e[p],null,r),i=t.r2l(t.range[0]),a=t.r2l(t.range[1]);return i<a?i<=n&&n<=a:a<=n&&n<=i},t.clearCalc=function(){var n=function(){t._categories=[],t._categoriesMap={}},i=e._axisMatchGroups;if(i&&i.length){for(var a=!1,o=0;o<i.length;o++){var s=i[o];if(s[r]){a=!0;var l=null,u=null;for(var c in s){var p=e[y.id2name(c)];if(p._categories){l=p._categories,u=p._categoriesMap;break}}l&&u?(t._categories=l,t._categoriesMap=u):n();break}}a||n()}else n();if(t._initialCategories)for(var h=0;h<t._initialCategories.length;h++)k(t._initialCategories[h])},t.sortByInitialCategories=function(){var n=[];if(t._categories=[],t._categoriesMap={},t._initialCategories)for(var i=0;i<t._initialCategories.length;i++)k(t._initialCategories[i]);n=n.concat(t._traceIndices);var a=t._matchGroup;for(var o in a)if(r!==o){var s=e[y.id2name(o)];s._categories=t._categories,s._categoriesMap=t._categoriesMap,n=n.concat(s._traceIndices)}return n};var L=e._d3locale;"date"===t.type&&(t._dateFormat=L?L.timeFormat.utc:n.time.format.utc,t._extraFormat=e._extraFormat),t._separators=e.separators,t._numFormat=L?L.numberFormat:n.format,delete t._minDtick,delete t._forceTick0}},{"../../constants/numerical":147,"../../lib":169,"./axis_ids":216,"./constants":219,d3:14,"fast-isnumeric":16}],232:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes"),a=t("../array_container_defaults");function o(t){var e=["showexponent","showtickprefix","showticksuffix"].filter(function(e){return void 0!==t[e]});if(e.every(function(r){return t[r]===t[e[0]]})||1===e.length)return t[e[0]]}function s(t,e){function r(r,a){return n.coerce(t,e,i.tickformatstops,r,a)}r("enabled")&&(r("dtickrange"),r("value"))}e.exports=function(t,e,r,l,u,c){c&&1!==c.pass||function(t,e,r,n,i){var a=o(t);r("tickprefix")&&r("showtickprefix",a);r("ticksuffix",i.tickSuffixDflt)&&r("showticksuffix",a)}(t,0,r,0,u),c&&2!==c.pass||function(t,e,r,l,u){var c=o(t);r("tickprefix")&&r("showtickprefix",c);r("ticksuffix",u.tickSuffixDflt)&&r("showticksuffix",c);if(r("showticklabels")){var p=u.font||{},h=e.color,f=h&&h!==i.color.dflt?h:p.color;if(n.coerceFont(r,"tickfont",{family:p.family,size:p.size,color:f}),r("tickangle"),"category"!==l){var d=r("tickformat"),m=t.tickformatstops;Array.isArray(m)&&m.length&&a(t,e,{name:"tickformatstops",inclusionAttr:"enabled",handleItemDefaults:s}),d||"date"===l||(r("showexponent",c),r("exponentformat"),r("separatethousands"))}}}(t,e,r,l,u)}},{"../../lib":169,"../array_container_defaults":209,"./layout_attributes":225}],233:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e,r,a){var o=n.coerce2(t,e,i,"ticklen"),s=n.coerce2(t,e,i,"tickwidth"),l=n.coerce2(t,e,i,"tickcolor",e.color);r("ticks",a.outerTicks||o||s||l?"outside":"")||(delete e.ticklen,delete e.tickwidth,delete e.tickcolor)}},{"../../lib":169,"./layout_attributes":225}],234:[function(t,e,r){"use strict";var n=t("./clean_ticks");e.exports=function(t,e,r,i){var a;"array"!==t.tickmode||"log"!==i&&"date"!==i?a=r("tickmode",Array.isArray(t.tickvals)?"array":t.dtick?"linear":"auto"):a=e.tickmode="auto";if("auto"===a)r("nticks");else if("linear"===a){var o=e.dtick=n.dtick(t.dtick,i);e.tick0=n.tick0(t.tick0,i,e.calendar,o)}else if("multicategory"!==i){void 0===r("tickvals")?e.tickmode="auto":r("ticktext")}}},{"./clean_ticks":218}],235:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../registry"),a=t("../../lib"),o=t("../../components/drawing"),s=t("./axes");e.exports=function(t,e,r,l){var u=t._fullLayout;if(0!==e.length){var c,p,h,f;l&&(c=l());var d=n.ease(r.easing);return t._transitionData._interruptCallbacks.push(function(){return window.cancelAnimationFrame(f),f=null,function(){for(var r={},n=0;n<e.length;n++){var a=e[n],o=a.plotinfo.xaxis,s=a.plotinfo.yaxis;a.xr0&&(r[o._name+".range"]=a.xr0.slice()),a.yr0&&(r[s._name+".range"]=a.yr0.slice())}return i.call("relayout",t,r).then(function(){for(var t=0;t<e.length;t++)m(e[t].plotinfo)})}()}),p=Date.now(),f=window.requestAnimationFrame(function n(){h=Date.now();for(var a=Math.min(1,(h-p)/r.duration),o=d(a),s=0;s<e.length;s++)y(e[s],o);h-p>r.duration?(function(){for(var r={},n=0;n<e.length;n++){var a=e[n],o=a.plotinfo.xaxis,s=a.plotinfo.yaxis;a.xr1&&(r[o._name+".range"]=a.xr1.slice()),a.yr1&&(r[s._name+".range"]=a.yr1.slice())}c&&c(),i.call("relayout",t,r).then(function(){for(var t=0;t<e.length;t++)m(e[t].plotinfo)})}(),f=window.cancelAnimationFrame(n)):f=window.requestAnimationFrame(n)}),Promise.resolve()}function m(t){var e=t.xaxis,r=t.yaxis;u._defs.select("#"+t.clipId+"> rect").call(o.setTranslate,0,0).call(o.setScale,1,1),t.plot.call(o.setTranslate,e._offset,r._offset).call(o.setScale,1,1);var n=t.plot.selectAll(".scatterlayer .trace");n.selectAll(".point").call(o.setPointGroupScale,1,1),n.selectAll(".textpoint").call(o.setTextPointsScale,1,1),n.call(o.hideOutsideRangePoints,t)}function y(e,r){var n=e.plotinfo,i=n.xaxis,l=n.yaxis,u=i._length,c=l._length,p=!!e.xr1,h=!!e.yr1,f=[];if(p){var d=a.simpleMap(e.xr0,i.r2l),m=a.simpleMap(e.xr1,i.r2l),y=d[1]-d[0],g=m[1]-m[0];f[0]=(d[0]*(1-r)+r*m[0]-d[0])/(d[1]-d[0])*u,f[2]=u*(1-r+r*g/y),i.range[0]=i.l2r(d[0]*(1-r)+r*m[0]),i.range[1]=i.l2r(d[1]*(1-r)+r*m[1])}else f[0]=0,f[2]=u;if(h){var v=a.simpleMap(e.yr0,l.r2l),_=a.simpleMap(e.yr1,l.r2l),x=v[1]-v[0],b=_[1]-_[0];f[1]=(v[1]*(1-r)+r*_[1]-v[1])/(v[0]-v[1])*c,f[3]=c*(1-r+r*b/x),l.range[0]=i.l2r(v[0]*(1-r)+r*_[0]),l.range[1]=l.l2r(v[1]*(1-r)+r*_[1])}else f[1]=0,f[3]=c;s.drawOne(t,i,{skipTitle:!0}),s.drawOne(t,l,{skipTitle:!0}),s.redrawComponents(t,[i._id,l._id]);var w=p?u/f[2]:1,k=h?c/f[3]:1,T=p?f[0]:0,A=h?f[1]:0,M=p?f[0]/f[2]*u:0,S=h?f[1]/f[3]*c:0,L=i._offset-M,C=l._offset-S;n.clipRect.call(o.setTranslate,T,A).call(o.setScale,1/w,1/k),n.plot.call(o.setTranslate,L,C).call(o.setScale,w,k),o.setPointGroupScale(n.zoomScalePts,1/w,1/k),o.setTextPointsScale(n.zoomScaleTxt,1/w,1/k)}s.redrawComponents(t)}},{"../../components/drawing":71,"../../lib":169,"../../registry":261,"./axes":213,d3:14}],236:[function(t,e,r){"use strict";var n=t("../../registry").traceIs,i=t("./axis_autotype");function a(t){return{v:"x",h:"y"}[t.orientation||"v"]}function o(t,e){var r=a(t),i=n(t,"box-violin"),o=n(t._fullInput||{},"candlestick");return i&&!o&&e===r&&void 0===t[r]&&void 0===t[r+"0"]}e.exports=function(t,e,r,s){"-"===r("type",(s.splomStash||{}).type)&&(!function(t,e){if("-"!==t.type)return;var r,s=t._id,l=s.charAt(0);-1!==s.indexOf("scene")&&(s=l);var u=function(t,e,r){for(var n=0;n<t.length;n++){var i=t[n];if("splom"===i.type&&i._length>0&&(i["_"+r+"axes"]||{})[e])return i;if((i[r+"axis"]||r)===e){if(o(i,r))return i;if((i[r]||[]).length||i[r+"0"])return i}}}(e,s,l);if(!u)return;if("histogram"===u.type&&l==={v:"y",h:"x"}[u.orientation||"v"])return void(t.type="linear");var c=l+"calendar",p=u[c],h={noMultiCategory:!n(u,"cartesian")||n(u,"noMultiCategory")};"box"===u.type&&u._hasPreCompStats&&l==={h:"x",v:"y"}[u.orientation||"v"]&&(h.noMultiCategory=!0);if(o(u,l)){var f=a(u),d=[];for(r=0;r<e.length;r++){var m=e[r];n(m,"box-violin")&&(m[l+"axis"]||l)===s&&(void 0!==m[f]?d.push(m[f][0]):void 0!==m.name?d.push(m.name):d.push("text"),m[c]!==p&&(p=void 0))}t.type=i(d,p,h)}else if("splom"===u.type){var y=u.dimensions,g=y[u._axesDim[s]];g.visible&&(t.type=i(g.values,p,h))}else t.type=i(u[l]||[u[l+"0"]],p,h)}(e,s.data),"-"===e.type?e.type="linear":t.type=e.type)}},{"../../registry":261,"./axis_autotype":214}],237:[function(t,e,r){"use strict";var n=t("../registry"),i=t("../lib");function a(t,e,r){var n,a,o,s=!1;if("data"===e.type)n=t._fullData[null!==e.traces?e.traces[0]:0];else{if("layout"!==e.type)return!1;n=t._fullLayout}return a=i.nestedProperty(n,e.prop).get(),(o=r[e.type]=r[e.type]||{}).hasOwnProperty(e.prop)&&o[e.prop]!==a&&(s=!0),o[e.prop]=a,{changed:s,value:a}}function o(t,e){var r=[],n=e[0],a={};if("string"==typeof n)a[n]=e[1];else{if(!i.isPlainObject(n))return r;a=n}return l(a,function(t,e,n){r.push({type:"layout",prop:t,value:n})},"",0),r}function s(t,e){var r,n,a,o,s=[];if(n=e[0],a=e[1],r=e[2],o={},"string"==typeof n)o[n]=a;else{if(!i.isPlainObject(n))return s;o=n,void 0===r&&(r=a)}return void 0===r&&(r=null),l(o,function(e,n,i){var a,o;if(Array.isArray(i)){o=i.slice();var l=Math.min(o.length,t.data.length);r&&(l=Math.min(l,r.length)),a=[];for(var u=0;u<l;u++)a[u]=r?r[u]:u}else o=i,a=r?r.slice():null;if(null===a)Array.isArray(o)&&(o=o[0]);else if(Array.isArray(a)){if(!Array.isArray(o)){var c=o;o=[];for(var p=0;p<a.length;p++)o[p]=c}o.length=Math.min(a.length,o.length)}s.push({type:"data",prop:e,traces:a,value:o})},"",0),s}function l(t,e,r,n){Object.keys(t).forEach(function(a){var o=t[a];if("_"!==a[0]){var s=r+(n>0?".":"")+a;i.isPlainObject(o)?l(o,e,s,n+1):e(s,a,o)}})}r.manageCommandObserver=function(t,e,n,o){var s={},l=!0;e&&e._commandObserver&&(s=e._commandObserver),s.cache||(s.cache={}),s.lookupTable={};var u=r.hasSimpleAPICommandBindings(t,n,s.lookupTable);if(e&&e._commandObserver){if(u)return s;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,s}if(u){a(t,u,s.cache),s.check=function(){if(l){var e=a(t,u,s.cache);return e.changed&&o&&void 0!==s.lookupTable[e.value]&&(s.disable(),Promise.resolve(o({value:e.value,type:u.type,prop:u.prop,traces:u.traces,index:s.lookupTable[e.value]})).then(s.enable,s.enable)),e.changed}};for(var c=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],p=0;p<c.length;p++)t._internalOn(c[p],s.check);s.remove=function(){for(var e=0;e<c.length;e++)t._removeInternalListener(c[e],s.check)}}else i.log("Unable to automatically bind plot updates to API command"),s.lookupTable={},s.remove=function(){};return s.disable=function(){l=!1},s.enable=function(){l=!0},e&&(e._commandObserver=s),s},r.hasSimpleAPICommandBindings=function(t,e,n){var i,a,o=e.length;for(i=0;i<o;i++){var s,l=e[i],u=l.method,c=l.args;if(Array.isArray(c)||(c=[]),!u)return!1;var p=r.computeAPICommandBindings(t,u,c);if(1!==p.length)return!1;if(a){if((s=p[0]).type!==a.type)return!1;if(s.prop!==a.prop)return!1;if(Array.isArray(a.traces)){if(!Array.isArray(s.traces))return!1;s.traces.sort();for(var h=0;h<a.traces.length;h++)if(a.traces[h]!==s.traces[h])return!1}else if(s.prop!==a.prop)return!1}else a=p[0],Array.isArray(a.traces)&&a.traces.sort();var f=(s=p[0]).value;if(Array.isArray(f)){if(1!==f.length)return!1;f=f[0]}n&&(n[f]=i)}return a},r.executeAPICommand=function(t,e,r){if("skip"===e)return Promise.resolve();var a=n.apiMethodRegistry[e],o=[t];Array.isArray(r)||(r=[]);for(var s=0;s<r.length;s++)o.push(r[s]);return a.apply(null,o).catch(function(t){return i.warn("API call to Plotly."+e+" rejected.",t),Promise.reject(t)})},r.computeAPICommandBindings=function(t,e,r){var n;switch(Array.isArray(r)||(r=[]),e){case"restyle":n=s(t,r);break;case"relayout":n=o(t,r);break;case"update":n=s(t,[r[0],r[2]]).concat(o(t,[r[1]]));break;case"animate":n=function(t,e){return Array.isArray(e[0])&&1===e[0].length&&-1!==["string","number"].indexOf(typeof e[0][0])?[{type:"layout",prop:"_currentFrame",value:e[0][0].toString()}]:[]}(0,r);break;default:n=[]}return n}},{"../lib":169,"../registry":261}],238:[function(t,e,r){"use strict";var n=t("../lib/extend").extendFlat;r.attributes=function(t,e){e=e||{};var r={valType:"info_array",editType:(t=t||{}).editType,items:[{valType:"number",min:0,max:1,editType:t.editType},{valType:"number",min:0,max:1,editType:t.editType}],dflt:[0,1]},i=(t.name&&t.name,t.trace,e.description&&e.description,{x:n({},r,{}),y:n({},r,{}),editType:t.editType});return t.noGridCell||(i.row={valType:"integer",min:0,dflt:0,editType:t.editType},i.column={valType:"integer",min:0,dflt:0,editType:t.editType}),i},r.defaults=function(t,e,r,n){var i=n&&n.x||[0,1],a=n&&n.y||[0,1],o=e.grid;if(o){var s=r("domain.column");void 0!==s&&(s<o.columns?i=o._domains.x[s]:delete t.domain.column);var l=r("domain.row");void 0!==l&&(l<o.rows?a=o._domains.y[l]:delete t.domain.row)}var u=r("domain.x",i),c=r("domain.y",a);u[0]<u[1]||(t.domain.x=i.slice()),c[0]<c[1]||(t.domain.y=a.slice())}},{"../lib/extend":162}],239:[function(t,e,r){"use strict";e.exports=function(t){var e=t.editType,r=t.colorEditType;void 0===r&&(r=e);var n={family:{valType:"string",noBlank:!0,strict:!0,editType:e},size:{valType:"number",min:1,editType:e},color:{valType:"color",editType:r},editType:e};return t.arrayOk&&(n.family.arrayOk=!0,n.size.arrayOk=!0,n.color.arrayOk=!0),n}},{}],240:[function(t,e,r){"use strict";e.exports={_isLinkedToArray:"frames_entry",group:{valType:"string"},name:{valType:"string"},traces:{valType:"any"},baseframe:{valType:"string"},data:{valType:"any"},layout:{valType:"any"}}},{}],241:[function(t,e,r){"use strict";var n=t("../registry"),i=t("./cartesian/constants").SUBPLOT_PATTERN;r.getSubplotCalcData=function(t,e,r){var i=n.subplotsRegistry[e];if(!i)return[];for(var a=i.attr,o=[],s=0;s<t.length;s++){var l=t[s];l[0].trace[a]===r&&o.push(l)}return o},r.getModuleCalcData=function(t,e){var r,i=[],a=[];if(!(r="string"==typeof e?n.getModule(e).plot:"function"==typeof e?e:e.plot))return[i,t];for(var o=0;o<t.length;o++){var s=t[o],l=s[0].trace;!0===l.visible&&0!==l._length&&(l._module.plot===r?i.push(s):a.push(s))}return[i,a]},r.getSubplotData=function(t,e,r){if(!n.subplotsRegistry[e])return[];var a,o,s,l=n.subplotsRegistry[e].attr,u=[];if("gl2d"===e){var c=r.match(i);o="x"+c[1],s="y"+c[2]}for(var p=0;p<t.length;p++)a=t[p],"gl2d"===e&&n.traceIs(a,"gl2d")?a[l[0]]===o&&a[l[1]]===s&&u.push(a):a[l]===r&&u.push(a);return u}},{"../registry":261,"./cartesian/constants":219}],242:[function(t,e,r){"use strict";function n(t,e){var r,n,i=[0,0,0,0];for(r=0;r<4;++r)for(n=0;n<4;++n)i[n]+=t[4*r+n]*e[r];return i}e.exports=function(t,e){return n(t.projection,n(t.view,n(t.model,[e[0],e[1],e[2],1])))}},{}],243:[function(t,e,r){"use strict";var n=t("./font_attributes"),i=t("./animation_attributes"),a=t("../components/color/attributes"),o=t("./pad_attributes"),s=t("../lib/extend").extendFlat,l=n({editType:"calc"});l.family.dflt='"Open Sans", verdana, arial, sans-serif',l.size.dflt=12,l.color.dflt=a.defaultLine,e.exports={font:l,title:{text:{valType:"string",editType:"layoutstyle"},font:n({editType:"layoutstyle"}),xref:{valType:"enumerated",dflt:"container",values:["container","paper"],editType:"layoutstyle"},yref:{valType:"enumerated",dflt:"container",values:["container","paper"],editType:"layoutstyle"},x:{valType:"number",min:0,max:1,dflt:.5,editType:"layoutstyle"},y:{valType:"number",min:0,max:1,dflt:"auto",editType:"layoutstyle"},xanchor:{valType:"enumerated",dflt:"auto",values:["auto","left","center","right"],editType:"layoutstyle"},yanchor:{valType:"enumerated",dflt:"auto",values:["auto","top","middle","bottom"],editType:"layoutstyle"},pad:s(o({editType:"layoutstyle"}),{}),editType:"layoutstyle"},uniformtext:{mode:{valType:"enumerated",values:[!1,"hide","show"],dflt:!1,editType:"plot"},minsize:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"plot"},autosize:{valType:"boolean",dflt:!1,editType:"none"},width:{valType:"number",min:10,dflt:700,editType:"plot"},height:{valType:"number",min:10,dflt:450,editType:"plot"},margin:{l:{valType:"number",min:0,dflt:80,editType:"plot"},r:{valType:"number",min:0,dflt:80,editType:"plot"},t:{valType:"number",min:0,dflt:100,editType:"plot"},b:{valType:"number",min:0,dflt:80,editType:"plot"},pad:{valType:"number",min:0,dflt:0,editType:"plot"},autoexpand:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},paper_bgcolor:{valType:"color",dflt:a.background,editType:"plot"},plot_bgcolor:{valType:"color",dflt:a.background,editType:"layoutstyle"},separators:{valType:"string",editType:"plot"},hidesources:{valType:"boolean",dflt:!1,editType:"plot"},showlegend:{valType:"boolean",editType:"legend"},colorway:{valType:"colorlist",dflt:a.defaults,editType:"calc"},datarevision:{valType:"any",editType:"calc"},uirevision:{valType:"any",editType:"none"},editrevision:{valType:"any",editType:"none"},selectionrevision:{valType:"any",editType:"none"},template:{valType:"any",editType:"calc"},modebar:{orientation:{valType:"enumerated",values:["v","h"],dflt:"h",editType:"modebar"},bgcolor:{valType:"color",editType:"modebar"},color:{valType:"color",editType:"modebar"},activecolor:{valType:"color",editType:"modebar"},uirevision:{valType:"any",editType:"none"},editType:"modebar"},meta:{valType:"any",arrayOk:!0,editType:"plot"},transition:s({},i.transition,{editType:"none"}),_deprecated:{title:{valType:"string",editType:"layoutstyle"},titlefont:n({editType:"layoutstyle"})}}},{"../components/color/attributes":49,"../lib/extend":162,"./animation_attributes":208,"./font_attributes":239,"./pad_attributes":251}],244:[function(t,e,r){"use strict";var n={"open-street-map":{id:"osm",version:8,sources:{"plotly-osm-tiles":{type:"raster",attribution:'<a href="http://www.openstreetmap.org/about/" target="_blank">\xa9 OpenStreetMap</a>',tiles:["https://a.tile.openstreetmap.org/{z}/{x}/{y}.png","https://b.tile.openstreetmap.org/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-osm-tiles",type:"raster",source:"plotly-osm-tiles",minzoom:0,maxzoom:22}]},"white-bg":{id:"white-bg",version:8,sources:{},layers:[{id:"white-bg",type:"background",paint:{"background-color":"#FFFFFF"},minzoom:0,maxzoom:22}]},"carto-positron":{id:"carto-positron",version:8,sources:{"plotly-carto-positron":{type:"raster",attribution:'<a href="https://carto.com/" target="_blank">\xa9 CARTO</a>',tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-positron",type:"raster",source:"plotly-carto-positron",minzoom:0,maxzoom:22}]},"carto-darkmatter":{id:"carto-darkmatter",version:8,sources:{"plotly-carto-darkmatter":{type:"raster",attribution:'<a href="https://carto.com/" target="_blank">\xa9 CARTO</a>',tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/dark_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-darkmatter",type:"raster",source:"plotly-carto-darkmatter",minzoom:0,maxzoom:22}]},"stamen-terrain":{id:"stamen-terrain",version:8,sources:{"plotly-stamen-terrain":{type:"raster",attribution:'Map tiles by <a href="http://stamen.com">Stamen Design</a>, under <a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a> | Data by <a href="http://openstreetmap.org">OpenStreetMap</a>, under <a href="http://www.openstreetmap.org/copyright">ODbL</a>.',tiles:["https://stamen-tiles.a.ssl.fastly.net/terrain/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-stamen-terrain",type:"raster",source:"plotly-stamen-terrain",minzoom:0,maxzoom:22}]},"stamen-toner":{id:"stamen-toner",version:8,sources:{"plotly-stamen-toner":{type:"raster",attribution:'Map tiles by <a href="http://stamen.com">Stamen Design</a>, under <a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a> | Data by <a href="http://openstreetmap.org">OpenStreetMap</a>, under <a href="http://www.openstreetmap.org/copyright">ODbL</a>.',tiles:["https://stamen-tiles.a.ssl.fastly.net/toner/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-stamen-toner",type:"raster",source:"plotly-stamen-toner",minzoom:0,maxzoom:22}]},"stamen-watercolor":{id:"stamen-watercolor",version:8,sources:{"plotly-stamen-watercolor":{type:"raster",attribution:'Map tiles by <a href="http://stamen.com">Stamen Design</a>, under <a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a> | Data by <a href="http://openstreetmap.org">OpenStreetMap</a>, under <a href="http://creativecommons.org/licenses/by-sa/3.0">CC BY SA</a>.',tiles:["https://stamen-tiles.a.ssl.fastly.net/watercolor/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-stamen-watercolor",type:"raster",source:"plotly-stamen-watercolor",minzoom:0,maxzoom:22}]}},i=Object.keys(n);e.exports={requiredVersion:"1.3.2",styleUrlPrefix:"mapbox://styles/mapbox/",styleUrlSuffix:"v9",styleValuesMapbox:["basic","streets","outdoors","light","dark","satellite","satellite-streets"],styleValueDflt:"basic",stylesNonMapbox:n,styleValuesNonMapbox:i,traceLayerPrefix:"plotly-trace-layer-",layoutLayerPrefix:"plotly-layout-layer-",wrongVersionErrorMsg:["Your custom plotly.js bundle is not using the correct mapbox-gl version","Please install mapbox-gl@1.3.2."].join("\n"),noAccessTokenErrorMsg:["Missing Mapbox access token.","Mapbox trace type require a Mapbox access token to be registered.","For example:"," Plotly.plot(gd, data, layout, { mapboxAccessToken: 'my-access-token' });","More info here: https://www.mapbox.com/help/define-access-token/"].join("\n"),missingStyleErrorMsg:["No valid mapbox style found, please set `mapbox.style` to one of:",i.join(", "),"or register a Mapbox access token to use a Mapbox-served style."].join("\n"),multipleTokensErrorMsg:["Set multiple mapbox access token across different mapbox subplot,","using first token found as mapbox-gl does not allow multipleaccess tokens on the same page."].join("\n"),mapOnErrorMsg:"Mapbox error.",mapboxLogo:{path0:"m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z",path1:"M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z",path2:"M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z",polygon:"11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34"},styleRules:{map:"overflow:hidden;position:relative;","missing-css":"display:none;",canary:"background-color:salmon;","ctrl-bottom-left":"position: absolute; pointer-events: none; z-index: 2; bottom: 0; left: 0;","ctrl-bottom-right":"position: absolute; pointer-events: none; z-index: 2; right: 0; bottom: 0;",ctrl:"clear: both; pointer-events: auto; transform: translate(0, 0);","ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner":"display: none;","ctrl-attrib.mapboxgl-compact:hover .mapboxgl-ctrl-attrib-inner":"display: block; margin-top:2px","ctrl-attrib.mapboxgl-compact:hover":"padding: 2px 24px 2px 4px; visibility: visible; margin-top: 6px;","ctrl-attrib.mapboxgl-compact::after":'content: ""; cursor: pointer; position: absolute; background-image: url(\'data:image/svg+xml;charset=utf-8,%3Csvg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"%3E %3Cpath fill="%23333333" fill-rule="evenodd" d="M4,10a6,6 0 1,0 12,0a6,6 0 1,0 -12,0 M9,7a1,1 0 1,0 2,0a1,1 0 1,0 -2,0 M9,10a1,1 0 1,1 2,0l0,3a1,1 0 1,1 -2,0"/%3E %3C/svg%3E\'); background-color: rgba(255, 255, 255, 0.5); width: 24px; height: 24px; box-sizing: border-box; border-radius: 12px;',"ctrl-attrib.mapboxgl-compact":"min-height: 20px; padding: 0; margin: 10px; position: relative; background-color: #fff; border-radius: 3px 12px 12px 3px;","ctrl-bottom-right > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; right: 0","ctrl-bottom-left > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; left: 0","ctrl-bottom-left .mapboxgl-ctrl":"margin: 0 0 10px 10px; float: left;","ctrl-bottom-right .mapboxgl-ctrl":"margin: 0 10px 10px 0; float: right;","ctrl-attrib":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a:hover":"color: inherit; text-decoration: underline;","ctrl-attrib .mapbox-improve-map":"font-weight: bold; margin-left: 2px;","attrib-empty":"display: none;","ctrl-logo":'display:block; width: 21px; height: 21px; background-image: url(\'data:image/svg+xml;charset=utf-8,%3C?xml version="1.0" encoding="utf-8"?%3E %3Csvg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 21 21" style="enable-background:new 0 0 21 21;" xml:space="preserve"%3E%3Cg transform="translate(0,0.01)"%3E%3Cpath d="m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z" style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3Cpath d="M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpath d="M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpolygon points="11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34 " style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3C/g%3E%3C/svg%3E\')'}}},{}],245:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){var r=t.split(" "),i=r[0],a=r[1],o=n.isArrayOrTypedArray(e)?n.mean(e):e,s=.5+o/100,l=1.5+o/100,u=["",""],c=[0,0];switch(i){case"top":u[0]="top",c[1]=-l;break;case"bottom":u[0]="bottom",c[1]=l}switch(a){case"left":u[1]="right",c[0]=-s;break;case"right":u[1]="left",c[0]=s}return{anchor:u[0]&&u[1]?u.join("-"):u[0]?u[0]:u[1]?u[1]:"center",offset:c}}},{"../../lib":169}],246:[function(t,e,r){"use strict";var n=t("mapbox-gl"),i=t("../../lib"),a=t("../../plots/get_data").getSubplotCalcData,o=t("../../constants/xmlns_namespaces"),s=t("d3"),l=t("../../components/drawing"),u=t("../../lib/svg_text_utils"),c=t("./mapbox"),p=r.constants=t("./constants");function h(t){return"string"==typeof t&&(-1!==p.styleValuesMapbox.indexOf(t)||0===t.indexOf("mapbox://"))}r.name="mapbox",r.attr="subplot",r.idRoot="mapbox",r.idRegex=r.attrRegex=i.counterRegex("mapbox"),r.attributes={subplot:{valType:"subplotid",dflt:"mapbox",editType:"calc"}},r.layoutAttributes=t("./layout_attributes"),r.supplyLayoutDefaults=t("./layout_defaults"),r.plot=function(t){var e=t._fullLayout,r=t.calcdata,o=e._subplots.mapbox;if(n.version!==p.requiredVersion)throw new Error(p.wrongVersionErrorMsg);var s=function(t,e){var r=t._fullLayout;if(""===t._context.mapboxAccessToken)return"";for(var n=[],a=[],o=!1,s=!1,l=0;l<e.length;l++){var u=r[e[l]],c=u.accesstoken;h(u.style)&&(c?i.pushUnique(n,c):(h(u._input.style)&&(i.error("Uses Mapbox map style, but did not set an access token."),o=!0),s=!0)),c&&i.pushUnique(a,c)}if(s){var f=o?p.noAccessTokenErrorMsg:p.missingStyleErrorMsg;throw i.error(f),new Error(f)}return n.length?(n.length>1&&i.warn(p.multipleTokensErrorMsg),n[0]):(a.length&&i.log(["Listed mapbox access token(s)",a.join(","),"but did not use a Mapbox map style, ignoring token(s)."].join(" ")),"")}(t,o);n.accessToken=s;for(var l=0;l<o.length;l++){var u=o[l],f=a(r,"mapbox",u),d=e[u],m=d._subplot;m||(m=new c(t,u),e[u]._subplot=m),m.viewInitial||(m.viewInitial={center:i.extendFlat({},d.center),zoom:d.zoom,bearing:d.bearing,pitch:d.pitch}),m.plot(f,e,t._promises)}},r.clean=function(t,e,r,n){for(var i=n._subplots.mapbox||[],a=0;a<i.length;a++){var o=i[a];!e[o]&&n[o]._subplot&&n[o]._subplot.destroy()}},r.toSVG=function(t){for(var e=t._fullLayout,r=e._subplots.mapbox,n=e._size,i=0;i<r.length;i++){var a=e[r[i]],c=a.domain,h=a._subplot.toImage("png");e._glimages.append("svg:image").attr({xmlns:o.svg,"xlink:href":h,x:n.l+n.w*c.x[0],y:n.t+n.h*(1-c.y[1]),width:n.w*(c.x[1]-c.x[0]),height:n.h*(c.y[1]-c.y[0]),preserveAspectRatio:"none"});var f=s.select(a._subplot.div);if(!(null===f.select(".mapboxgl-ctrl-logo").node().offsetParent)){var d=e._glimages.append("g");d.attr("transform","translate("+(n.l+n.w*c.x[0]+10)+", "+(n.t+n.h*(1-c.y[0])-31)+")"),d.append("path").attr("d",p.mapboxLogo.path0).style({opacity:.9,fill:"#ffffff","enable-background":"new"}),d.append("path").attr("d",p.mapboxLogo.path1).style("opacity",.35).style("enable-background","new"),d.append("path").attr("d",p.mapboxLogo.path2).style("opacity",.35).style("enable-background","new"),d.append("polygon").attr("points",p.mapboxLogo.polygon).style({opacity:.9,fill:"#ffffff","enable-background":"new"})}var m=f.select(".mapboxgl-ctrl-attrib").text().replace("Improve this map",""),y=e._glimages.append("g"),g=y.append("text");g.text(m).classed("static-attribution",!0).attr({"font-size":12,"font-family":"Arial",color:"rgba(0, 0, 0, 0.75)","text-anchor":"end","data-unformatted":m});var v=l.bBox(g.node()),_=n.w*(c.x[1]-c.x[0]);if(v.width>_/2){var x=m.split("|").join("<br>");g.text(x).attr("data-unformatted",x).call(u.convertToTspans,t),v=l.bBox(g.node())}g.attr("transform","translate(-3, "+(8-v.height)+")"),y.insert("rect",".static-attribution").attr({x:-v.width-6,y:-v.height-3,width:v.width+6,height:v.height+3,fill:"rgba(255, 255, 255, 0.75)"});var b=1;v.width+6>_&&(b=_/(v.width+6));var w=[n.l+n.w*c.x[1],n.t+n.h*(1-c.y[0])];y.attr("transform","translate("+w[0]+","+w[1]+") scale("+b+")")}},r.updateFx=function(t){for(var e=t._fullLayout,r=e._subplots.mapbox,n=0;n<r.length;n++){e[r[n]]._subplot.updateFx(e)}}},{"../../components/drawing":71,"../../constants/xmlns_namespaces":148,"../../lib":169,"../../lib/svg_text_utils":190,"../../plots/get_data":241,"./constants":244,"./layout_attributes":248,"./layout_defaults":249,"./mapbox":250,d3:14,"mapbox-gl":22}],247:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./convert_text_opts"),a=t("./constants");function o(t,e){this.subplot=t,this.uid=t.uid+"-"+e,this.index=e,this.idSource="source-"+this.uid,this.idLayer=a.layoutLayerPrefix+this.uid,this.sourceType=null,this.source=null,this.layerType=null,this.below=null,this.visible=!1}var s=o.prototype;function l(t){if(!t.visible)return!1;var e=t.source;if(Array.isArray(e)&&e.length>0){for(var r=0;r<e.length;r++)if("string"!=typeof e[r]||0===e[r].length)return!1;return!0}return n.isPlainObject(e)||"string"==typeof e&&e.length>0}function u(t){var e={},r={};switch(t.type){case"circle":n.extendFlat(r,{"circle-radius":t.circle.radius,"circle-color":t.color,"circle-opacity":t.opacity});break;case"line":n.extendFlat(r,{"line-width":t.line.width,"line-color":t.color,"line-opacity":t.opacity,"line-dasharray":t.line.dash});break;case"fill":n.extendFlat(r,{"fill-color":t.color,"fill-outline-color":t.fill.outlinecolor,"fill-opacity":t.opacity});break;case"symbol":var a=t.symbol,o=i(a.textposition,a.iconsize);n.extendFlat(e,{"icon-image":a.icon+"-15","icon-size":a.iconsize/10,"text-field":a.text,"text-size":a.textfont.size,"text-anchor":o.anchor,"text-offset":o.offset,"symbol-placement":a.placement}),n.extendFlat(r,{"icon-color":t.color,"text-color":a.textfont.color,"text-opacity":t.opacity});break;case"raster":n.extendFlat(r,{"raster-fade-duration":0,"raster-opacity":t.opacity})}return{layout:e,paint:r}}s.update=function(t){this.visible?this.needsNewImage(t)?this.updateImage(t):this.needsNewSource(t)?(this.removeLayer(),this.updateSource(t),this.updateLayer(t)):this.needsNewLayer(t)?this.updateLayer(t):this.updateStyle(t):(this.updateSource(t),this.updateLayer(t)),this.visible=l(t)},s.needsNewImage=function(t){return this.subplot.map.getSource(this.idSource)&&"image"===this.sourceType&&"image"===t.sourcetype&&(this.source!==t.source||JSON.stringify(this.coordinates)!==JSON.stringify(t.coordinates))},s.needsNewSource=function(t){return this.sourceType!==t.sourcetype||this.source!==t.source||this.layerType!==t.type},s.needsNewLayer=function(t){return this.layerType!==t.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},s.updateImage=function(t){this.subplot.map.getSource(this.idSource).updateImage({url:t.source,coordinates:t.coordinates})},s.updateSource=function(t){var e=this.subplot.map;if(e.getSource(this.idSource)&&e.removeSource(this.idSource),this.sourceType=t.sourcetype,this.source=t.source,l(t)){var r=function(t){var e,r=t.sourcetype,n=t.source,i={type:r};"geojson"===r?e="data":"vector"===r?e="string"==typeof n?"url":"tiles":"raster"===r?(e="tiles",i.tileSize=256):"image"===r&&(e="url",i.coordinates=t.coordinates);i[e]=n,t.sourceattribution&&(i.attribution=t.sourceattribution);return i}(t);e.addSource(this.idSource,r)}},s.updateLayer=function(t){var e,r=this.subplot,n=u(t),i=this.subplot.belowLookup["layout-"+this.index];if("traces"===i)for(var o=r.getMapLayers(),s=0;s<o.length;s++){var c=o[s].id;if("string"==typeof c&&0===c.indexOf(a.traceLayerPrefix)){e=c;break}}else e=i;this.removeLayer(),l(t)&&r.addLayer({id:this.idLayer,source:this.idSource,"source-layer":t.sourcelayer||"",type:t.type,minzoom:t.minzoom,maxzoom:t.maxzoom,layout:n.layout,paint:n.paint},e),this.layerType=t.type,this.below=i},s.updateStyle=function(t){if(l(t)){var e=u(t);this.subplot.setOptions(this.idLayer,"setLayoutProperty",e.layout),this.subplot.setOptions(this.idLayer,"setPaintProperty",e.paint)}},s.removeLayer=function(){var t=this.subplot.map;t.getLayer(this.idLayer)&&t.removeLayer(this.idLayer)},s.dispose=function(){var t=this.subplot.map;t.getLayer(this.idLayer)&&t.removeLayer(this.idLayer),t.getSource(this.idSource)&&t.removeSource(this.idSource)},e.exports=function(t,e,r){var n=new o(t,e);return n.update(r),n}},{"../../lib":169,"./constants":244,"./convert_text_opts":245}],248:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../components/color").defaultLine,a=t("../domain").attributes,o=t("../font_attributes"),s=t("../../traces/scatter/attributes").textposition,l=t("../../plot_api/edit_types").overrideAll,u=t("../../plot_api/plot_template").templatedArray,c=t("./constants"),p=o({});p.family.dflt="Open Sans Regular, Arial Unicode MS Regular",(e.exports=l({_arrayAttrRegexps:[n.counterRegex("mapbox",".layers",!0)],domain:a({name:"mapbox"}),accesstoken:{valType:"string",noBlank:!0,strict:!0},style:{valType:"any",values:c.styleValuesMapbox.concat(c.styleValuesNonMapbox),dflt:c.styleValueDflt},center:{lon:{valType:"number",dflt:0},lat:{valType:"number",dflt:0}},zoom:{valType:"number",dflt:1},bearing:{valType:"number",dflt:0},pitch:{valType:"number",dflt:0},layers:u("layer",{visible:{valType:"boolean",dflt:!0},sourcetype:{valType:"enumerated",values:["geojson","vector","raster","image"],dflt:"geojson"},source:{valType:"any"},sourcelayer:{valType:"string",dflt:""},sourceattribution:{valType:"string"},type:{valType:"enumerated",values:["circle","line","fill","symbol","raster"],dflt:"circle"},coordinates:{valType:"any"},below:{valType:"string"},color:{valType:"color",dflt:i},opacity:{valType:"number",min:0,max:1,dflt:1},minzoom:{valType:"number",min:0,max:24,dflt:0},maxzoom:{valType:"number",min:0,max:24,dflt:24},circle:{radius:{valType:"number",dflt:15}},line:{width:{valType:"number",dflt:2},dash:{valType:"data_array"}},fill:{outlinecolor:{valType:"color",dflt:i}},symbol:{icon:{valType:"string",dflt:"marker"},iconsize:{valType:"number",dflt:10},text:{valType:"string",dflt:""},placement:{valType:"enumerated",values:["point","line","line-center"],dflt:"point"},textfont:p,textposition:n.extendFlat({},s,{arrayOk:!1})}})},"plot","from-root")).uirevision={valType:"any",editType:"none"}},{"../../components/color":50,"../../lib":169,"../../plot_api/edit_types":196,"../../plot_api/plot_template":203,"../../traces/scatter/attributes":292,"../domain":238,"../font_attributes":239,"./constants":244}],249:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../subplot_defaults"),a=t("../array_container_defaults"),o=t("./layout_attributes");function s(t,e,r,n){r("accesstoken",n.accessToken),r("style"),r("center.lon"),r("center.lat"),r("zoom"),r("bearing"),r("pitch"),a(t,e,{name:"layers",handleItemDefaults:l}),e._input=t}function l(t,e){function r(r,i){return n.coerce(t,e,o.layers,r,i)}if(r("visible")){var i,a=r("sourcetype"),s="raster"===a||"image"===a;r("source"),r("sourceattribution"),"vector"===a&&r("sourcelayer"),"image"===a&&r("coordinates"),s&&(i="raster");var l=r("type",i);s&&"raster"!==l&&(l=e.type="raster",n.log("Source types *raster* and *image* must drawn *raster* layer type.")),r("below"),r("color"),r("opacity"),r("minzoom"),r("maxzoom"),"circle"===l&&r("circle.radius"),"line"===l&&(r("line.width"),r("line.dash")),"fill"===l&&r("fill.outlinecolor"),"symbol"===l&&(r("symbol.icon"),r("symbol.iconsize"),r("symbol.text"),n.coerceFont(r,"symbol.textfont"),r("symbol.textposition"),r("symbol.placement"))}}e.exports=function(t,e,r){i(t,e,r,{type:"mapbox",attributes:o,handleDefaults:s,partition:"y",accessToken:e._mapboxAccessToken})}},{"../../lib":169,"../array_container_defaults":209,"../subplot_defaults":259,"./layout_attributes":248}],250:[function(t,e,r){"use strict";var n=t("mapbox-gl"),i=t("../../components/fx"),a=t("../../lib"),o=t("../../lib/geo_location_utils"),s=t("../../registry"),l=t("../cartesian/axes"),u=t("../../components/dragelement"),c=t("../cartesian/select").prepSelect,p=t("../cartesian/select").selectOnClick,h=t("./constants"),f=t("./layers");function d(t,e){this.id=e,this.gd=t;var r=t._fullLayout,n=t._context;this.container=r._glcontainer.node(),this.isStatic=n.staticPlot,this.uid=r._uid+"-"+this.id,this.div=null,this.xaxis=null,this.yaxis=null,this.createFramework(r),this.map=null,this.accessToken=null,this.styleObj=null,this.traceHash={},this.layerList=[],this.belowLookup={},this.dragging=!1,this.wheeling=!1}var m=d.prototype;m.plot=function(t,e,r){var n,i=this,a=e[i.id];i.map&&a.accesstoken!==i.accessToken&&(i.map.remove(),i.map=null,i.styleObj=null,i.traceHash=[],i.layerList={}),n=i.map?new Promise(function(r,n){i.updateMap(t,e,r,n)}):new Promise(function(r,n){i.createMap(t,e,r,n)}),r.push(n)},m.createMap=function(t,e,r,i){var a=this,s=e[a.id],l=a.styleObj=g(s.style);a.accessToken=s.accesstoken;var u=a.map=new n.Map({container:a.div,style:l.style,center:_(s.center),zoom:s.zoom,bearing:s.bearing,pitch:s.pitch,interactive:!a.isStatic,preserveDrawingBuffer:a.isStatic,doubleClickZoom:!1,boxZoom:!1,attributionControl:!1}).addControl(new n.AttributionControl({compact:!0}));u._canvas.style.left="0px",u._canvas.style.top="0px",a.rejectOnError(i),a.isStatic||a.initFx(t,e);var c=[];c.push(new Promise(function(t){u.once("load",t)})),c=c.concat(o.fetchTraceGeoData(t)),Promise.all(c).then(function(){a.fillBelowLookup(t,e),a.updateData(t),a.updateLayout(e),a.resolveOnRender(r)}).catch(i)},m.updateMap=function(t,e,r,n){var i=this,a=i.map,s=e[this.id];i.rejectOnError(n);var l=[],u=g(s.style);i.styleObj.id!==u.id&&(i.styleObj=u,a.setStyle(u.style),i.traceHash={},l.push(new Promise(function(t){a.once("styledata",t)}))),l=l.concat(o.fetchTraceGeoData(t)),Promise.all(l).then(function(){i.fillBelowLookup(t,e),i.updateData(t),i.updateLayout(e),i.resolveOnRender(r)}).catch(n)},m.fillBelowLookup=function(t,e){var r,n,i=e[this.id].layers,a=this.belowLookup={},o=!1;for(r=0;r<t.length;r++){var s=t[r][0].trace,l=s._module;"string"==typeof s.below?n=s.below:l.getBelow&&(n=l.getBelow(s,this)),""===n&&(o=!0),a["trace-"+s.uid]=n||""}for(r=0;r<i.length;r++){var u=i[r];n="string"==typeof u.below?u.below:o?"traces":"",a["layout-"+r]=n}var c,p,h={};for(c in a)h[n=a[c]]?h[n].push(c):h[n]=[c];for(n in h){var f=h[n];if(f.length>1)for(r=0;r<f.length;r++)0===(c=f[r]).indexOf("trace-")?(p=c.split("trace-")[1],this.traceHash[p]&&(this.traceHash[p].below=null)):0===c.indexOf("layout-")&&(p=c.split("layout-")[1],this.layerList[p]&&(this.layerList[p].below=null))}};var y={choroplethmapbox:0,densitymapbox:1,scattermapbox:2};function g(t){var e={};return a.isPlainObject(t)?(e.id=t.id,e.style=t):"string"==typeof t?(e.id=t,-1!==h.styleValuesMapbox.indexOf(t)?e.style=v(t):h.stylesNonMapbox[t]?e.style=h.stylesNonMapbox[t]:e.style=t):(e.id=h.styleValueDflt,e.style=v(h.styleValueDflt)),e.transition={duration:0,delay:0},e}function v(t){return h.styleUrlPrefix+t+"-"+h.styleUrlSuffix}function _(t){return[t.lon,t.lat]}m.updateData=function(t){var e,r,n,i,a=this.traceHash,o=t.slice().sort(function(t,e){return y[t[0].trace.type]-y[e[0].trace.type]});for(n=0;n<o.length;n++){var s=o[n],l=!1;(e=a[(r=s[0].trace).uid])&&(e.type===r.type?(e.update(s),l=!0):e.dispose()),!l&&r._module&&(a[r.uid]=r._module.plot(this,s))}var u=Object.keys(a);t:for(n=0;n<u.length;n++){var c=u[n];for(i=0;i<t.length;i++)if(c===(r=t[i][0].trace).uid)continue t;(e=a[c]).dispose(),delete a[c]}},m.updateLayout=function(t){var e=this.map,r=t[this.id];this.dragging||this.wheeling||(e.setCenter(_(r.center)),e.setZoom(r.zoom),e.setBearing(r.bearing),e.setPitch(r.pitch)),this.updateLayers(t),this.updateFramework(t),this.updateFx(t),this.map.resize(),this.gd._context._scrollZoom.mapbox?e.scrollZoom.enable():e.scrollZoom.disable()},m.resolveOnRender=function(t){var e=this.map;e.on("render",function r(){e.loaded()&&(e.off("render",r),setTimeout(t,10))})},m.rejectOnError=function(t){var e=this.map;function r(){t(new Error(h.mapOnErrorMsg))}e.once("error",r),e.once("style.error",r),e.once("source.error",r),e.once("tile.error",r),e.once("layer.error",r)},m.createFramework=function(t){var e=this,r=e.div=document.createElement("div");r.id=e.uid,r.style.position="absolute",e.container.appendChild(r),e.xaxis={_id:"x",c2p:function(t){return e.project(t).x}},e.yaxis={_id:"y",c2p:function(t){return e.project(t).y}},e.updateFramework(t),e.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},l.setConvert(e.mockAxis,t)},m.initFx=function(t,e){var r=this,n=r.gd,a=r.map;function o(){i.loneUnhover(e._hoverlayer)}function l(){var t=r.getView();n.emit("plotly_relayouting",r.getViewEditsWithDerived(t))}a.on("moveend",function(t){if(r.map){var e=n._fullLayout;if(t.originalEvent||r.wheeling){var i=e[r.id];s.call("_storeDirectGUIEdit",n.layout,e._preGUI,r.getViewEdits(i));var a=r.getView();i._input.center=i.center=a.center,i._input.zoom=i.zoom=a.zoom,i._input.bearing=i.bearing=a.bearing,i._input.pitch=i.pitch=a.pitch,n.emit("plotly_relayout",r.getViewEditsWithDerived(a))}t.originalEvent&&"mouseup"===t.originalEvent.type?r.dragging=!1:r.wheeling&&(r.wheeling=!1),e._rehover&&e._rehover()}}),a.on("wheel",function(){r.wheeling=!0}),a.on("mousemove",function(t){var e=r.div.getBoundingClientRect();t.clientX=t.point.x+e.left,t.clientY=t.point.y+e.top,t.target.getBoundingClientRect=function(){return e},r.xaxis.p2c=function(){return t.lngLat.lng},r.yaxis.p2c=function(){return t.lngLat.lat},n._fullLayout._rehover=function(){n._fullLayout._hoversubplot===r.id&&n._fullLayout[r.id]&&i.hover(n,t,r.id)},i.hover(n,t,r.id),n._fullLayout._hoversubplot=r.id}),a.on("dragstart",function(){r.dragging=!0,o()}),a.on("zoomstart",o),a.on("mouseout",function(){n._fullLayout._hoversubplot=null}),a.on("drag",l),a.on("zoom",l),a.on("dblclick",function(){var t=n._fullLayout[r.id];s.call("_storeDirectGUIEdit",n.layout,n._fullLayout._preGUI,r.getViewEdits(t));var e=r.viewInitial;a.setCenter(_(e.center)),a.setZoom(e.zoom),a.setBearing(e.bearing),a.setPitch(e.pitch);var i=r.getView();t._input.center=t.center=i.center,t._input.zoom=t.zoom=i.zoom,t._input.bearing=t.bearing=i.bearing,t._input.pitch=t.pitch=i.pitch,n.emit("plotly_doubleclick",null),n.emit("plotly_relayout",r.getViewEditsWithDerived(i))}),r.clearSelect=function(){n._fullLayout._zoomlayer.selectAll(".select-outline").remove()},r.onClickInPanFn=function(t){return function(e){var a=n._fullLayout.clickmode;a.indexOf("select")>-1&&p(e.originalEvent,n,[r.xaxis],[r.yaxis],r.id,t),a.indexOf("event")>-1&&i.click(n,e.originalEvent)}}},m.updateFx=function(t){var e=this,r=e.map,n=e.gd;if(!e.isStatic){var i,o=t.dragmode;i="select"===o?function(t,r){(t.range={})[e.id]=[l([r.xmin,r.ymin]),l([r.xmax,r.ymax])]}:function(t,r,n){(t.lassoPoints={})[e.id]=n.filtered.map(l)};var s=e.dragOptions;e.dragOptions=a.extendDeep(s||{},{element:e.div,gd:n,plotinfo:{id:e.id,xaxis:e.xaxis,yaxis:e.yaxis,fillRangeItems:i},xaxes:[e.xaxis],yaxes:[e.yaxis],subplot:e.id}),r.off("click",e.onClickInPanHandler),"select"===o||"lasso"===o?(r.dragPan.disable(),r.on("zoomstart",e.clearSelect),e.dragOptions.prepFn=function(t,r,n){c(t,r,n,e.dragOptions,o)},u.init(e.dragOptions)):(r.dragPan.enable(),r.off("zoomstart",e.clearSelect),e.div.onmousedown=null,e.onClickInPanHandler=e.onClickInPanFn(e.dragOptions),r.on("click",e.onClickInPanHandler))}function l(t){var r=e.map.unproject(t);return[r.lng,r.lat]}},m.updateFramework=function(t){var e=t[this.id].domain,r=t._size,n=this.div.style;n.width=r.w*(e.x[1]-e.x[0])+"px",n.height=r.h*(e.y[1]-e.y[0])+"px",n.left=r.l+e.x[0]*r.w+"px",n.top=r.t+(1-e.y[1])*r.h+"px",this.xaxis._offset=r.l+e.x[0]*r.w,this.xaxis._length=r.w*(e.x[1]-e.x[0]),this.yaxis._offset=r.t+(1-e.y[1])*r.h,this.yaxis._length=r.h*(e.y[1]-e.y[0])},m.updateLayers=function(t){var e,r=t[this.id].layers,n=this.layerList;if(r.length!==n.length){for(e=0;e<n.length;e++)n[e].dispose();for(n=this.layerList=[],e=0;e<r.length;e++)n.push(f(this,e,r[e]))}else for(e=0;e<r.length;e++)n[e].update(r[e])},m.destroy=function(){this.map&&(this.map.remove(),this.map=null,this.container.removeChild(this.div))},m.toImage=function(){return this.map.stop(),this.map.getCanvas().toDataURL()},m.setOptions=function(t,e,r){for(var n in r)this.map[e](t,n,r[n])},m.getMapLayers=function(){return this.map.getStyle().layers},m.addLayer=function(t,e){var r=this.map;if("string"==typeof e){if(""===e)return void r.addLayer(t,e);for(var n=this.getMapLayers(),i=0;i<n.length;i++)if(e===n[i].id)return void r.addLayer(t,e);a.warn(["Trying to add layer with *below* value",e,"referencing a layer that does not exist","or that does not yet exist."].join(" "))}r.addLayer(t)},m.project=function(t){return this.map.project(new n.LngLat(t[0],t[1]))},m.getView=function(){var t=this.map,e=t.getCenter(),r={lon:e.lng,lat:e.lat},n=t.getCanvas(),i=n.width,a=n.height;return{center:r,zoom:t.getZoom(),bearing:t.getBearing(),pitch:t.getPitch(),_derived:{coordinates:[t.unproject([0,0]).toArray(),t.unproject([i,0]).toArray(),t.unproject([i,a]).toArray(),t.unproject([0,a]).toArray()]}}},m.getViewEdits=function(t){for(var e=this.id,r=["center","zoom","bearing","pitch"],n={},i=0;i<r.length;i++){var a=r[i];n[e+"."+a]=t[a]}return n},m.getViewEditsWithDerived=function(t){var e=this.id,r=this.getViewEdits(t);return r[e+"._derived"]=t._derived,r},e.exports=d},{"../../components/dragelement":68,"../../components/fx":88,"../../lib":169,"../../lib/geo_location_utils":165,"../../registry":261,"../cartesian/axes":213,"../cartesian/select":230,"./constants":244,"./layers":247,"mapbox-gl":22}],251:[function(t,e,r){"use strict";e.exports=function(t){var e=t.editType;return{t:{valType:"number",dflt:0,editType:e},r:{valType:"number",dflt:0,editType:e},b:{valType:"number",dflt:0,editType:e},l:{valType:"number",dflt:0,editType:e},editType:e}}},{}],252:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("../registry"),o=t("../plot_api/plot_schema"),s=t("../plot_api/plot_template"),l=t("../lib"),u=t("../components/color"),c=t("../constants/numerical").BADNUM,p=t("./cartesian/axis_ids"),h=t("./animation_attributes"),f=t("./frame_attributes"),d=t("../plots/get_data").getModuleCalcData,m=l.relinkPrivateKeys,y=l._,g=e.exports={};l.extendFlat(g,a),g.attributes=t("./attributes"),g.attributes.type.values=g.allTypes,g.fontAttrs=t("./font_attributes"),g.layoutAttributes=t("./layout_attributes"),g.fontWeight="normal";var v=g.transformsRegistry,_=t("./command");g.executeAPICommand=_.executeAPICommand,g.computeAPICommandBindings=_.computeAPICommandBindings,g.manageCommandObserver=_.manageCommandObserver,g.hasSimpleAPICommandBindings=_.hasSimpleAPICommandBindings,g.redrawText=function(t){var e=(t=l.getGraphDiv(t))._fullLayout||{};if(!(!(e._has&&e._has("polar"))&&t.data&&t.data[0]&&t.data[0].r))return new Promise(function(e){setTimeout(function(){a.getComponentMethod("annotations","draw")(t),a.getComponentMethod("legend","draw")(t),a.getComponentMethod("colorbar","draw")(t),e(g.previousPromises(t))},300)})},g.resize=function(t){var e;t=l.getGraphDiv(t);var r=new Promise(function(r,n){t&&!l.isHidden(t)||n(new Error("Resize must be passed a displayed plot div element.")),t._redrawTimer&&clearTimeout(t._redrawTimer),t._resolveResize&&(e=t._resolveResize),t._resolveResize=r,t._redrawTimer=setTimeout(function(){if(!t.layout||t.layout.width&&t.layout.height||l.isHidden(t))r(t);else{delete t.layout.width,delete t.layout.height;var e=t.changed;t.autoplay=!0,a.call("relayout",t,{autosize:!0}).then(function(){t.changed=e,t._resolveResize===r&&(delete t._resolveResize,r(t))})}},100)});return e&&e(r),r},g.previousPromises=function(t){if((t._promises||[]).length)return Promise.all(t._promises).then(function(){t._promises=[]})},g.addLinks=function(t){if(t._context.showLink||t._context.showSources){var e=t._fullLayout,r=l.ensureSingle(e._paper,"text","js-plot-link-container",function(t){t.style({"font-family":'"Open Sans", Arial, sans-serif',"font-size":"12px",fill:u.defaultLine,"pointer-events":"all"}).each(function(){var t=n.select(this);t.append("tspan").classed("js-link-to-tool",!0),t.append("tspan").classed("js-link-spacer",!0),t.append("tspan").classed("js-sourcelinks",!0)})}),i=r.node(),a={y:e._paper.attr("height")-9};document.body.contains(i)&&i.getComputedTextLength()>=e.width-20?(a["text-anchor"]="start",a.x=5):(a["text-anchor"]="end",a.x=e._paper.attr("width")-7),r.attr(a);var o=r.select(".js-link-to-tool"),s=r.select(".js-link-spacer"),c=r.select(".js-sourcelinks");t._context.showSources&&t._context.showSources(t),t._context.showLink&&function(t,e){e.text("");var r=e.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(t._context.linkText+" "+String.fromCharCode(187));if(t._context.sendData)r.on("click",function(){g.sendDataToCloud(t)});else{var n=window.location.pathname.split("/"),i=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+i})}}(t,o),s.text(o.text()&&c.text()?" - ":"")}},g.sendDataToCloud=function(t){t.emit("plotly_beforeexport");var e=(window.PLOTLYENV||{}).BASE_URL||t._context.plotlyServerURL,r=n.select(t).append("div").attr("id","hiddenform").style("display","none"),i=r.append("form").attr({action:e+"/external",method:"post",target:"_blank"});return i.append("input").attr({type:"text",name:"data"}).node().value=g.graphJson(t,!1,"keepdata"),i.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1};var x=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],b=["year","month","dayMonth","dayMonthYear"];function w(t,e){var r=t._context.locale,n=!1,i={};function o(t){for(var r=!0,a=0;a<e.length;a++){var o=e[a];i[o]||(t[o]?i[o]=t[o]:r=!1)}r&&(n=!0)}for(var s=0;s<2;s++){for(var l=t._context.locales,u=0;u<2;u++){var c=(l[r]||{}).format;if(c&&(o(c),n))break;l=a.localeRegistry}var p=r.split("-")[0];if(n||p===r)break;r=p}return n||o(a.localeRegistry.en.format),i}function k(t,e){var r={_fullLayout:e},n="x"===t._id.charAt(0),i=t._mainAxis._anchorAxis,a="",o="",s="";if(i&&(s=i._mainAxis._id,a=n?t._id+s:s+t._id),!a||!e._plots[a]){a="";for(var l=t._counterAxes,u=0;u<l.length;u++){var c=l[u],h=n?t._id+c:c+t._id;o||(o=h);var f=p.getFromId(r,c);if(s&&f.overlaying===s){a=h;break}}}return a||o}function T(t){var e=t.transforms;if(Array.isArray(e)&&e.length)for(var r=0;r<e.length;r++){var n=e[r],i=n._module||v[n.type];if(i&&i.makesData)return!0}return!1}function A(t,e,r,n){for(var i=t.transforms,a=[t],o=0;o<i.length;o++){var s=i[o],l=v[s.type];l&&l.transform&&(a=l.transform(a,{transform:s,fullTrace:t,fullData:e,layout:r,fullLayout:n,transformIndex:o}))}return a}function M(t){var e=t.margin;if(!t._size){var r=t._size={l:Math.round(e.l),r:Math.round(e.r),t:Math.round(e.t),b:Math.round(e.b),p:Math.round(e.pad)};r.w=Math.round(t.width)-r.l-r.r,r.h=Math.round(t.height)-r.t-r.b}t._pushmargin||(t._pushmargin={}),t._pushmarginIds||(t._pushmarginIds={})}g.supplyDefaults=function(t,e){var r=e&&e.skipUpdateCalc,i=t._fullLayout||{};if(i._skipDefaults)delete i._skipDefaults;else{var o,s=t._fullLayout={},u=t.layout||{},c=t._fullData||[],p=t._fullData=[],h=t.data||[],f=t.calcdata||[],d=t._context||{};t._transitionData||g.createTransitionData(t),s._dfltTitle={plot:y(t,"Click to enter Plot title"),x:y(t,"Click to enter X axis title"),y:y(t,"Click to enter Y axis title"),colorbar:y(t,"Click to enter Colorscale title"),annotation:y(t,"new text")},s._traceWord=y(t,"trace");var v=w(t,x);if(s._mapboxAccessToken=d.mapboxAccessToken,i._initialAutoSizeIsDone){var _=i.width,k=i.height;g.supplyLayoutGlobalDefaults(u,s,v),u.width||(s.width=_),u.height||(s.height=k),g.sanitizeMargins(s)}else{g.supplyLayoutGlobalDefaults(u,s,v);var T=!u.width||!u.height,A=s.autosize,S=d.autosizable;T&&(A||S)?g.plotAutoSize(t,u,s):T&&g.sanitizeMargins(s),!A&&T&&(u.width=s.width,u.height=s.height)}s._d3locale=function(t,e){return t.decimal=e.charAt(0),t.thousands=e.charAt(1),n.locale(t)}(v,s.separators),s._extraFormat=w(t,b),s._initialAutoSizeIsDone=!0,s._dataLength=h.length,s._modules=[],s._visibleModules=[],s._basePlotModules=[];var L=s._subplots=function(){var t,e,r=a.collectableSubplotTypes,n={};if(!r){r=[];var i=a.subplotsRegistry;for(var o in i){var s=i[o],u=s.attr;if(u&&(r.push(o),Array.isArray(u)))for(e=0;e<u.length;e++)l.pushUnique(r,u[e])}}for(t=0;t<r.length;t++)n[r[t]]=[];return n}(),C=s._splomAxes={x:{},y:{}},E=s._splomSubplots={};s._splomGridDflt={},s._scatterStackOpts={},s._firstScatter={},s._alignmentOpts={},s._colorAxes={},s._requestRangeslider={},s._traceUids=function(t,e){var r,n,i=e.length,a=[];for(r=0;r<t.length;r++){var o=t[r]._fullInput;o!==n&&a.push(o),n=o}var s=a.length,u=new Array(i),c={};function p(t,e){u[e]=t,c[t]=1}function h(t,e){if(t&&"string"==typeof t&&!c[t])return p(t,e),!0}for(r=0;r<i;r++){var f=e[r].uid;"number"==typeof f&&(f=String(f)),h(f,r)||(r<s&&h(a[r].uid,r)||p(l.randstr(c),r))}return u}(c,h),s._globalTransforms=(t._context||{}).globalTransforms,g.supplyDataDefaults(h,p,u,s);var z=Object.keys(C.x),P=Object.keys(C.y);if(z.length>1&&P.length>1){for(a.getComponentMethod("grid","sizeDefaults")(u,s),o=0;o<z.length;o++)l.pushUnique(L.xaxis,z[o]);for(o=0;o<P.length;o++)l.pushUnique(L.yaxis,P[o]);for(var I in E)l.pushUnique(L.cartesian,I)}if(s._has=g._hasPlotType.bind(s),c.length===p.length)for(o=0;o<p.length;o++)m(p[o],c[o]);g.supplyLayoutModuleDefaults(u,s,p,t._transitionData);var D=s._visibleModules,O=[];for(o=0;o<D.length;o++){var R=D[o].crossTraceDefaults;R&&l.pushUnique(O,R)}for(o=0;o<O.length;o++)O[o](p,s);s._hasOnlyLargeSploms=1===s._basePlotModules.length&&"splom"===s._basePlotModules[0].name&&z.length>15&&P.length>15&&0===s.shapes.length&&0===s.images.length,s._hasCartesian=s._has("cartesian"),s._hasGeo=s._has("geo"),s._hasGL3D=s._has("gl3d"),s._hasGL2D=s._has("gl2d"),s._hasTernary=s._has("ternary"),s._hasPie=s._has("pie"),g.linkSubplots(p,s,c,i),g.cleanPlot(p,s,c,i),i._zoomlayer&&!t._dragging&&i._zoomlayer.selectAll(".select-outline").remove(),function(t,e){var r,n=[];e.meta&&(r=e._meta={meta:e.meta,layout:{meta:e.meta}});for(var i=0;i<t.length;i++){var a=t[i];a.meta?n[a.index]=a._meta={meta:a.meta}:e.meta&&(a._meta={meta:e.meta}),e.meta&&(a._meta.layout={meta:e.meta})}n.length&&(r||(r=e._meta={}),r.data=n)}(p,s),m(s,i),a.getComponentMethod("colorscale","crossTraceDefaults")(p,s),s._preGUI||(s._preGUI={}),s._tracePreGUI||(s._tracePreGUI={});var F,B=s._tracePreGUI,N={};for(F in B)N[F]="old";for(o=0;o<p.length;o++)N[F=p[o]._fullInput.uid]||(B[F]={}),N[F]="new";for(F in N)"old"===N[F]&&delete B[F];M(s),a.getComponentMethod("rangeslider","makeData")(s),r||f.length!==p.length||g.supplyDefaultsUpdateCalc(f,p)}},g.supplyDefaultsUpdateCalc=function(t,e){for(var r=0;r<e.length;r++){var n=e[r],i=(t[r]||[])[0];if(i&&i.trace){var a=i.trace;if(a._hasCalcTransform){var o,s,u,c=a._arrayAttrs;for(o=0;o<c.length;o++)s=c[o],u=l.nestedProperty(a,s).get().slice(),l.nestedProperty(n,s).set(u)}i.trace=n}}},g.createTransitionData=function(t){t._transitionData||(t._transitionData={}),t._transitionData._frames||(t._transitionData._frames=[]),t._transitionData._frameHash||(t._transitionData._frameHash={}),t._transitionData._counter||(t._transitionData._counter=0),t._transitionData._interruptCallbacks||(t._transitionData._interruptCallbacks=[])},g._hasPlotType=function(t){var e,r=this._basePlotModules||[];for(e=0;e<r.length;e++)if(r[e].name===t)return!0;var n=this._modules||[];for(e=0;e<n.length;e++){var i=n[e].name;if(i===t)return!0;var o=a.modules[i];if(o&&o.categories[t])return!0}return!1},g.cleanPlot=function(t,e,r,n){var i,a,o=n._basePlotModules||[];for(i=0;i<o.length;i++){var s=o[i];s.clean&&s.clean(t,e,r,n)}var l=n._has&&n._has("gl"),u=e._has&&e._has("gl");l&&!u&&void 0!==n._glcontainer&&(n._glcontainer.selectAll(".gl-canvas").remove(),n._glcontainer.selectAll(".no-webgl").remove(),n._glcanvas=null);var c=!!n._infolayer;t:for(i=0;i<r.length;i++){var p=r[i].uid;for(a=0;a<t.length;a++){if(p===t[a].uid)continue t}c&&n._infolayer.select(".cb"+p).remove()}},g.linkSubplots=function(t,e,r,n){var i,o,s=n._plots||{},u=e._plots={},c=e._subplots,h={_fullData:t,_fullLayout:e},f=c.cartesian.concat(c.gl2d||[]);for(i=0;i<f.length;i++){var d,m=f[i],y=s[m],g=p.getFromId(h,m,"x"),v=p.getFromId(h,m,"y");for(y?d=u[m]=y:(d=u[m]={}).id=m,g._counterAxes.push(v._id),v._counterAxes.push(g._id),g._subplotsWith.push(m),v._subplotsWith.push(m),d.xaxis=g,d.yaxis=v,d._hasClipOnAxisFalse=!1,o=0;o<t.length;o++){var _=t[o];if(_.xaxis===d.xaxis._id&&_.yaxis===d.yaxis._id&&!1===_.cliponaxis){d._hasClipOnAxisFalse=!0;break}}}var x,b=p.list(h,null,!0);for(i=0;i<b.length;i++){var w=null;(x=b[i]).overlaying&&(w=p.getFromId(h,x.overlaying))&&w.overlaying&&(x.overlaying=!1,w=null),x._mainAxis=w||x,w&&(x.domain=w.domain.slice()),x._anchorAxis="free"===x.anchor?null:p.getFromId(h,x.anchor)}for(i=0;i<b.length;i++)if((x=b[i])._counterAxes.sort(p.idSort),x._subplotsWith.sort(l.subplotSort),x._mainSubplot=k(x,e),x._counterAxes.length&&(x.spikemode&&-1!==x.spikemode.indexOf("across")||x.automargin&&x.mirror&&"free"!==x.anchor||a.getComponentMethod("rangeslider","isVisible")(x))){var T=1,A=0;for(o=0;o<x._counterAxes.length;o++){var M=p.getFromId(h,x._counterAxes[o]);T=Math.min(T,M.domain[0]),A=Math.max(A,M.domain[1])}T<A&&(x._counterDomainMin=T,x._counterDomainMax=A)}},g.clearExpandedTraceDefaultColors=function(t){var e,r,n;for(r=[],(e=t._module._colorAttrs)||(t._module._colorAttrs=e=[],o.crawl(t._module.attributes,function(t,n,i,a){r[a]=n,r.length=a+1,"color"===t.valType&&void 0===t.dflt&&e.push(r.join("."))})),n=0;n<e.length;n++){l.nestedProperty(t,"_input."+e[n]).get()||l.nestedProperty(t,e[n]).set(null)}},g.supplyDataDefaults=function(t,e,r,n){var i,o,u,c=n._modules,p=n._visibleModules,h=n._basePlotModules,f=0,d=0;function y(t){e.push(t);var r=t._module;r&&(l.pushUnique(c,r),!0===t.visible&&l.pushUnique(p,r),l.pushUnique(h,t._module.basePlotModule),f++,!1!==t._input.visible&&d++)}n._transformModules=[];var v={},_=[],x=(r.template||{}).data||{},b=s.traceTemplater(x);for(i=0;i<t.length;i++){if(u=t[i],(o=b.newTrace(u)).uid=n._traceUids[i],g.supplyTraceDefaults(u,o,d,n,i),o.index=i,o._input=u,o._expandedIndex=f,o.transforms&&o.transforms.length)for(var w=!1!==u.visible&&!1===o.visible,k=A(o,e,r,n),T=0;T<k.length;T++){var M=k[T],S={_template:o._template,type:o.type,uid:o.uid+T};w&&!1===M.visible&&delete M.visible,g.supplyTraceDefaults(M,S,f,n,i),m(S,M),S.index=i,S._input=u,S._fullInput=o,S._expandedIndex=f,S._expandedInput=M,y(S)}else o._fullInput=o,o._expandedInput=o,y(o);a.traceIs(o,"carpetAxis")&&(v[o.carpet]=o),a.traceIs(o,"carpetDependent")&&_.push(i)}for(i=0;i<_.length;i++)if((o=e[_[i]]).visible){var L=v[o.carpet];o._carpet=L,L&&L.visible?(o.xaxis=L.xaxis,o.yaxis=L.yaxis):o.visible=!1}},g.supplyAnimationDefaults=function(t){var e;t=t||{};var r={};function n(e,n){return l.coerce(t||{},r,h,e,n)}if(n("mode"),n("direction"),n("fromcurrent"),Array.isArray(t.frame))for(r.frame=[],e=0;e<t.frame.length;e++)r.frame[e]=g.supplyAnimationFrameDefaults(t.frame[e]||{});else r.frame=g.supplyAnimationFrameDefaults(t.frame||{});if(Array.isArray(t.transition))for(r.transition=[],e=0;e<t.transition.length;e++)r.transition[e]=g.supplyAnimationTransitionDefaults(t.transition[e]||{});else r.transition=g.supplyAnimationTransitionDefaults(t.transition||{});return r},g.supplyAnimationFrameDefaults=function(t){var e={};function r(r,n){return l.coerce(t||{},e,h.frame,r,n)}return r("duration"),r("redraw"),e},g.supplyAnimationTransitionDefaults=function(t){var e={};function r(r,n){return l.coerce(t||{},e,h.transition,r,n)}return r("duration"),r("easing"),e},g.supplyFrameDefaults=function(t){var e={};function r(r,n){return l.coerce(t,e,f,r,n)}return r("group"),r("name"),r("traces"),r("baseframe"),r("data"),r("layout"),e},g.supplyTraceDefaults=function(t,e,r,n,i){var o,s=n.colorway||u.defaults,c=s[r%s.length];function p(r,n){return l.coerce(t,e,g.attributes,r,n)}var h=p("visible");p("type"),p("name",n._traceWord+" "+i),p("uirevision",n.uirevision);var f=g.getModule(e);if(e._module=f,f){var d=f.basePlotModule,m=d.attr,y=d.attributes;if(m&&y){var v=n._subplots,_="";if(h||"gl2d"!==d.name){if(Array.isArray(m))for(o=0;o<m.length;o++){var x=m[o],b=l.coerce(t,e,y,x);v[x]&&l.pushUnique(v[x],b),_+=b}else _=l.coerce(t,e,y,m);v[d.name]&&l.pushUnique(v[d.name],_)}}}return h&&(p("customdata"),p("ids"),p("meta"),a.traceIs(e,"showLegend")?(l.coerce(t,e,f.attributes.showlegend?f.attributes:g.attributes,"showlegend"),p("legendgroup"),e._dfltShowLegend=!0):e._dfltShowLegend=!1,f&&f.supplyDefaults(t,e,c,n),a.traceIs(e,"noOpacity")||p("opacity"),a.traceIs(e,"notLegendIsolatable")&&(e.visible=!!e.visible),a.traceIs(e,"noHover")||(e.hovertemplate||l.coerceHoverinfo(t,e,n),"parcats"!==e.type&&a.getComponentMethod("fx","supplyDefaults")(t,e,c,n)),f&&f.selectPoints&&p("selectedpoints"),g.supplyTransformDefaults(t,e,n)),e},g.hasMakesDataTransform=T,g.supplyTransformDefaults=function(t,e,r){if(e._length||T(t)){var n=r._globalTransforms||[],i=r._transformModules||[];if(Array.isArray(t.transforms)||0!==n.length)for(var a=t.transforms||[],o=n.concat(a),s=e.transforms=[],u=0;u<o.length;u++){var c,p=o[u],h=p.type,f=v[h],d=!(p._module&&p._module===f),m=f&&"function"==typeof f.transform;f||l.warn("Unrecognized transform type "+h+"."),f&&f.supplyDefaults&&(d||m)?((c=f.supplyDefaults(p,e,r,t)).type=h,c._module=f,l.pushUnique(i,f)):c=l.extendFlat({},p),s.push(c)}}},g.supplyLayoutGlobalDefaults=function(t,e,r){function n(r,n){return l.coerce(t,e,g.layoutAttributes,r,n)}var i=t.template;l.isPlainObject(i)&&(e.template=i,e._template=i.layout,e._dataTemplate=i.data);var o=l.coerceFont(n,"font");n("title.text",e._dfltTitle.plot),l.coerceFont(n,"title.font",{family:o.family,size:Math.round(1.4*o.size),color:o.color}),n("title.xref"),n("title.yref"),n("title.x"),n("title.y"),n("title.xanchor"),n("title.yanchor"),n("title.pad.t"),n("title.pad.r"),n("title.pad.b"),n("title.pad.l"),n("uniformtext.mode")&&n("uniformtext.minsize"),n("autosize",!(t.width&&t.height)),n("width"),n("height"),n("margin.l"),n("margin.r"),n("margin.t"),n("margin.b"),n("margin.pad"),n("margin.autoexpand"),t.width&&t.height&&g.sanitizeMargins(e),a.getComponentMethod("grid","sizeDefaults")(t,e),n("paper_bgcolor"),n("separators",r.decimal+r.thousands),n("hidesources"),n("colorway"),n("datarevision");var s=n("uirevision");n("editrevision",s),n("selectionrevision",s),n("modebar.orientation"),n("modebar.bgcolor",u.addOpacity(e.paper_bgcolor,.5));var c=u.contrast(u.rgb(e.modebar.bgcolor));n("modebar.color",u.addOpacity(c,.3)),n("modebar.activecolor",u.addOpacity(c,.7)),n("modebar.uirevision",s),n("meta"),l.isPlainObject(t.transition)&&(n("transition.duration"),n("transition.easing"),n("transition.ordering")),a.getComponentMethod("calendars","handleDefaults")(t,e,"calendar"),a.getComponentMethod("fx","supplyLayoutGlobalDefaults")(t,e,n)},g.plotAutoSize=function(t,e,r){var n,a,o=t._context||{},s=o.frameMargins,u=l.isPlotDiv(t);if(u&&t.emit("plotly_autosize"),o.fillFrame)n=window.innerWidth,a=window.innerHeight,document.body.style.overflow="hidden";else{var c=u?window.getComputedStyle(t):{};if(n=parseFloat(c.width)||parseFloat(c.maxWidth)||r.width,a=parseFloat(c.height)||parseFloat(c.maxHeight)||r.height,i(s)&&s>0){var p=1-2*s;n=Math.round(p*n),a=Math.round(p*a)}}var h=g.layoutAttributes.width.min,f=g.layoutAttributes.height.min;n<h&&(n=h),a<f&&(a=f);var d=!e.width&&Math.abs(r.width-n)>1,m=!e.height&&Math.abs(r.height-a)>1;(m||d)&&(d&&(r.width=n),m&&(r.height=a)),t._initialAutoSize||(t._initialAutoSize={width:n,height:a}),g.sanitizeMargins(r)},g.supplyLayoutModuleDefaults=function(t,e,r,n){var i,o,s,u=a.componentsRegistry,c=e._basePlotModules,p=a.subplotsRegistry.cartesian;for(i in u)(s=u[i]).includeBasePlot&&s.includeBasePlot(t,e);for(var h in c.length||c.push(p),e._has("cartesian")&&(a.getComponentMethod("grid","contentDefaults")(t,e),p.finalizeSubplots(t,e)),e._subplots)e._subplots[h].sort(l.subplotSort);for(o=0;o<c.length;o++)(s=c[o]).supplyLayoutDefaults&&s.supplyLayoutDefaults(t,e,r);var f=e._modules;for(o=0;o<f.length;o++)(s=f[o]).supplyLayoutDefaults&&s.supplyLayoutDefaults(t,e,r);var d=e._transformModules;for(o=0;o<d.length;o++)(s=d[o]).supplyLayoutDefaults&&s.supplyLayoutDefaults(t,e,r,n);for(i in u)(s=u[i]).supplyLayoutDefaults&&s.supplyLayoutDefaults(t,e,r)},g.purge=function(t){var e=t._fullLayout||{};void 0!==e._glcontainer&&(e._glcontainer.selectAll(".gl-canvas").remove(),e._glcontainer.remove(),e._glcanvas=null),e._modeBar&&e._modeBar.destroy(),t._transitionData&&(t._transitionData._interruptCallbacks&&(t._transitionData._interruptCallbacks.length=0),t._transitionData._animationRaf&&window.cancelAnimationFrame(t._transitionData._animationRaf)),l.clearThrottle(),l.clearResponsive(t),delete t.data,delete t.layout,delete t._fullData,delete t._fullLayout,delete t.calcdata,delete t.framework,delete t.empty,delete t.fid,delete t.undoqueue,delete t.undonum,delete t.autoplay,delete t.changed,delete t._promises,delete t._redrawTimer,delete t._hmlumcount,delete t._hmpixcount,delete t._transitionData,delete t._transitioning,delete t._initialAutoSize,delete t._transitioningWithDuration,delete t._dragging,delete t._dragged,delete t._dragdata,delete t._hoverdata,delete t._snapshotInProgress,delete t._editing,delete t._mouseDownTime,delete t._legendMouseDownTime,t.removeAllListeners&&t.removeAllListeners()},g.style=function(t){var e,r=t._fullLayout._visibleModules,n=[];for(e=0;e<r.length;e++){var i=r[e];i.style&&l.pushUnique(n,i.style)}for(e=0;e<n.length;e++)n[e](t)},g.sanitizeMargins=function(t){if(t&&t.margin){var e,r=t.width,n=t.height,i=t.margin,a=r-(i.l+i.r),o=n-(i.t+i.b);a<0&&(e=(r-1)/(i.l+i.r),i.l=Math.floor(e*i.l),i.r=Math.floor(e*i.r)),o<0&&(e=(n-1)/(i.t+i.b),i.t=Math.floor(e*i.t),i.b=Math.floor(e*i.b))}},g.clearAutoMarginIds=function(t){t._fullLayout._pushmarginIds={}},g.allowAutoMargin=function(t,e){t._fullLayout._pushmarginIds[e]=1},g.autoMargin=function(t,e,r){var n=t._fullLayout,i=n._pushmargin,a=n._pushmarginIds;if(!1!==n.margin.autoexpand){if(r){var o=r.pad;if(void 0===o){var s=n.margin;o=Math.min(12,s.l,s.r,s.t,s.b)}r.l+r.r>.5*n.width&&(l.log("Margin push",e,"is too big in x, dropping"),r.l=r.r=0),r.b+r.t>.5*n.height&&(l.log("Margin push",e,"is too big in y, dropping"),r.b=r.t=0);var u=void 0!==r.xl?r.xl:r.x,c=void 0!==r.xr?r.xr:r.x,p=void 0!==r.yt?r.yt:r.y,h=void 0!==r.yb?r.yb:r.y;i[e]={l:{val:u,size:r.l+o},r:{val:c,size:r.r+o},b:{val:h,size:r.b+o},t:{val:p,size:r.t+o}},a[e]=1}else delete i[e],delete a[e];if(!n._replotting)return g.doAutoMargin(t)}},g.doAutoMargin=function(t){var e=t._fullLayout;e._size||(e._size={}),M(e);var r=e._size,n=e.margin,o=l.extendFlat({},r),s=n.l,u=n.r,c=n.t,p=n.b,h=e.width,f=e.height,d=e._pushmargin,m=e._pushmarginIds;if(!1!==e.margin.autoexpand){for(var y in d)m[y]||delete d[y];for(var v in d.base={l:{val:0,size:s},r:{val:1,size:u},t:{val:1,size:c},b:{val:0,size:p}},d){var _=d[v].l||{},x=d[v].b||{},b=_.val,w=_.size,k=x.val,T=x.size;for(var A in d){if(i(w)&&d[A].r){var S=d[A].r.val,L=d[A].r.size;if(S>b){var C=(w*S+(L-h)*b)/(S-b),E=(L*(1-b)+(w-h)*(1-S))/(S-b);C>=0&&E>=0&&h-(C+E)>0&&C+E>s+u&&(s=C,u=E)}}if(i(T)&&d[A].t){var z=d[A].t.val,P=d[A].t.size;if(z>k){var I=(T*z+(P-f)*k)/(z-k),D=(P*(1-k)+(T-f)*(1-z))/(z-k);I>=0&&D>=0&&f-(D+I)>0&&I+D>p+c&&(p=I,c=D)}}}}}if(r.l=Math.round(s),r.r=Math.round(u),r.t=Math.round(c),r.b=Math.round(p),r.p=Math.round(n.pad),r.w=Math.round(h)-r.l-r.r,r.h=Math.round(f)-r.t-r.b,!e._replotting&&g.didMarginChange(o,r)){"_redrawFromAutoMarginCount"in e?e._redrawFromAutoMarginCount++:e._redrawFromAutoMarginCount=1;var O=3*(1+Object.keys(m).length);if(e._redrawFromAutoMarginCount<O)return a.call("plot",t);l.warn("Too many auto-margin redraws.")}};var S=["l","r","t","b","p","w","h"];function L(t,e,r){var n=!1;var i=[g.previousPromises,function(){if(t._transitionData)return t._transitioning=!1,function(t){var e=Promise.resolve();if(!t)return e;for(;t.length;)e=e.then(t.shift());return e}(t._transitionData._interruptCallbacks)},r.prepareFn,g.rehover,function(){return t.emit("plotly_transitioning",[]),new Promise(function(i){t._transitioning=!0,e.duration>0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push(function(){n=!0}),r.redraw&&t._transitionData._interruptCallbacks.push(function(){return a.call("redraw",t)}),t._transitionData._interruptCallbacks.push(function(){t.emit("plotly_transitioninterrupted",[])});var o=0,s=0;function l(){return o++,function(){var e;s++,n||s!==o||(e=i,t._transitionData&&(function(t){if(t)for(;t.length;)t.shift()}(t._transitionData._interruptCallbacks),Promise.resolve().then(function(){if(r.redraw)return a.call("redraw",t)}).then(function(){t._transitioning=!1,t._transitioningWithDuration=!1,t.emit("plotly_transitioned",[])}).then(e)))}}r.runFn(l),setTimeout(l())})}],o=l.syncOrAsync(i,t);return o&&o.then||(o=Promise.resolve()),o.then(function(){return t})}g.didMarginChange=function(t,e){for(var r=0;r<S.length;r++){var n=S[r],a=t[n],o=e[n];if(!i(a)||Math.abs(o-a)>1)return!0}return!1},g.graphJson=function(t,e,r,n,i){(i&&e&&!t._fullData||i&&!e&&!t._fullLayout)&&g.supplyDefaults(t);var a=i?t._fullData:t.data,o=i?t._fullLayout:t.layout,s=(t._transitionData||{})._frames;function u(t){if("function"==typeof t)return null;if(l.isPlainObject(t)){var e,n,i={};for(e in t)if("function"!=typeof t[e]&&-1===["_","["].indexOf(e.charAt(0))){if("keepdata"===r){if("src"===e.substr(e.length-3))continue}else if("keepstream"===r){if("string"==typeof(n=t[e+"src"])&&n.indexOf(":")>0&&!l.isPlainObject(t.stream))continue}else if("keepall"!==r&&"string"==typeof(n=t[e+"src"])&&n.indexOf(":")>0)continue;i[e]=u(t[e])}return i}return Array.isArray(t)?t.map(u):l.isTypedArray(t)?l.simpleMap(t,l.identity):l.isJSDate(t)?l.ms2DateTimeLocal(+t):t}var c={data:(a||[]).map(function(t){var r=u(t);return e&&delete r.fit,r})};return e||(c.layout=u(o)),t.framework&&t.framework.isPolar&&(c=t.framework.getConfig()),s&&(c.frames=u(s)),"object"===n?c:JSON.stringify(c)},g.modifyFrames=function(t,e){var r,n,i,a=t._transitionData._frames,o=t._transitionData._frameHash;for(r=0;r<e.length;r++)switch((n=e[r]).type){case"replace":i=n.value;var s=(a[n.index]||{}).name,l=i.name;a[n.index]=o[l]=i,l!==s&&(delete o[s],o[l]=i);break;case"insert":o[(i=n.value).name]=i,a.splice(n.index,0,i);break;case"delete":delete o[(i=a[n.index]).name],a.splice(n.index,1)}return Promise.resolve()},g.computeFrame=function(t,e){var r,n,i,a,o=t._transitionData._frameHash;if(!e)throw new Error("computeFrame must be given a string frame name");var s=o[e.toString()];if(!s)return!1;for(var l=[s],u=[s.name];s.baseframe&&(s=o[s.baseframe.toString()])&&-1===u.indexOf(s.name);)l.push(s),u.push(s.name);for(var c={};s=l.pop();)if(s.layout&&(c.layout=g.extendLayout(c.layout,s.layout)),s.data){if(c.data||(c.data=[]),!(n=s.traces))for(n=[],r=0;r<s.data.length;r++)n[r]=r;for(c.traces||(c.traces=[]),r=0;r<s.data.length;r++)null!=(i=n[r])&&(-1===(a=c.traces.indexOf(i))&&(a=c.data.length,c.traces[a]=i),c.data[a]=g.extendTrace(c.data[a],s.data[r]))}return c},g.recomputeFrameHash=function(t){for(var e=t._transitionData._frameHash={},r=t._transitionData._frames,n=0;n<r.length;n++){var i=r[n];i&&i.name&&(e[i.name]=i)}},g.extendObjectWithContainers=function(t,e,r){var n,i,a,o,s,u,c,p=l.extendDeepNoArrays({},e||{}),h=l.expandObjectPaths(p),f={};if(r&&r.length)for(a=0;a<r.length;a++)void 0===(i=(n=l.nestedProperty(h,r[a])).get())?l.nestedProperty(f,r[a]).set(null):(n.set(null),l.nestedProperty(f,r[a]).set(i));if(t=l.extendDeepNoArrays(t||{},h),r&&r.length)for(a=0;a<r.length;a++)if(u=l.nestedProperty(f,r[a]).get()){for(c=(s=l.nestedProperty(t,r[a])).get(),Array.isArray(c)||(c=[],s.set(c)),o=0;o<u.length;o++){var d=u[o];c[o]=null===d?null:g.extendObjectWithContainers(c[o],d)}s.set(c)}return t},g.dataArrayContainers=["transforms","dimensions"],g.layoutArrayContainers=a.layoutArrayContainers,g.extendTrace=function(t,e){return g.extendObjectWithContainers(t,e,g.dataArrayContainers)},g.extendLayout=function(t,e){return g.extendObjectWithContainers(t,e,g.layoutArrayContainers)},g.transition=function(t,e,r,n,i,a){var o={redraw:i.redraw},s={},u=[];return o.prepareFn=function(){for(var i=Array.isArray(e)?e.length:0,a=n.slice(0,i),o=0;o<a.length;o++){var c=a[o],p=t._fullData[c]._module;if(p){if(p.animatable){var h=p.basePlotModule.name;s[h]||(s[h]=[]),s[h].push(c)}t.data[a[o]]=g.extendTrace(t.data[a[o]],e[o])}}var f=l.expandObjectPaths(l.extendDeepNoArrays({},r)),d=/^[xy]axis[0-9]*$/;for(var m in f)d.test(m)&&delete f[m].range;g.extendLayout(t.layout,f),delete t.calcdata,g.supplyDefaults(t),g.doCalcdata(t);var y=l.expandObjectPaths(r);if(y){var v=t._fullLayout._plots;for(var _ in v){var x=v[_],b=x.xaxis,w=x.yaxis,k=b.range.slice(),T=w.range.slice(),A=null,M=null,S=null,L=null;Array.isArray(y[b._name+".range"])?A=y[b._name+".range"].slice():Array.isArray((y[b._name]||{}).range)&&(A=y[b._name].range.slice()),Array.isArray(y[w._name+".range"])?M=y[w._name+".range"].slice():Array.isArray((y[w._name]||{}).range)&&(M=y[w._name].range.slice()),k&&A&&(b.r2l(k[0])!==b.r2l(A[0])||b.r2l(k[1])!==b.r2l(A[1]))&&(S={xr0:k,xr1:A}),T&&M&&(w.r2l(T[0])!==w.r2l(M[0])||w.r2l(T[1])!==w.r2l(M[1]))&&(L={yr0:T,yr1:M}),(S||L)&&u.push(l.extendFlat({plotinfo:x},S,L))}}return Promise.resolve()},o.runFn=function(e){var n,i,o=t._fullLayout._basePlotModules,c=u.length;if(r)for(i=0;i<o.length;i++)o[i].transitionAxes&&o[i].transitionAxes(t,u,a,e);for(var p in c?((n=l.extendFlat({},a)).duration=0,delete s.cartesian):n=a,s){var h=s[p];t._fullData[h[0]]._module.basePlotModule.plot(t,h,n,e)}},L(t,a,o)},g.transitionFromReact=function(t,e,r,n){var i=t._fullLayout,a=i.transition,o={},s=[];return o.prepareFn=function(){var t=i._plots;for(var a in o.redraw=!1,"some"===e.anim&&(o.redraw=!0),"some"===r.anim&&(o.redraw=!0),t){var u=t[a],c=u.xaxis,p=u.yaxis,h=n[c._name].range.slice(),f=n[p._name].range.slice(),d=c.range.slice(),m=p.range.slice();c.setScale(),p.setScale();var y=null,g=null;c.r2l(h[0])===c.r2l(d[0])&&c.r2l(h[1])===c.r2l(d[1])||(y={xr0:h,xr1:d}),p.r2l(f[0])===p.r2l(m[0])&&p.r2l(f[1])===p.r2l(m[1])||(g={yr0:f,yr1:m}),(y||g)&&s.push(l.extendFlat({plotinfo:u},y,g))}return Promise.resolve()},o.runFn=function(r){for(var n,i,o,u=t._fullData,c=t._fullLayout._basePlotModules,p=[],h=0;h<u.length;h++)p.push(h);function f(){for(var e=0;e<c.length;e++)c[e].transitionAxes&&c[e].transitionAxes(t,s,n,r)}function d(){for(var e=0;e<c.length;e++)c[e].plot(t,o,i,r)}s.length&&e.anim?"traces first"===a.ordering?(n=l.extendFlat({},a,{duration:0}),o=p,i=a,setTimeout(f,a.duration),d()):(n=a,o=null,i=l.extendFlat({},a,{duration:0}),setTimeout(d,n.duration),f()):s.length?(n=a,f()):e.anim&&(o=p,i=a,d())},L(t,a,o)},g.doCalcdata=function(t,e){var r,n,i,s,u=p.list(t),h=t._fullData,f=t._fullLayout,d=new Array(h.length),m=(t.calcdata||[]).slice();for(t.calcdata=d,f._numBoxes=0,f._numViolins=0,f._violinScaleGroupStats={},t._hmpixcount=0,t._hmlumcount=0,f._piecolormap={},f._sunburstcolormap={},f._treemapcolormap={},f._funnelareacolormap={},i=0;i<h.length;i++)Array.isArray(e)&&-1===e.indexOf(i)&&(d[i]=m[i]);for(i=0;i<h.length;i++)(r=h[i])._arrayAttrs=o.findArrayAttributes(r),r._extremes={};var y=f._subplots.polar||[];for(i=0;i<y.length;i++)u.push(f[y[i]].radialaxis,f[y[i]].angularaxis);for(var g in f._colorAxes){var _=f[g];!1!==_.cauto&&(delete _.cmin,delete _.cmax)}var x=!1;function b(e){if(r=h[e],n=r._module,!0===r.visible&&r.transforms){if(n&&n.calc){var i=n.calc(t,r);i[0]&&i[0].t&&i[0].t._scene&&delete i[0].t._scene.dirty}for(s=0;s<r.transforms.length;s++){var a=r.transforms[s];(n=v[a.type])&&n.calcTransform&&(r._hasCalcTransform=!0,x=!0,n.calcTransform(t,r,a))}}}function w(e,i){if(r=h[e],!!(n=r._module).isContainer===i){var a=[];if(!0===r.visible&&0!==r._length){delete r._indexToPoints;var o=r.transforms||[];for(s=o.length-1;s>=0;s--)if(o[s].enabled){r._indexToPoints=o[s]._indexToPoints;break}n&&n.calc&&(a=n.calc(t,r))}Array.isArray(a)&&a[0]||(a=[{x:c,y:c}]),a[0].t||(a[0].t={}),a[0].trace=r,d[e]=a}}for(E(u,h,f),i=0;i<h.length;i++)w(i,!0);for(i=0;i<h.length;i++)b(i);for(x&&E(u,h,f),i=0;i<h.length;i++)w(i,!0);for(i=0;i<h.length;i++)w(i,!1);z(t);var k=function(t,e){var r,n,i,o,s,u=[];function c(t,r,n){var i=r._id.charAt(0);if("histogram2dcontour"===t){var a=r._counterAxes[0],o=p.getFromId(e,a),s="x"===i||"x"===a&&"category"===o.type,l="y"===i||"y"===a&&"category"===o.type;return function(t,e){return 0===t||0===e?-1:s&&t===n[e].length-1?-1:l&&e===n.length-1?-1:("y"===i?e:t)-1}}return function(t,e){return"y"===i?e:t}}var h={min:function(t){return l.aggNums(Math.min,null,t)},max:function(t){return l.aggNums(Math.max,null,t)},sum:function(t){return l.aggNums(function(t,e){return t+e},null,t)},total:function(t){return l.aggNums(function(t,e){return t+e},null,t)},mean:function(t){return l.mean(t)},median:function(t){return l.median(t)}};for(r=0;r<t.length;r++){var f=t[r];if("category"===f.type){var d=f.categoryorder.match(C);if(d){var m=d[1],y=d[2],g=[];for(n=0;n<f._categories.length;n++)g.push([f._categories[n],[]]);for(n=0;n<f._traceIndices.length;n++){var v=f._traceIndices[n],_=e._fullData[v],x=f._id.charAt(0);if(!0===_.visible){var b=_.type;a.traceIs(_,"histogram")&&(delete _._xautoBinFinished,delete _._yautoBinFinished);var w=e.calcdata[v];for(i=0;i<w.length;i++){var k,T,A,M=w[i];if("splom"===b){var S=_._axesDim[f._id];if("y"===x){var L=_._diag[S][0];L&&(f=e._fullLayout[p.id2name(L)])}var E=M.trace.dimensions[S].values;for(o=0;o<E.length;o++)for(k=E[o],T=f._categoriesMap[k],s=0;s<M.trace.dimensions.length;s++)if(s!==S){var z=M.trace.dimensions[s];g[T][1].push(z.values[o])}}else if("scattergl"===b){for(o=0;o<M.t.x.length;o++)"x"===x&&(k=M.t.x[o],T=k,A=M.t.y[o]),"y"===x&&(k=M.t.y[o],T=k,A=M.t.x[o]),g[T][1].push(A);M.t&&M.t._scene&&delete M.t._scene.dirty}else if(M.hasOwnProperty("z")){A=M.z;var P=c(_.type,f,A);for(o=0;o<A.length;o++)for(s=0;s<A[o].length;s++)(T=P(s,o))+1&&g[T][1].push(A[o][s])}else for("x"===x?(k=M.p+1?M.p:M.x,A=M.s||M.v||M.y):"y"===x&&(k=M.p+1?M.p:M.y,A=M.s||M.v||M.x),Array.isArray(A)||(A=[A]),o=0;o<A.length;o++)g[k][1].push(A[o])}}}f._categoriesValue=g;var I=[];for(n=0;n<g.length;n++)I.push([g[n][0],h[m](g[n][1])]);I.sort(function(t,e){return t[1]-e[1]}),f._categoriesAggregatedValue=I,f._initialCategories=I.map(function(t){return t[0]}),"descending"===y&&f._initialCategories.reverse(),u=u.concat(f.sortByInitialCategories())}}}return u}(u,t);if(k.length){for(f._numBoxes=0,f._numViolins=0,i=0;i<k.length;i++)w(k[i],!0);for(i=0;i<k.length;i++)w(k[i],!1);z(t)}a.getComponentMethod("fx","calc")(t),a.getComponentMethod("errorbars","calc")(t)};var C=/(total|sum|min|max|mean|median) (ascending|descending)/;function E(t,e,r){var n,i,a,o={};for(n=0;n<t.length;n++)a=(i=t[n])._id,i.clearCalc(),"multicategory"===i.type&&i.setupMultiCategory(e),o[i._id]=1;var s=r._axisMatchGroups||[];for(n=0;n<s.length;n++)for(a in s[n])o[a]||(i=r[p.id2name(a)]).clearCalc()}function z(t){var e,r,n,i=t._fullLayout,a=i._visibleModules,o={};for(r=0;r<a.length;r++){var s=a[r],u=s.crossTraceCalc;if(u){var c=s.basePlotModule.name;o[c]?l.pushUnique(o[c],u):o[c]=[u]}}for(n in o){var p=o[n],h=i._subplots[n];if(Array.isArray(h))for(e=0;e<h.length;e++){var f=h[e],d="cartesian"===n?i._plots[f]:i[f];for(r=0;r<p.length;r++)p[r](t,d,f)}else for(r=0;r<p.length;r++)p[r](t)}}g.rehover=function(t){t._fullLayout._rehover&&t._fullLayout._rehover()},g.redrag=function(t){t._fullLayout._redrag&&t._fullLayout._redrag()},g.generalUpdatePerTraceModule=function(t,e,r,n){var i,a=e.traceHash,o={};for(i=0;i<r.length;i++){var s=r[i],u=s[0].trace;u.visible&&(o[u.type]=o[u.type]||[],o[u.type].push(s))}for(var c in a)if(!o[c]){var p=a[c][0];p[0].trace.visible=!1,o[c]=[p]}for(var h in o){var f=o[h];f[0][0].trace._module.plot(t,e,l.filterVisible(f),n)}e.traceHash=o},g.plotBasePlot=function(t,e,r,n,i){var o=a.getModule(t),s=d(e.calcdata,o)[0];o.plot(e,s,n,i)},g.cleanBasePlot=function(t,e,r,n,i){var a=i._has&&i._has(t),o=r._has&&r._has(t);a&&!o&&i["_"+t+"layer"].selectAll("g.trace").remove()}},{"../components/color":50,"../constants/numerical":147,"../lib":169,"../plot_api/plot_schema":202,"../plot_api/plot_template":203,"../plots/get_data":241,"../registry":261,"./animation_attributes":208,"./attributes":210,"./cartesian/axis_ids":216,"./command":237,"./font_attributes":239,"./frame_attributes":240,"./layout_attributes":243,d3:14,"fast-isnumeric":16}],253:[function(t,e,r){"use strict";var n=t("../../../traces/scatter/attributes"),i=n.marker,a=t("../../../lib/extend").extendFlat;["Area traces are deprecated!","Please switch to the *barpolar* trace type."].join(" ");e.exports={r:a({},n.r,{}),t:a({},n.t,{}),marker:{color:a({},i.color,{}),size:a({},i.size,{}),symbol:a({},i.symbol,{}),opacity:a({},i.opacity,{}),editType:"calc"}}},{"../../../lib/extend":162,"../../../traces/scatter/attributes":292}],254:[function(t,e,r){"use strict";var n=t("../../cartesian/layout_attributes"),i=t("../../../lib/extend").extendFlat,a=t("../../../plot_api/edit_types").overrideAll,o=["Legacy polar charts are deprecated!","Please switch to *polar* subplots."].join(" "),s=i({},n.domain,{});function l(t,e){return i({},e,{showline:{valType:"boolean"},showticklabels:{valType:"boolean"},tickorientation:{valType:"enumerated",values:["horizontal","vertical"]},ticklen:{valType:"number",min:0},tickcolor:{valType:"color"},ticksuffix:{valType:"string"},endpadding:{valType:"number",description:o},visible:{valType:"boolean"}})}e.exports=a({radialaxis:l(0,{range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},domain:s,orientation:{valType:"number"}}),angularaxis:l(0,{range:{valType:"info_array",items:[{valType:"number",dflt:0},{valType:"number",dflt:360}]},domain:s}),layout:{direction:{valType:"enumerated",values:["clockwise","counterclockwise"]},orientation:{valType:"angle"}}},"plot","nested")},{"../../../lib/extend":162,"../../../plot_api/edit_types":196,"../../cartesian/layout_attributes":225}],255:[function(t,e,r){"use strict";(e.exports=t("./micropolar")).manager=t("./micropolar_manager")},{"./micropolar":256,"./micropolar_manager":257}],256:[function(t,e,r){var n=t("d3"),i=t("../../../lib").extendDeepAll,a=t("../../../constants/alignment").MID_SHIFT,o=e.exports={version:"0.2.2"};o.Axis=function(){var t,e,r,s,l={data:[],layout:{}},u={},c={},p=n.dispatch("hover"),h={};return h.render=function(u){return function(u){e=u||e;var p=l.data,h=l.layout;("string"==typeof e||e.nodeName)&&(e=n.select(e)),e.datum(p).each(function(e,l){var u=e.slice();c={data:o.util.cloneJson(u),layout:o.util.cloneJson(h)};var p=0;u.forEach(function(t,e){t.color||(t.color=h.defaultColorRange[p],p=(p+1)%h.defaultColorRange.length),t.strokeColor||(t.strokeColor="LinePlot"===t.geometry?t.color:n.rgb(t.color).darker().toString()),c.data[e].color=t.color,c.data[e].strokeColor=t.strokeColor,c.data[e].strokeDash=t.strokeDash,c.data[e].strokeSize=t.strokeSize});var f=u.filter(function(t,e){var r=t.visible;return"undefined"==typeof r||!0===r}),d=!1,m=f.map(function(t,e){return d=d||"undefined"!=typeof t.groupId,t});if(d){var y=n.nest().key(function(t,e){return"undefined"!=typeof t.groupId?t.groupId:"unstacked"}).entries(m),g=[],v=y.map(function(t,e){if("unstacked"===t.key)return t.values;var r=t.values[0].r.map(function(t,e){return 0});return t.values.forEach(function(t,e,n){t.yStack=[r],g.push(r),r=o.util.sumArrays(t.r,r)}),t.values});f=n.merge(v)}f.forEach(function(t,e){t.t=Array.isArray(t.t[0])?t.t:[t.t],t.r=Array.isArray(t.r[0])?t.r:[t.r]});var _=Math.min(h.width-h.margin.left-h.margin.right,h.height-h.margin.top-h.margin.bottom)/2;_=Math.max(10,_);var x,b=[h.margin.left+_,h.margin.top+_];x=d?[0,n.max(o.util.sumArrays(o.util.arrayLast(f).r[0],o.util.arrayLast(g)))]:n.extent(o.util.flattenArray(f.map(function(t,e){return t.r}))),h.radialAxis.domain!=o.DATAEXTENT&&(x[0]=0),r=n.scale.linear().domain(h.radialAxis.domain!=o.DATAEXTENT&&h.radialAxis.domain?h.radialAxis.domain:x).range([0,_]),c.layout.radialAxis.domain=r.domain();var w,k=o.util.flattenArray(f.map(function(t,e){return t.t})),T="string"==typeof k[0];T&&(k=o.util.deduplicate(k),w=k.slice(),k=n.range(k.length),f=f.map(function(t,e){var r=t;return t.t=[k],d&&(r.yStack=t.yStack),r}));var A=f.filter(function(t,e){return"LinePlot"===t.geometry||"DotPlot"===t.geometry}).length===f.length,M=null===h.needsEndSpacing?T||!A:h.needsEndSpacing,S=h.angularAxis.domain&&h.angularAxis.domain!=o.DATAEXTENT&&!T&&h.angularAxis.domain[0]>=0?h.angularAxis.domain:n.extent(k),L=Math.abs(k[1]-k[0]);A&&!T&&(L=0);var C=S.slice();M&&T&&(C[1]+=L);var E=h.angularAxis.ticksCount||4;E>8&&(E=E/(E/8)+E%8),h.angularAxis.ticksStep&&(E=(C[1]-C[0])/E);var z=h.angularAxis.ticksStep||(C[1]-C[0])/(E*(h.minorTicks+1));w&&(z=Math.max(Math.round(z),1)),C[2]||(C[2]=z);var P=n.range.apply(this,C);if(P=P.map(function(t,e){return parseFloat(t.toPrecision(12))}),s=n.scale.linear().domain(C.slice(0,2)).range("clockwise"===h.direction?[0,360]:[360,0]),c.layout.angularAxis.domain=s.domain(),c.layout.angularAxis.endPadding=M?L:0,"undefined"==typeof(t=n.select(this).select("svg.chart-root"))||t.empty()){var I=(new DOMParser).parseFromString("<svg xmlns='http://www.w3.org/2000/svg' class='chart-root'>' + '<g class='outer-group'>' + '<g class='chart-group'>' + '<circle class='background-circle'></circle>' + '<g class='geometry-group'></g>' + '<g class='radial axis-group'>' + '<circle class='outside-circle'></circle>' + '</g>' + '<g class='angular axis-group'></g>' + '<g class='guides-group'><line></line><circle r='0'></circle></g>' + '</g>' + '<g class='legend-group'></g>' + '<g class='tooltips-group'></g>' + '<g class='title-group'><text></text></g>' + '</g>' + '</svg>","application/xml"),D=this.appendChild(this.ownerDocument.importNode(I.documentElement,!0));t=n.select(D)}t.select(".guides-group").style({"pointer-events":"none"}),t.select(".angular.axis-group").style({"pointer-events":"none"}),t.select(".radial.axis-group").style({"pointer-events":"none"});var O,R=t.select(".chart-group"),F={fill:"none",stroke:h.tickColor},B={"font-size":h.font.size,"font-family":h.font.family,fill:h.font.color,"text-shadow":["-1px 0px","1px -1px","-1px 1px","1px 1px"].map(function(t,e){return" "+t+" 0 "+h.font.outlineColor}).join(",")};if(h.showLegend){O=t.select(".legend-group").attr({transform:"translate("+[_,h.margin.top]+")"}).style({display:"block"});var N=f.map(function(t,e){var r=o.util.cloneJson(t);return r.symbol="DotPlot"===t.geometry?t.dotType||"circle":"LinePlot"!=t.geometry?"square":"line",r.visibleInLegend="undefined"==typeof t.visibleInLegend||t.visibleInLegend,r.color="LinePlot"===t.geometry?t.strokeColor:t.color,r});o.Legend().config({data:f.map(function(t,e){return t.name||"Element"+e}),legendConfig:i({},o.Legend.defaultConfig().legendConfig,{container:O,elements:N,reverseOrder:h.legend.reverseOrder})})();var U=O.node().getBBox();_=Math.min(h.width-U.width-h.margin.left-h.margin.right,h.height-h.margin.top-h.margin.bottom)/2,_=Math.max(10,_),b=[h.margin.left+_,h.margin.top+_],r.range([0,_]),c.layout.radialAxis.domain=r.domain(),O.attr("transform","translate("+[b[0]+_,b[1]-_]+")")}else O=t.select(".legend-group").style({display:"none"});t.attr({width:h.width,height:h.height}).style({opacity:h.opacity}),R.attr("transform","translate("+b+")").style({cursor:"crosshair"});var j=[(h.width-(h.margin.left+h.margin.right+2*_+(U?U.width:0)))/2,(h.height-(h.margin.top+h.margin.bottom+2*_))/2];if(j[0]=Math.max(0,j[0]),j[1]=Math.max(0,j[1]),t.select(".outer-group").attr("transform","translate("+j+")"),h.title&&h.title.text){var V=t.select("g.title-group text").style(B).text(h.title.text),q=V.node().getBBox();V.attr({x:b[0]-q.width/2,y:b[1]-_-20})}var G=t.select(".radial.axis-group");if(h.radialAxis.gridLinesVisible){var H=G.selectAll("circle.grid-circle").data(r.ticks(5));H.enter().append("circle").attr({class:"grid-circle"}).style(F),H.attr("r",r),H.exit().remove()}G.select("circle.outside-circle").attr({r:_}).style(F);var Z=t.select("circle.background-circle").attr({r:_}).style({fill:h.backgroundColor,stroke:h.stroke});function X(t,e){return s(t)%360+h.orientation}if(h.radialAxis.visible){var W=n.svg.axis().scale(r).ticks(5).tickSize(5);G.call(W).attr({transform:"rotate("+h.radialAxis.orientation+")"}),G.selectAll(".domain").style(F),G.selectAll("g>text").text(function(t,e){return this.textContent+h.radialAxis.ticksSuffix}).style(B).style({"text-anchor":"start"}).attr({x:0,y:0,dx:0,dy:0,transform:function(t,e){return"horizontal"===h.radialAxis.tickOrientation?"rotate("+-h.radialAxis.orientation+") translate("+[0,B["font-size"]]+")":"translate("+[0,B["font-size"]]+")"}}),G.selectAll("g>line").style({stroke:"black"})}var Y=t.select(".angular.axis-group").selectAll("g.angular-tick").data(P),K=Y.enter().append("g").classed("angular-tick",!0);Y.attr({transform:function(t,e){return"rotate("+X(t)+")"}}).style({display:h.angularAxis.visible?"block":"none"}),Y.exit().remove(),K.append("line").classed("grid-line",!0).classed("major",function(t,e){return e%(h.minorTicks+1)==0}).classed("minor",function(t,e){return!(e%(h.minorTicks+1)==0)}).style(F),K.selectAll(".minor").style({stroke:h.minorTickColor}),Y.select("line.grid-line").attr({x1:h.tickLength?_-h.tickLength:0,x2:_}).style({display:h.angularAxis.gridLinesVisible?"block":"none"}),K.append("text").classed("axis-text",!0).style(B);var J=Y.select("text.axis-text").attr({x:_+h.labelOffset,dy:a+"em",transform:function(t,e){var r=X(t),n=_+h.labelOffset,i=h.angularAxis.tickOrientation;return"horizontal"==i?"rotate("+-r+" "+n+" 0)":"radial"==i?r<270&&r>90?"rotate(180 "+n+" 0)":null:"rotate("+(r<=180&&r>0?-90:90)+" "+n+" 0)"}}).style({"text-anchor":"middle",display:h.angularAxis.labelsVisible?"block":"none"}).text(function(t,e){return e%(h.minorTicks+1)!=0?"":w?w[t]+h.angularAxis.ticksSuffix:t+h.angularAxis.ticksSuffix}).style(B);h.angularAxis.rewriteTicks&&J.text(function(t,e){return e%(h.minorTicks+1)!=0?"":h.angularAxis.rewriteTicks(this.textContent,e)});var $=n.max(R.selectAll(".angular-tick text")[0].map(function(t,e){return t.getCTM().e+t.getBBox().width}));O.attr({transform:"translate("+[_+$,h.margin.top]+")"});var Q=t.select("g.geometry-group").selectAll("g").size()>0,tt=t.select("g.geometry-group").selectAll("g.geometry").data(f);if(tt.enter().append("g").attr({class:function(t,e){return"geometry geometry"+e}}),tt.exit().remove(),f[0]||Q){var et=[];f.forEach(function(t,e){var n={};n.radialScale=r,n.angularScale=s,n.container=tt.filter(function(t,r){return r==e}),n.geometry=t.geometry,n.orientation=h.orientation,n.direction=h.direction,n.index=e,et.push({data:t,geometryConfig:n})});var rt=n.nest().key(function(t,e){return"undefined"!=typeof t.data.groupId||"unstacked"}).entries(et),nt=[];rt.forEach(function(t,e){"unstacked"===t.key?nt=nt.concat(t.values.map(function(t,e){return[t]})):nt.push(t.values)}),nt.forEach(function(t,e){var r;r=Array.isArray(t)?t[0].geometryConfig.geometry:t.geometryConfig.geometry;var n=t.map(function(t,e){return i(o[r].defaultConfig(),t)});o[r]().config(n)()})}var it,at,ot=t.select(".guides-group"),st=t.select(".tooltips-group"),lt=o.tooltipPanel().config({container:st,fontSize:8})(),ut=o.tooltipPanel().config({container:st,fontSize:8})(),ct=o.tooltipPanel().config({container:st,hasTick:!0})();if(!T){var pt=ot.select("line").attr({x1:0,y1:0,y2:0}).style({stroke:"grey","pointer-events":"none"});R.on("mousemove.angular-guide",function(t,e){var r=o.util.getMousePos(Z).angle;pt.attr({x2:-_,transform:"rotate("+r+")"}).style({opacity:.5});var n=(r+180+360-h.orientation)%360;it=s.invert(n);var i=o.util.convertToCartesian(_+12,r+180);lt.text(o.util.round(it)).move([i[0]+b[0],i[1]+b[1]])}).on("mouseout.angular-guide",function(t,e){ot.select("line").style({opacity:0})})}var ht=ot.select("circle").style({stroke:"grey",fill:"none"});R.on("mousemove.radial-guide",function(t,e){var n=o.util.getMousePos(Z).radius;ht.attr({r:n}).style({opacity:.5}),at=r.invert(o.util.getMousePos(Z).radius);var i=o.util.convertToCartesian(n,h.radialAxis.orientation);ut.text(o.util.round(at)).move([i[0]+b[0],i[1]+b[1]])}).on("mouseout.radial-guide",function(t,e){ht.style({opacity:0}),ct.hide(),lt.hide(),ut.hide()}),t.selectAll(".geometry-group .mark").on("mouseover.tooltip",function(e,r){var i=n.select(this),a=this.style.fill,s="black",l=this.style.opacity||1;if(i.attr({"data-opacity":l}),a&&"none"!==a){i.attr({"data-fill":a}),s=n.hsl(a).darker().toString(),i.style({fill:s,opacity:1});var u={t:o.util.round(e[0]),r:o.util.round(e[1])};T&&(u.t=w[e[0]]);var c="t: "+u.t+", r: "+u.r,p=this.getBoundingClientRect(),h=t.node().getBoundingClientRect(),f=[p.left+p.width/2-j[0]-h.left,p.top+p.height/2-j[1]-h.top];ct.config({color:s}).text(c),ct.move(f)}else a=this.style.stroke||"black",i.attr({"data-stroke":a}),s=n.hsl(a).darker().toString(),i.style({stroke:s,opacity:1})}).on("mousemove.tooltip",function(t,e){if(0!=n.event.which)return!1;n.select(this).attr("data-fill")&&ct.show()}).on("mouseout.tooltip",function(t,e){ct.hide();var r=n.select(this),i=r.attr("data-fill");i?r.style({fill:i,opacity:r.attr("data-opacity")}):r.style({stroke:r.attr("data-stroke"),opacity:r.attr("data-opacity")})})})}(u),this},h.config=function(t){if(!arguments.length)return l;var e=o.util.cloneJson(t);return e.data.forEach(function(t,e){l.data[e]||(l.data[e]={}),i(l.data[e],o.Axis.defaultConfig().data[0]),i(l.data[e],t)}),i(l.layout,o.Axis.defaultConfig().layout),i(l.layout,e.layout),this},h.getLiveConfig=function(){return c},h.getinputConfig=function(){return u},h.radialScale=function(t){return r},h.angularScale=function(t){return s},h.svg=function(){return t},n.rebind(h,p,"on"),h},o.Axis.defaultConfig=function(t,e){return{data:[{t:[1,2,3,4],r:[10,11,12,13],name:"Line1",geometry:"LinePlot",color:null,strokeDash:"solid",strokeColor:null,strokeSize:"1",visibleInLegend:!0,opacity:1}],layout:{defaultColorRange:n.scale.category10().range(),title:null,height:450,width:500,margin:{top:40,right:40,bottom:40,left:40},font:{size:12,color:"gray",outlineColor:"white",family:"Tahoma, sans-serif"},direction:"clockwise",orientation:0,labelOffset:10,radialAxis:{domain:null,orientation:-45,ticksSuffix:"",visible:!0,gridLinesVisible:!0,tickOrientation:"horizontal",rewriteTicks:null},angularAxis:{domain:[0,360],ticksSuffix:"",visible:!0,gridLinesVisible:!0,labelsVisible:!0,tickOrientation:"horizontal",rewriteTicks:null,ticksCount:null,ticksStep:null},minorTicks:0,tickLength:null,tickColor:"silver",minorTickColor:"#eee",backgroundColor:"none",needsEndSpacing:null,showLegend:!0,legend:{reverseOrder:!1},opacity:1}}},o.util={},o.DATAEXTENT="dataExtent",o.AREA="AreaChart",o.LINE="LinePlot",o.DOT="DotPlot",o.BAR="BarChart",o.util._override=function(t,e){for(var r in t)r in e&&(e[r]=t[r])},o.util._extend=function(t,e){for(var r in t)e[r]=t[r]},o.util._rndSnd=function(){return 2*Math.random()-1+(2*Math.random()-1)+(2*Math.random()-1)},o.util.dataFromEquation2=function(t,e){var r=e||6;return n.range(0,360+r,r).map(function(e,r){var n=e*Math.PI/180;return[e,t(n)]})},o.util.dataFromEquation=function(t,e,r){var i=e||6,a=[],o=[];n.range(0,360+i,i).forEach(function(e,r){var n=e*Math.PI/180,i=t(n);a.push(e),o.push(i)});var s={t:a,r:o};return r&&(s.name=r),s},o.util.ensureArray=function(t,e){if("undefined"==typeof t)return null;var r=[].concat(t);return n.range(e).map(function(t,e){return r[e]||r[0]})},o.util.fillArrays=function(t,e,r){return e.forEach(function(e,n){t[e]=o.util.ensureArray(t[e],r)}),t},o.util.cloneJson=function(t){return JSON.parse(JSON.stringify(t))},o.util.validateKeys=function(t,e){"string"==typeof e&&(e=e.split("."));var r=e.shift();return t[r]&&(!e.length||objHasKeys(t[r],e))},o.util.sumArrays=function(t,e){return n.zip(t,e).map(function(t,e){return n.sum(t)})},o.util.arrayLast=function(t){return t[t.length-1]},o.util.arrayEqual=function(t,e){for(var r=Math.max(t.length,e.length,1);r-- >=0&&t[r]===e[r];);return-2===r},o.util.flattenArray=function(t){for(var e=[];!o.util.arrayEqual(e,t);)e=t,t=[].concat.apply([],t);return t},o.util.deduplicate=function(t){return t.filter(function(t,e,r){return r.indexOf(t)==e})},o.util.convertToCartesian=function(t,e){var r=e*Math.PI/180;return[t*Math.cos(r),t*Math.sin(r)]},o.util.round=function(t,e){var r=e||2,n=Math.pow(10,r);return Math.round(t*n)/n},o.util.getMousePos=function(t){var e=n.mouse(t.node()),r=e[0],i=e[1],a={};return a.x=r,a.y=i,a.pos=e,a.angle=180*(Math.atan2(i,r)+Math.PI)/Math.PI,a.radius=Math.sqrt(r*r+i*i),a},o.util.duplicatesCount=function(t){for(var e,r={},n={},i=0,a=t.length;i<a;i++)(e=t[i])in r?(r[e]++,n[e]=r[e]):r[e]=1;return n},o.util.duplicates=function(t){return Object.keys(o.util.duplicatesCount(t))},o.util.translator=function(t,e,r,n){if(n){var i=r.slice();r=e,e=i}var a=e.reduce(function(t,e){if("undefined"!=typeof t)return t[e]},t);"undefined"!=typeof a&&(e.reduce(function(t,r,n){if("undefined"!=typeof t)return n===e.length-1&&delete t[r],t[r]},t),r.reduce(function(t,e,n){return"undefined"==typeof t[e]&&(t[e]={}),n===r.length-1&&(t[e]=a),t[e]},t))},o.PolyChart=function(){var t=[o.PolyChart.defaultConfig()],e=n.dispatch("hover"),r={solid:"none",dash:[5,2],dot:[2,5]};function a(){var e=t[0].geometryConfig,i=e.container;"string"==typeof i&&(i=n.select(i)),i.datum(t).each(function(t,i){var a=!!t[0].data.yStack,o=t.map(function(t,e){return a?n.zip(t.data.t[0],t.data.r[0],t.data.yStack[0]):n.zip(t.data.t[0],t.data.r[0])}),s=e.angularScale,l=e.radialScale.domain()[0],u={bar:function(r,i,a){var o=t[a].data,l=e.radialScale(r[1])-e.radialScale(0),u=e.radialScale(r[2]||0),c=o.barWidth;n.select(this).attr({class:"mark bar",d:"M"+[[l+u,-c/2],[l+u,c/2],[u,c/2],[u,-c/2]].join("L")+"Z",transform:function(t,r){return"rotate("+(e.orientation+s(t[0]))+")"}})}};u.dot=function(r,i,a){var o=r[2]?[r[0],r[1]+r[2]]:r,s=n.svg.symbol().size(t[a].data.dotSize).type(t[a].data.dotType)(r,i);n.select(this).attr({class:"mark dot",d:s,transform:function(t,r){var n,i,a,s=(n=function(t,r){var n=e.radialScale(t[1]),i=(e.angularScale(t[0])+e.orientation)*Math.PI/180;return{r:n,t:i}}(o),i=n.r*Math.cos(n.t),a=n.r*Math.sin(n.t),{x:i,y:a});return"translate("+[s.x,s.y]+")"}})};var c=n.svg.line.radial().interpolate(t[0].data.lineInterpolation).radius(function(t){return e.radialScale(t[1])}).angle(function(t){return e.angularScale(t[0])*Math.PI/180});u.line=function(r,i,a){var s=r[2]?o[a].map(function(t,e){return[t[0],t[1]+t[2]]}):o[a];if(n.select(this).each(u.dot).style({opacity:function(e,r){return+t[a].data.dotVisible},fill:d.stroke(r,i,a)}).attr({class:"mark dot"}),!(i>0)){var l=n.select(this.parentNode).selectAll("path.line").data([0]);l.enter().insert("path"),l.attr({class:"line",d:c(s),transform:function(t,r){return"rotate("+(e.orientation+90)+")"},"pointer-events":"none"}).style({fill:function(t,e){return d.fill(r,i,a)},"fill-opacity":0,stroke:function(t,e){return d.stroke(r,i,a)},"stroke-width":function(t,e){return d["stroke-width"](r,i,a)},"stroke-dasharray":function(t,e){return d["stroke-dasharray"](r,i,a)},opacity:function(t,e){return d.opacity(r,i,a)},display:function(t,e){return d.display(r,i,a)}})}};var p=e.angularScale.range(),h=Math.abs(p[1]-p[0])/o[0].length*Math.PI/180,f=n.svg.arc().startAngle(function(t){return-h/2}).endAngle(function(t){return h/2}).innerRadius(function(t){return e.radialScale(l+(t[2]||0))}).outerRadius(function(t){return e.radialScale(l+(t[2]||0))+e.radialScale(t[1])});u.arc=function(t,r,i){n.select(this).attr({class:"mark arc",d:f,transform:function(t,r){return"rotate("+(e.orientation+s(t[0])+90)+")"}})};var d={fill:function(e,r,n){return t[n].data.color},stroke:function(e,r,n){return t[n].data.strokeColor},"stroke-width":function(e,r,n){return t[n].data.strokeSize+"px"},"stroke-dasharray":function(e,n,i){return r[t[i].data.strokeDash]},opacity:function(e,r,n){return t[n].data.opacity},display:function(e,r,n){return"undefined"==typeof t[n].data.visible||t[n].data.visible?"block":"none"}},m=n.select(this).selectAll("g.layer").data(o);m.enter().append("g").attr({class:"layer"});var y=m.selectAll("path.mark").data(function(t,e){return t});y.enter().append("path").attr({class:"mark"}),y.style(d).each(u[e.geometryType]),y.exit().remove(),m.exit().remove()})}return a.config=function(e){return arguments.length?(e.forEach(function(e,r){t[r]||(t[r]={}),i(t[r],o.PolyChart.defaultConfig()),i(t[r],e)}),this):t},a.getColorScale=function(){},n.rebind(a,e,"on"),a},o.PolyChart.defaultConfig=function(){return{data:{name:"geom1",t:[[1,2,3,4]],r:[[1,2,3,4]],dotType:"circle",dotSize:64,dotVisible:!1,barWidth:20,color:"#ffa500",strokeSize:1,strokeColor:"silver",strokeDash:"solid",opacity:1,index:0,visible:!0,visibleInLegend:!0},geometryConfig:{geometry:"LinePlot",geometryType:"arc",direction:"clockwise",orientation:0,container:"body",radialScale:null,angularScale:null,colorScale:n.scale.category20()}}},o.BarChart=function(){return o.PolyChart()},o.BarChart.defaultConfig=function(){return{geometryConfig:{geometryType:"bar"}}},o.AreaChart=function(){return o.PolyChart()},o.AreaChart.defaultConfig=function(){return{geometryConfig:{geometryType:"arc"}}},o.DotPlot=function(){return o.PolyChart()},o.DotPlot.defaultConfig=function(){return{geometryConfig:{geometryType:"dot",dotType:"circle"}}},o.LinePlot=function(){return o.PolyChart()},o.LinePlot.defaultConfig=function(){return{geometryConfig:{geometryType:"line"}}},o.Legend=function(){var t=o.Legend.defaultConfig(),e=n.dispatch("hover");function r(){var e=t.legendConfig,a=t.data.map(function(t,r){return[].concat(t).map(function(t,n){var a=i({},e.elements[r]);return a.name=t,a.color=[].concat(e.elements[r].color)[n],a})}),o=n.merge(a);o=o.filter(function(t,r){return e.elements[r]&&(e.elements[r].visibleInLegend||"undefined"==typeof e.elements[r].visibleInLegend)}),e.reverseOrder&&(o=o.reverse());var s=e.container;("string"==typeof s||s.nodeName)&&(s=n.select(s));var l=o.map(function(t,e){return t.color}),u=e.fontSize,c=null==e.isContinuous?"number"==typeof o[0]:e.isContinuous,p=c?e.height:u*o.length,h=s.classed("legend-group",!0).selectAll("svg").data([0]),f=h.enter().append("svg").attr({width:300,height:p+u,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"});f.append("g").classed("legend-axis",!0),f.append("g").classed("legend-marks",!0);var d=n.range(o.length),m=n.scale[c?"linear":"ordinal"]().domain(d).range(l),y=n.scale[c?"linear":"ordinal"]().domain(d)[c?"range":"rangePoints"]([0,p]);if(c){var g=h.select(".legend-marks").append("defs").append("linearGradient").attr({id:"grad1",x1:"0%",y1:"0%",x2:"0%",y2:"100%"}).selectAll("stop").data(l);g.enter().append("stop"),g.attr({offset:function(t,e){return e/(l.length-1)*100+"%"}}).style({"stop-color":function(t,e){return t}}),h.append("rect").classed("legend-mark",!0).attr({height:e.height,width:e.colorBandWidth,fill:"url(#grad1)"})}else{var v=h.select(".legend-marks").selectAll("path.legend-mark").data(o);v.enter().append("path").classed("legend-mark",!0),v.attr({transform:function(t,e){return"translate("+[u/2,y(e)+u/2]+")"},d:function(t,e){var r,i,a,o=t.symbol;return a=3*(i=u),"line"===(r=o)?"M"+[[-i/2,-i/12],[i/2,-i/12],[i/2,i/12],[-i/2,i/12]]+"Z":-1!=n.svg.symbolTypes.indexOf(r)?n.svg.symbol().type(r).size(a)():n.svg.symbol().type("square").size(a)()},fill:function(t,e){return m(e)}}),v.exit().remove()}var _=n.svg.axis().scale(y).orient("right"),x=h.select("g.legend-axis").attr({transform:"translate("+[c?e.colorBandWidth:u,u/2]+")"}).call(_);return x.selectAll(".domain").style({fill:"none",stroke:"none"}),x.selectAll("line").style({fill:"none",stroke:c?e.textColor:"none"}),x.selectAll("text").style({fill:e.textColor,"font-size":e.fontSize}).text(function(t,e){return o[e].name}),r}return r.config=function(e){return arguments.length?(i(t,e),this):t},n.rebind(r,e,"on"),r},o.Legend.defaultConfig=function(t,e){return{data:["a","b","c"],legendConfig:{elements:[{symbol:"line",color:"red"},{symbol:"square",color:"yellow"},{symbol:"diamond",color:"limegreen"}],height:150,colorBandWidth:30,fontSize:12,container:"body",isContinuous:null,textColor:"grey",reverseOrder:!1}}},o.tooltipPanel=function(){var t,e,r,a={container:null,hasTick:!1,fontSize:12,color:"white",padding:5},s="tooltip-"+o.tooltipPanel.uid++,l=10,u=function(){var n=(t=a.container.selectAll("g."+s).data([0])).enter().append("g").classed(s,!0).style({"pointer-events":"none",display:"none"});return r=n.append("path").style({fill:"white","fill-opacity":.9}).attr({d:"M0 0"}),e=n.append("text").attr({dx:a.padding+l,dy:.3*+a.fontSize}),u};return u.text=function(i){var o=n.hsl(a.color).l,s=o>=.5?"#aaa":"white",c=o>=.5?"black":"white",p=i||"";e.style({fill:c,"font-size":a.fontSize+"px"}).text(p);var h=a.padding,f=e.node().getBBox(),d={fill:a.color,stroke:s,"stroke-width":"2px"},m=f.width+2*h+l,y=f.height+2*h;return r.attr({d:"M"+[[l,-y/2],[l,-y/4],[a.hasTick?0:l,0],[l,y/4],[l,y/2],[m,y/2],[m,-y/2]].join("L")+"Z"}).style(d),t.attr({transform:"translate("+[l,-y/2+2*h]+")"}),t.style({display:"block"}),u},u.move=function(e){if(t)return t.attr({transform:"translate("+[e[0],e[1]]+")"}).style({display:"block"}),u},u.hide=function(){if(t)return t.style({display:"none"}),u},u.show=function(){if(t)return t.style({display:"block"}),u},u.config=function(t){return i(a,t),u},u},o.tooltipPanel.uid=1,o.adapter={},o.adapter.plotly=function(){var t={convert:function(t,e){var r={};if(t.data&&(r.data=t.data.map(function(t,r){var n=i({},t);return[[n,["marker","color"],["color"]],[n,["marker","opacity"],["opacity"]],[n,["marker","line","color"],["strokeColor"]],[n,["marker","line","dash"],["strokeDash"]],[n,["marker","line","width"],["strokeSize"]],[n,["marker","symbol"],["dotType"]],[n,["marker","size"],["dotSize"]],[n,["marker","barWidth"],["barWidth"]],[n,["line","interpolation"],["lineInterpolation"]],[n,["showlegend"],["visibleInLegend"]]].forEach(function(t,r){o.util.translator.apply(null,t.concat(e))}),e||delete n.marker,e&&delete n.groupId,e?("LinePlot"===n.geometry?(n.type="scatter",!0===n.dotVisible?(delete n.dotVisible,n.mode="lines+markers"):n.mode="lines"):"DotPlot"===n.geometry?(n.type="scatter",n.mode="markers"):"AreaChart"===n.geometry?n.type="area":"BarChart"===n.geometry&&(n.type="bar"),delete n.geometry):("scatter"===n.type?"lines"===n.mode?n.geometry="LinePlot":"markers"===n.mode?n.geometry="DotPlot":"lines+markers"===n.mode&&(n.geometry="LinePlot",n.dotVisible=!0):"area"===n.type?n.geometry="AreaChart":"bar"===n.type&&(n.geometry="BarChart"),delete n.mode,delete n.type),n}),!e&&t.layout&&"stack"===t.layout.barmode)){var a=o.util.duplicates(r.data.map(function(t,e){return t.geometry}));r.data.forEach(function(t,e){var n=a.indexOf(t.geometry);-1!=n&&(r.data[e].groupId=n)})}if(t.layout){var s=i({},t.layout);if([[s,["plot_bgcolor"],["backgroundColor"]],[s,["showlegend"],["showLegend"]],[s,["radialaxis"],["radialAxis"]],[s,["angularaxis"],["angularAxis"]],[s.angularaxis,["showline"],["gridLinesVisible"]],[s.angularaxis,["showticklabels"],["labelsVisible"]],[s.angularaxis,["nticks"],["ticksCount"]],[s.angularaxis,["tickorientation"],["tickOrientation"]],[s.angularaxis,["ticksuffix"],["ticksSuffix"]],[s.angularaxis,["range"],["domain"]],[s.angularaxis,["endpadding"],["endPadding"]],[s.radialaxis,["showline"],["gridLinesVisible"]],[s.radialaxis,["tickorientation"],["tickOrientation"]],[s.radialaxis,["ticksuffix"],["ticksSuffix"]],[s.radialaxis,["range"],["domain"]],[s.angularAxis,["showline"],["gridLinesVisible"]],[s.angularAxis,["showticklabels"],["labelsVisible"]],[s.angularAxis,["nticks"],["ticksCount"]],[s.angularAxis,["tickorientation"],["tickOrientation"]],[s.angularAxis,["ticksuffix"],["ticksSuffix"]],[s.angularAxis,["range"],["domain"]],[s.angularAxis,["endpadding"],["endPadding"]],[s.radialAxis,["showline"],["gridLinesVisible"]],[s.radialAxis,["tickorientation"],["tickOrientation"]],[s.radialAxis,["ticksuffix"],["ticksSuffix"]],[s.radialAxis,["range"],["domain"]],[s.font,["outlinecolor"],["outlineColor"]],[s.legend,["traceorder"],["reverseOrder"]],[s,["labeloffset"],["labelOffset"]],[s,["defaultcolorrange"],["defaultColorRange"]]].forEach(function(t,r){o.util.translator.apply(null,t.concat(e))}),e?("undefined"!=typeof s.tickLength&&(s.angularaxis.ticklen=s.tickLength,delete s.tickLength),s.tickColor&&(s.angularaxis.tickcolor=s.tickColor,delete s.tickColor)):(s.angularAxis&&"undefined"!=typeof s.angularAxis.ticklen&&(s.tickLength=s.angularAxis.ticklen),s.angularAxis&&"undefined"!=typeof s.angularAxis.tickcolor&&(s.tickColor=s.angularAxis.tickcolor)),s.legend&&"boolean"!=typeof s.legend.reverseOrder&&(s.legend.reverseOrder="normal"!=s.legend.reverseOrder),s.legend&&"boolean"==typeof s.legend.traceorder&&(s.legend.traceorder=s.legend.traceorder?"reversed":"normal",delete s.legend.reverseOrder),s.margin&&"undefined"!=typeof s.margin.t){var l=["t","r","b","l","pad"],u=["top","right","bottom","left","pad"],c={};n.entries(s.margin).forEach(function(t,e){c[u[l.indexOf(t.key)]]=t.value}),s.margin=c}e&&(delete s.needsEndSpacing,delete s.minorTickColor,delete s.minorTicks,delete s.angularaxis.ticksCount,delete s.angularaxis.ticksCount,delete s.angularaxis.ticksStep,delete s.angularaxis.rewriteTicks,delete s.angularaxis.nticks,delete s.radialaxis.ticksCount,delete s.radialaxis.ticksCount,delete s.radialaxis.ticksStep,delete s.radialaxis.rewriteTicks,delete s.radialaxis.nticks),r.layout=s}return r}};return t}},{"../../../constants/alignment":144,"../../../lib":169,d3:14}],257:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../../lib"),a=t("../../../components/color"),o=t("./micropolar"),s=t("./undo_manager"),l=i.extendDeepAll,u=e.exports={};u.framework=function(t){var e,r,i,a,c,p=new s;function h(r,s){return s&&(c=s),n.select(n.select(c).node().parentNode).selectAll(".svg-container>*:not(.chart-root)").remove(),e=e?l(e,r):r,i||(i=o.Axis()),a=o.adapter.plotly().convert(e),i.config(a).render(c),t.data=e.data,t.layout=e.layout,u.fillLayout(t),e}return h.isPolar=!0,h.svg=function(){return i.svg()},h.getConfig=function(){return e},h.getLiveConfig=function(){return o.adapter.plotly().convert(i.getLiveConfig(),!0)},h.getLiveScales=function(){return{t:i.angularScale(),r:i.radialScale()}},h.setUndoPoint=function(){var t,n,i=this,a=o.util.cloneJson(e);t=a,n=r,p.add({undo:function(){n&&i(n)},redo:function(){i(t)}}),r=o.util.cloneJson(a)},h.undo=function(){p.undo()},h.redo=function(){p.redo()},h},u.fillLayout=function(t){var e=n.select(t).selectAll(".plot-container"),r=e.selectAll(".svg-container"),i=t.framework&&t.framework.svg&&t.framework.svg(),o={width:800,height:600,paper_bgcolor:a.background,_container:e,_paperdiv:r,_paper:i};t._fullLayout=l(o,t.layout)}},{"../../../components/color":50,"../../../lib":169,"./micropolar":256,"./undo_manager":258,d3:14}],258:[function(t,e,r){"use strict";e.exports=function(){var t,e=[],r=-1,n=!1;function i(t,e){return t?(n=!0,t[e](),n=!1,this):this}return{add:function(t){return n?this:(e.splice(r+1,e.length-r),e.push(t),r=e.length-1,this)},setCallback:function(e){t=e},undo:function(){var n=e[r];return n?(i(n,"undo"),r-=1,t&&t(n.undo),this):this},redo:function(){var n=e[r+1];return n?(i(n,"redo"),r+=1,t&&t(n.redo),this):this},clear:function(){e=[],r=-1},hasUndo:function(){return-1!==r},hasRedo:function(){return r<e.length-1},getCommands:function(){return e},getPreviousCommand:function(){return e[r-1]},getIndex:function(){return r}}}},{}],259:[function(t,e,r){"use strict";var n=t("../lib"),i=t("../plot_api/plot_template"),a=t("./domain").defaults;e.exports=function(t,e,r,o){var s,l,u=o.type,c=o.attributes,p=o.handleDefaults,h=o.partition||"x",f=e._subplots[u],d=f.length,m=d&&f[0].replace(/\d+$/,"");function y(t,e){return n.coerce(s,l,c,t,e)}for(var g=0;g<d;g++){var v=f[g];s=t[v]?t[v]:t[v]={},l=i.newContainer(e,v,m),y("uirevision",e.uirevision);var _={};_[h]=[g/d,(g+1)/d],a(l,e,y,_),o.id=v,p(s,l,y,o)}}},{"../lib":169,"../plot_api/plot_template":203,"./domain":238}],260:[function(t,e,r){"use strict";['Variables are inserted using %{variable}, for example "y: %{y}".','Numbers are formatted using d3-format\'s syntax %{variable:d3-format}, for example "Price: %{y:$.2f}".',t("../constants/docs").FORMAT_LINK,"for details on the formatting syntax.",'Dates are formatted using d3-time-format\'s syntax %{variable|d3-time-format}, for example "Day: %{2019-01-01|%A}".',t("../constants/docs").DATE_FORMAT_LINK,"for details on the date formatting syntax."].join(" ");function n(t){var e=t.description?" "+t.description:"",r=t.keys||[];if(r.length>0){for(var n=[],i=0;i<r.length;i++)n[i]="`"+r[i]+"`";e+="Finally, the template string has access to ",e=1===r.length?"variable "+n[0]:"variables "+n.slice(0,-1).join(", ")+" and "+n.slice(-1)+"."}return e}r.hovertemplateAttrs=function(t,e){t=t||{};n(e=e||{});var r={valType:"string",dflt:"",editType:t.editType||"none"};return!1!==t.arrayOk&&(r.arrayOk=!0),r},r.texttemplateAttrs=function(t,e){t=t||{};n(e=e||{});var r={valType:"string",dflt:"",editType:t.editType||"calc"};return!1!==t.arrayOk&&(r.arrayOk=!0),r}},{"../constants/docs":145}],261:[function(t,e,r){"use strict";var n=t("./lib/loggers"),i=t("./lib/noop"),a=t("./lib/push_unique"),o=t("./lib/is_plain_object"),s=t("./lib/dom").addStyleRule,l=t("./lib/extend"),u=t("./plots/attributes"),c=t("./plots/layout_attributes"),p=l.extendFlat,h=l.extendDeepAll;function f(t){var e=t.name,i=t.categories,a=t.meta;if(r.modules[e])n.log("Type "+e+" already registered");else{r.subplotsRegistry[t.basePlotModule.name]||function(t){var e=t.name;if(r.subplotsRegistry[e])return void n.log("Plot type "+e+" already registered.");for(var i in g(t),r.subplotsRegistry[e]=t,r.componentsRegistry)x(i,t.name)}(t.basePlotModule);for(var o={},l=0;l<i.length;l++)o[i[l]]=!0,r.allCategories[i[l]]=!0;for(var u in r.modules[e]={_module:t,categories:o},a&&Object.keys(a).length&&(r.modules[e].meta=a),r.allTypes.push(e),r.componentsRegistry)v(u,e);t.layoutAttributes&&p(r.traceLayoutAttributes,t.layoutAttributes);var c=t.basePlotModule,h=c.name;if("mapbox"===h){var f=c.constants.styleRules;for(var d in f)s(".js-plotly-plot .plotly .mapboxgl-"+d,f[d])}"geo"!==h&&"mapbox"!==h||void 0===typeof window||void 0!==window.PlotlyGeoAssets||(window.PlotlyGeoAssets={topojson:{}})}}function d(t){if("string"!=typeof t.name)throw new Error("Component module *name* must be a string.");var e=t.name;for(var n in r.componentsRegistry[e]=t,t.layoutAttributes&&(t.layoutAttributes._isLinkedToArray&&a(r.layoutArrayContainers,e),g(t)),r.modules)v(e,n);for(var i in r.subplotsRegistry)x(e,i);for(var o in r.transformsRegistry)_(e,o);t.schema&&t.schema.layout&&h(c,t.schema.layout)}function m(t){if("string"!=typeof t.name)throw new Error("Transform module *name* must be a string.");var e="Transform module "+t.name,i="function"==typeof t.transform,a="function"==typeof t.calcTransform;if(!i&&!a)throw new Error(e+" is missing a *transform* or *calcTransform* method.");for(var s in i&&a&&n.log([e+" has both a *transform* and *calcTransform* methods.","Please note that all *transform* methods are executed","before all *calcTransform* methods."].join(" ")),o(t.attributes)||n.log(e+" registered without an *attributes* object."),"function"!=typeof t.supplyDefaults&&n.log(e+" registered without a *supplyDefaults* method."),r.transformsRegistry[t.name]=t,r.componentsRegistry)_(s,t.name)}function y(t){var e=t.name,n=e.split("-")[0],i=t.dictionary,a=t.format,o=i&&Object.keys(i).length,s=a&&Object.keys(a).length,l=r.localeRegistry,u=l[e];if(u||(l[e]=u={}),n!==e){var c=l[n];c||(l[n]=c={}),o&&c.dictionary===u.dictionary&&(c.dictionary=i),s&&c.format===u.format&&(c.format=a)}o&&(u.dictionary=i),s&&(u.format=a)}function g(t){if(t.layoutAttributes){var e=t.layoutAttributes._arrayAttrRegexps;if(e)for(var n=0;n<e.length;n++)a(r.layoutArrayRegexes,e[n])}}function v(t,e){var n=r.componentsRegistry[t].schema;if(n&&n.traces){var i=n.traces[e];i&&h(r.modules[e]._module.attributes,i)}}function _(t,e){var n=r.componentsRegistry[t].schema;if(n&&n.transforms){var i=n.transforms[e];i&&h(r.transformsRegistry[e].attributes,i)}}function x(t,e){var n=r.componentsRegistry[t].schema;if(n&&n.subplots){var i=r.subplotsRegistry[e],a=i.layoutAttributes,o="subplot"===i.attr?i.name:i.attr;Array.isArray(o)&&(o=o[0]);var s=n.subplots[o];a&&s&&h(a,s)}}function b(t){return"object"==typeof t&&(t=t.type),t}r.modules={},r.allCategories={},r.allTypes=[],r.subplotsRegistry={},r.transformsRegistry={},r.componentsRegistry={},r.layoutArrayContainers=[],r.layoutArrayRegexes=[],r.traceLayoutAttributes={},r.localeRegistry={},r.apiMethodRegistry={},r.collectableSubplotTypes=null,r.register=function(t){if(r.collectableSubplotTypes=null,!t)throw new Error("No argument passed to Plotly.register.");t&&!Array.isArray(t)&&(t=[t]);for(var e=0;e<t.length;e++){var n=t[e];if(!n)throw new Error("Invalid module was attempted to be registered!");switch(n.moduleType){case"trace":f(n);break;case"transform":m(n);break;case"component":d(n);break;case"locale":y(n);break;case"apiMethod":var i=n.name;r.apiMethodRegistry[i]=n.fn;break;default:throw new Error("Invalid module was attempted to be registered!")}}},r.getModule=function(t){var e=r.modules[b(t)];return!!e&&e._module},r.traceIs=function(t,e){if("various"===(t=b(t)))return!1;var i=r.modules[t];return i||(t&&"area"!==t&&n.log("Unrecognized trace type "+t+"."),i=r.modules[u.type.dflt]),!!i.categories[e]},r.getTransformIndices=function(t,e){for(var r=[],n=t.transforms||[],i=0;i<n.length;i++)n[i].type===e&&r.push(i);return r},r.hasTransform=function(t,e){for(var r=t.transforms||[],n=0;n<r.length;n++)if(r[n].type===e)return!0;return!1},r.getComponentMethod=function(t,e){var n=r.componentsRegistry[t];return n&&n[e]||i},r.call=function(){var t=arguments[0],e=[].slice.call(arguments,1);return r.apiMethodRegistry[t].apply(null,e)}},{"./lib/dom":160,"./lib/extend":162,"./lib/is_plain_object":170,"./lib/loggers":173,"./lib/noop":178,"./lib/push_unique":182,"./plots/attributes":210,"./plots/layout_attributes":243}],262:[function(t,e,r){"use strict";var n=t("../registry"),i=t("../lib"),a=i.extendFlat,o=i.extendDeep;function s(t){var e;switch(t){case"themes__thumb":e={autosize:!0,width:150,height:150,title:{text:""},showlegend:!1,margin:{l:5,r:5,t:5,b:5,pad:0},annotations:[]};break;case"thumbnail":e={title:{text:""},hidesources:!0,showlegend:!1,borderwidth:0,bordercolor:"",margin:{l:1,r:1,t:1,b:1,pad:0},annotations:[]};break;default:e={}}return e}e.exports=function(t,e){var r;t.framework&&t.framework.isPolar&&(t=t.framework.getConfig());var i,l=t.data,u=t.layout,c=o([],l),p=o({},u,s(e.tileClass)),h=t._context||{};if(e.width&&(p.width=e.width),e.height&&(p.height=e.height),"thumbnail"===e.tileClass||"themes__thumb"===e.tileClass){p.annotations=[];var f=Object.keys(p);for(r=0;r<f.length;r++)i=f[r],["xaxis","yaxis","zaxis"].indexOf(i.slice(0,5))>-1&&(p[f[r]].title={text:""});for(r=0;r<c.length;r++){var d=c[r];d.showscale=!1,d.marker&&(d.marker.showscale=!1),n.traceIs(d,"pie-like")&&(d.textposition="none")}}if(Array.isArray(e.annotations))for(r=0;r<e.annotations.length;r++)p.annotations.push(e.annotations[r]);var m=Object.keys(p).filter(function(t){return t.match(/^scene\d*$/)});if(m.length){var y={};for("thumbnail"===e.tileClass&&(y={title:{text:""},showaxeslabels:!1,showticklabels:!1,linetickenable:!1}),r=0;r<m.length;r++){var g=p[m[r]];g.xaxis||(g.xaxis={}),g.yaxis||(g.yaxis={}),g.zaxis||(g.zaxis={}),a(g.xaxis,y),a(g.yaxis,y),a(g.zaxis,y),g._scene=null}}var v=document.createElement("div");e.tileClass&&(v.className=e.tileClass);var _={gd:v,td:v,layout:p,data:c,config:{staticPlot:void 0===e.staticPlot||e.staticPlot,plotGlPixelRatio:void 0===e.plotGlPixelRatio?2:e.plotGlPixelRatio,displaylogo:e.displaylogo||!1,showLink:e.showLink||!1,showTips:e.showTips||!1,mapboxAccessToken:h.mapboxAccessToken}};return"transparent"!==e.setBackground&&(_.config.setBackground=e.setBackground||"opaque"),_.gd.defaultLayout=s(e.tileClass),_}},{"../lib":169,"../registry":261}],263:[function(t,e,r){"use strict";var n=t("../lib"),i=t("../plot_api/to_image"),a=t("./filesaver"),o=t("./helpers");e.exports=function(t,e){var r;return n.isPlainObject(t)||(r=n.getGraphDiv(t)),(e=e||{}).format=e.format||"png",e.imageDataOnly=!0,new Promise(function(s,l){r&&r._snapshotInProgress&&l(new Error("Snapshotting already in progress.")),n.isIE()&&"svg"!==e.format&&l(new Error(o.MSG_IE_BAD_FORMAT)),r&&(r._snapshotInProgress=!0);var u=i(t,e),c=e.filename||t.fn||"newplot";c+="."+e.format,u.then(function(t){return r&&(r._snapshotInProgress=!1),a(t,c,e.format)}).then(function(t){s(t)}).catch(function(t){r&&(r._snapshotInProgress=!1),l(t)})})}},{"../lib":169,"../plot_api/to_image":206,"./filesaver":264,"./helpers":265}],264:[function(t,e,r){"use strict";var n=t("../lib"),i=t("./helpers");e.exports=function(t,e,r){var a=document.createElement("a"),o="download"in a;return new Promise(function(s,l){var u,c;if(n.isIE9orBelow()&&l(new Error("IE < 10 unsupported")),n.isSafari()){var p="svg"===r?",":";base64,";return i.octetStream(p+encodeURIComponent(t)),s(e)}return n.isIE()?(u=i.createBlob(t,"svg"),window.navigator.msSaveBlob(u,e),u=null,s(e)):o?(u=i.createBlob(t,r),c=i.createObjectURL(u),a.href=c,a.download=e,document.body.appendChild(a),a.click(),document.body.removeChild(a),i.revokeObjectURL(c),u=null,s(e)):void l(new Error("download error"))})}},{"../lib":169,"./helpers":265}],265:[function(t,e,r){"use strict";var n=t("../registry");r.getDelay=function(t){return t._has&&(t._has("gl3d")||t._has("gl2d")||t._has("mapbox"))?500:0},r.getRedrawFunc=function(t){return function(){var e=t._fullLayout||{};!(e._has&&e._has("polar"))&&t.data&&t.data[0]&&t.data[0].r||n.getComponentMethod("colorbar","draw")(t)}},r.encodeSVG=function(t){return"data:image/svg+xml,"+encodeURIComponent(t)};var i=window.URL||window.webkitURL;r.createObjectURL=function(t){return i.createObjectURL(t)},r.revokeObjectURL=function(t){return i.revokeObjectURL(t)},r.createBlob=function(t,e){if("svg"===e)return new window.Blob([t],{type:"image/svg+xml;charset=utf-8"});var r=function(t){for(var e=t.length,r=new ArrayBuffer(e),n=new Uint8Array(r),i=0;i<e;i++)n[i]=t.charCodeAt(i);return r}(window.atob(t));return new window.Blob([r],{type:"image/"+e})},r.octetStream=function(t){document.location.href="data:application/octet-stream"+t},r.IMAGE_URL_PREFIX=/^data:image\/\w+;base64,/,r.MSG_IE_BAD_FORMAT="Sorry IE does not support downloading from canvas. Try {format:'svg'} instead."},{"../registry":261}],266:[function(t,e,r){"use strict";var n=t("./helpers"),i={getDelay:n.getDelay,getRedrawFunc:n.getRedrawFunc,clone:t("./cloneplot"),toSVG:t("./tosvg"),svgToImg:t("./svgtoimg"),toImage:t("./toimage"),downloadImage:t("./download")};e.exports=i},{"./cloneplot":262,"./download":263,"./helpers":265,"./svgtoimg":267,"./toimage":268,"./tosvg":269}],267:[function(t,e,r){"use strict";var n=t("../lib"),i=t("events").EventEmitter,a=t("./helpers");e.exports=function(t){var e=t.emitter||new i,r=new Promise(function(i,o){var s=window.Image,l=t.svg,u=t.format||"png";if(n.isIE()&&"svg"!==u){var c=new Error(a.MSG_IE_BAD_FORMAT);return o(c),t.promise?r:e.emit("error",c)}var p,h,f=t.canvas,d=t.scale||1,m=t.width||300,y=t.height||150,g=d*m,v=d*y,_=f.getContext("2d"),x=new s;"svg"===u||n.isIE9orBelow()||n.isSafari()?h=a.encodeSVG(l):(p=a.createBlob(l,"svg"),h=a.createObjectURL(p)),f.width=g,f.height=v,x.onload=function(){var r;switch(p=null,a.revokeObjectURL(h),"svg"!==u&&_.drawImage(x,0,0,g,v),u){case"jpeg":r=f.toDataURL("image/jpeg");break;case"png":r=f.toDataURL("image/png");break;case"webp":r=f.toDataURL("image/webp");break;case"svg":r=h;break;default:var n="Image format is not jpeg, png, svg or webp.";if(o(new Error(n)),!t.promise)return e.emit("error",n)}i(r),t.promise||e.emit("success",r)},x.onerror=function(r){if(p=null,a.revokeObjectURL(h),o(r),!t.promise)return e.emit("error",r)},x.src=h});return t.promise?r:e}},{"../lib":169,"./helpers":265,events:12}],268:[function(t,e,r){"use strict";var n=t("events").EventEmitter,i=t("../registry"),a=t("../lib"),o=t("./helpers"),s=t("./cloneplot"),l=t("./tosvg"),u=t("./svgtoimg");e.exports=function(t,e){var r=new n,c=s(t,{format:"png"}),p=c.gd;p.style.position="absolute",p.style.left="-5000px",document.body.appendChild(p);var h=o.getRedrawFunc(p);return i.call("plot",p,c.data,c.layout,c.config).then(h).then(function(){var t=o.getDelay(p._fullLayout);setTimeout(function(){var t=l(p),n=document.createElement("canvas");n.id=a.randstr(),(r=u({format:e.format,width:p._fullLayout.width,height:p._fullLayout.height,canvas:n,emitter:r,svg:t})).clean=function(){p&&document.body.removeChild(p)}},t)}).catch(function(t){r.emit("error",t)}),r}},{"../lib":169,"../registry":261,"./cloneplot":262,"./helpers":265,"./svgtoimg":267,"./tosvg":269,events:12}],269:[function(t,e,r){"use strict";var n=t("d3"),i=t("../lib"),a=t("../components/drawing"),o=t("../components/color"),s=t("../constants/xmlns_namespaces"),l=/"/g,u=new RegExp('("TOBESTRIPPED)|(TOBESTRIPPED")',"g");e.exports=function(t,e,r){var c,p=t._fullLayout,h=p._paper,f=p._toppaper,d=p.width,m=p.height;h.insert("rect",":first-child").call(a.setRect,0,0,d,m).call(o.fill,p.paper_bgcolor);var y=p._basePlotModules||[];for(c=0;c<y.length;c++){var g=y[c];g.toSVG&&g.toSVG(t)}if(f){var v=f.node().childNodes,_=Array.prototype.slice.call(v);for(c=0;c<_.length;c++){var x=_[c];x.childNodes.length&&h.node().appendChild(x)}}if(p._draggers&&p._draggers.remove(),h.node().style.background="",h.selectAll("text").attr({"data-unformatted":null,"data-math":null}).each(function(){var t=n.select(this);if("hidden"!==this.style.visibility&&"none"!==this.style.display){t.style({visibility:null,display:null});var e=this.style.fontFamily;e&&-1!==e.indexOf('"')&&t.style("font-family",e.replace(l,"TOBESTRIPPED"))}else t.remove()}),p._gradientUrlQueryParts){var b=[];for(var w in p._gradientUrlQueryParts)b.push(w);b.length&&h.selectAll(b.join(",")).each(function(){var t=n.select(this),e=this.style.fill;e&&-1!==e.indexOf("url(")&&t.style("fill",e.replace(l,"TOBESTRIPPED"));var r=this.style.stroke;r&&-1!==r.indexOf("url(")&&t.style("stroke",r.replace(l,"TOBESTRIPPED"))})}"pdf"!==e&&"eps"!==e||h.selectAll("#MathJax_SVG_glyphs path").attr("stroke-width",0),h.node().setAttributeNS(s.xmlns,"xmlns",s.svg),h.node().setAttributeNS(s.xmlns,"xmlns:xlink",s.xlink),"svg"===e&&r&&(h.attr("width",r*d),h.attr("height",r*m),h.attr("viewBox","0 0 "+d+" "+m));var k=(new window.XMLSerializer).serializeToString(h.node());return k=function(t){var e=n.select("body").append("div").style({display:"none"}).html(""),r=t.replace(/(&[^;]*;)/gi,function(t){return"&lt;"===t?"&#60;":"&rt;"===t?"&#62;":-1!==t.indexOf("<")||-1!==t.indexOf(">")?"":e.html(t).text()});return e.remove(),r}(k),k=(k=k.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&amp;")).replace(u,"'"),i.isIE()&&(k=(k=(k=k.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),k}},{"../components/color":50,"../components/drawing":71,"../constants/xmlns_namespaces":148,"../lib":169,d3:14}],270:[function(t,e,r){"use strict";var n=t("../../plots/template_attributes").hovertemplateAttrs,i=t("../scattergeo/attributes"),a=t("../../components/colorscale/attributes"),o=t("../../plots/attributes"),s=t("../../components/color/attributes").defaultLine,l=t("../../lib/extend").extendFlat,u=i.marker.line;e.exports=l({locations:{valType:"data_array",editType:"calc"},locationmode:i.locationmode,z:{valType:"data_array",editType:"calc"},geojson:l({},i.geojson,{}),featureidkey:i.featureidkey,text:l({},i.text,{}),hovertext:l({},i.hovertext,{}),marker:{line:{color:l({},u.color,{dflt:s}),width:l({},u.width,{dflt:1}),editType:"calc"},opacity:{valType:"number",arrayOk:!0,min:0,max:1,dflt:1,editType:"style"},editType:"calc"},selected:{marker:{opacity:i.selected.marker.opacity,editType:"plot"},editType:"plot"},unselected:{marker:{opacity:i.unselected.marker.opacity,editType:"plot"},editType:"plot"},hoverinfo:l({},o.hoverinfo,{editType:"calc",flags:["location","z","text","name"]}),hovertemplate:n(),showlegend:l({},o.showlegend,{dflt:!1})},a("",{cLetter:"z",editTypeOverride:"calc"}))},{"../../components/color/attributes":49,"../../components/colorscale/attributes":57,"../../lib/extend":162,"../../plots/attributes":210,"../../plots/template_attributes":260,"../scattergeo/attributes":319}],271:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../constants/numerical").BADNUM,a=t("../../components/colorscale/calc"),o=t("../scatter/arrays_to_calcdata"),s=t("../scatter/calc_selection");function l(t){return t&&"string"==typeof t}e.exports=function(t,e){var r,u=e._length,c=new Array(u);r=e.geojson?function(t){return l(t)||n(t)}:l;for(var p=0;p<u;p++){var h=c[p]={},f=e.locations[p],d=e.z[p];r(f)&&n(d)?(h.loc=f,h.z=d):(h.loc=null,h.z=i),h.index=p}return o(c,e),a(t,e,{vals:e.z,containerStr:"",cLetter:"z"}),s(c,e),c}},{"../../components/colorscale/calc":58,"../../constants/numerical":147,"../scatter/arrays_to_calcdata":291,"../scatter/calc_selection":294,"fast-isnumeric":16}],272:[function(t,e,r){"use strict";e.exports=function(t,e,r,n,i){t.location=e.location,t.z=e.z;var a=n[i];return a.fIn&&a.fIn.properties&&(t.properties=a.fIn.properties),t.ct=a.ct,t}},{}],273:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("./attributes"),a=t("../../lib").fillText;e.exports=function(t,e,r){var o,s,l,u,c=t.cd,p=c[0].trace,h=t.subplot;for(s=0;s<c.length;s++)if(u=!1,(o=c[s])._polygons){for(l=0;l<o._polygons.length;l++)o._polygons[l].contains([e,r])&&(u=!u),o._polygons[l].contains([e+360,r])&&(u=!u);if(u)break}if(u&&o)return t.x0=t.x1=t.xa.c2p(o.ct),t.y0=t.y1=t.ya.c2p(o.ct),t.index=o.index,t.location=o.loc,t.z=o.z,t.zLabel=n.tickText(h.mockAxis,h.mockAxis.c2l(o.z),"hover").text,t.hovertemplate=o.hovertemplate,function(t,e,r){if(e.hovertemplate)return;var n=r.hi||e.hoverinfo,o=String(r.loc),s="all"===n?i.hoverinfo.flags:n.split("+"),l=-1!==s.indexOf("name"),u=-1!==s.indexOf("location"),c=-1!==s.indexOf("z"),p=-1!==s.indexOf("text"),h=[];!l&&u?t.nameOverride=o:(l&&(t.nameOverride=e.name),u&&h.push(o));c&&h.push(t.zLabel);p&&a(r,e,h);t.extraText=h.join("<br>")}(t,p,o,h.mockAxis),[t]}},{"../../lib":169,"../../plots/cartesian/axes":213,"./attributes":270}],274:[function(t,e,r){"use strict";e.exports=function(t,e){var r,n,i,a,o,s=t.cd,l=t.xaxis,u=t.yaxis,c=[];if(!1===e)for(r=0;r<s.length;r++)s[r].selected=0;else for(r=0;r<s.length;r++)(i=(n=s[r]).ct)&&(a=l.c2p(i),o=u.c2p(i),e.contains([a,o],null,r,t)?(c.push({pointNumber:r,lon:i[0],lat:i[1]}),n.selected=1):n.selected=0);return c}},{}],275:[function(t,e,r){"use strict";var n=t("../choropleth/attributes"),i=t("../../components/colorscale/attributes"),a=t("../../plots/template_attributes").hovertemplateAttrs,o=t("../../plots/attributes"),s=t("../../lib/extend").extendFlat;e.exports=s({locations:{valType:"data_array",editType:"calc"},z:{valType:"data_array",editType:"calc"},geojson:{valType:"any",editType:"calc"},featureidkey:s({},n.featureidkey,{}),below:{valType:"string",editType:"plot"},text:n.text,hovertext:n.hovertext,marker:{line:{color:s({},n.marker.line.color,{editType:"plot"}),width:s({},n.marker.line.width,{editType:"plot"}),editType:"calc"},opacity:s({},n.marker.opacity,{editType:"plot"}),editType:"calc"},selected:{marker:{opacity:s({},n.selected.marker.opacity,{editType:"plot"}),editType:"plot"},editType:"plot"},unselected:{marker:{opacity:s({},n.unselected.marker.opacity,{editType:"plot"}),editType:"plot"},editType:"plot"},hoverinfo:n.hoverinfo,hovertemplate:a({},{keys:["properties"]}),showlegend:s({},o.showlegend,{dflt:!1})},i("",{cLetter:"z",editTypeOverride:"calc"}))},{"../../components/colorscale/attributes":57,"../../lib/extend":162,"../../plots/attributes":210,"../../plots/template_attributes":260,"../choropleth/attributes":270}],276:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../components/colorscale"),o=t("../../components/drawing"),s=t("../../lib/geojson_utils").makeBlank,l=t("../../lib/geo_location_utils");function u(t){var e,r=t[0].trace,n=r._opts;if(r.selectedpoints){for(var a=o.makeSelectedPointStyleFns(r),s=0;s<t.length;s++){var l=t[s];l.fOut&&(l.fOut.properties.mo2=a.selectedOpacityFn(l))}e={type:"identity",property:"mo2"}}else e=i.isArrayOrTypedArray(r.marker.opacity)?{type:"identity",property:"mo"}:r.marker.opacity;return i.extendFlat(n.fill.paint,{"fill-opacity":e}),i.extendFlat(n.line.paint,{"line-opacity":e}),n}e.exports={convert:function(t){var e=t[0].trace,r=!0===e.visible&&0!==e._length,o={layout:{visibility:"none"},paint:{}},c={layout:{visibility:"none"},paint:{}},p=e._opts={fill:o,line:c,geojson:s()};if(!r)return p;var h=l.extractTraceFeature(t);if(!h)return p;var f,d,m,y=a.makeColorScaleFuncFromTrace(e),g=e.marker,v=g.line||{};i.isArrayOrTypedArray(g.opacity)&&(f=function(t){var e=t.mo;return n(e)?+i.constrain(e,0,1):0}),i.isArrayOrTypedArray(v.color)&&(d=function(t){return t.mlc}),i.isArrayOrTypedArray(v.width)&&(m=function(t){return t.mlw});for(var _=0;_<t.length;_++){var x=t[_],b=x.fOut;if(b){var w=b.properties;w.fc=y(x.z),f&&(w.mo=f(x)),d&&(w.mlc=d(x)),m&&(w.mlw=m(x)),x.ct=w.ct,x._polygons=l.feature2polygons(b)}}var k=f?{type:"identity",property:"mo"}:g.opacity;return i.extendFlat(o.paint,{"fill-color":{type:"identity",property:"fc"},"fill-opacity":k}),i.extendFlat(c.paint,{"line-color":d?{type:"identity",property:"mlc"}:v.color,"line-width":m?{type:"identity",property:"mlw"}:v.width,"line-opacity":k}),o.layout.visibility="visible",c.layout.visibility="visible",p.geojson={type:"FeatureCollection",features:h},u(t),p},convertOnSelect:u}},{"../../components/colorscale":62,"../../components/drawing":71,"../../lib":169,"../../lib/geo_location_utils":165,"../../lib/geojson_utils":166,"fast-isnumeric":16}],277:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../components/colorscale/defaults"),a=t("./attributes");e.exports=function(t,e,r,o){function s(r,i){return n.coerce(t,e,a,r,i)}var l=s("locations"),u=s("z"),c=s("geojson");n.isArrayOrTypedArray(l)&&l.length&&n.isArrayOrTypedArray(u)&&u.length&&("string"==typeof c&&""!==c||n.isPlainObject(c))?(s("featureidkey"),e._length=Math.min(l.length,u.length),s("below"),s("text"),s("hovertext"),s("hovertemplate"),s("marker.line.width")&&s("marker.line.color"),s("marker.opacity"),i(t,e,o,s,{prefix:"",cLetter:"z"}),n.coerceSelectionMarkerOpacity(e,s)):e.visible=!1}},{"../../components/colorscale/defaults":60,"../../lib":169,"./attributes":275}],278:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../heatmap/colorbar"),calc:t("../choropleth/calc"),plot:t("./plot"),hoverPoints:t("../choropleth/hover"),eventData:t("../choropleth/event_data"),selectPoints:t("../choropleth/select"),styleOnSelect:function(t,e){e&&e[0].trace._glTrace.updateOnSelect(e)},getBelow:function(t,e){for(var r=e.getMapLayers(),n=r.length-2;n>=0;n--){var i=r[n].id;if("string"==typeof i&&0===i.indexOf("water"))for(var a=n+1;a<r.length;a++)if("string"==typeof(i=r[a].id)&&-1===i.indexOf("plotly-"))return i}},moduleType:"trace",name:"choroplethmapbox",basePlotModule:t("../../plots/mapbox"),categories:["mapbox","gl","noOpacity","showLegend"],meta:{hr_name:"choropleth_mapbox"}}},{"../../plots/mapbox":246,"../choropleth/calc":271,"../choropleth/event_data":272,"../choropleth/hover":273,"../choropleth/select":274,"../heatmap/colorbar":288,"./attributes":275,"./defaults":277,"./plot":279}],279:[function(t,e,r){"use strict";var n=t("./convert").convert,i=t("./convert").convertOnSelect,a=t("../../plots/mapbox/constants").traceLayerPrefix;function o(t,e){this.type="choroplethmapbox",this.subplot=t,this.uid=e,this.sourceId="source-"+e,this.layerList=[["fill",a+e+"-fill"],["line",a+e+"-line"]],this.below=null}var s=o.prototype;s.update=function(t){this._update(n(t))},s.updateOnSelect=function(t){this._update(i(t))},s._update=function(t){var e=this.subplot,r=this.layerList,n=e.belowLookup["trace-"+this.uid];e.map.getSource(this.sourceId).setData(t.geojson),n!==this.below&&(this._removeLayers(),this._addLayers(t,n),this.below=n);for(var i=0;i<r.length;i++){var a=r[i],o=a[0],s=a[1],l=t[o];e.setOptions(s,"setLayoutProperty",l.layout),"visible"===l.layout.visibility&&e.setOptions(s,"setPaintProperty",l.paint)}},s._addLayers=function(t,e){for(var r=this.subplot,n=this.layerList,i=this.sourceId,a=0;a<n.length;a++){var o=n[a],s=o[0],l=t[s];r.addLayer({type:s,id:o[1],source:i,layout:l.layout,paint:l.paint},e)}},s._removeLayers=function(){for(var t=this.subplot.map,e=this.layerList,r=e.length-1;r>=0;r--)t.removeLayer(e[r][1])},s.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},e.exports=function(t,e){var r=e[0].trace,i=new o(t,r.uid),a=i.sourceId,s=n(e),l=i.below=t.belowLookup["trace-"+r.uid];return t.map.addSource(a,{type:"geojson",data:s.geojson}),i._addLayers(s,l),e[0].trace._glTrace=i,i}},{"../../plots/mapbox/constants":244,"./convert":276}],280:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),i=t("../../plots/template_attributes").hovertemplateAttrs,a=t("../../plots/attributes"),o=t("../scattermapbox/attributes"),s=t("../../lib/extend").extendFlat;e.exports=s({lon:o.lon,lat:o.lat,z:{valType:"data_array",editType:"calc"},radius:{valType:"number",editType:"plot",arrayOk:!0,min:1,dflt:30},below:{valType:"string",editType:"plot"},text:o.text,hovertext:o.hovertext,hoverinfo:s({},a.hoverinfo,{flags:["lon","lat","z","text","name"]}),hovertemplate:i(),showlegend:s({},a.showlegend,{dflt:!1})},n("",{cLetter:"z",editTypeOverride:"calc"}))},{"../../components/colorscale/attributes":57,"../../lib/extend":162,"../../plots/attributes":210,"../../plots/template_attributes":260,"../scattermapbox/attributes":321}],281:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib").isArrayOrTypedArray,a=t("../../constants/numerical").BADNUM,o=t("../../components/colorscale/calc"),s=t("../../lib")._;e.exports=function(t,e){for(var r=e._length,l=new Array(r),u=e.z,c=i(u)&&u.length,p=0;p<r;p++){var h=l[p]={},f=e.lon[p],d=e.lat[p];if(h.lonlat=n(f)&&n(d)?[+f,+d]:[a,a],c){var m=u[p];h.z=n(m)?m:a}}return o(t,e,{vals:c?u:[0,1],containerStr:"",cLetter:"z"}),r&&(l[0].t={labels:{lat:s(t,"lat:")+" ",lon:s(t,"lon:")+" "}}),l}},{"../../components/colorscale/calc":58,"../../constants/numerical":147,"../../lib":169,"fast-isnumeric":16}],282:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../components/color"),o=t("../../components/colorscale"),s=t("../../constants/numerical").BADNUM,l=t("../../lib/geojson_utils").makeBlank;e.exports=function(t){var e=t[0].trace,r=!0===e.visible&&0!==e._length,u=e._opts={heatmap:{layout:{visibility:"none"},paint:{}},geojson:l()};if(!r)return u;var c,p=[],h=e.z,f=e.radius,d=i.isArrayOrTypedArray(h)&&h.length,m=i.isArrayOrTypedArray(f);for(c=0;c<t.length;c++){var y=t[c],g=y.lonlat;if(g[0]!==s){var v={};if(d){var _=y.z;v.z=_!==s?_:0}m&&(v.r=n(f[c])&&f[c]>0?+f[c]:0),p.push({type:"Feature",geometry:{type:"Point",coordinates:g},properties:v})}}var x=o.extractOpts(e),b=x.reversescale?o.flipScale(x.colorscale):x.colorscale,w=b[0][1],k=["interpolate",["linear"],["heatmap-density"],0,a.opacity(w)<1?w:a.addOpacity(w,0)];for(c=1;c<b.length;c++)k.push(b[c][0],b[c][1]);var T=["interpolate",["linear"],["get","z"],x.min,0,x.max,1];return i.extendFlat(u.heatmap.paint,{"heatmap-weight":d?T:1/(x.max-x.min),"heatmap-color":k,"heatmap-radius":m?{type:"identity",property:"r"}:e.radius,"heatmap-opacity":e.opacity}),u.geojson={type:"FeatureCollection",features:p},u.heatmap.layout.visibility="visible",u}},{"../../components/color":50,"../../components/colorscale":62,"../../constants/numerical":147,"../../lib":169,"../../lib/geojson_utils":166,"fast-isnumeric":16}],283:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../components/colorscale/defaults"),a=t("./attributes");e.exports=function(t,e,r,o){function s(r,i){return n.coerce(t,e,a,r,i)}var l=s("lon")||[],u=s("lat")||[],c=Math.min(l.length,u.length);c?(e._length=c,s("z"),s("radius"),s("below"),s("text"),s("hovertext"),s("hovertemplate"),i(t,e,o,s,{prefix:"",cLetter:"z"})):e.visible=!1}},{"../../components/colorscale/defaults":60,"../../lib":169,"./attributes":280}],284:[function(t,e,r){"use strict";e.exports=function(t,e){return t.lon=e.lon,t.lat=e.lat,t.z=e.z,t}},{}],285:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axes"),a=t("../scattermapbox/hover");e.exports=function(t,e,r){var o=a(t,e,r);if(o){var s=o[0],l=s.cd,u=l[0].trace,c=l[s.index];if(delete s.color,"z"in c){var p=s.subplot.mockAxis;s.z=c.z,s.zLabel=i.tickText(p,p.c2l(c.z),"hover").text}return s.extraText=function(t,e,r){if(t.hovertemplate)return;var i=(e.hi||t.hoverinfo).split("+"),a=-1!==i.indexOf("all"),o=-1!==i.indexOf("lon"),s=-1!==i.indexOf("lat"),l=e.lonlat,u=[];function c(t){return t+"\xb0"}a||o&&s?u.push("("+c(l[0])+", "+c(l[1])+")"):o?u.push(r.lon+c(l[0])):s&&u.push(r.lat+c(l[1]));(a||-1!==i.indexOf("text"))&&n.fillText(e,t,u);return u.join("<br>")}(u,c,l[0].t.labels),[s]}}},{"../../lib":169,"../../plots/cartesian/axes":213,"../scattermapbox/hover":326}],286:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../heatmap/colorbar"),formatLabels:t("../scattermapbox/format_labels"),calc:t("./calc"),plot:t("./plot"),hoverPoints:t("./hover"),eventData:t("./event_data"),getBelow:function(t,e){for(var r=e.getMapLayers(),n=0;n<r.length;n++){var i=r[n],a=i.id;if("symbol"===i.type&&"string"==typeof a&&-1===a.indexOf("plotly-"))return a}},moduleType:"trace",name:"densitymapbox",basePlotModule:t("../../plots/mapbox"),categories:["mapbox","gl","showLegend"],meta:{hr_name:"density_mapbox"}}},{"../../plots/mapbox":246,"../heatmap/colorbar":288,"../scattermapbox/format_labels":325,"./attributes":280,"./calc":281,"./defaults":283,"./event_data":284,"./hover":285,"./plot":287}],287:[function(t,e,r){"use strict";var n=t("./convert"),i=t("../../plots/mapbox/constants").traceLayerPrefix;function a(t,e){this.type="densitymapbox",this.subplot=t,this.uid=e,this.sourceId="source-"+e,this.layerList=[["heatmap",i+e+"-heatmap"]],this.below=null}var o=a.prototype;o.update=function(t){var e=this.subplot,r=this.layerList,i=n(t),a=e.belowLookup["trace-"+this.uid];e.map.getSource(this.sourceId).setData(i.geojson),a!==this.below&&(this._removeLayers(),this._addLayers(i,a),this.below=a);for(var o=0;o<r.length;o++){var s=r[o],l=s[0],u=s[1],c=i[l];e.setOptions(u,"setLayoutProperty",c.layout),"visible"===c.layout.visibility&&e.setOptions(u,"setPaintProperty",c.paint)}},o._addLayers=function(t,e){for(var r=this.subplot,n=this.layerList,i=this.sourceId,a=0;a<n.length;a++){var o=n[a],s=o[0],l=t[s];r.addLayer({type:s,id:o[1],source:i,layout:l.layout,paint:l.paint},e)}},o._removeLayers=function(){for(var t=this.subplot.map,e=this.layerList,r=e.length-1;r>=0;r--)t.removeLayer(e[r][1])},o.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},e.exports=function(t,e){var r=e[0].trace,i=new a(t,r.uid),o=i.sourceId,s=n(e),l=i.below=t.belowLookup["trace-"+r.uid];return t.map.addSource(o,{type:"geojson",data:s.geojson}),i._addLayers(s,l),i}},{"../../plots/mapbox/constants":244,"./convert":282}],288:[function(t,e,r){"use strict";e.exports={min:"zmin",max:"zmax"}},{}],289:[function(t,e,r){"use strict";var n=t("../../lib");r.formatPiePercent=function(t,e){var r=(100*t).toPrecision(3);return-1!==r.lastIndexOf(".")&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)+"%"},r.formatPieValue=function(t,e){var r=t.toPrecision(10);return-1!==r.lastIndexOf(".")&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)},r.getFirstFilled=function(t,e){if(Array.isArray(t))for(var r=0;r<e.length;r++){var n=t[e[r]];if(n||0===n||""===n)return n}},r.castOption=function(t,e){return Array.isArray(t)?r.getFirstFilled(t,e):t||void 0}},{"../../lib":169}],290:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("./helpers").castOption;e.exports=function(t,e,r){var a=r.marker.line,o=i(a.color,e.pts)||n.defaultLine,s=i(a.width,e.pts)||0;t.style("stroke-width",s).call(n.fill,e.color).call(n.stroke,o)}},{"../../components/color":50,"./helpers":289}],291:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){for(var r=0;r<t.length;r++)t[r].i=r;n.mergeArray(e.text,t,"tx"),n.mergeArray(e.texttemplate,t,"txt"),n.mergeArray(e.hovertext,t,"htx"),n.mergeArray(e.customdata,t,"data"),n.mergeArray(e.textposition,t,"tp"),e.textfont&&(n.mergeArrayCastPositive(e.textfont.size,t,"ts"),n.mergeArray(e.textfont.color,t,"tc"),n.mergeArray(e.textfont.family,t,"tf"));var i=e.marker;if(i){n.mergeArrayCastPositive(i.size,t,"ms"),n.mergeArrayCastPositive(i.opacity,t,"mo"),n.mergeArray(i.symbol,t,"mx"),n.mergeArray(i.color,t,"mc");var a=i.line;i.line&&(n.mergeArray(a.color,t,"mlc"),n.mergeArrayCastPositive(a.width,t,"mlw"));var o=i.gradient;o&&"none"!==o.type&&(n.mergeArray(o.type,t,"mgt"),n.mergeArray(o.color,t,"mgc"))}}},{"../../lib":169}],292:[function(t,e,r){"use strict";var n=t("../../plots/template_attributes").texttemplateAttrs,i=t("../../plots/template_attributes").hovertemplateAttrs,a=t("../../components/colorscale/attributes"),o=t("../../plots/font_attributes"),s=t("../../components/drawing/attributes").dash,l=t("../../components/drawing"),u=t("./constants"),c=t("../../lib/extend").extendFlat;e.exports={x:{valType:"data_array",editType:"calc+clearAxisTypes",anim:!0},x0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes",anim:!0},dx:{valType:"number",dflt:1,editType:"calc",anim:!0},y:{valType:"data_array",editType:"calc+clearAxisTypes",anim:!0},y0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes",anim:!0},dy:{valType:"number",dflt:1,editType:"calc",anim:!0},stackgroup:{valType:"string",dflt:"",editType:"calc"},orientation:{valType:"enumerated",values:["v","h"],editType:"calc"},groupnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:"",editType:"calc"},stackgaps:{valType:"enumerated",values:["infer zero","interpolate"],dflt:"infer zero",editType:"calc"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},texttemplate:n({},{}),hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},mode:{valType:"flaglist",flags:["lines","markers","text"],extras:["none"],editType:"calc"},hoveron:{valType:"flaglist",flags:["points","fills"],editType:"style"},hovertemplate:i({},{keys:u.eventDataKeys}),line:{color:{valType:"color",editType:"style",anim:!0},width:{valType:"number",min:0,dflt:2,editType:"style",anim:!0},shape:{valType:"enumerated",values:["linear","spline","hv","vh","hvh","vhv"],dflt:"linear",editType:"plot"},smoothing:{valType:"number",min:0,max:1.3,dflt:1,editType:"plot"},dash:c({},s,{editType:"style"}),simplify:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},connectgaps:{valType:"boolean",dflt:!1,editType:"calc"},cliponaxis:{valType:"boolean",dflt:!0,editType:"plot"},fill:{valType:"enumerated",values:["none","tozeroy","tozerox","tonexty","tonextx","toself","tonext"],editType:"calc"},fillcolor:{valType:"color",editType:"style",anim:!0},marker:c({symbol:{valType:"enumerated",values:l.symbolList,dflt:"circle",arrayOk:!0,editType:"style"},opacity:{valType:"number",min:0,max:1,arrayOk:!0,editType:"style",anim:!0},size:{valType:"number",min:0,dflt:6,arrayOk:!0,editType:"calc",anim:!0},maxdisplayed:{valType:"number",min:0,dflt:0,editType:"plot"},sizeref:{valType:"number",dflt:1,editType:"calc"},sizemin:{valType:"number",min:0,dflt:0,editType:"calc"},sizemode:{valType:"enumerated",values:["diameter","area"],dflt:"diameter",editType:"calc"},line:c({width:{valType:"number",min:0,arrayOk:!0,editType:"style",anim:!0},editType:"calc"},a("marker.line",{anim:!0})),gradient:{type:{valType:"enumerated",values:["radial","horizontal","vertical","none"],arrayOk:!0,dflt:"none",editType:"calc"},color:{valType:"color",arrayOk:!0,editType:"calc"},editType:"calc"},editType:"calc"},a("marker",{anim:!0})),selected:{marker:{opacity:{valType:"number",min:0,max:1,editType:"style"},color:{valType:"color",editType:"style"},size:{valType:"number",min:0,editType:"style"},editType:"style"},textfont:{color:{valType:"color",editType:"style"},editType:"style"},editType:"style"},unselected:{marker:{opacity:{valType:"number",min:0,max:1,editType:"style"},color:{valType:"color",editType:"style"},size:{valType:"number",min:0,editType:"style"},editType:"style"},textfont:{color:{valType:"color",editType:"style"},editType:"style"},editType:"style"},textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"middle center",arrayOk:!0,editType:"calc"},textfont:o({editType:"calc",colorEditType:"style",arrayOk:!0}),r:{valType:"data_array",editType:"calc"},t:{valType:"data_array",editType:"calc"}}},{"../../components/colorscale/attributes":57,"../../components/drawing":71,"../../components/drawing/attributes":70,"../../lib/extend":162,"../../plots/font_attributes":239,"../../plots/template_attributes":260,"./constants":296}],293:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../plots/cartesian/axes"),o=t("../../constants/numerical").BADNUM,s=t("./subtypes"),l=t("./colorscale_calc"),u=t("./arrays_to_calcdata"),c=t("./calc_selection");function p(t,e,r,n,i,o,l){var u=e._length,c=t._fullLayout,p=r._id,h=n._id,f=c._firstScatter[d(e)]===e.uid,y=(m(e,c,r,n)||{}).orientation,g=e.fill;r._minDtick=0,n._minDtick=0;var v={padded:!0},_={padded:!0};l&&(v.ppad=_.ppad=l);var x=u<2||i[0]!==i[u-1]||o[0]!==o[u-1];x&&("tozerox"===g||"tonextx"===g&&(f||"h"===y))?v.tozero=!0:(e.error_y||{}).visible||"tonexty"!==g&&"tozeroy"!==g&&(s.hasMarkers(e)||s.hasText(e))||(v.padded=!1,v.ppad=0),x&&("tozeroy"===g||"tonexty"===g&&(f||"v"===y))?_.tozero=!0:"tonextx"!==g&&"tozerox"!==g||(_.padded=!1),p&&(e._extremes[p]=a.findExtremes(r,i,v)),h&&(e._extremes[h]=a.findExtremes(n,o,_))}function h(t,e){if(s.hasMarkers(t)){var r,n=t.marker,o=1.6*(t.marker.sizeref||1);if(r="area"===t.marker.sizemode?function(t){return Math.max(Math.sqrt((t||0)/o),3)}:function(t){return Math.max((t||0)/o,3)},i.isArrayOrTypedArray(n.size)){var l={type:"linear"};a.setConvert(l);for(var u=l.makeCalcdata(t.marker,"size"),c=new Array(e),p=0;p<e;p++)c[p]=r(u[p]);return c}return r(n.size)}}function f(t,e){var r=d(e),n=t._firstScatter;n[r]||(n[r]=e.uid)}function d(t){var e=t.stackgroup;return t.xaxis+t.yaxis+t.type+(e?"-"+e:"")}function m(t,e,r,n){var i=t.stackgroup;if(i){var a=e._scatterStackOpts[r._id+n._id][i],o="v"===a.orientation?n:r;return"linear"===o.type||"log"===o.type?a:void 0}}e.exports={calc:function(t,e){var r,s,d,y,g,v,_=t._fullLayout,x=a.getFromId(t,e.xaxis||"x"),b=a.getFromId(t,e.yaxis||"y"),w=x.makeCalcdata(e,"x"),k=b.makeCalcdata(e,"y"),T=e._length,A=new Array(T),M=e.ids,S=m(e,_,x,b),L=!1;f(_,e);var C,E="x",z="y";for(S?(i.pushUnique(S.traceIndices,e._expandedIndex),(r="v"===S.orientation)?(z="s",C="x"):(E="s",C="y"),g="interpolate"===S.stackgaps):p(t,e,x,b,w,k,h(e,T)),s=0;s<T;s++){var P=A[s]={},I=n(w[s]),D=n(k[s]);I&&D?(P[E]=w[s],P[z]=k[s]):S&&(r?I:D)?(P[C]=r?w[s]:k[s],P.gap=!0,g?(P.s=o,L=!0):P.s=0):P[E]=P[z]=o,M&&(P.id=String(M[s]))}if(u(A,e),l(t,e),c(A,e),S){for(s=0;s<A.length;)A[s][C]===o?A.splice(s,1):s++;if(i.sort(A,function(t,e){return t[C]-e[C]||t.i-e.i}),L){for(s=0;s<A.length-1&&A[s].gap;)s++;for((v=A[s].s)||(v=A[s].s=0),d=0;d<s;d++)A[d].s=v;for(y=A.length-1;y>s&&A[y].gap;)y--;for(v=A[y].s,d=A.length-1;d>y;d--)A[d].s=v;for(;s<y;)if(A[++s].gap){for(d=s+1;A[d].gap;)d++;for(var O=A[s-1][C],R=A[s-1].s,F=(A[d].s-R)/(A[d][C]-O);s<d;)A[s].s=R+(A[s][C]-O)*F,s++}}}return A},calcMarkerSize:h,calcAxisExpansion:p,setFirstScatter:f,getStackOpts:m}},{"../../constants/numerical":147,"../../lib":169,"../../plots/cartesian/axes":213,"./arrays_to_calcdata":291,"./calc_selection":294,"./colorscale_calc":295,"./subtypes":316,"fast-isnumeric":16}],294:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){n.isArrayOrTypedArray(e.selectedpoints)&&n.tagSelected(t,e)}},{"../../lib":169}],295:[function(t,e,r){"use strict";var n=t("../../components/colorscale/helpers").hasColorscale,i=t("../../components/colorscale/calc"),a=t("./subtypes");e.exports=function(t,e){a.hasLines(e)&&n(e,"line")&&i(t,e,{vals:e.line.color,containerStr:"line",cLetter:"c"}),a.hasMarkers(e)&&(n(e,"marker")&&i(t,e,{vals:e.marker.color,containerStr:"marker",cLetter:"c"}),n(e,"marker.line")&&i(t,e,{vals:e.marker.line.color,containerStr:"marker.line",cLetter:"c"}))}},{"../../components/colorscale/calc":58,"../../components/colorscale/helpers":61,"./subtypes":316}],296:[function(t,e,r){"use strict";e.exports={PTS_LINESONLY:20,minTolerance:.2,toleranceGrowth:10,maxScreensAway:20,eventDataKeys:[]}},{}],297:[function(t,e,r){"use strict";var n=t("./calc");function i(t,e,r,n,i,a,o){i[n]=!0;var s={i:null,gap:!0,s:0};if(s[o]=r,t.splice(e,0,s),e&&r===t[e-1][o]){var l=t[e-1];s.s=l.s,s.i=l.i,s.gap=l.gap}else a&&(s.s=function(t,e,r,n){var i=t[e-1],a=t[e+1];return a?i?i.s+(a.s-i.s)*(r-i[n])/(a[n]-i[n]):a.s:i.s}(t,e,r,o));e||(t[0].t=t[1].t,t[0].trace=t[1].trace,delete t[1].t,delete t[1].trace)}e.exports=function(t,e){var r=e.xaxis,a=e.yaxis,o=r._id+a._id,s=t._fullLayout._scatterStackOpts[o];if(s){var l,u,c,p,h,f,d,m,y,g,v,_,x,b,w,k=t.calcdata;for(var T in s){var A=(g=s[T]).traceIndices;if(A.length){for(v="interpolate"===g.stackgaps,_=g.groupnorm,"v"===g.orientation?(x="x",b="y"):(x="y",b="x"),w=new Array(A.length),l=0;l<w.length;l++)w[l]=!1;f=k[A[0]];var M=new Array(f.length);for(l=0;l<f.length;l++)M[l]=f[l][x];for(l=1;l<A.length;l++){for(h=k[A[l]],u=c=0;u<h.length;u++){for(d=h[u][x];d>M[c]&&c<M.length;c++)i(h,u,M[c],l,w,v,x),u++;if(d!==M[c]){for(p=0;p<l;p++)i(k[A[p]],c,d,p,w,v,x);M.splice(c,0,d)}c++}for(;c<M.length;c++)i(h,u,M[c],l,w,v,x),u++}var S=M.length;for(u=0;u<f.length;u++){for(m=f[u][b]=f[u].s,l=1;l<A.length;l++)(h=k[A[l]])[0].trace._rawLength=h[0].trace._length,h[0].trace._length=S,m+=h[u].s,h[u][b]=m;if(_)for(y=("fraction"===_?m:m/100)||1,l=0;l<A.length;l++){var L=k[A[l]][u];L[b]/=y,L.sNorm=L.s/y}}for(l=0;l<A.length;l++){var C=(h=k[A[l]])[0].trace,E=n.calcMarkerSize(C,C._rawLength),z=Array.isArray(E);if(E&&w[l]||z){var P=E;for(E=new Array(S),u=0;u<S;u++)E[u]=h[u].gap?0:z?P[h[u].i]:P}var I=new Array(S),D=new Array(S);for(u=0;u<S;u++)I[u]=h[u].x,D[u]=h[u].y;n.calcAxisExpansion(t,C,r,a,I,D,E),h[0].t.orientation=g.orientation}}}}}},{"./calc":293}],298:[function(t,e,r){"use strict";e.exports=function(t){for(var e=0;e<t.length;e++){var r=t[e];if("scatter"===r.type){var n=r.fill;if("none"!==n&&"toself"!==n&&(r.opacity=void 0,"tonexty"===n||"tonextx"===n))for(var i=e-1;i>=0;i--){var a=t[i];if("scatter"===a.type&&a.xaxis===r.xaxis&&a.yaxis===r.yaxis){a.opacity=void 0;break}}}}}},{}],299:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry"),a=t("./attributes"),o=t("./constants"),s=t("./subtypes"),l=t("./xy_defaults"),u=t("./stack_defaults"),c=t("./marker_defaults"),p=t("./line_defaults"),h=t("./line_shape_defaults"),f=t("./text_defaults"),d=t("./fillcolor_defaults");e.exports=function(t,e,r,m){function y(r,i){return n.coerce(t,e,a,r,i)}var g=l(t,e,m,y);if(g||(e.visible=!1),e.visible){var v=u(t,e,m,y),_=!v&&g<o.PTS_LINESONLY?"lines+markers":"lines";y("text"),y("hovertext"),y("mode",_),s.hasLines(e)&&(p(t,e,r,m,y),h(t,e,y),y("connectgaps"),y("line.simplify")),s.hasMarkers(e)&&c(t,e,r,m,y,{gradient:!0}),s.hasText(e)&&(y("texttemplate"),f(t,e,m,y));var x=[];(s.hasMarkers(e)||s.hasText(e))&&(y("cliponaxis"),y("marker.maxdisplayed"),x.push("points")),y("fill",v?v.fillDflt:"none"),"none"!==e.fill&&(d(t,e,r,y),s.hasLines(e)||h(t,e,y));var b=(e.line||{}).color,w=(e.marker||{}).color;"tonext"!==e.fill&&"toself"!==e.fill||x.push("fills"),y("hoveron",x.join("+")||"points"),"fills"!==e.hoveron&&y("hovertemplate");var k=i.getComponentMethod("errorbars","supplyDefaults");k(t,e,b||w||r,{axis:"y"}),k(t,e,b||w||r,{axis:"x",inherit:"y"}),n.coerceSelectionMarkerOpacity(e,y)}}},{"../../lib":169,"../../registry":261,"./attributes":292,"./constants":296,"./fillcolor_defaults":300,"./line_defaults":305,"./line_shape_defaults":307,"./marker_defaults":311,"./stack_defaults":314,"./subtypes":316,"./text_defaults":317,"./xy_defaults":318}],300:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../lib").isArrayOrTypedArray;e.exports=function(t,e,r,a){var o=!1;if(e.marker){var s=e.marker.color,l=(e.marker.line||{}).color;s&&!i(s)?o=s:l&&!i(l)&&(o=l)}a("fillcolor",n.addOpacity((e.line||{}).color||o||r,.5))}},{"../../components/color":50,"../../lib":169}],301:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes");e.exports=function(t,e,r){var i={},a={_fullLayout:r},o=n.getFromTrace(a,e,"x"),s=n.getFromTrace(a,e,"y");return i.xLabel=n.tickText(o,t.x,!0).text,i.yLabel=n.tickText(s,t.y,!0).text,i}},{"../../plots/cartesian/axes":213}],302:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("./subtypes");e.exports=function(t,e){var r,a;if("lines"===t.mode)return(r=t.line.color)&&n.opacity(r)?r:t.fillcolor;if("none"===t.mode)return t.fill?t.fillcolor:"";var o=e.mcc||(t.marker||{}).color,s=e.mlcc||((t.marker||{}).line||{}).color;return(a=o&&n.opacity(o)?o:s&&n.opacity(s)&&(e.mlw||((t.marker||{}).line||{}).width)?s:"")?n.opacity(a)<.3?n.addOpacity(a,.3):a:(r=(t.line||{}).color)&&n.opacity(r)&&i.hasLines(t)&&t.line.width?r:t.fillcolor}},{"../../components/color":50,"./subtypes":316}],303:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../components/fx"),a=t("../../registry"),o=t("./get_trace_color"),s=t("../../components/color"),l=n.fillText;e.exports=function(t,e,r,u){var c=t.cd,p=c[0].trace,h=t.xa,f=t.ya,d=h.c2p(e),m=f.c2p(r),y=[d,m],g=p.hoveron||"",v=-1!==p.mode.indexOf("markers")?3:.5;if(-1!==g.indexOf("points")){var _=function(t){var e=Math.max(v,t.mrc||0),r=h.c2p(t.x)-d,n=f.c2p(t.y)-m;return Math.max(Math.sqrt(r*r+n*n)-e,1-v/e)},x=i.getDistanceFunction(u,function(t){var e=Math.max(3,t.mrc||0),r=1-1/e,n=Math.abs(h.c2p(t.x)-d);return n<e?r*n/e:n-e+r},function(t){var e=Math.max(3,t.mrc||0),r=1-1/e,n=Math.abs(f.c2p(t.y)-m);return n<e?r*n/e:n-e+r},_);if(i.getClosest(c,x,t),!1!==t.index){var b=c[t.index],w=h.c2p(b.x,!0),k=f.c2p(b.y,!0),T=b.mrc||1;t.index=b.i;var A=c[0].t.orientation,M=A&&(b.sNorm||b.s),S="h"===A?M:b.x,L="v"===A?M:b.y;return n.extendFlat(t,{color:o(p,b),x0:w-T,x1:w+T,xLabelVal:S,y0:k-T,y1:k+T,yLabelVal:L,spikeDistance:_(b),hovertemplate:p.hovertemplate}),l(b,p,t),a.getComponentMethod("errorbars","hoverInfo")(b,p,t),[t]}}if(-1!==g.indexOf("fills")&&p._polygons){var C,E,z,P,I,D,O,R,F,B=p._polygons,N=[],U=!1,j=1/0,V=-1/0,q=1/0,G=-1/0;for(C=0;C<B.length;C++)(z=B[C]).contains(y)&&(U=!U,N.push(z),q=Math.min(q,z.ymin),G=Math.max(G,z.ymax));if(U){var H=((q=Math.max(q,0))+(G=Math.min(G,f._length)))/2;for(C=0;C<N.length;C++)for(P=N[C].pts,E=1;E<P.length;E++)(R=P[E-1][1])>H!=(F=P[E][1])>=H&&(D=P[E-1][0],O=P[E][0],F-R&&(I=D+(O-D)*(H-R)/(F-R),j=Math.min(j,I),V=Math.max(V,I)));j=Math.max(j,0),V=Math.min(V,h._length);var Z=s.defaultLine;return s.opacity(p.fillcolor)?Z=p.fillcolor:s.opacity((p.line||{}).color)&&(Z=p.line.color),n.extendFlat(t,{distance:t.maxHoverDistance,x0:j,x1:V,y0:H,y1:H,color:Z,hovertemplate:!1}),delete t.index,p.text&&!Array.isArray(p.text)?t.text=String(p.text):t.text=p.name,[t]}}}},{"../../components/color":50,"../../components/fx":88,"../../lib":169,"../../registry":261,"./get_trace_color":302}],304:[function(t,e,r){"use strict";var n=t("./subtypes");e.exports={hasLines:n.hasLines,hasMarkers:n.hasMarkers,hasText:n.hasText,isBubble:n.isBubble,attributes:t("./attributes"),supplyDefaults:t("./defaults"),crossTraceDefaults:t("./cross_trace_defaults"),calc:t("./calc").calc,crossTraceCalc:t("./cross_trace_calc"),arraysToCalcdata:t("./arrays_to_calcdata"),plot:t("./plot"),colorbar:t("./marker_colorbar"),formatLabels:t("./format_labels"),style:t("./style").style,styleOnSelect:t("./style").styleOnSelect,hoverPoints:t("./hover"),selectPoints:t("./select"),animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{}}},{"../../plots/cartesian":224,"./arrays_to_calcdata":291,"./attributes":292,"./calc":293,"./cross_trace_calc":297,"./cross_trace_defaults":298,"./defaults":299,"./format_labels":301,"./hover":303,"./marker_colorbar":310,"./plot":312,"./select":313,"./style":315,"./subtypes":316}],305:[function(t,e,r){"use strict";var n=t("../../lib").isArrayOrTypedArray,i=t("../../components/colorscale/helpers").hasColorscale,a=t("../../components/colorscale/defaults");e.exports=function(t,e,r,o,s,l){var u=(t.marker||{}).color;(s("line.color",r),i(t,"line"))?a(t,e,o,s,{prefix:"line.",cLetter:"c"}):s("line.color",!n(u)&&u||r);s("line.width"),(l||{}).noDash||s("line.dash")}},{"../../components/colorscale/defaults":60,"../../components/colorscale/helpers":61,"../../lib":169}],306:[function(t,e,r){"use strict";var n=t("../../constants/numerical"),i=n.BADNUM,a=n.LOG_CLIP,o=a+.5,s=a-.5,l=t("../../lib"),u=l.segmentsIntersect,c=l.constrain,p=t("./constants");e.exports=function(t,e){var r,n,a,h,f,d,m,y,g,v,_,x,b,w,k,T,A,M,S=e.xaxis,L=e.yaxis,C="log"===S.type,E="log"===L.type,z=S._length,P=L._length,I=e.connectGaps,D=e.baseTolerance,O=e.shape,R="linear"===O,F=e.fill&&"none"!==e.fill,B=[],N=p.minTolerance,U=t.length,j=new Array(U),V=0;function q(r){var n=t[r];if(!n)return!1;var a=e.linearized?S.l2p(n.x):S.c2p(n.x),l=e.linearized?L.l2p(n.y):L.c2p(n.y);if(a===i){if(C&&(a=S.c2p(n.x,!0)),a===i)return!1;E&&l===i&&(a*=Math.abs(S._m*P*(S._m>0?o:s)/(L._m*z*(L._m>0?o:s)))),a*=1e3}if(l===i){if(E&&(l=L.c2p(n.y,!0)),l===i)return!1;l*=1e3}return[a,l]}function G(t,e,r,n){var i=r-t,a=n-e,o=.5-t,s=.5-e,l=i*i+a*a,u=i*o+a*s;if(u>0&&u<l){var c=o*a-s*i;if(c*c<l)return!0}}function H(t,e){var r=t[0]/z,n=t[1]/P,i=Math.max(0,-r,r-1,-n,n-1);return i&&void 0!==A&&G(r,n,A,M)&&(i=0),i&&e&&G(r,n,e[0]/z,e[1]/P)&&(i=0),(1+p.toleranceGrowth*i)*D}function Z(t,e){var r=t[0]-e[0],n=t[1]-e[1];return Math.sqrt(r*r+n*n)}var X,W,Y,K,J,$,Q,tt=p.maxScreensAway,et=-z*tt,rt=z*(1+tt),nt=-P*tt,it=P*(1+tt),at=[[et,nt,rt,nt],[rt,nt,rt,it],[rt,it,et,it],[et,it,et,nt]];function ot(t){if(t[0]<et||t[0]>rt||t[1]<nt||t[1]>it)return[c(t[0],et,rt),c(t[1],nt,it)]}function st(t,e){return t[0]===e[0]&&(t[0]===et||t[0]===rt)||(t[1]===e[1]&&(t[1]===nt||t[1]===it)||void 0)}function lt(t,e,r){return function(n,i){var a=ot(n),o=ot(i),s=[];if(a&&o&&st(a,o))return s;a&&s.push(a),o&&s.push(o);var u=2*l.constrain((n[t]+i[t])/2,e,r)-((a||n)[t]+(o||i)[t]);u&&((a&&o?u>0==a[t]>o[t]?a:o:a||o)[t]+=u);return s}}function ut(t){var e=t[0],r=t[1],n=e===j[V-1][0],i=r===j[V-1][1];if(!n||!i)if(V>1){var a=e===j[V-2][0],o=r===j[V-2][1];n&&(e===et||e===rt)&&a?o?V--:j[V-1]=t:i&&(r===nt||r===it)&&o?a?V--:j[V-1]=t:j[V++]=t}else j[V++]=t}function ct(t){j[V-1][0]!==t[0]&&j[V-1][1]!==t[1]&&ut([Y,K]),ut(t),J=null,Y=K=0}function pt(t){if(A=t[0]/z,M=t[1]/P,X=t[0]<et?et:t[0]>rt?rt:0,W=t[1]<nt?nt:t[1]>it?it:0,X||W){if(V)if(J){var e=Q(J,t);e.length>1&&(ct(e[0]),j[V++]=e[1])}else $=Q(j[V-1],t)[0],j[V++]=$;else j[V++]=[X||t[0],W||t[1]];var r=j[V-1];X&&W&&(r[0]!==X||r[1]!==W)?(J&&(Y!==X&&K!==W?ut(Y&&K?(n=J,a=(i=t)[0]-n[0],o=(i[1]-n[1])/a,(n[1]*i[0]-i[1]*n[0])/a>0?[o>0?et:rt,it]:[o>0?rt:et,nt]):[Y||X,K||W]):Y&&K&&ut([Y,K])),ut([X,W])):Y-X&&K-W&&ut([X||Y,W||K]),J=t,Y=X,K=W}else J&&ct(Q(J,t)[0]),j[V++]=t;var n,i,a,o}for("linear"===O||"spline"===O?Q=function(t,e){for(var r=[],n=0,i=0;i<4;i++){var a=at[i],o=u(t[0],t[1],e[0],e[1],a[0],a[1],a[2],a[3]);o&&(!n||Math.abs(o.x-r[0][0])>1||Math.abs(o.y-r[0][1])>1)&&(o=[o.x,o.y],n&&Z(o,t)<Z(r[0],t)?r.unshift(o):r.push(o),n++)}return r}:"hv"===O||"vh"===O?Q=function(t,e){var r=[],n=ot(t),i=ot(e);return n&&i&&st(n,i)?r:(n&&r.push(n),i&&r.push(i),r)}:"hvh"===O?Q=lt(0,et,rt):"vhv"===O&&(Q=lt(1,nt,it)),r=0;r<U;r++)if(n=q(r)){for(V=0,J=null,pt(n),r++;r<U;r++){if(!(h=q(r))){if(I)continue;break}if(R&&e.simplify){var ht=q(r+1);if(v=Z(h,n),F&&(0===V||V===U-1)||!(v<H(h,ht)*N)){for(y=[(h[0]-n[0])/v,(h[1]-n[1])/v],f=n,_=v,x=w=k=0,m=!1,a=h,r++;r<t.length;r++){if(d=ht,ht=q(r+1),!d){if(I)continue;break}if(T=(g=[d[0]-n[0],d[1]-n[1]])[0]*y[1]-g[1]*y[0],w=Math.min(w,T),(k=Math.max(k,T))-w>H(d,ht))break;a=d,(b=g[0]*y[0]+g[1]*y[1])>_?(_=b,h=d,m=!1):b<x&&(x=b,f=d,m=!0)}if(m?(pt(h),a!==f&&pt(f)):(f!==n&&pt(f),a!==h&&pt(h)),pt(a),r>=t.length||!d)break;pt(d),n=d}}else pt(h)}J&&ut([Y||J[0],K||J[1]]),B.push(j.slice(0,V))}return B}},{"../../constants/numerical":147,"../../lib":169,"./constants":296}],307:[function(t,e,r){"use strict";e.exports=function(t,e,r){"spline"===r("line.shape")&&r("line.smoothing")}},{}],308:[function(t,e,r){"use strict";var n={tonextx:1,tonexty:1,tonext:1};e.exports=function(t,e,r){var i,a,o,s,l,u={},c=!1,p=-1,h=0,f=-1;for(a=0;a<r.length;a++)(o=(i=r[a][0].trace).stackgroup||"")?o in u?l=u[o]:(l=u[o]=h,h++):i.fill in n&&f>=0?l=f:(l=f=h,h++),l<p&&(c=!0),i._groupIndex=p=l;var d=r.slice();c&&d.sort(function(t,e){var r=t[0].trace,n=e[0].trace;return r._groupIndex-n._groupIndex||r.index-n.index});var m={};for(a=0;a<d.length;a++)o=(i=d[a][0].trace).stackgroup||"",!0===i.visible?(i._nexttrace=null,i.fill in n&&(s=m[o],i._prevtrace=s||null,s&&(s._nexttrace=i)),i._ownfill=i.fill&&("tozero"===i.fill.substr(0,6)||"toself"===i.fill||"to"===i.fill.substr(0,2)&&!i._prevtrace),m[o]=i):i._prevtrace=i._nexttrace=i._ownfill=null;return d}},{}],309:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.exports=function(t){var e=t.marker,r=e.sizeref||1,i=e.sizemin||0,a="area"===e.sizemode?function(t){return Math.sqrt(t/r)}:function(t){return t/r};return function(t){var e=a(t/2);return n(e)&&e>0?Math.max(e,i):0}}},{"fast-isnumeric":16}],310:[function(t,e,r){"use strict";e.exports={container:"marker",min:"cmin",max:"cmax"}},{}],311:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../components/colorscale/helpers").hasColorscale,a=t("../../components/colorscale/defaults"),o=t("./subtypes");e.exports=function(t,e,r,s,l,u){var c=o.isBubble(t),p=(t.line||{}).color;(u=u||{},p&&(r=p),l("marker.symbol"),l("marker.opacity",c?.7:1),l("marker.size"),l("marker.color",r),i(t,"marker")&&a(t,e,s,l,{prefix:"marker.",cLetter:"c"}),u.noSelect||(l("selected.marker.color"),l("unselected.marker.color"),l("selected.marker.size"),l("unselected.marker.size")),u.noLine||(l("marker.line.color",p&&!Array.isArray(p)&&e.marker.color!==p?p:c?n.background:n.defaultLine),i(t,"marker.line")&&a(t,e,s,l,{prefix:"marker.line.",cLetter:"c"}),l("marker.line.width",c?1:0)),c&&(l("marker.sizeref"),l("marker.sizemin"),l("marker.sizemode")),u.gradient)&&("none"!==l("marker.gradient.type")&&l("marker.gradient.color"))}},{"../../components/color":50,"../../components/colorscale/defaults":60,"../../components/colorscale/helpers":61,"./subtypes":316}],312:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../registry"),a=t("../../lib"),o=a.ensureSingle,s=a.identity,l=t("../../components/drawing"),u=t("./subtypes"),c=t("./line_points"),p=t("./link_traces"),h=t("../../lib/polygon").tester;function f(t,e,r,p,f,d,m){var y;!function(t,e,r,i,o){var s=r.xaxis,l=r.yaxis,c=n.extent(a.simpleMap(s.range,s.r2c)),p=n.extent(a.simpleMap(l.range,l.r2c)),h=i[0].trace;if(!u.hasMarkers(h))return;var f=h.marker.maxdisplayed;if(0===f)return;var d=i.filter(function(t){return t.x>=c[0]&&t.x<=c[1]&&t.y>=p[0]&&t.y<=p[1]}),m=Math.ceil(d.length/f),y=0;o.forEach(function(t,r){var n=t[0].trace;u.hasMarkers(n)&&n.marker.maxdisplayed>0&&r<e&&y++});var g=Math.round(y*m/3+Math.floor(y/3)*m/7.1);i.forEach(function(t){delete t.vis}),d.forEach(function(t,e){0===Math.round((e+g)%m)&&(t.vis=!0)})}(0,e,r,p,f);var g=!!m&&m.duration>0;function v(t){return g?t.transition():t}var _=r.xaxis,x=r.yaxis,b=p[0].trace,w=b.line,k=n.select(d),T=o(k,"g","errorbars"),A=o(k,"g","lines"),M=o(k,"g","points"),S=o(k,"g","text");if(i.getComponentMethod("errorbars","plot")(t,T,r,m),!0===b.visible){var L,C;v(k).style("opacity",b.opacity);var E=b.fill.charAt(b.fill.length-1);"x"!==E&&"y"!==E&&(E=""),p[0][r.isRangePlot?"nodeRangePlot3":"node3"]=k;var z,P,I="",D=[],O=b._prevtrace;O&&(I=O._prevRevpath||"",C=O._nextFill,D=O._polygons);var R,F,B,N,U,j,V,q="",G="",H=[],Z=a.noop;if(L=b._ownFill,u.hasLines(b)||"none"!==b.fill){for(C&&C.datum(p),-1!==["hv","vh","hvh","vhv"].indexOf(w.shape)?(R=l.steps(w.shape),F=l.steps(w.shape.split("").reverse().join(""))):R=F="spline"===w.shape?function(t){var e=t[t.length-1];return t.length>1&&t[0][0]===e[0]&&t[0][1]===e[1]?l.smoothclosed(t.slice(1),w.smoothing):l.smoothopen(t,w.smoothing)}:function(t){return"M"+t.join("L")},B=function(t){return F(t.reverse())},H=c(p,{xaxis:_,yaxis:x,connectGaps:b.connectgaps,baseTolerance:Math.max(w.width||1,3)/4,shape:w.shape,simplify:w.simplify,fill:b.fill}),V=b._polygons=new Array(H.length),y=0;y<H.length;y++)b._polygons[y]=h(H[y]);H.length&&(N=H[0][0],j=(U=H[H.length-1])[U.length-1]),Z=function(t){return function(e){if(z=R(e),P=B(e),q?E?(q+="L"+z.substr(1),G=P+"L"+G.substr(1)):(q+="Z"+z,G=P+"Z"+G):(q=z,G=P),u.hasLines(b)&&e.length>1){var r=n.select(this);if(r.datum(p),t)v(r.style("opacity",0).attr("d",z).call(l.lineGroupStyle)).style("opacity",1);else{var i=v(r);i.attr("d",z),l.singleLineStyle(p,i)}}}}}var X=A.selectAll(".js-line").data(H);v(X.exit()).style("opacity",0).remove(),X.each(Z(!1)),X.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(l.lineGroupStyle).each(Z(!0)),l.setClipUrl(X,r.layerClipId,t),H.length?(L?(L.datum(p),N&&j&&(E?("y"===E?N[1]=j[1]=x.c2p(0,!0):"x"===E&&(N[0]=j[0]=_.c2p(0,!0)),v(L).attr("d","M"+j+"L"+N+"L"+q.substr(1)).call(l.singleFillStyle)):v(L).attr("d",q+"Z").call(l.singleFillStyle))):C&&("tonext"===b.fill.substr(0,6)&&q&&I?("tonext"===b.fill?v(C).attr("d",q+"Z"+I+"Z").call(l.singleFillStyle):v(C).attr("d",q+"L"+I.substr(1)+"Z").call(l.singleFillStyle),b._polygons=b._polygons.concat(D)):(Y(C),b._polygons=null)),b._prevRevpath=G,b._prevPolygons=V):(L?Y(L):C&&Y(C),b._polygons=b._prevRevpath=b._prevPolygons=null),M.datum(p),S.datum(p),function(e,i,a){var o,c=a[0].trace,p=u.hasMarkers(c),h=u.hasText(c),f=tt(c),d=et,m=et;if(p||h){var y=s,b=c.stackgroup,w=b&&"infer zero"===t._fullLayout._scatterStackOpts[_._id+x._id][b].stackgaps;c.marker.maxdisplayed||c._needsCull?y=w?J:K:b&&!w&&(y=$),p&&(d=y),h&&(m=y)}var k,T=(o=e.selectAll("path.point").data(d,f)).enter().append("path").classed("point",!0);g&&T.call(l.pointStyle,c,t).call(l.translatePoints,_,x).style("opacity",0).transition().style("opacity",1),o.order(),p&&(k=l.makePointStyleFns(c)),o.each(function(e){var i=n.select(this),a=v(i);l.translatePoint(e,a,_,x)?(l.singlePointStyle(e,a,c,k,t),r.layerClipId&&l.hideOutsideRangePoint(e,a,_,x,c.xcalendar,c.ycalendar),c.customdata&&i.classed("plotly-customdata",null!==e.data&&void 0!==e.data)):a.remove()}),g?o.exit().transition().style("opacity",0).remove():o.exit().remove(),(o=i.selectAll("g").data(m,f)).enter().append("g").classed("textpoint",!0).append("text"),o.order(),o.each(function(t){var e=n.select(this),i=v(e.select("text"));l.translatePoint(t,i,_,x)?r.layerClipId&&l.hideOutsideRangePoint(t,e,_,x,c.xcalendar,c.ycalendar):e.remove()}),o.selectAll("text").call(l.textPointStyle,c,t).each(function(t){var e=_.c2p(t.x),r=x.c2p(t.y);n.select(this).selectAll("tspan.line").each(function(){v(n.select(this)).attr({x:e,y:r})})}),o.exit().remove()}(M,S,p);var W=!1===b.cliponaxis?null:r.layerClipId;l.setClipUrl(M,W,t),l.setClipUrl(S,W,t)}function Y(t){v(t).attr("d","M0,0Z")}function K(t){return t.filter(function(t){return!t.gap&&t.vis})}function J(t){return t.filter(function(t){return t.vis})}function $(t){return t.filter(function(t){return!t.gap})}function Q(t){return t.id}function tt(t){if(t.ids)return Q}function et(){return!1}}e.exports=function(t,e,r,i,a,u){var c,h,d=!a,m=!!a&&a.duration>0,y=p(t,e,r);((c=i.selectAll("g.trace").data(y,function(t){return t[0].trace.uid})).enter().append("g").attr("class",function(t){return"trace scatter trace"+t[0].trace.uid}).style("stroke-miterlimit",2),c.order(),function(t,e,r){e.each(function(e){var i=o(n.select(this),"g","fills");l.setClipUrl(i,r.layerClipId,t);var a=e[0].trace,u=[];a._ownfill&&u.push("_ownFill"),a._nexttrace&&u.push("_nextFill");var c=i.selectAll("g").data(u,s);c.enter().append("g"),c.exit().each(function(t){a[t]=null}).remove(),c.order().each(function(t){a[t]=o(n.select(this),"path","js-fill")})})}(t,c,e),m)?(u&&(h=u()),n.transition().duration(a.duration).ease(a.easing).each("end",function(){h&&h()}).each("interrupt",function(){h&&h()}).each(function(){i.selectAll("g.trace").each(function(r,n){f(t,n,e,r,y,this,a)})})):c.each(function(r,n){f(t,n,e,r,y,this,a)});d&&c.exit().remove(),i.selectAll("path:not([d])").remove()}},{"../../components/drawing":71,"../../lib":169,"../../lib/polygon":181,"../../registry":261,"./line_points":306,"./link_traces":308,"./subtypes":316,d3:14}],313:[function(t,e,r){"use strict";var n=t("./subtypes");e.exports=function(t,e){var r,i,a,o,s=t.cd,l=t.xaxis,u=t.yaxis,c=[],p=s[0].trace;if(!n.hasMarkers(p)&&!n.hasText(p))return[];if(!1===e)for(r=0;r<s.length;r++)s[r].selected=0;else for(r=0;r<s.length;r++)i=s[r],a=l.c2p(i.x),o=u.c2p(i.y),null!==i.i&&e.contains([a,o],!1,r,t)?(c.push({pointNumber:i.i,x:l.c2d(i.x),y:u.c2d(i.y)}),i.selected=1):i.selected=0;return c}},{"./subtypes":316}],314:[function(t,e,r){"use strict";var n=["orientation","groupnorm","stackgaps"];e.exports=function(t,e,r,i){var a=r._scatterStackOpts,o=i("stackgroup");if(o){var s=e.xaxis+e.yaxis,l=a[s];l||(l=a[s]={});var u=l[o],c=!1;u?u.traces.push(e):(u=l[o]={traceIndices:[],traces:[e]},c=!0);for(var p={orientation:e.x&&!e.y?"h":"v"},h=0;h<n.length;h++){var f=n[h],d=f+"Found";if(!u[d]){var m=void 0!==t[f],y="orientation"===f;if((m||c)&&(u[f]=i(f,p[f]),y&&(u.fillDflt="h"===u[f]?"tonextx":"tonexty"),m&&(u[d]=!0,!c&&(delete u.traces[0][f],y))))for(var g=0;g<u.traces.length-1;g++){var v=u.traces[g];v._input.fill!==v.fill&&(v.fill=u.fillDflt)}}}return u}}},{}],315:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../components/drawing"),a=t("../../registry");function o(t,e,r){i.pointStyle(t.selectAll("path.point"),e,r)}function s(t,e,r){i.textPointStyle(t.selectAll("text"),e,r)}e.exports={style:function(t){var e=n.select(t).selectAll("g.trace.scatter");e.style("opacity",function(t){return t[0].trace.opacity}),e.selectAll("g.points").each(function(e){o(n.select(this),e.trace||e[0].trace,t)}),e.selectAll("g.text").each(function(e){s(n.select(this),e.trace||e[0].trace,t)}),e.selectAll("g.trace path.js-line").call(i.lineGroupStyle),e.selectAll("g.trace path.js-fill").call(i.fillGroupStyle),a.getComponentMethod("errorbars","style")(e)},stylePoints:o,styleText:s,styleOnSelect:function(t,e,r){var n=e[0].trace;n.selectedpoints?(i.selectedPointStyle(r.selectAll("path.point"),n),i.selectedTextStyle(r.selectAll("text"),n)):(o(r,n,t),s(r,n,t))}}},{"../../components/drawing":71,"../../registry":261,d3:14}],316:[function(t,e,r){"use strict";var n=t("../../lib");e.exports={hasLines:function(t){return t.visible&&t.mode&&-1!==t.mode.indexOf("lines")},hasMarkers:function(t){return t.visible&&(t.mode&&-1!==t.mode.indexOf("markers")||"splom"===t.type)},hasText:function(t){return t.visible&&t.mode&&-1!==t.mode.indexOf("text")},isBubble:function(t){return n.isPlainObject(t.marker)&&n.isArrayOrTypedArray(t.marker.size)}}},{"../../lib":169}],317:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e,r,i,a){a=a||{},i("textposition"),n.coerceFont(i,"textfont",r.font),a.noSelect||(i("selected.textfont.color"),i("unselected.textfont.color"))}},{"../../lib":169}],318:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry");e.exports=function(t,e,r,a){var o,s=a("x"),l=a("y");if(i.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],r),s){var u=n.minRowLength(s);l?o=Math.min(u,n.minRowLength(l)):(o=u,a("y0"),a("dy"))}else{if(!l)return 0;o=n.minRowLength(l),a("x0"),a("dx")}return e._length=o,o}},{"../../lib":169,"../../registry":261}],319:[function(t,e,r){"use strict";var n=t("../../plots/template_attributes").hovertemplateAttrs,i=t("../../plots/template_attributes").texttemplateAttrs,a=t("../scatter/attributes"),o=t("../../plots/attributes"),s=t("../../components/colorscale/attributes"),l=t("../../components/drawing/attributes").dash,u=t("../../lib/extend").extendFlat,c=t("../../plot_api/edit_types").overrideAll,p=a.marker,h=a.line,f=p.line;e.exports=c({lon:{valType:"data_array"},lat:{valType:"data_array"},locations:{valType:"data_array"},locationmode:{valType:"enumerated",values:["ISO-3","USA-states","country names","geojson-id"],dflt:"ISO-3"},geojson:{valType:"any",editType:"calc"},featureidkey:{valType:"string",editType:"calc",dflt:"id"},mode:u({},a.mode,{dflt:"markers"}),text:u({},a.text,{}),texttemplate:i({editType:"plot"},{keys:["lat","lon","location","text"]}),hovertext:u({},a.hovertext,{}),textfont:a.textfont,textposition:a.textposition,line:{color:h.color,width:h.width,dash:l},connectgaps:a.connectgaps,marker:u({symbol:p.symbol,opacity:p.opacity,size:p.size,sizeref:p.sizeref,sizemin:p.sizemin,sizemode:p.sizemode,colorbar:p.colorbar,line:u({width:f.width},s("marker.line")),gradient:p.gradient},s("marker")),fill:{valType:"enumerated",values:["none","toself"],dflt:"none"},fillcolor:a.fillcolor,selected:a.selected,unselected:a.unselected,hoverinfo:u({},o.hoverinfo,{flags:["lon","lat","location","text","name"]}),hovertemplate:n()},"calc","nested")},{"../../components/colorscale/attributes":57,"../../components/drawing/attributes":70,"../../lib/extend":162,"../../plot_api/edit_types":196,"../../plots/attributes":210,"../../plots/template_attributes":260,"../scatter/attributes":292}],320:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../constants/numerical").BADNUM,a=t("../scatter/colorscale_calc"),o=t("../scatter/arrays_to_calcdata"),s=t("../scatter/calc_selection"),l=t("../../lib")._;function u(t){return t&&"string"==typeof t}e.exports=function(t,e){var r,c=Array.isArray(e.locations),p=c?e.locations.length:e._length,h=new Array(p);r=e.geojson?function(t){return u(t)||n(t)}:u;for(var f=0;f<p;f++){var d=h[f]={};if(c){var m=e.locations[f];d.loc=r(m)?m:null}else{var y=e.lon[f],g=e.lat[f];n(y)&&n(g)?d.lonlat=[+y,+g]:d.lonlat=[i,i]}}return o(h,e),a(t,e),s(h,e),p&&(h[0].t={labels:{lat:l(t,"lat:")+" ",lon:l(t,"lon:")+" "}}),h}},{"../../constants/numerical":147,"../../lib":169,"../scatter/arrays_to_calcdata":291,"../scatter/calc_selection":294,"../scatter/colorscale_calc":295,"fast-isnumeric":16}],321:[function(t,e,r){"use strict";var n=t("../../plots/template_attributes").hovertemplateAttrs,i=t("../../plots/template_attributes").texttemplateAttrs,a=t("../scattergeo/attributes"),o=t("../scatter/attributes"),s=t("../../plots/mapbox/layout_attributes"),l=t("../../plots/attributes"),u=t("../../components/colorscale/attributes"),c=t("../../lib/extend").extendFlat,p=t("../../plot_api/edit_types").overrideAll,h=a.line,f=a.marker;e.exports=p({lon:a.lon,lat:a.lat,mode:c({},o.mode,{dflt:"markers"}),text:c({},o.text,{}),texttemplate:i({editType:"plot"},{keys:["lat","lon","text"]}),hovertext:c({},o.hovertext,{}),line:{color:h.color,width:h.width},connectgaps:o.connectgaps,marker:c({symbol:{valType:"string",dflt:"circle",arrayOk:!0},opacity:f.opacity,size:f.size,sizeref:f.sizeref,sizemin:f.sizemin,sizemode:f.sizemode},u("marker")),fill:a.fill,fillcolor:o.fillcolor,textfont:s.layers.symbol.textfont,textposition:s.layers.symbol.textposition,below:{valType:"string"},selected:{marker:o.selected.marker},unselected:{marker:o.unselected.marker},hoverinfo:c({},l.hoverinfo,{flags:["lon","lat","text","name"]}),hovertemplate:n()},"calc","nested")},{"../../components/colorscale/attributes":57,"../../lib/extend":162,"../../plot_api/edit_types":196,"../../plots/attributes":210,"../../plots/mapbox/layout_attributes":248,"../../plots/template_attributes":260,"../scatter/attributes":292,"../scattergeo/attributes":319}],322:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../constants/numerical").BADNUM,o=t("../../lib/geojson_utils"),s=t("../../components/colorscale"),l=t("../../components/drawing"),u=t("../scatter/make_bubble_size_func"),c=t("../scatter/subtypes"),p=t("../../plots/mapbox/convert_text_opts"),h=t("../../components/fx/helpers").appendArrayPointValue,f=t("../../lib/svg_text_utils").NEWLINES,d=t("../../lib/svg_text_utils").BR_TAG_ALL;function m(){return{geojson:o.makeBlank(),layout:{visibility:"none"},paint:{}}}function y(t){return i.isArrayOrTypedArray(t)?function(t){return t}:t?function(){return t}:g}function g(){return""}function v(t){return t[0]===a}e.exports=function(t,e){var r,a=e[0].trace,_=!0===a.visible&&0!==a._length,x="none"!==a.fill,b=c.hasLines(a),w=c.hasMarkers(a),k=c.hasText(a),T=w&&"circle"===a.marker.symbol,A=w&&"circle"!==a.marker.symbol,M=m(),S=m(),L=m(),C=m(),E={fill:M,line:S,circle:L,symbol:C};if(!_)return E;if((x||b)&&(r=o.calcTraceToLineCoords(e)),x&&(M.geojson=o.makePolygon(r),M.layout.visibility="visible",i.extendFlat(M.paint,{"fill-color":a.fillcolor})),b&&(S.geojson=o.makeLine(r),S.layout.visibility="visible",i.extendFlat(S.paint,{"line-width":a.line.width,"line-color":a.line.color,"line-opacity":a.opacity})),T){var z=function(t){var e,r,a,o,c=t[0].trace,p=c.marker,h=c.selectedpoints,f=i.isArrayOrTypedArray(p.color),d=i.isArrayOrTypedArray(p.size),m=i.isArrayOrTypedArray(p.opacity);function y(t){return c.opacity*t}f&&(r=s.hasColorscale(c,"marker")?s.makeColorScaleFuncFromTrace(p):i.identity);d&&(a=u(c));m&&(o=function(t){var e=n(t)?+i.constrain(t,0,1):0;return y(e)});var g,_=[];for(e=0;e<t.length;e++){var x=t[e],b=x.lonlat;if(!v(b)){var w={};r&&(w.mcc=x.mcc=r(x.mc)),a&&(w.mrc=x.mrc=a(x.ms)),o&&(w.mo=o(x.mo)),h&&(w.selected=x.selected||0),_.push({type:"Feature",geometry:{type:"Point",coordinates:b},properties:w})}}if(h)for(g=l.makeSelectedPointStyleFns(c),e=0;e<_.length;e++){var k=_[e].properties;g.selectedOpacityFn&&(k.mo=y(g.selectedOpacityFn(k))),g.selectedColorFn&&(k.mcc=g.selectedColorFn(k)),g.selectedSizeFn&&(k.mrc=g.selectedSizeFn(k))}return{geojson:{type:"FeatureCollection",features:_},mcc:f||g&&g.selectedColorFn?{type:"identity",property:"mcc"}:p.color,mrc:d||g&&g.selectedSizeFn?{type:"identity",property:"mrc"}:(T=p.size,T/2),mo:m||g&&g.selectedOpacityFn?{type:"identity",property:"mo"}:y(p.opacity)};var T}(e);L.geojson=z.geojson,L.layout.visibility="visible",i.extendFlat(L.paint,{"circle-color":z.mcc,"circle-radius":z.mrc,"circle-opacity":z.mo})}if((A||k)&&(C.geojson=function(t,e){for(var r=e._fullLayout,n=t[0].trace,a=(n.marker||{}).symbol,o="circle"!==a?y(a):g,s=c.hasText(n)?y(n.text):g,l=[],u=0;u<t.length;u++){var p=t[u];if(!v(p.lonlat)){var m,_=n.texttemplate;if(_){var x=Array.isArray(_)?_[u]||"":_,b=n._module.formatLabels(p,n,r),w={};h(w,n,p.i);var k=n._meta||{};m=i.texttemplateString(x,b,r._d3locale,w,p,k)}else m=s(p.tx);m&&(m=m.replace(f,"").replace(d,"\n")),l.push({type:"Feature",geometry:{type:"Point",coordinates:p.lonlat},properties:{symbol:o(p.mx),text:m}})}}return{type:"FeatureCollection",features:l}}(e,t),i.extendFlat(C.layout,{visibility:"visible","icon-image":"{symbol}-15","text-field":"{text}"}),A&&(i.extendFlat(C.layout,{"icon-size":a.marker.size/10}),i.extendFlat(C.paint,{"icon-opacity":a.opacity*a.marker.opacity,"icon-color":a.marker.color})),k)){var P=(a.marker||{}).size,I=p(a.textposition,P);i.extendFlat(C.layout,{"text-size":a.textfont.size,"text-anchor":I.anchor,"text-offset":I.offset}),i.extendFlat(C.paint,{"text-color":a.textfont.color,"text-opacity":a.opacity})}return E}},{"../../components/colorscale":62,"../../components/drawing":71,"../../components/fx/helpers":85,"../../constants/numerical":147,"../../lib":169,"../../lib/geojson_utils":166,"../../lib/svg_text_utils":190,"../../plots/mapbox/convert_text_opts":245,"../scatter/make_bubble_size_func":309,"../scatter/subtypes":316,"fast-isnumeric":16}],323:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../scatter/subtypes"),a=t("../scatter/marker_defaults"),o=t("../scatter/line_defaults"),s=t("../scatter/text_defaults"),l=t("../scatter/fillcolor_defaults"),u=t("./attributes");e.exports=function(t,e,r,c){function p(r,i){return n.coerce(t,e,u,r,i)}if(function(t,e,r){var n=r("lon")||[],i=r("lat")||[],a=Math.min(n.length,i.length);return e._length=a,a}(0,e,p)){if(p("text"),p("texttemplate"),p("hovertext"),p("hovertemplate"),p("mode"),p("below"),i.hasLines(e)&&(o(t,e,r,c,p,{noDash:!0}),p("connectgaps")),i.hasMarkers(e)){a(t,e,r,c,p,{noLine:!0});var h=e.marker;"circle"!==h.symbol&&(n.isArrayOrTypedArray(h.size)&&(h.size=h.size[0]),n.isArrayOrTypedArray(h.color)&&(h.color=h.color[0]))}i.hasText(e)&&s(t,e,c,p,{noSelect:!0}),p("fill"),"none"!==e.fill&&l(t,e,r,p),n.coerceSelectionMarkerOpacity(e,p)}else e.visible=!1}},{"../../lib":169,"../scatter/fillcolor_defaults":300,"../scatter/line_defaults":305,"../scatter/marker_defaults":311,"../scatter/subtypes":316,"../scatter/text_defaults":317,"./attributes":321}],324:[function(t,e,r){"use strict";e.exports=function(t,e){return t.lon=e.lon,t.lat=e.lat,t}},{}],325:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes");e.exports=function(t,e,r){var i={},a=r[e.subplot]._subplot.mockAxis,o=t.lonlat;return i.lonLabel=n.tickText(a,a.c2l(o[0]),!0).text,i.latLabel=n.tickText(a,a.c2l(o[1]),!0).text,i}},{"../../plots/cartesian/axes":213}],326:[function(t,e,r){"use strict";var n=t("../../components/fx"),i=t("../../lib"),a=t("../scatter/get_trace_color"),o=i.fillText,s=t("../../constants/numerical").BADNUM;e.exports=function(t,e,r){var l=t.cd,u=l[0].trace,c=t.xa,p=t.ya,h=t.subplot,f=360*(e>=0?Math.floor((e+180)/360):Math.ceil((e-180)/360)),d=e-f;if(n.getClosest(l,function(t){var e=t.lonlat;if(e[0]===s)return 1/0;var n=i.modHalf(e[0],360),a=e[1],o=h.project([n,a]),l=o.x-c.c2p([d,a]),u=o.y-p.c2p([n,r]),f=Math.max(3,t.mrc||0);return Math.max(Math.sqrt(l*l+u*u)-f,1-3/f)},t),!1!==t.index){var m=l[t.index],y=m.lonlat,g=[i.modHalf(y[0],360)+f,y[1]],v=c.c2p(g),_=p.c2p(g),x=m.mrc||1;t.x0=v-x,t.x1=v+x,t.y0=_-x,t.y1=_+x;var b={};b[u.subplot]={_subplot:h};var w=u._module.formatLabels(m,u,b);return t.lonLabel=w.lonLabel,t.latLabel=w.latLabel,t.color=a(u,m),t.extraText=function(t,e,r){if(t.hovertemplate)return;var n=(e.hi||t.hoverinfo).split("+"),i=-1!==n.indexOf("all"),a=-1!==n.indexOf("lon"),s=-1!==n.indexOf("lat"),l=e.lonlat,u=[];function c(t){return t+"\xb0"}i||a&&s?u.push("("+c(l[0])+", "+c(l[1])+")"):a?u.push(r.lon+c(l[0])):s&&u.push(r.lat+c(l[1]));(i||-1!==n.indexOf("text"))&&o(e,t,u);return u.join("<br>")}(u,m,l[0].t.labels),t.hovertemplate=u.hovertemplate,[t]}}},{"../../components/fx":88,"../../constants/numerical":147,"../../lib":169,"../scatter/get_trace_color":302}],327:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../scatter/marker_colorbar"),formatLabels:t("./format_labels"),calc:t("../scattergeo/calc"),plot:t("./plot"),hoverPoints:t("./hover"),eventData:t("./event_data"),selectPoints:t("./select"),styleOnSelect:function(t,e){e&&e[0].trace._glTrace.update(e)},moduleType:"trace",name:"scattermapbox",basePlotModule:t("../../plots/mapbox"),categories:["mapbox","gl","symbols","showLegend","scatter-like"],meta:{}}},{"../../plots/mapbox":246,"../scatter/marker_colorbar":310,"../scattergeo/calc":320,"./attributes":321,"./defaults":323,"./event_data":324,"./format_labels":325,"./hover":326,"./plot":328,"./select":329}],328:[function(t,e,r){"use strict";var n=t("./convert"),i=t("../../plots/mapbox/constants").traceLayerPrefix,a=["fill","line","circle","symbol"];function o(t,e){this.type="scattermapbox",this.subplot=t,this.uid=e,this.sourceIds={fill:"source-"+e+"-fill",line:"source-"+e+"-line",circle:"source-"+e+"-circle",symbol:"source-"+e+"-symbol"},this.layerIds={fill:i+e+"-fill",line:i+e+"-line",circle:i+e+"-circle",symbol:i+e+"-symbol"},this.below=null}var s=o.prototype;s.addSource=function(t,e){this.subplot.map.addSource(this.sourceIds[t],{type:"geojson",data:e.geojson})},s.setSourceData=function(t,e){this.subplot.map.getSource(this.sourceIds[t]).setData(e.geojson)},s.addLayer=function(t,e,r){this.subplot.addLayer({type:t,id:this.layerIds[t],source:this.sourceIds[t],layout:e.layout,paint:e.paint},r)},s.update=function(t){var e,r,i,o=this.subplot,s=o.map,l=n(o.gd,t),u=o.belowLookup["trace-"+this.uid];if(u!==this.below){for(e=a.length-1;e>=0;e--)r=a[e],s.removeLayer(this.layerIds[r]);for(e=0;e<a.length;e++)i=l[r=a[e]],this.addLayer(r,i,u);this.below=u}for(e=0;e<a.length;e++)i=l[r=a[e]],o.setOptions(this.layerIds[r],"setLayoutProperty",i.layout),"visible"===i.layout.visibility&&(this.setSourceData(r,i),o.setOptions(this.layerIds[r],"setPaintProperty",i.paint));t[0].trace._glTrace=this},s.dispose=function(){for(var t=this.subplot.map,e=a.length-1;e>=0;e--){var r=a[e];t.removeLayer(this.layerIds[r]),t.removeSource(this.sourceIds[r])}},e.exports=function(t,e){for(var r=e[0].trace,i=new o(t,r.uid),s=n(t.gd,e),l=i.below=t.belowLookup["trace-"+r.uid],u=0;u<a.length;u++){var c=a[u],p=s[c];i.addSource(c,p),i.addLayer(c,p,l)}return e[0].trace._glTrace=i,i}},{"../../plots/mapbox/constants":244,"./convert":322}],329:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../scatter/subtypes"),a=t("../../constants/numerical").BADNUM;e.exports=function(t,e){var r,o=t.cd,s=t.xaxis,l=t.yaxis,u=[],c=o[0].trace;if(!i.hasMarkers(c))return[];if(!1===e)for(r=0;r<o.length;r++)o[r].selected=0;else for(r=0;r<o.length;r++){var p=o[r],h=p.lonlat;if(h[0]!==a){var f=[n.modHalf(h[0],360),h[1]],d=[s.c2p(f),l.c2p(f)];e.contains(d,null,r,t)?(u.push({pointNumber:r,lon:h[0],lat:h[1]}),p.selected=1):p.selected=0}}return u}},{"../../constants/numerical":147,"../../lib":169,"../scatter/subtypes":316}]},{},[5])(5)});