otsdaq_utilities  v2_05_02_indev
plotly-1.27.1.min.js
1 
7 !function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.Plotly=t()}}(function(){var t;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){var r=e[o][1][t];return i(r||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":"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 .modebar":"position:absolute;top:2px;right:2px;z-index:1001;background:rgba(255,255,255,0.7);","X .modebar--hover":"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":"opacity:1;","X .modebar-group":"float:left;display:inline-block;box-sizing:border-box;margin-left:8px;position:relative;vertical-align:middle;white-space:nowrap;","X .modebar-group:first-child":"margin-left:0px;","X .modebar-btn":"position:relative;font-size:16px;padding:3px 4px;cursor:pointer;line-height:normal;box-sizing:border-box;","X .modebar-btn svg":"position:relative;top:2px;","X .modebar-btn path":"fill:rgba(0,31,95,0.3);","X .modebar-btn.active path,X .modebar-btn:hover path":"fill:rgba(0,22,72,0.5);","X .modebar-btn.modebar-btn--logo":"padding:3px 1px;","X .modebar-btn.modebar-btn--logo path":"fill:#447adb !important;","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 .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;","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":709}],2:[function(t,e,r){"use strict";e.exports={undo:{width:857.1,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",ascent:850,descent:-150},home:{width:928.6,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",ascent:850,descent:-150},"camera-retro":{width: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",ascent:850,descent:-150},zoombox:{width: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",ascent:850,descent:-150},pan:{width: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",ascent:850,descent:-150},zoom_plus:{width: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",ascent:850,descent:-150},zoom_minus:{width:1e3,path:"m0 788l0-876 875 0 0 876-875 0z m688-500l-500 0 0 125 500 0 0-125z",ascent:850,descent:-150},autoscale:{width: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",ascent:850,descent:-150},tooltip_basic:{width:1500,path:"m375 725l0 0-375-375 375-374 0-1 1125 0 0 750-1125 0z",ascent:850,descent:-150},tooltip_compare:{width:1125,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",ascent:850,descent:-150},plotlylogo:{width:1542,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",ascent:850,descent:-150},"z-axis":{width: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",ascent:850,descent:-150},"3d_rotate":{width: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",ascent:850,descent:-150},camera:{width: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",ascent:850,descent:-150},movie:{width: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",ascent:850,descent:-150},question:{width:857.1,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",ascent:850,descent:-150},disk:{width:857.1,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",ascent:850,descent:-150},lasso:{width:1031,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",ascent:850,descent:-150},selectbox:{width: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",ascent:850,descent:-150},spikeline:{width: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",ascent:850,descent:-150}}},{}],3:[function(t,e,r){"use strict";e.exports=t("../src/traces/bar")},{"../src/traces/bar":840}],4:[function(t,e,r){"use strict";e.exports=t("../src/traces/box")},{"../src/traces/box":852}],5:[function(t,e,r){"use strict";e.exports=t("../src/components/calendars")},{"../src/components/calendars":588}],6:[function(t,e,r){"use strict";e.exports=t("../src/traces/candlestick")},{"../src/traces/candlestick":860}],7:[function(t,e,r){"use strict";e.exports=t("../src/traces/carpet")},{"../src/traces/carpet":881}],8:[function(t,e,r){"use strict";e.exports=t("../src/traces/choropleth")},{"../src/traces/choropleth":896}],9:[function(t,e,r){"use strict";e.exports=t("../src/traces/contour")},{"../src/traces/contour":907}],10:[function(t,e,r){"use strict";e.exports=t("../src/traces/contourcarpet")},{"../src/traces/contourcarpet":922}],11:[function(t,e,r){"use strict";e.exports=t("../src/core")},{"../src/core":693}],12:[function(t,e,r){"use strict";e.exports=t("../src/transforms/filter")},{"../src/transforms/filter":1077}],13:[function(t,e,r){"use strict";e.exports=t("../src/transforms/groupby")},{"../src/transforms/groupby":1078}],14:[function(t,e,r){"use strict";e.exports=t("../src/traces/heatmap")},{"../src/traces/heatmap":936}],15:[function(t,e,r){"use strict";e.exports=t("../src/traces/heatmapgl")},{"../src/traces/heatmapgl":945}],16:[function(t,e,r){"use strict";e.exports=t("../src/traces/histogram")},{"../src/traces/histogram":953}],17:[function(t,e,r){"use strict";e.exports=t("../src/traces/histogram2d")},{"../src/traces/histogram2d":958}],18:[function(t,e,r){"use strict";e.exports=t("../src/traces/histogram2dcontour")},{"../src/traces/histogram2dcontour":962}],19:[function(t,e,r){"use strict";var n=t("./core");n.register([t("./bar"),t("./box"),t("./heatmap"),t("./histogram"),t("./histogram2d"),t("./histogram2dcontour"),t("./pie"),t("./contour"),t("./scatterternary"),t("./sankey"),t("./scatter3d"),t("./surface"),t("./mesh3d"),t("./scattergeo"),t("./choropleth"),t("./scattergl"),t("./pointcloud"),t("./heatmapgl"),t("./parcoords"),t("./scattermapbox"),t("./carpet"),t("./scattercarpet"),t("./contourcarpet"),t("./ohlc"),t("./candlestick")]),n.register([t("./filter"),t("./groupby"),t("./sort")]),n.register([t("./calendars")]),e.exports=n},{"./bar":3,"./box":4,"./calendars":5,"./candlestick":6,"./carpet":7,"./choropleth":8,"./contour":9,"./contourcarpet":10,"./core":11,"./filter":12,"./groupby":13,"./heatmap":14,"./heatmapgl":15,"./histogram":16,"./histogram2d":17,"./histogram2dcontour":18,"./mesh3d":20,"./ohlc":21,"./parcoords":22,"./pie":23,"./pointcloud":24,"./sankey":25,"./scatter3d":26,"./scattercarpet":27,"./scattergeo":28,"./scattergl":29,"./scattermapbox":30,"./scatterternary":31,"./sort":32,"./surface":33}],20:[function(t,e,r){"use strict";e.exports=t("../src/traces/mesh3d")},{"../src/traces/mesh3d":966}],21:[function(t,e,r){"use strict";e.exports=t("../src/traces/ohlc")},{"../src/traces/ohlc":971}],22:[function(t,e,r){"use strict";e.exports=t("../src/traces/parcoords")},{"../src/traces/parcoords":980}],23:[function(t,e,r){"use strict";e.exports=t("../src/traces/pie")},{"../src/traces/pie":989}],24:[function(t,e,r){"use strict";e.exports=t("../src/traces/pointcloud")},{"../src/traces/pointcloud":998}],25:[function(t,e,r){"use strict";e.exports=t("../src/traces/sankey")},{"../src/traces/sankey":1004}],26:[function(t,e,r){"use strict";e.exports=t("../src/traces/scatter3d")},{"../src/traces/scatter3d":1036}],27:[function(t,e,r){"use strict";e.exports=t("../src/traces/scattercarpet")},{"../src/traces/scattercarpet":1041}],28:[function(t,e,r){"use strict";e.exports=t("../src/traces/scattergeo")},{"../src/traces/scattergeo":1050}],29:[function(t,e,r){"use strict";e.exports=t("../src/traces/scattergl")},{"../src/traces/scattergl":1055}],30:[function(t,e,r){"use strict";e.exports=t("../src/traces/scattermapbox")},{"../src/traces/scattermapbox":1061}],31:[function(t,e,r){"use strict";e.exports=t("../src/traces/scatterternary")},{"../src/traces/scatterternary":1067}],32:[function(t,e,r){"use strict";e.exports=t("../src/transforms/sort")},{"../src/transforms/sort":1079}],33:[function(t,e,r){"use strict";e.exports=t("../src/traces/surface")},{"../src/traces/surface":1076}],34:[function(t,e,r){"use strict";function n(t,e){function r(e,r,n,a){var o=1/t.clientHeight,s=o*(r-m),l=o*(n-v),c=p.flipX?1:-1,f=p.flipY?1:-1,d=Math.PI*p.rotateSpeed,y=i();if(1&e)a.shift?u.rotate(y,0,0,-s*d):u.rotate(y,c*d*s,-f*d*l,0);else if(2&e)u.pan(y,-p.translateSpeed*s*h,p.translateSpeed*l*h,0);else if(4&e){var b=p.zoomSpeed*l/window.innerHeight*(y-u.lastT())*50;u.pan(y,0,0,h*(Math.exp(b)-1))}m=r,v=n,g=a}t=t||document.body,e=e||{};var n=[.01,1/0];"distanceLimits"in e&&(n[0]=e.distanceLimits[0],n[1]=e.distanceLimits[1]),"zoomMin"in e&&(n[0]=e.zoomMin),"zoomMax"in e&&(n[1]=e.zoomMax);var u=a({center:e.center||[0,0,0],up:e.up||[0,1,0],eye:e.eye||[0,0,10],mode:e.mode||"orbit",distanceLimits:n}),c=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],h=0,f=t.clientWidth,d=t.clientHeight,p={view:u,element:t,delay:e.delay||16,rotateSpeed:e.rotateSpeed||1,zoomSpeed:e.zoomSpeed||1,translateSpeed:e.translateSpeed||1,flipX:!!e.flipX,flipY:!!e.flipY,modes:u.modes,tick:function(){var e=i(),r=this.delay;u.idle(e-r),u.flush(e-(100+2*r));var n=e-2*r;u.recalcMatrix(n);for(var a=!0,o=u.computedMatrix,s=0;s<16;++s)a=a&&c[s]===o[s],c[s]=o[s];var l=t.clientWidth===f&&t.clientHeight===d;return f=t.clientWidth,d=t.clientHeight,a?!l:(h=Math.exp(u.computedRadius[0]),!0)},lookAt:function(t,e,r){u.lookAt(u.lastT(),t,e,r)},rotate:function(t,e,r){u.rotate(u.lastT(),t,e,r)},pan:function(t,e,r){u.pan(u.lastT(),t,e,r)},translate:function(t,e,r){u.translate(u.lastT(),t,e,r)}};Object.defineProperties(p,{matrix:{get:function(){return u.computedMatrix},set:function(t){return u.setMatrix(u.lastT(),t),u.computedMatrix},enumerable:!0},mode:{get:function(){return u.getMode()},set:function(t){return u.setMode(t),u.getMode()},enumerable:!0},center:{get:function(){return u.computedCenter},set:function(t){return u.lookAt(u.lastT(),t),u.computedCenter},enumerable:!0},eye:{get:function(){return u.computedEye},set:function(t){return u.lookAt(u.lastT(),null,t),u.computedEye},enumerable:!0},up:{get:function(){return u.computedUp},set:function(t){return u.lookAt(u.lastT(),null,null,t),u.computedUp},enumerable:!0},distance:{get:function(){return h},set:function(t){return u.setDistance(u.lastT(),t),t},enumerable:!0},distanceLimits:{get:function(){return u.getDistanceLimits(n)},set:function(t){return u.setDistanceLimits(t),t},enumerable:!0}}),t.addEventListener("contextmenu",function(t){return t.preventDefault(),!1});var m=0,v=0,g={shift:!1,control:!1,alt:!1,meta:!1};return o(t,r),t.addEventListener("touchstart",function(e){var n=l(e.changedTouches[0],t);r(0,n[0],n[1],g),r(1,n[0],n[1],g)}),t.addEventListener("touchmove",function(e){var n=l(e.changedTouches[0],t);r(1,n[0],n[1],g)}),t.addEventListener("touchend",function(e){l(e.changedTouches[0],t);r(0,m,v,g)}),s(t,function(t,e,r){var n=p.flipX?1:-1,a=p.flipY?1:-1,o=i();if(Math.abs(t)>Math.abs(e))u.rotate(o,0,0,-t*n*Math.PI*p.rotateSpeed/window.innerWidth);else{var s=p.zoomSpeed*a*e/window.innerHeight*(o-u.lastT())/100;u.pan(o,0,0,h*(Math.exp(s)-1))}},!0),p}e.exports=n;var i=t("right-now"),a=t("3d-view"),o=t("mouse-change"),s=t("mouse-wheel"),l=t("mouse-event-offset")},{"3d-view":35,"mouse-change":445,"mouse-event-offset":446,"mouse-wheel":448,"right-now":494}],35:[function(t,e,r){"use strict";function n(t,e){this._controllerNames=Object.keys(t),this._controllerList=this._controllerNames.map(function(e){return t[e]}),this._mode=e,this._active=t[e],this._active||(this._mode="turntable",this._active=t.turntable),this.modes=this._controllerNames,this.computedMatrix=this._active.computedMatrix,this.computedEye=this._active.computedEye,this.computedUp=this._active.computedUp,this.computedCenter=this._active.computedCenter,this.computedRadius=this._active.computedRadius}function i(t){t=t||{};var e=t.eye||[0,0,1],r=t.center||[0,0,0],i=t.up||[0,1,0],l=t.distanceLimits||[0,1/0],u=t.mode||"turntable",c=a(),h=o(),f=s();return c.setDistanceLimits(l[0],l[1]),c.lookAt(0,e,r,i),h.setDistanceLimits(l[0],l[1]),h.lookAt(0,e,r,i),f.setDistanceLimits(l[0],l[1]),f.lookAt(0,e,r,i),new n({turntable:c,orbit:h,matrix:f},u)}e.exports=i;var a=t("turntable-camera-controller"),o=t("orbit-camera-controller"),s=t("matrix-camera-controller"),l=n.prototype;[["flush",1],["idle",1],["lookAt",4],["rotate",4],["pan",4],["translate",4],["setMatrix",2],["setDistanceLimits",2],["setDistance",2]].forEach(function(t){for(var e=t[0],r=[],n=0;n<t[1];++n)r.push("a"+n);var i="var cc=this._controllerList;for(var i=0;i<cc.length;++i){cc[i]."+t[0]+"("+r.join()+")}";l[e]=Function.apply(null,r.concat(i))}),l.recalcMatrix=function(t){this._active.recalcMatrix(t)},l.getDistance=function(t){return this._active.getDistance(t)},l.getDistanceLimits=function(t){return this._active.getDistanceLimits(t)},l.lastT=function(){return this._active.lastT()},l.setMode=function(t){if(t!==this._mode){var e=this._controllerNames.indexOf(t);if(!(e<0)){var r=this._active,n=this._controllerList[e],i=Math.max(r.lastT(),n.lastT());r.recalcMatrix(i),n.setMatrix(i,r.computedMatrix),this._active=n,this._mode=t,this.computedMatrix=this._active.computedMatrix,this.computedEye=this._active.computedEye,this.computedUp=this._active.computedUp,this.computedCenter=this._active.computedCenter,this.computedRadius=this._active.computedRadius}}},l.getMode=function(){return this._mode}},{"matrix-camera-controller":443,"orbit-camera-controller":465,"turntable-camera-controller":530}],36:[function(e,r,n){!function(i,a){"object"==typeof n&&void 0!==r?a(n,e("d3-array"),e("d3-collection"),e("d3-interpolate")):"function"==typeof t&&t.amd?t(["exports","d3-array","d3-collection","d3-interpolate"],a):a(i.d3=i.d3||{},i.d3,i.d3,i.d3)}(this,function(t,e,r,n){"use strict";var i=function(){function t(){v.forEach(function(t){t.sourceLinks=[],t.targetLinks=[]}),g.forEach(function(t,e){var r=t.source,n=t.target;"number"==typeof r&&(r=t.source=v[t.source]),"number"==typeof n&&(n=t.target=v[t.target]),t.originalIndex=e,r.sourceLinks.push(t),n.targetLinks.push(t)})}function i(){v.forEach(function(t){t.value=Math.max(e.sum(t.sourceLinks,h),e.sum(t.targetLinks,h))})}function a(){for(var t,e=v,r=0;e.length;)t=[],e.forEach(function(e){e.x=r,e.dx=d,e.sourceLinks.forEach(function(e){t.indexOf(e.target)<0&&t.push(e.target)})}),e=t,++r;o(r),s((m[0]-d)/(r-1))}function o(t){v.forEach(function(e){e.sourceLinks.length||(e.x=t-1)})}function s(t){v.forEach(function(e){e.x*=t})}function l(t){function n(){a.forEach(function(t){var e,r,n,a=0,o=t.length;for(t.sort(i),n=0;n<o;++n)e=t[n],r=a-e.y,r>0&&(e.y+=r),a=e.y+e.dy+p;if((r=a-p-m[1])>0)for(a=e.y-=r,n=o-2;n>=0;--n)e=t[n],r=e.y+e.dy+p-a,r>0&&(e.y-=r),a=e.y})}function i(t,e){return t.y-e.y}var a=r.nest().key(function(t){return t.x}).sortKeys(e.ascending).entries(v).map(function(t){return t.values});!function(){var t=e.min(a,function(t){return(m[1]-(t.length-1)*p)/e.sum(t,h)});a.forEach(function(e){e.forEach(function(e,r){e.y=r,e.dy=e.value*t})}),g.forEach(function(e){e.dy=e.value*t})}(),n();for(var o=1;t>0;--t)!function(t){function r(t){return c(t.target)*t.value}a.slice().reverse().forEach(function(n){n.forEach(function(n){if(n.sourceLinks.length){var i=e.sum(n.sourceLinks,r)/e.sum(n.sourceLinks,h);n.y+=(i-c(n))*t}})})}(o*=.99),n(),function(t){function r(t){return c(t.source)*t.value}a.forEach(function(n){n.forEach(function(n){if(n.targetLinks.length){var i=e.sum(n.targetLinks,r)/e.sum(n.targetLinks,h);n.y+=(i-c(n))*t}})})}(o),n()}function u(){function t(t,e){return t.source.y-e.source.y||t.originalIndex-e.originalIndex}function e(t,e){return t.target.y-e.target.y||t.originalIndex-e.originalIndex}v.forEach(function(r){r.sourceLinks.sort(e),r.targetLinks.sort(t)}),v.forEach(function(t){var e=0,r=0;t.sourceLinks.forEach(function(t){t.sy=e,e+=t.dy}),t.targetLinks.forEach(function(t){t.ty=r,r+=t.dy})})}function c(t){return t.y+t.dy/2}function h(t){return t.value}var f={},d=24,p=8,m=[1,1],v=[],g=[];return f.nodeWidth=function(t){return arguments.length?(d=+t,f):d},f.nodePadding=function(t){return arguments.length?(p=+t,f):p},f.nodes=function(t){return arguments.length?(v=t,f):v},f.links=function(t){return arguments.length?(g=t,f):g},f.size=function(t){return arguments.length?(m=t,f):m},f.layout=function(e){return t(),i(),a(),l(e),u(),f},f.relayout=function(){return u(),f},f.link=function(){function t(t){var r=t.source.x+t.source.dx,i=t.target.x,a=n.interpolateNumber(r,i),o=a(e),s=a(1-e),l=t.source.y+t.sy,u=l+t.dy,c=t.target.y+t.ty,h=c+t.dy;return"M"+r+","+l+"C"+o+","+l+" "+s+","+c+" "+i+","+c+"L"+i+","+h+"C"+s+","+h+" "+o+","+u+" "+r+","+u+"Z"}var e=.5;return t.curvature=function(r){return arguments.length?(e=+r,t):e},t},f};t.sankey=i,Object.defineProperty(t,"__esModule",{value:!0})})},{"d3-array":110,"d3-collection":111,"d3-interpolate":115}],37:[function(t,e,r){"use strict";function n(t){var e=s.get(t),r=e&&(e._triangleBuffer.handle||e._triangleBuffer.buffer);if(!r||!t.isBuffer(r)){var n=a(t,new Float32Array([-1,-1,-1,4,4,-1]));e=o(t,[{buffer:n,type:t.FLOAT,size:2}]),e._triangleBuffer=n,s.set(t,e)}e.bind(),t.drawArrays(t.TRIANGLES,0,3),e.unbind()}var i="undefined"==typeof WeakMap?t("weak-map"):WeakMap,a=t("gl-buffer"),o=t("gl-vao"),s=new i;e.exports=n},{"gl-buffer":152,"gl-vao":266,"weak-map":551}],38:[function(t,e,r){function n(t,e,r){e="number"==typeof e?e:1,r=r||": ";var n=t.split(/\r?\n/),a=String(n.length+e-1).length;return n.map(function(t,n){var o=n+e,s=String(o).length;return i(o,a-s)+r+t}).join("\n")}var i=t("pad-left");e.exports=n},{"pad-left":466}],39:[function(t,e,r){"use strict";function n(t,e){for(var r=new Array(e+1),n=0;n<t.length;++n)r[n]=t[n];for(var n=0;n<=t.length;++n){for(var i=t.length;i<=e;++i){for(var o=new Array(e),s=0;s<e;++s)o[s]=Math.pow(i+1-n,s);r[i]=o}if(a.apply(void 0,r))return!0}return!1}function i(t){var e=t.length;if(0===e)return[];if(1===e)return[0];for(var r=t[0].length,i=[t[0]],a=[0],o=1;o<e;++o)if(i.push(t[o]),n(i,r)){if(a.push(o),a.length===r+1)return a}else i.pop();return a}e.exports=i;var a=t("robust-orientation")},{"robust-orientation":500}],40:[function(t,e,r){"use strict";function n(t,e){return i(e).filter(function(r){for(var n=new Array(r.length),i=0;i<r.length;++i)n[i]=e[r[i]];return a(n)*t<1})}e.exports=n;var i=t("delaunay-triangulate"),a=t("circumradius")},{circumradius:83,"delaunay-triangulate":119}],41:[function(t,e,r){function n(t,e){return a(i(t,e))}e.exports=n;var i=t("alpha-complex"),a=t("simplicial-complex-boundary")},{"alpha-complex":40,"simplicial-complex-boundary":508}],42:[function(t,e,r){"use strict";e.exports=function(){function t(t){return!Array.isArray(t)&&null!==t&&"object"==typeof t}function e(t,e,r){for(var n=(e-t)/Math.max(r-1,1),i=[],a=0;a<r;a++)i.push(t+a*n);return i}function r(){for(var t=[].slice.call(arguments),e=t.map(function(t){return t.length}),r=Math.min.apply(null,e),n=[],i=0;i<r;i++){n[i]=[];for(var a=0;a<t.length;++a)n[i][a]=t[a][i]}return n}function n(t,e,r){for(var n=Math.min.apply(null,[t.length,e.length,r.length]),i=[],a=0;a<n;a++)i.push([t[a],e[a],r[a]]);return i}function i(t){function e(t){for(var n=0;n<t.length;n++)Array.isArray(t[n])?e(t[n],r):r+=t[n]}var r=0;return e(t,r),r}function a(t){for(var e=[],r=0;r<t.length;++r){e[r]=[];for(var n=0;n<t[r].length;++n)e[r][n]=t[r][n]}return e}function o(t){for(var e=[],r=0;r<t.length;++r)e[r]=t[r];return e}function s(t,e){if(t.length!==e.length)return!1;for(var r=t.length;r--;)if(t[r]!==e[r])return!1;return!0}function l(t,e){var r,n;if("string"!=typeof t)return t;if(r=[],"#"===t[0]?(t=t.substr(1),3===t.length&&(t+=t),n=parseInt(t,16),r[0]=n>>16&255,r[1]=n>>8&255,r[2]=255&n):h.test(t)&&(n=t.match(f),r[0]=parseInt(n[1]),r[1]=parseInt(n[2]),r[2]=parseInt(n[3])),!e)for(var i=0;i<3;++i)r[i]=r[i]/255;return r}function u(t,e){var r,n;if("string"!=typeof t)return t;if(r=[],"#"===t[0]?(t=t.substr(1),3===t.length&&(t+=t),n=parseInt(t,16),r[0]=n>>16&255,r[1]=n>>8&255,r[2]=255&n):h.test(t)&&(n=t.match(f),r[0]=parseInt(n[1]),r[1]=parseInt(n[2]),r[2]=parseInt(n[3]),n[4]?r[3]=parseFloat(n[4]):r[3]=1),!e)for(var i=0;i<3;++i)r[i]=r[i]/255;return r}var c={},h=/^rgba?\(\s*\d{1,3}\s*,\s*\d{1,3}\s*,\s*\d{1,3}\s*(,.*)?\)$/,f=/^rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,?\s*(.*)?\)$/;return c.isPlainObject=t,c.linspace=e,c.zip3=n,c.sum=i,c.zip=r,c.isEqual=s,c.copy2D=a,c.copy1D=o,c.str2RgbArray=l,c.str2RgbaArray=u,c}()},{}],43:[function(t,e,r){(function(r){"use strict";function n(t,e){if(t===e)return 0;for(var r=t.length,n=e.length,i=0,a=Math.min(r,n);i<a;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0}function i(t){return r.Buffer&&"function"==typeof r.Buffer.isBuffer?r.Buffer.isBuffer(t):!(null==t||!t._isBuffer)}function a(t){return Object.prototype.toString.call(t)}function o(t){return!i(t)&&("function"==typeof r.ArrayBuffer&&("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):!!t&&(t instanceof DataView||!!(t.buffer&&t.buffer instanceof ArrayBuffer))))}function s(t){if(x.isFunction(t)){if(M)return t.name;var e=t.toString(),r=e.match(A);return r&&r[1]}}function l(t,e){return"string"==typeof t?t.length<e?t:t.slice(0,e):t}function u(t){if(M||!x.isFunction(t))return x.inspect(t);var e=s(t);return"[Function"+(e?": "+e:"")+"]"}function c(t){return l(u(t.actual),128)+" "+t.operator+" "+l(u(t.expected),128)}function h(t,e,r,n,i){throw new k.AssertionError({message:r,actual:t,expected:e,operator:n,stackStartFunction:i})}function f(t,e){t||h(t,!0,e,"==",k.ok)}function d(t,e,r,s){if(t===e)return!0;if(i(t)&&i(e))return 0===n(t,e);if(x.isDate(t)&&x.isDate(e))return t.getTime()===e.getTime();if(x.isRegExp(t)&&x.isRegExp(e))return t.source===e.source&&t.global===e.global&&t.multiline===e.multiline&&t.lastIndex===e.lastIndex&&t.ignoreCase===e.ignoreCase;if(null!==t&&"object"==typeof t||null!==e&&"object"==typeof e){if(o(t)&&o(e)&&a(t)===a(e)&&!(t instanceof Float32Array||t instanceof Float64Array))return 0===n(new Uint8Array(t.buffer),new Uint8Array(e.buffer));if(i(t)!==i(e))return!1;s=s||{actual:[],expected:[]};var l=s.actual.indexOf(t);return l!==-1&&l===s.expected.indexOf(e)||(s.actual.push(t),s.expected.push(e),m(t,e,r,s))}return r?t===e:t==e}function p(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function m(t,e,r,n){if(null===t||void 0===t||null===e||void 0===e)return!1;if(x.isPrimitive(t)||x.isPrimitive(e))return t===e;if(r&&Object.getPrototypeOf(t)!==Object.getPrototypeOf(e))return!1;var i=p(t),a=p(e);if(i&&!a||!i&&a)return!1;if(i)return t=w.call(t),e=w.call(e),d(t,e,r);var o,s,l=T(t),u=T(e);if(l.length!==u.length)return!1;for(l.sort(),u.sort(),s=l.length-1;s>=0;s--)if(l[s]!==u[s])return!1;for(s=l.length-1;s>=0;s--)if(o=l[s],!d(t[o],e[o],r,n))return!1;return!0}function v(t,e,r){d(t,e,!0)&&h(t,e,r,"notDeepStrictEqual",v)}function g(t,e){if(!t||!e)return!1;if("[object RegExp]"==Object.prototype.toString.call(e))return e.test(t);try{if(t instanceof e)return!0}catch(t){}return!Error.isPrototypeOf(e)&&e.call({},t)===!0}function y(t){var e;try{t()}catch(t){e=t}return e}function b(t,e,r,n){var i;if("function"!=typeof e)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),i=y(e),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),t&&!i&&h(i,r,"Missing expected exception"+n);var a="string"==typeof n,o=!t&&x.isError(i),s=!t&&i&&!r;if((o&&a&&g(i,r)||s)&&h(i,r,"Got unwanted exception"+n),t&&i&&r&&!g(i,r)||!t&&i)throw i}var x=t("util/"),_=Object.prototype.hasOwnProperty,w=Array.prototype.slice,M=function(){return"foo"===function(){}.name}(),k=e.exports=f,A=/\s*function\s+([^\(\s]*)\s*/;k.AssertionError=function(t){this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,
8 this.generatedMessage=!1):(this.message=c(this),this.generatedMessage=!0);var e=t.stackStartFunction||h;if(Error.captureStackTrace)Error.captureStackTrace(this,e);else{var r=new Error;if(r.stack){var n=r.stack,i=s(e),a=n.indexOf("\n"+i);if(a>=0){var o=n.indexOf("\n",a+1);n=n.substring(o+1)}this.stack=n}}},x.inherits(k.AssertionError,Error),k.fail=h,k.ok=f,k.equal=function(t,e,r){t!=e&&h(t,e,r,"==",k.equal)},k.notEqual=function(t,e,r){t==e&&h(t,e,r,"!=",k.notEqual)},k.deepEqual=function(t,e,r){d(t,e,!1)||h(t,e,r,"deepEqual",k.deepEqual)},k.deepStrictEqual=function(t,e,r){d(t,e,!0)||h(t,e,r,"deepStrictEqual",k.deepStrictEqual)},k.notDeepEqual=function(t,e,r){d(t,e,!1)&&h(t,e,r,"notDeepEqual",k.notDeepEqual)},k.notDeepStrictEqual=v,k.strictEqual=function(t,e,r){t!==e&&h(t,e,r,"===",k.strictEqual)},k.notStrictEqual=function(t,e,r){t===e&&h(t,e,r,"!==",k.notStrictEqual)},k.throws=function(t,e,r){b(!0,t,e,r)},k.doesNotThrow=function(t,e,r){b(!1,t,e,r)},k.ifError=function(t){if(t)throw t};var T=Object.keys||function(t){var e=[];for(var r in t)_.call(t,r)&&e.push(r);return e}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"util/":541}],44:[function(t,e,r){e.exports=function(t){return atob(t)}},{}],45:[function(t,e,r){"use strict";function n(t){for(var e=0,r=0;r<t.length;++r)e+=t[r];return e}function i(t,e){for(var r=e.length,i=new Array(r+1),o=0;o<r;++o){for(var s=new Array(r+1),l=0;l<=r;++l)s[l]=t[l][o];i[o]=s}i[r]=new Array(r+1);for(var o=0;o<=r;++o)i[r][o]=1;for(var u=new Array(r+1),o=0;o<r;++o)u[o]=e[o];u[r]=1;var c=a(i,u),h=n(c[r+1]);0===h&&(h=1);for(var f=new Array(r+1),o=0;o<=r;++o)f[o]=n(c[o])/h;return f}e.exports=i;var a=t("robust-linear-solve")},{"robust-linear-solve":499}],46:[function(t,e,r){"use strict";function n(t,e){return i(t[0].mul(e[1]).add(e[0].mul(t[1])),t[1].mul(e[1]))}var i=t("./lib/rationalize");e.exports=n},{"./lib/rationalize":56}],47:[function(t,e,r){"use strict";function n(t,e){return t[0].mul(e[1]).cmp(e[0].mul(t[1]))}e.exports=n},{}],48:[function(t,e,r){"use strict";function n(t,e){return i(t[0].mul(e[1]),t[1].mul(e[0]))}var i=t("./lib/rationalize");e.exports=n},{"./lib/rationalize":56}],49:[function(t,e,r){"use strict";function n(t,e){if(i(t))return e?u(t,n(e)):[t[0].clone(),t[1].clone()];var r,c,h=0;if(a(t))r=t.clone();else if("string"==typeof t)r=s(t);else{if(0===t)return[o(0),o(1)];if(t===Math.floor(t))r=o(t);else{for(;t!==Math.floor(t);)t*=Math.pow(2,256),h-=256;r=o(t)}}if(i(e))r.mul(e[1]),c=e[0].clone();else if(a(e))c=e.clone();else if("string"==typeof e)c=s(e);else if(e)if(e===Math.floor(e))c=o(e);else{for(;e!==Math.floor(e);)e*=Math.pow(2,256),h+=256;c=o(e)}else c=o(1);return h>0?r=r.ushln(h):h<0&&(c=c.ushln(-h)),l(r,c)}var i=t("./is-rat"),a=t("./lib/is-bn"),o=t("./lib/num-to-bn"),s=t("./lib/str-to-bn"),l=t("./lib/rationalize"),u=t("./div");e.exports=n},{"./div":48,"./is-rat":50,"./lib/is-bn":54,"./lib/num-to-bn":55,"./lib/rationalize":56,"./lib/str-to-bn":57}],50:[function(t,e,r){"use strict";function n(t){return Array.isArray(t)&&2===t.length&&i(t[0])&&i(t[1])}var i=t("./lib/is-bn");e.exports=n},{"./lib/is-bn":54}],51:[function(t,e,r){"use strict";function n(t){return t.cmp(new i(0))}var i=t("bn.js");e.exports=n},{"bn.js":64}],52:[function(t,e,r){"use strict";function n(t){var e=t.length,r=t.words,n=0;if(1===e)n=r[0];else if(2===e)n=r[0]+67108864*r[1];else for(var a=0;a<e;a++){var o=r[a];n+=o*Math.pow(67108864,a)}return i(t)*n}var i=t("./bn-sign");e.exports=n},{"./bn-sign":51}],53:[function(t,e,r){"use strict";function n(t){var e=a(i.lo(t));if(e<32)return e;var r=a(i.hi(t));return r>20?52:r+32}var i=t("double-bits"),a=t("bit-twiddle").countTrailingZeros;e.exports=n},{"bit-twiddle":63,"double-bits":120}],54:[function(t,e,r){"use strict";function n(t){return t&&"object"==typeof t&&Boolean(t.words)}t("bn.js");e.exports=n},{"bn.js":64}],55:[function(t,e,r){"use strict";function n(t){var e=a.exponent(t);return e<52?new i(t):new i(t*Math.pow(2,52-e)).ushln(e-52)}var i=t("bn.js"),a=t("double-bits");e.exports=n},{"bn.js":64,"double-bits":120}],56:[function(t,e,r){"use strict";function n(t,e){var r=a(t),n=a(e);if(0===r)return[i(0),i(1)];if(0===n)return[i(0),i(0)];n<0&&(t=t.neg(),e=e.neg());var o=t.gcd(e);return o.cmpn(1)?[t.div(o),e.div(o)]:[t,e]}var i=t("./num-to-bn"),a=t("./bn-sign");e.exports=n},{"./bn-sign":51,"./num-to-bn":55}],57:[function(t,e,r){"use strict";function n(t){return new i(t)}var i=t("bn.js");e.exports=n},{"bn.js":64}],58:[function(t,e,r){"use strict";function n(t,e){return i(t[0].mul(e[0]),t[1].mul(e[1]))}var i=t("./lib/rationalize");e.exports=n},{"./lib/rationalize":56}],59:[function(t,e,r){"use strict";function n(t){return i(t[0])*i(t[1])}var i=t("./lib/bn-sign");e.exports=n},{"./lib/bn-sign":51}],60:[function(t,e,r){"use strict";function n(t,e){return i(t[0].mul(e[1]).sub(t[1].mul(e[0])),t[1].mul(e[1]))}var i=t("./lib/rationalize");e.exports=n},{"./lib/rationalize":56}],61:[function(t,e,r){"use strict";function n(t){var e=t[0],r=t[1];if(0===e.cmpn(0))return 0;var n=e.abs().divmod(r.abs()),o=n.div,s=i(o),l=n.mod,u=e.negative!==r.negative?-1:1;if(0===l.cmpn(0))return u*s;if(s){var c=a(s)+4,h=i(l.ushln(c).divRound(r));return u*(s+h*Math.pow(2,-c))}var f=r.bitLength()-l.bitLength()+53,h=i(l.ushln(f).divRound(r));return f<1023?u*h*Math.pow(2,-f):(h*=Math.pow(2,-1023),u*h*Math.pow(2,1023-f))}var i=t("./lib/bn-to-num"),a=t("./lib/ctz");e.exports=n},{"./lib/bn-to-num":52,"./lib/ctz":53}],62:[function(t,e,r){"use strict";function n(t,e,r,n,i,a){var o=["function ",t,"(a,l,h,",n.join(","),"){",a?"":"var i=",r?"l-1":"h+1",";while(l<=h){var m=(l+h)>>>1,x=a",i?".get(m)":"[m]"];return a?e.indexOf("c")<0?o.push(";if(x===y){return m}else if(x<=y){"):o.push(";var p=c(x,y);if(p===0){return m}else if(p<=0){"):o.push(";if(",e,"){i=m;"),r?o.push("l=m+1}else{h=m-1}"):o.push("h=m-1}else{l=m+1}"),o.push("}"),a?o.push("return -1};"):o.push("return i};"),o.join("")}function i(t,e,r,i){return new Function([n("A","x"+t+"y",e,["y"],!1,i),n("B","x"+t+"y",e,["y"],!0,i),n("P","c(x,y)"+t+"0",e,["y","c"],!1,i),n("Q","c(x,y)"+t+"0",e,["y","c"],!0,i),"function dispatchBsearch",r,"(a,y,c,l,h){if(a.shape){if(typeof(c)==='function'){return Q(a,(l===undefined)?0:l|0,(h===undefined)?a.shape[0]-1:h|0,y,c)}else{return B(a,(c===undefined)?0:c|0,(l===undefined)?a.shape[0]-1:l|0,y)}}else{if(typeof(c)==='function'){return P(a,(l===undefined)?0:l|0,(h===undefined)?a.length-1:h|0,y,c)}else{return A(a,(c===undefined)?0:c|0,(l===undefined)?a.length-1:l|0,y)}}}return dispatchBsearch",r].join(""))()}e.exports={ge:i(">=",!1,"GE"),gt:i(">",!1,"GT"),lt:i("<",!0,"LT"),le:i("<=",!0,"LE"),eq:i("-",!0,"EQ",!0)}},{}],63:[function(t,e,r){"use strict";"use restrict";function n(t){var e=32;return t&=-t,t&&e--,65535&t&&(e-=16),16711935&t&&(e-=8),252645135&t&&(e-=4),858993459&t&&(e-=2),1431655765&t&&(e-=1),e}r.INT_BITS=32,r.INT_MAX=2147483647,r.INT_MIN=-1<<31,r.sign=function(t){return(t>0)-(t<0)},r.abs=function(t){var e=t>>31;return(t^e)-e},r.min=function(t,e){return e^(t^e)&-(t<e)},r.max=function(t,e){return t^(t^e)&-(t<e)},r.isPow2=function(t){return!(t&t-1||!t)},r.log2=function(t){var e,r;return e=(t>65535)<<4,t>>>=e,r=(t>255)<<3,t>>>=r,e|=r,r=(t>15)<<2,t>>>=r,e|=r,r=(t>3)<<1,t>>>=r,(e|=r)|t>>1},r.log10=function(t){return t>=1e9?9:t>=1e8?8:t>=1e7?7:t>=1e6?6:t>=1e5?5:t>=1e4?4:t>=1e3?3:t>=100?2:t>=10?1:0},r.popCount=function(t){return t-=t>>>1&1431655765,16843009*((t=(858993459&t)+(t>>>2&858993459))+(t>>>4)&252645135)>>>24},r.countTrailingZeros=n,r.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1},r.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)-(t>>>1)},r.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,27030>>>(t&=15)&1};var i=new Array(256);!function(t){for(var e=0;e<256;++e){var r=e,n=e,i=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--i;t[e]=n<<i&255}}(i),r.reverse=function(t){return i[255&t]<<24|i[t>>>8&255]<<16|i[t>>>16&255]<<8|i[t>>>24&255]},r.interleave2=function(t,e){return t&=65535,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e&=65535,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t|e<<1},r.deinterleave2=function(t,e){return t=t>>>e&1431655765,t=858993459&(t|t>>>1),t=252645135&(t|t>>>2),t=16711935&(t|t>>>4),(t=65535&(t|t>>>16))<<16>>16},r.interleave3=function(t,e,r){return t&=1023,t=4278190335&(t|t<<16),t=251719695&(t|t<<8),t=3272356035&(t|t<<4),t=1227133513&(t|t<<2),e&=1023,e=4278190335&(e|e<<16),e=251719695&(e|e<<8),e=3272356035&(e|e<<4),e=1227133513&(e|e<<2),t|=e<<1,r&=1023,r=4278190335&(r|r<<16),r=251719695&(r|r<<8),r=3272356035&(r|r<<4),r=1227133513&(r|r<<2),t|r<<2},r.deinterleave3=function(t,e){return t=t>>>e&1227133513,t=3272356035&(t|t>>>2),t=251719695&(t|t>>>4),t=4278190335&(t|t>>>8),(t=1023&(t|t>>>16))<<22>>22},r.nextCombination=function(t){var e=t|t-1;return e+1|(~e&-~e)-1>>>n(t)+1}},{}],64:[function(t,e,r){!function(e,r){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function a(t,e,r){if(a.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}function o(t,e,r){for(var n=0,i=Math.min(t.length,r),a=e;a<i;a++){var o=t.charCodeAt(a)-48;n<<=4,n|=o>=49&&o<=54?o-49+10:o>=17&&o<=22?o-17+10:15&o}return n}function s(t,e,r,n){for(var i=0,a=Math.min(t.length,r),o=e;o<a;o++){var s=t.charCodeAt(o)-48;i*=n,i+=s>=49?s-49+10:s>=17?s-17+10:s}return i}function l(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var n=r/26|0,i=r%26;e[r]=(t.words[n]&1<<i)>>>i}return e}function u(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],a=0|e.words[0],o=i*a,s=67108863&o,l=o/67108864|0;r.words[0]=s;for(var u=1;u<n;u++){for(var c=l>>>26,h=67108863&l,f=Math.min(u,e.length-1),d=Math.max(0,u-t.length+1);d<=f;d++){var p=u-d|0;i=0|t.words[p],a=0|e.words[d],o=i*a+h,c+=o/67108864|0,h=67108863&o}r.words[u]=0|h,l=0|c}return 0!==l?r.words[u]=0|l:r.length--,r.strip()}function c(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,a=0;a<r.length-1;a++){var o=i;i=0;for(var s=67108863&n,l=Math.min(a,e.length-1),u=Math.max(0,a-t.length+1);u<=l;u++){var c=a-u,h=0|t.words[c],f=0|e.words[u],d=h*f,p=67108863&d;o=o+(d/67108864|0)|0,p=p+s|0,s=67108863&p,o=o+(p>>>26)|0,i+=o>>>26,o&=67108863}r.words[a]=s,n=o,o=i}return 0!==n?r.words[a]=n:r.length--,r.strip()}function h(t,e,r){return(new f).mulp(t,e,r)}function f(t,e){this.x=t,this.y=e}function d(t,e){this.name=t,this.p=new a(e,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function p(){d.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function m(){d.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function v(){d.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function g(){d.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function y(t){if("string"==typeof t){var e=a._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function b(t){y.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}"object"==typeof e?e.exports=a:r.BN=a,a.BN=a,a.wordSize=26;var x;try{x=t("buffer").Buffer}catch(t){}a.isBN=function(t){return t instanceof a||null!==t&&"object"==typeof t&&t.constructor.wordSize===a.wordSize&&Array.isArray(t.words)},a.max=function(t,e){return t.cmp(e)>0?t:e},a.min=function(t,e){return t.cmp(e)<0?t:e},a.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36),t=t.toString().replace(/\s+/g,"");var i=0;"-"===t[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},a.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},a.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var a,o,s=0;if("be"===r)for(i=t.length-1,a=0;i>=0;i-=3)o=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[a]|=o<<s&67108863,this.words[a+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);else if("le"===r)for(i=0,a=0;i<t.length;i+=3)o=t[i]|t[i+1]<<8|t[i+2]<<16,this.words[a]|=o<<s&67108863,this.words[a+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);return this.strip()},a.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var n,i,a=0;for(r=t.length-6,n=0;r>=e;r-=6)i=o(t,r,r+6),this.words[n]|=i<<a&67108863,this.words[n+1]|=i>>>26-a&4194303,(a+=24)>=26&&(a-=26,n++);r+6!==e&&(i=o(t,e,r+6),this.words[n]|=i<<a&67108863,this.words[n+1]|=i>>>26-a&4194303),this.strip()},a.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var a=t.length-r,o=a%n,l=Math.min(a,a-o)+r,u=0,c=r;c<l;c+=n)u=s(t,c,c+n,e),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==o){var h=1;for(u=s(t,c,t.length,e),c=0;c<o;c++)h*=e;this.imuln(h),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}},a.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},a.prototype.clone=function(){var t=new a(null);return this.copy(t),t},a.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},a.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var _=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],w=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],M=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];a.prototype.toString=function(t,e){t=t||10,e=0|e||1;var r;if(16===t||"hex"===t){r="";for(var i=0,a=0,o=0;o<this.length;o++){var s=this.words[o],l=(16777215&(s<<i|a)).toString(16);a=s>>>24-i&16777215,r=0!==a||o!==this.length-1?_[6-l.length]+l+r:l+r,i+=2,i>=26&&(i-=26,o--)}for(0!==a&&(r=a.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var u=w[t],c=M[t];r="";var h=this.clone();for(h.negative=0;!h.isZero();){var f=h.modn(c).toString(t);h=h.idivn(c),r=h.isZero()?f+r:_[u-f.length]+f+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(t,e){return n(void 0!==x),this.toArrayLike(x,t,e)},a.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},a.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),a=r||Math.max(1,i);n(i<=a,"byte array longer than desired length"),n(a>0,"Requested array length <= 0"),this.strip();var o,s,l="le"===e,u=new t(a),c=this.clone();if(l){for(s=0;!c.isZero();s++)o=c.andln(255),c.iushrn(8),u[s]=o;for(;s<a;s++)u[s]=0}else{for(s=0;s<a-i;s++)u[s]=0;for(s=0;!c.isZero();s++)o=c.andln(255),c.iushrn(8),u[a-s-1]=o}return u},Math.clz32?a.prototype._countBits=function(t){return 32-Math.clz32(t)}:a.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},a.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},a.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},a.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},a.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},a.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},a.prototype.isNeg=function(){return 0!==this.negative},a.prototype.neg=function(){return this.clone().ineg()},a.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},a.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},a.prototype.ior=function(t){return n(0==(this.negative|t.negative)),this.iuor(t)},a.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},a.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},a.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},a.prototype.iand=function(t){return n(0==(this.negative|t.negative)),this.iuand(t)},a.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},a.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},a.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;n<r.length;n++)this.words[n]=e.words[n]^r.words[n];if(this!==e)for(;n<e.length;n++)this.words[n]=e.words[n];return this.length=e.length,this.strip()},a.prototype.ixor=function(t){return n(0==(this.negative|t.negative)),this.iuxor(t)},a.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},a.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},a.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i<e;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},a.prototype.notn=function(t){return this.clone().inotn(t)},a.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<i:this.words[r]&~(1<<i),this.strip()},a.prototype.iadd=function(t){var e;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();var r,n;this.length>t.length?(r=this,n=t):(r=t,n=this);for(var i=0,a=0;a<n.length;a++)e=(0|r.words[a])+(0|n.words[a])+i,this.words[a]=67108863&e,i=e>>>26;for(;0!==i&&a<r.length;a++)e=(0|r.words[a])+i,this.words[a]=67108863&e,i=e>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;a<r.length;a++)this.words[a]=r.words[a];return this},a.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},a.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r=this.cmp(t);if(0===r)return this.negative=0,this.length=1,this.words[0]=0,this;var n,i;r>0?(n=this,i=t):(n=t,i=this);for(var a=0,o=0;o<i.length;o++)e=(0|n.words[o])-(0|i.words[o])+a,a=e>>26,this.words[o]=67108863&e;for(;0!==a&&o<n.length;o++)e=(0|n.words[o])+a,a=e>>26,this.words[o]=67108863&e;if(0===a&&o<n.length&&n!==this)for(;o<n.length;o++)this.words[o]=n.words[o];return this.length=Math.max(this.length,o),n!==this&&(this.negative=1),this.strip()},a.prototype.sub=function(t){return this.clone().isub(t)};var k=function(t,e,r){var n,i,a,o=t.words,s=e.words,l=r.words,u=0,c=0|o[0],h=8191&c,f=c>>>13,d=0|o[1],p=8191&d,m=d>>>13,v=0|o[2],g=8191&v,y=v>>>13,b=0|o[3],x=8191&b,_=b>>>13,w=0|o[4],M=8191&w,k=w>>>13,A=0|o[5],T=8191&A,S=A>>>13,E=0|o[6],L=8191&E,C=E>>>13,z=0|o[7],D=8191&z,I=z>>>13,P=0|o[8],O=8191&P,j=P>>>13,F=0|o[9],R=8191&F,N=F>>>13,B=0|s[0],U=8191&B,V=B>>>13,q=0|s[1],H=8191&q,G=q>>>13,Y=0|s[2],X=8191&Y,W=Y>>>13,Z=0|s[3],J=8191&Z,K=Z>>>13,Q=0|s[4],$=8191&Q,tt=Q>>>13,et=0|s[5],rt=8191&et,nt=et>>>13,it=0|s[6],at=8191&it,ot=it>>>13,st=0|s[7],lt=8191&st,ut=st>>>13,ct=0|s[8],ht=8191&ct,ft=ct>>>13,dt=0|s[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19,n=Math.imul(h,U),i=Math.imul(h,V),i=i+Math.imul(f,U)|0,a=Math.imul(f,V);var vt=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(p,U),i=Math.imul(p,V),i=i+Math.imul(m,U)|0,a=Math.imul(m,V),n=n+Math.imul(h,H)|0,i=i+Math.imul(h,G)|0,i=i+Math.imul(f,H)|0,a=a+Math.imul(f,G)|0;var gt=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(g,U),i=Math.imul(g,V),i=i+Math.imul(y,U)|0,a=Math.imul(y,V),n=n+Math.imul(p,H)|0,i=i+Math.imul(p,G)|0,i=i+Math.imul(m,H)|0,a=a+Math.imul(m,G)|0,n=n+Math.imul(h,X)|0,i=i+Math.imul(h,W)|0,i=i+Math.imul(f,X)|0,a=a+Math.imul(f,W)|0;var yt=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(x,U),i=Math.imul(x,V),i=i+Math.imul(_,U)|0,a=Math.imul(_,V),n=n+Math.imul(g,H)|0,i=i+Math.imul(g,G)|0,i=i+Math.imul(y,H)|0,a=a+Math.imul(y,G)|0,n=n+Math.imul(p,X)|0,i=i+Math.imul(p,W)|0,i=i+Math.imul(m,X)|0,a=a+Math.imul(m,W)|0,n=n+Math.imul(h,J)|0,i=i+Math.imul(h,K)|0,i=i+Math.imul(f,J)|0,a=a+Math.imul(f,K)|0;var bt=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(M,U),i=Math.imul(M,V),i=i+Math.imul(k,U)|0,a=Math.imul(k,V),n=n+Math.imul(x,H)|0,i=i+Math.imul(x,G)|0,i=i+Math.imul(_,H)|0,a=a+Math.imul(_,G)|0,n=n+Math.imul(g,X)|0,i=i+Math.imul(g,W)|0,i=i+Math.imul(y,X)|0,a=a+Math.imul(y,W)|0,n=n+Math.imul(p,J)|0,i=i+Math.imul(p,K)|0,i=i+Math.imul(m,J)|0,a=a+Math.imul(m,K)|0,n=n+Math.imul(h,$)|0,i=i+Math.imul(h,tt)|0,i=i+Math.imul(f,$)|0,a=a+Math.imul(f,tt)|0;var xt=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(T,U),i=Math.imul(T,V),i=i+Math.imul(S,U)|0,a=Math.imul(S,V),n=n+Math.imul(M,H)|0,i=i+Math.imul(M,G)|0,i=i+Math.imul(k,H)|0,a=a+Math.imul(k,G)|0,n=n+Math.imul(x,X)|0,i=i+Math.imul(x,W)|0,i=i+Math.imul(_,X)|0,a=a+Math.imul(_,W)|0,n=n+Math.imul(g,J)|0,i=i+Math.imul(g,K)|0,i=i+Math.imul(y,J)|0,a=a+Math.imul(y,K)|0,n=n+Math.imul(p,$)|0,i=i+Math.imul(p,tt)|0,i=i+Math.imul(m,$)|0,a=a+Math.imul(m,tt)|0,n=n+Math.imul(h,rt)|0,i=i+Math.imul(h,nt)|0,i=i+Math.imul(f,rt)|0,a=a+Math.imul(f,nt)|0;var _t=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(L,U),i=Math.imul(L,V),i=i+Math.imul(C,U)|0,a=Math.imul(C,V),n=n+Math.imul(T,H)|0,i=i+Math.imul(T,G)|0,i=i+Math.imul(S,H)|0,a=a+Math.imul(S,G)|0,n=n+Math.imul(M,X)|0,i=i+Math.imul(M,W)|0,i=i+Math.imul(k,X)|0,a=a+Math.imul(k,W)|0,n=n+Math.imul(x,J)|0,i=i+Math.imul(x,K)|0,i=i+Math.imul(_,J)|0,a=a+Math.imul(_,K)|0,n=n+Math.imul(g,$)|0,i=i+Math.imul(g,tt)|0,i=i+Math.imul(y,$)|0,a=a+Math.imul(y,tt)|0,n=n+Math.imul(p,rt)|0,i=i+Math.imul(p,nt)|0,i=i+Math.imul(m,rt)|0,a=a+Math.imul(m,nt)|0,n=n+Math.imul(h,at)|0,i=i+Math.imul(h,ot)|0,i=i+Math.imul(f,at)|0,a=a+Math.imul(f,ot)|0;var wt=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(D,U),i=Math.imul(D,V),i=i+Math.imul(I,U)|0,a=Math.imul(I,V),n=n+Math.imul(L,H)|0,i=i+Math.imul(L,G)|0,i=i+Math.imul(C,H)|0,a=a+Math.imul(C,G)|0,n=n+Math.imul(T,X)|0,i=i+Math.imul(T,W)|0,i=i+Math.imul(S,X)|0,a=a+Math.imul(S,W)|0,n=n+Math.imul(M,J)|0,i=i+Math.imul(M,K)|0,i=i+Math.imul(k,J)|0,a=a+Math.imul(k,K)|0,n=n+Math.imul(x,$)|0,i=i+Math.imul(x,tt)|0,i=i+Math.imul(_,$)|0,a=a+Math.imul(_,tt)|0,n=n+Math.imul(g,rt)|0,i=i+Math.imul(g,nt)|0,i=i+Math.imul(y,rt)|0,a=a+Math.imul(y,nt)|0,n=n+Math.imul(p,at)|0,i=i+Math.imul(p,ot)|0,i=i+Math.imul(m,at)|0,a=a+Math.imul(m,ot)|0,n=n+Math.imul(h,lt)|0,i=i+Math.imul(h,ut)|0,i=i+Math.imul(f,lt)|0,a=a+Math.imul(f,ut)|0;var Mt=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(O,U),i=Math.imul(O,V),i=i+Math.imul(j,U)|0,a=Math.imul(j,V),n=n+Math.imul(D,H)|0,i=i+Math.imul(D,G)|0,i=i+Math.imul(I,H)|0,a=a+Math.imul(I,G)|0,n=n+Math.imul(L,X)|0,i=i+Math.imul(L,W)|0,i=i+Math.imul(C,X)|0,a=a+Math.imul(C,W)|0,n=n+Math.imul(T,J)|0,i=i+Math.imul(T,K)|0,i=i+Math.imul(S,J)|0,a=a+Math.imul(S,K)|0,n=n+Math.imul(M,$)|0,i=i+Math.imul(M,tt)|0,i=i+Math.imul(k,$)|0,a=a+Math.imul(k,tt)|0,n=n+Math.imul(x,rt)|0,i=i+Math.imul(x,nt)|0,i=i+Math.imul(_,rt)|0,a=a+Math.imul(_,nt)|0,n=n+Math.imul(g,at)|0,i=i+Math.imul(g,ot)|0,i=i+Math.imul(y,at)|0,a=a+Math.imul(y,ot)|0,n=n+Math.imul(p,lt)|0,i=i+Math.imul(p,ut)|0,i=i+Math.imul(m,lt)|0,a=a+Math.imul(m,ut)|0,n=n+Math.imul(h,ht)|0,i=i+Math.imul(h,ft)|0,i=i+Math.imul(f,ht)|0,a=a+Math.imul(f,ft)|0;var kt=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(R,U),i=Math.imul(R,V),i=i+Math.imul(N,U)|0,a=Math.imul(N,V),n=n+Math.imul(O,H)|0,i=i+Math.imul(O,G)|0,i=i+Math.imul(j,H)|0,a=a+Math.imul(j,G)|0,n=n+Math.imul(D,X)|0,i=i+Math.imul(D,W)|0,i=i+Math.imul(I,X)|0,a=a+Math.imul(I,W)|0,n=n+Math.imul(L,J)|0,i=i+Math.imul(L,K)|0,i=i+Math.imul(C,J)|0,a=a+Math.imul(C,K)|0,n=n+Math.imul(T,$)|0,i=i+Math.imul(T,tt)|0,i=i+Math.imul(S,$)|0,a=a+Math.imul(S,tt)|0,n=n+Math.imul(M,rt)|0,i=i+Math.imul(M,nt)|0,i=i+Math.imul(k,rt)|0,a=a+Math.imul(k,nt)|0,n=n+Math.imul(x,at)|0,i=i+Math.imul(x,ot)|0,i=i+Math.imul(_,at)|0,a=a+Math.imul(_,ot)|0,n=n+Math.imul(g,lt)|0,i=i+Math.imul(g,ut)|0,i=i+Math.imul(y,lt)|0,a=a+Math.imul(y,ut)|0,n=n+Math.imul(p,ht)|0,i=i+Math.imul(p,ft)|0,i=i+Math.imul(m,ht)|0,a=a+Math.imul(m,ft)|0,n=n+Math.imul(h,pt)|0,i=i+Math.imul(h,mt)|0,i=i+Math.imul(f,pt)|0,a=a+Math.imul(f,mt)|0;var At=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(R,H),i=Math.imul(R,G),i=i+Math.imul(N,H)|0,a=Math.imul(N,G),n=n+Math.imul(O,X)|0,i=i+Math.imul(O,W)|0,i=i+Math.imul(j,X)|0,a=a+Math.imul(j,W)|0,n=n+Math.imul(D,J)|0,i=i+Math.imul(D,K)|0,i=i+Math.imul(I,J)|0,a=a+Math.imul(I,K)|0,n=n+Math.imul(L,$)|0,i=i+Math.imul(L,tt)|0,i=i+Math.imul(C,$)|0,a=a+Math.imul(C,tt)|0,n=n+Math.imul(T,rt)|0,i=i+Math.imul(T,nt)|0,i=i+Math.imul(S,rt)|0,a=a+Math.imul(S,nt)|0,n=n+Math.imul(M,at)|0,i=i+Math.imul(M,ot)|0,i=i+Math.imul(k,at)|0,a=a+Math.imul(k,ot)|0,n=n+Math.imul(x,lt)|0,i=i+Math.imul(x,ut)|0,i=i+Math.imul(_,lt)|0,a=a+Math.imul(_,ut)|0,n=n+Math.imul(g,ht)|0,i=i+Math.imul(g,ft)|0,i=i+Math.imul(y,ht)|0,a=a+Math.imul(y,ft)|0,n=n+Math.imul(p,pt)|0,i=i+Math.imul(p,mt)|0,i=i+Math.imul(m,pt)|0,a=a+Math.imul(m,mt)|0;var Tt=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(R,X),i=Math.imul(R,W),i=i+Math.imul(N,X)|0,a=Math.imul(N,W),n=n+Math.imul(O,J)|0,i=i+Math.imul(O,K)|0,i=i+Math.imul(j,J)|0,a=a+Math.imul(j,K)|0,n=n+Math.imul(D,$)|0,i=i+Math.imul(D,tt)|0,i=i+Math.imul(I,$)|0,a=a+Math.imul(I,tt)|0,n=n+Math.imul(L,rt)|0,i=i+Math.imul(L,nt)|0,i=i+Math.imul(C,rt)|0,a=a+Math.imul(C,nt)|0,n=n+Math.imul(T,at)|0,i=i+Math.imul(T,ot)|0,i=i+Math.imul(S,at)|0,a=a+Math.imul(S,ot)|0,n=n+Math.imul(M,lt)|0,i=i+Math.imul(M,ut)|0,i=i+Math.imul(k,lt)|0,a=a+Math.imul(k,ut)|0,n=n+Math.imul(x,ht)|0,i=i+Math.imul(x,ft)|0,i=i+Math.imul(_,ht)|0,a=a+Math.imul(_,ft)|0,n=n+Math.imul(g,pt)|0,i=i+Math.imul(g,mt)|0,i=i+Math.imul(y,pt)|0,a=a+Math.imul(y,mt)|0;var St=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(R,J),i=Math.imul(R,K),i=i+Math.imul(N,J)|0,a=Math.imul(N,K),n=n+Math.imul(O,$)|0,i=i+Math.imul(O,tt)|0,i=i+Math.imul(j,$)|0,a=a+Math.imul(j,tt)|0,n=n+Math.imul(D,rt)|0,i=i+Math.imul(D,nt)|0,i=i+Math.imul(I,rt)|0,a=a+Math.imul(I,nt)|0,n=n+Math.imul(L,at)|0,i=i+Math.imul(L,ot)|0,i=i+Math.imul(C,at)|0,a=a+Math.imul(C,ot)|0,n=n+Math.imul(T,lt)|0,i=i+Math.imul(T,ut)|0,i=i+Math.imul(S,lt)|0,a=a+Math.imul(S,ut)|0,n=n+Math.imul(M,ht)|0,i=i+Math.imul(M,ft)|0,i=i+Math.imul(k,ht)|0,a=a+Math.imul(k,ft)|0,n=n+Math.imul(x,pt)|0,i=i+Math.imul(x,mt)|0,i=i+Math.imul(_,pt)|0,a=a+Math.imul(_,mt)|0;var Et=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(R,$),i=Math.imul(R,tt),i=i+Math.imul(N,$)|0,a=Math.imul(N,tt),n=n+Math.imul(O,rt)|0,i=i+Math.imul(O,nt)|0,i=i+Math.imul(j,rt)|0,a=a+Math.imul(j,nt)|0,n=n+Math.imul(D,at)|0,i=i+Math.imul(D,ot)|0,i=i+Math.imul(I,at)|0,a=a+Math.imul(I,ot)|0,n=n+Math.imul(L,lt)|0,i=i+Math.imul(L,ut)|0,i=i+Math.imul(C,lt)|0,a=a+Math.imul(C,ut)|0,n=n+Math.imul(T,ht)|0,i=i+Math.imul(T,ft)|0,i=i+Math.imul(S,ht)|0,a=a+Math.imul(S,ft)|0,n=n+Math.imul(M,pt)|0,i=i+Math.imul(M,mt)|0,i=i+Math.imul(k,pt)|0,a=a+Math.imul(k,mt)|0;var Lt=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,n=Math.imul(R,rt),i=Math.imul(R,nt),i=i+Math.imul(N,rt)|0,a=Math.imul(N,nt),n=n+Math.imul(O,at)|0,i=i+Math.imul(O,ot)|0,i=i+Math.imul(j,at)|0,a=a+Math.imul(j,ot)|0,n=n+Math.imul(D,lt)|0,i=i+Math.imul(D,ut)|0,i=i+Math.imul(I,lt)|0,a=a+Math.imul(I,ut)|0,n=n+Math.imul(L,ht)|0,i=i+Math.imul(L,ft)|0,i=i+Math.imul(C,ht)|0,a=a+Math.imul(C,ft)|0,n=n+Math.imul(T,pt)|0,i=i+Math.imul(T,mt)|0,i=i+Math.imul(S,pt)|0,a=a+Math.imul(S,mt)|0;var Ct=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(R,at),i=Math.imul(R,ot),i=i+Math.imul(N,at)|0,a=Math.imul(N,ot),n=n+Math.imul(O,lt)|0,i=i+Math.imul(O,ut)|0,i=i+Math.imul(j,lt)|0,a=a+Math.imul(j,ut)|0,n=n+Math.imul(D,ht)|0,i=i+Math.imul(D,ft)|0,i=i+Math.imul(I,ht)|0,a=a+Math.imul(I,ft)|0,n=n+Math.imul(L,pt)|0,i=i+Math.imul(L,mt)|0,i=i+Math.imul(C,pt)|0,a=a+Math.imul(C,mt)|0;var zt=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(zt>>>26)|0,zt&=67108863,n=Math.imul(R,lt),i=Math.imul(R,ut),i=i+Math.imul(N,lt)|0,a=Math.imul(N,ut),n=n+Math.imul(O,ht)|0,i=i+Math.imul(O,ft)|0,i=i+Math.imul(j,ht)|0,a=a+Math.imul(j,ft)|0,n=n+Math.imul(D,pt)|0,i=i+Math.imul(D,mt)|0,i=i+Math.imul(I,pt)|0,a=a+Math.imul(I,mt)|0;var Dt=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,n=Math.imul(R,ht),i=Math.imul(R,ft),i=i+Math.imul(N,ht)|0,a=Math.imul(N,ft),
9 n=n+Math.imul(O,pt)|0,i=i+Math.imul(O,mt)|0,i=i+Math.imul(j,pt)|0,a=a+Math.imul(j,mt)|0;var It=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(R,pt),i=Math.imul(R,mt),i=i+Math.imul(N,pt)|0,a=Math.imul(N,mt);var Pt=(u+n|0)+((8191&i)<<13)|0;return u=(a+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,l[0]=vt,l[1]=gt,l[2]=yt,l[3]=bt,l[4]=xt,l[5]=_t,l[6]=wt,l[7]=Mt,l[8]=kt,l[9]=At,l[10]=Tt,l[11]=St,l[12]=Et,l[13]=Lt,l[14]=Ct,l[15]=zt,l[16]=Dt,l[17]=It,l[18]=Pt,0!==u&&(l[19]=u,r.length++),r};Math.imul||(k=u),a.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?k(this,t,e):r<63?u(this,t,e):r<1024?c(this,t,e):h(this,t,e)},f.prototype.makeRBT=function(t){for(var e=new Array(t),r=a.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,r,t);return e},f.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,i=0;i<e;i++)n|=(1&t)<<e-i-1,t>>=1;return n},f.prototype.permute=function(t,e,r,n,i,a){for(var o=0;o<a;o++)n[o]=e[t[o]],i[o]=r[t[o]]},f.prototype.transform=function(t,e,r,n,i,a){this.permute(a,t,e,r,n,i);for(var o=1;o<i;o<<=1)for(var s=o<<1,l=Math.cos(2*Math.PI/s),u=Math.sin(2*Math.PI/s),c=0;c<i;c+=s)for(var h=l,f=u,d=0;d<o;d++){var p=r[c+d],m=n[c+d],v=r[c+d+o],g=n[c+d+o],y=h*v-f*g;g=h*g+f*v,v=y,r[c+d]=p+v,n[c+d]=m+g,r[c+d+o]=p-v,n[c+d+o]=m-g,d!==s&&(y=l*h-u*f,f=l*f+u*h,h=y)}},f.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},f.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=t[n];t[n]=t[r-n-1],t[r-n-1]=i,i=e[n],e[n]=-e[r-n-1],e[r-n-1]=-i}},f.prototype.normalize13b=function(t,e){for(var r=0,n=0;n<e/2;n++){var i=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=67108863&i,r=i<67108864?0:i/67108864|0}return t},f.prototype.convert13b=function(t,e,r,i){for(var a=0,o=0;o<e;o++)a+=0|t[o],r[2*o]=8191&a,a>>>=13,r[2*o+1]=8191&a,a>>>=13;for(o=2*e;o<i;++o)r[o]=0;n(0===a),n(0==(a&-8192))},f.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},f.prototype.mulp=function(t,e,r){var n=2*this.guessLen13b(t.length,e.length),i=this.makeRBT(n),a=this.stub(n),o=new Array(n),s=new Array(n),l=new Array(n),u=new Array(n),c=new Array(n),h=new Array(n),f=r.words;f.length=n,this.convert13b(t.words,t.length,o,n),this.convert13b(e.words,e.length,u,n),this.transform(o,a,s,l,n,i),this.transform(u,a,c,h,n,i);for(var d=0;d<n;d++){var p=s[d]*c[d]-l[d]*h[d];l[d]=s[d]*h[d]+l[d]*c[d],s[d]=p}return this.conjugate(s,l,n),this.transform(s,l,f,a,n,i),this.conjugate(f,a,n),this.normalize13b(f,n),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},a.prototype.mul=function(t){var e=new a(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},a.prototype.mulf=function(t){var e=new a(null);return e.words=new Array(this.length+t.length),h(this,t,e)},a.prototype.imul=function(t){return this.clone().mulTo(t,this)},a.prototype.imuln=function(t){n("number"==typeof t),n(t<67108864);for(var e=0,r=0;r<this.length;r++){var i=(0|this.words[r])*t,a=(67108863&i)+(67108863&e);e>>=26,e+=i/67108864|0,e+=a>>>26,this.words[r]=67108863&a}return 0!==e&&(this.words[r]=e,this.length++),this},a.prototype.muln=function(t){return this.clone().imuln(t)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(t){var e=l(t);if(0===e.length)return new a(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var i=r.sqr();n<e.length;n++,i=i.sqr())0!==e[n]&&(r=r.mul(i));return r},a.prototype.iushln=function(t){n("number"==typeof t&&t>=0);var e,r=t%26,i=(t-r)/26,a=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(e=0;e<this.length;e++){var s=this.words[e]&a,l=(0|this.words[e])-s<<r;this.words[e]=l|o,o=s>>>26-r}o&&(this.words[e]=o,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e<i;e++)this.words[e]=0;this.length+=i}return this.strip()},a.prototype.ishln=function(t){return n(0===this.negative),this.iushln(t)},a.prototype.iushrn=function(t,e,r){n("number"==typeof t&&t>=0);var i;i=e?(e-e%26)/26:0;var a=t%26,o=Math.min((t-a)/26,this.length),s=67108863^67108863>>>a<<a,l=r;if(i-=o,i=Math.max(0,i),l){for(var u=0;u<o;u++)l.words[u]=this.words[u];l.length=o}if(0===o);else if(this.length>o)for(this.length-=o,u=0;u<this.length;u++)this.words[u]=this.words[u+o];else this.words[0]=0,this.length=1;var c=0;for(u=this.length-1;u>=0&&(0!==c||u>=i);u--){var h=0|this.words[u];this.words[u]=c<<26-a|h>>>a,c=h&s}return l&&0!==c&&(l.words[l.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},a.prototype.shln=function(t){return this.clone().ishln(t)},a.prototype.ushln=function(t){return this.clone().iushln(t)},a.prototype.shrn=function(t){return this.clone().ishrn(t)},a.prototype.ushrn=function(t){return this.clone().iushrn(t)},a.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<<e;return!(this.length<=r)&&!!(this.words[r]&i)},a.prototype.imaskn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<<e;this.words[this.length-1]&=i}return this.strip()},a.prototype.maskn=function(t){return this.clone().imaskn(t)},a.prototype.iaddn=function(t){return n("number"==typeof t),n(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},a.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},a.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},a.prototype.addn=function(t){return this.clone().iaddn(t)},a.prototype.subn=function(t){return this.clone().isubn(t)},a.prototype.iabs=function(){return this.negative=0,this},a.prototype.abs=function(){return this.clone().iabs()},a.prototype._ishlnsubmul=function(t,e,r){var i,a=t.length+r;this._expand(a);var o,s=0;for(i=0;i<t.length;i++){o=(0|this.words[i+r])+s;var l=(0|t.words[i])*e;o-=67108863&l,s=(o>>26)-(l/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)o=(0|this.words[i+r])+s,s=o>>26,this.words[i+r]=67108863&o;if(0===s)return this.strip();for(n(s===-1),s=0,i=0;i<this.length;i++)o=-(0|this.words[i])+s,s=o>>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},a.prototype._wordDiv=function(t,e){var r=this.length-t.length,n=this.clone(),i=t,o=0|i.words[i.length-1];0!==(r=26-this._countBits(o))&&(i=i.ushln(r),n.iushln(r),o=0|i.words[i.length-1]);var s,l=n.length-i.length;if("mod"!==e){s=new a(null),s.length=l+1,s.words=new Array(s.length);for(var u=0;u<s.length;u++)s.words[u]=0}var c=n.clone()._ishlnsubmul(i,1,l);0===c.negative&&(n=c,s&&(s.words[l]=1));for(var h=l-1;h>=0;h--){var f=67108864*(0|n.words[i.length+h])+(0|n.words[i.length+h-1]);for(f=Math.min(f/o|0,67108863),n._ishlnsubmul(i,f,h);0!==n.negative;)f--,n.negative=0,n._ishlnsubmul(i,1,h),n.isZero()||(n.negative^=1);s&&(s.words[h]=f)}return s&&s.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},a.prototype.divmod=function(t,e,r){if(n(!t.isZero()),this.isZero())return{div:new a(0),mod:new a(0)};var i,o,s;return 0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(i=s.div.neg()),"div"!==e&&(o=s.mod.neg(),r&&0!==o.negative&&o.iadd(t)),{div:i,mod:o}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(i=s.div.neg()),{div:i,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(o=s.mod.neg(),r&&0!==o.negative&&o.isub(t)),{div:s.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new a(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new a(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new a(this.modn(t.words[0]))}:this._wordDiv(t,e)},a.prototype.div=function(t){return this.divmod(t,"div",!1).div},a.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},a.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},a.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),a=r.cmp(n);return a<0||1===i&&0===a?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},a.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},a.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},a.prototype.divn=function(t){return this.clone().idivn(t)},a.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new a(1),o=new a(0),s=new a(0),l=new a(1),u=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++u;for(var c=r.clone(),h=e.clone();!e.isZero();){for(var f=0,d=1;0==(e.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(e.iushrn(f);f-- >0;)(i.isOdd()||o.isOdd())&&(i.iadd(c),o.isub(h)),i.iushrn(1),o.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||l.isOdd())&&(s.iadd(c),l.isub(h)),s.iushrn(1),l.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(s),o.isub(l)):(r.isub(e),s.isub(i),l.isub(o))}return{a:s,b:l,gcd:r.iushln(u)}},a.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new a(1),o=new a(0),s=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var l=0,u=1;0==(e.words[0]&u)&&l<26;++l,u<<=1);if(l>0)for(e.iushrn(l);l-- >0;)i.isOdd()&&i.iadd(s),i.iushrn(1);for(var c=0,h=1;0==(r.words[0]&h)&&c<26;++c,h<<=1);if(c>0)for(r.iushrn(c);c-- >0;)o.isOdd()&&o.iadd(s),o.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(o)):(r.isub(e),o.isub(i))}var f;return f=0===e.cmpn(1)?i:o,f.cmpn(0)<0&&f.iadd(t),f},a.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var a=e;e=r,r=a}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},a.prototype.invm=function(t){return this.egcd(t).a.umod(t)},a.prototype.isEven=function(){return 0==(1&this.words[0])},a.prototype.isOdd=function(){return 1==(1&this.words[0])},a.prototype.andln=function(t){return this.words[0]&t},a.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var a=i,o=r;0!==a&&o<this.length;o++){var s=0|this.words[o];s+=a,a=s>>>26,s&=67108863,this.words[o]=s}return 0!==a&&(this.words[o]=a,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(t){var e=t<0;if(0!==this.negative&&!e)return-1;if(0===this.negative&&e)return 1;this.strip();var r;if(this.length>1)r=1;else{e&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];r=i===t?0:i<t?-1:1}return 0!==this.negative?0|-r:r},a.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},a.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){n<i?e=-1:n>i&&(e=1);break}}return e},a.prototype.gtn=function(t){return 1===this.cmpn(t)},a.prototype.gt=function(t){return 1===this.cmp(t)},a.prototype.gten=function(t){return this.cmpn(t)>=0},a.prototype.gte=function(t){return this.cmp(t)>=0},a.prototype.ltn=function(t){return this.cmpn(t)===-1},a.prototype.lt=function(t){return this.cmp(t)===-1},a.prototype.lten=function(t){return this.cmpn(t)<=0},a.prototype.lte=function(t){return this.cmp(t)<=0},a.prototype.eqn=function(t){return 0===this.cmpn(t)},a.prototype.eq=function(t){return 0===this.cmp(t)},a.red=function(t){return new y(t)},a.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},a.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(t){return this.red=t,this},a.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},a.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},a.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},a.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},a.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},a.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},a.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},a.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},a.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var A={k256:null,p224:null,p192:null,p25519:null};d.prototype._tmp=function(){var t=new a(null);return t.words=new Array(Math.ceil(this.n/13)),t},d.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),e=r.bitLength()}while(e>this.n);var n=e<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):r.strip(),r},d.prototype.split=function(t,e){t.iushrn(this.n,0,e)},d.prototype.imulK=function(t){return t.imul(this.k)},i(p,d),p.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n<r;n++)e.words[n]=t.words[n];if(e.length=r,t.length<=9)return t.words[0]=0,void(t.length=1);var i=t.words[9];for(e.words[e.length++]=4194303&i,n=10;n<t.length;n++){var a=0|t.words[n];t.words[n-10]=(4194303&a)<<4|i>>>22,i=a}i>>>=22,t.words[n-10]=i,0===i&&t.length>10?t.length-=10:t.length-=9},p.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var n=0|t.words[r];e+=977*n,t.words[r]=67108863&e,e=64*n+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(m,d),i(v,d),i(g,d),g.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*(0|t.words[r])+e,i=67108863&n;n>>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},a._prime=function(t){if(A[t])return A[t];var e;if("k256"===t)e=new p;else if("p224"===t)e=new m;else if("p192"===t)e=new v;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new g}return A[t]=e,e},y.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},y.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},y.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},y.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},y.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},y.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},y.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},y.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},y.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},y.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},y.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},y.prototype.isqr=function(t){return this.imul(t,t.clone())},y.prototype.sqr=function(t){return this.mul(t,t)},y.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new a(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),o=0;!i.isZero()&&0===i.andln(1);)o++,i.iushrn(1);n(!i.isZero());var s=new a(1).toRed(this),l=s.redNeg(),u=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new a(2*c*c).toRed(this);0!==this.pow(c,u).cmp(l);)c.redIAdd(l);for(var h=this.pow(c,i),f=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=o;0!==d.cmp(s);){for(var m=d,v=0;0!==m.cmp(s);v++)m=m.redSqr();n(v<p);var g=this.pow(h,new a(1).iushln(p-v-1));f=f.redMul(g),h=g.redSqr(),d=d.redMul(h),p=v}return f},y.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},y.prototype.pow=function(t,e){if(e.isZero())return new a(1);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new a(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var i=r[0],o=0,s=0,l=e.bitLength()%26;for(0===l&&(l=26),n=e.length-1;n>=0;n--){for(var u=e.words[n],c=l-1;c>=0;c--){var h=u>>c&1;i!==r[0]&&(i=this.sqr(i)),0!==h||0!==o?(o<<=1,o|=h,(4===++s||0===n&&0===c)&&(i=this.mul(i,r[o]),s=0,o=0)):s=0}l=26}return i},y.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},y.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},a.mont=function(t){return new b(t)},i(b,y),b.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},b.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},b.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},b.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new a(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},b.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e,this)},{}],65:[function(t,e,r){"use strict";function n(t){var e,r,n,i=t.length,a=0;for(e=0;e<i;++e)a+=t[e].length;var o=new Array(a),s=0;for(e=0;e<i;++e){var l=t[e],u=l.length;for(r=0;r<u;++r){var c=o[s++]=new Array(u-1),h=0;for(n=0;n<u;++n)n!==r&&(c[h++]=l[n]);if(1&r){var f=c[1];c[1]=c[0],c[0]=f}}}return o}e.exports=n},{}],66:[function(t,e,r){"use strict";function n(t,e){for(var r=0;r<t;++r)if(!(e[r]<=e[r+t]))return!0;return!1}function i(t,e,r,i){for(var a=0,o=0,s=0,l=t.length;s<l;++s){var u=t[s];if(!n(e,u)){for(var c=0;c<2*e;++c)r[a++]=u[c];i[o++]=s}}return o}function a(t,e,r,n){var a=t.length,o=e.length;if(!(a<=0||o<=0)){var s=t[0].length>>>1;if(!(s<=0)){var l,u=h.mallocDouble(2*s*a),c=h.mallocInt32(a);if((a=i(t,s,u,c))>0){if(1===s&&n)f.init(a),l=f.sweepComplete(s,r,0,a,u,c,0,a,u,c);else{var p=h.mallocDouble(2*s*o),m=h.mallocInt32(o);o=i(e,s,p,m),o>0&&(f.init(a+o),l=1===s?f.sweepBipartite(s,r,0,a,u,c,0,o,p,m):d(s,r,n,a,u,c,o,p,m),h.free(p),h.free(m))}h.free(u),h.free(c)}return l}}}function o(t,e){c.push([t,e])}function s(t){return c=[],a(t,t,o,!0),c}function l(t,e){return c=[],a(t,e,o,!1),c}function u(t,e,r){switch(arguments.length){case 1:return s(t);case 2:return"function"==typeof e?a(t,t,e,!0):l(t,e);case 3:return a(t,e,r,!1);default:throw new Error("box-intersect: Invalid arguments")}}e.exports=u;var c,h=t("typedarray-pool"),f=t("./lib/sweep"),d=t("./lib/intersect")},{"./lib/intersect":68,"./lib/sweep":72,"typedarray-pool":533}],67:[function(t,e,r){"use strict";function n(t,e,r){var n="bruteForce"+(t?"Red":"Blue")+(e?"Flip":"")+(r?"Full":""),i=["function ",n,"(",w.join(),"){","var ",u,"=2*",a,";"],l="for(var i="+c+","+p+"="+u+"*"+c+";i<"+h+";++i,"+p+"+="+u+"){var x0="+f+"["+o+"+"+p+"],x1="+f+"["+o+"+"+p+"+"+a+"],xi="+d+"[i];",M="for(var j="+m+","+b+"="+u+"*"+m+";j<"+v+";++j,"+b+"+="+u+"){var y0="+g+"["+o+"+"+b+"],"+(r?"y1="+g+"["+o+"+"+b+"+"+a+"],":"")+"yi="+y+"[j];";return t?i.push(l,_,":",M):i.push(M,_,":",l),r?i.push("if(y1<x0||x1<y0)continue;"):e?i.push("if(y0<=x0||x1<y0)continue;"):i.push("if(y0<x0||x1<y0)continue;"),i.push("for(var k="+o+"+1;k<"+a+";++k){var r0="+f+"[k+"+p+"],r1="+f+"[k+"+a+"+"+p+"],b0="+g+"[k+"+b+"],b1="+g+"[k+"+a+"+"+b+"];if(r1<b0||b1<r0)continue "+_+";}var "+x+"="+s+"("),e?i.push("yi,xi"):i.push("xi,yi"),i.push(");if("+x+"!==void 0)return "+x+";}}}"),{name:n,code:i.join("")}}function i(t){function e(e,r){var a=n(e,r,t);i.push(a.code),o.push("return "+a.name+"("+w.join()+");")}var r="bruteForce"+(t?"Full":"Partial"),i=[],a=w.slice();t||a.splice(3,0,l);var o=["function "+r+"("+a.join()+"){"];o.push("if("+h+"-"+c+">"+v+"-"+m+"){"),t?(e(!0,!1),o.push("}else{"),e(!1,!1)):(o.push("if("+l+"){"),e(!0,!0),o.push("}else{"),e(!0,!1),o.push("}}else{if("+l+"){"),e(!1,!0),o.push("}else{"),e(!1,!1),o.push("}")),o.push("}}return "+r);var s=i.join("")+o.join("");return new Function(s)()}var a="d",o="ax",s="vv",l="fp",u="es",c="rs",h="re",f="rb",d="ri",p="rp",m="bs",v="be",g="bb",y="bi",b="bp",x="rv",_="Q",w=[a,o,s,c,h,f,d,m,v,g,y];r.partial=i(!1),r.full=i(!0)},{}],68:[function(t,e,r){"use strict";function n(t,e){var r=8*u.log2(e+1)*(t+1)|0,n=u.nextPow2(A*r);S.length<n&&(l.free(S),S=l.mallocInt32(n));var i=u.nextPow2(T*r);E<i&&(l.free(E),E=l.mallocDouble(i))}function i(t,e,r,n,i,a,o,s,l){var u=A*t;S[u]=e,S[u+1]=r,S[u+2]=n,S[u+3]=i,S[u+4]=a,S[u+5]=o;var c=T*t;E[c]=s,E[c+1]=l}function a(t,e,r,n,i,a,o,s,l,u,c){var h=2*t,f=l*h,d=u[f+e];t:for(var p=i,m=i*h;p<a;++p,m+=h){var v=o[m+e],g=o[m+e+t];if(!(d<v||g<d)&&(!n||d!==v)){for(var y=s[p],b=e+1;b<t;++b){var v=o[m+b],g=o[m+b+t],x=u[f+b],_=u[f+b+t];if(g<x||_<v)continue t}var w;if(void 0!==(w=n?r(c,y):r(y,c)))return w}}}function o(t,e,r,n,i,a,o,s,l,u){var c=2*t,h=s*c,f=l[h+e];t:for(var d=n,p=n*c;d<i;++d,p+=c){var m=o[d];if(m!==u){var v=a[p+e],g=a[p+e+t];if(!(f<v||g<f)){for(var y=e+1;y<t;++y){var v=a[p+y],g=a[p+y+t],b=l[h+y],x=l[h+y+t];if(g<b||x<v)continue t}var _=r(m,u);if(void 0!==_)return _}}}}function s(t,e,r,s,l,u,c,m,L){n(t,s+c);var C,z=0,D=2*t;for(i(z++,0,0,s,0,c,r?16:0,-1/0,1/0),r||i(z++,0,0,c,0,s,1,-1/0,1/0);z>0;){z-=1;var I=z*A,P=S[I],O=S[I+1],j=S[I+2],F=S[I+3],R=S[I+4],N=S[I+5],B=z*T,U=E[B],V=E[B+1],q=1&N,H=!!(16&N),G=l,Y=u,X=m,W=L;if(q&&(G=m,Y=L,X=l,W=u),!(2&N&&(j=_(t,P,O,j,G,Y,V),O>=j)||4&N&&(O=w(t,P,O,j,G,Y,U))>=j)){var Z=j-O,J=R-F;if(H){if(t*Z*(Z+J)<y){if(void 0!==(C=d.scanComplete(t,P,e,O,j,G,Y,F,R,X,W)))return C;continue}}else{if(t*Math.min(Z,J)<v){if(void 0!==(C=h(t,P,e,q,O,j,G,Y,F,R,X,W)))return C;continue}if(t*Z*J<g){if(void 0!==(C=d.scanBipartite(t,P,e,q,O,j,G,Y,F,R,X,W)))return C;continue}}var K=b(t,P,O,j,G,Y,U,V);if(O<K)if(t*(K-O)<v){if(void 0!==(C=f(t,P+1,e,O,K,G,Y,F,R,X,W)))return C}else if(P===t-2){if(void 0!==(C=q?d.sweepBipartite(t,e,F,R,X,W,O,K,G,Y):d.sweepBipartite(t,e,O,K,G,Y,F,R,X,W)))return C}else i(z++,P+1,O,K,F,R,q,-1/0,1/0),i(z++,P+1,F,R,O,K,1^q,-1/0,1/0);if(K<j){var Q=p(t,P,F,R,X,W),$=X[D*Q+P],tt=x(t,P,Q,R,X,W,$);if(tt<R&&i(z++,P,K,j,tt,R,(4|q)+(H?16:0),$,V),F<Q&&i(z++,P,K,j,F,Q,(2|q)+(H?16:0),U,$),Q+1===tt){if(void 0!==(C=H?o(t,P,e,K,j,G,Y,Q,X,W[Q]):a(t,P,e,q,K,j,G,Y,Q,X,W[Q])))return C}else if(Q<tt){var et;if(H){if(et=M(t,P,K,j,G,Y,$),K<et){var rt=x(t,P,K,et,G,Y,$);if(P===t-2){if(K<rt&&void 0!==(C=d.sweepComplete(t,e,K,rt,G,Y,Q,tt,X,W)))return C;if(rt<et&&void 0!==(C=d.sweepBipartite(t,e,rt,et,G,Y,Q,tt,X,W)))return C}else K<rt&&i(z++,P+1,K,rt,Q,tt,16,-1/0,1/0),rt<et&&(i(z++,P+1,rt,et,Q,tt,0,-1/0,1/0),i(z++,P+1,Q,tt,rt,et,1,-1/0,1/0))}}else et=q?k(t,P,K,j,G,Y,$):M(t,P,K,j,G,Y,$),K<et&&(P===t-2?C=q?d.sweepBipartite(t,e,Q,tt,X,W,K,et,G,Y):d.sweepBipartite(t,e,K,et,G,Y,Q,tt,X,W):(i(z++,P+1,K,et,Q,tt,q,-1/0,1/0),i(z++,P+1,Q,tt,K,et,1^q,-1/0,1/0)))}}}}}e.exports=s;var l=t("typedarray-pool"),u=t("bit-twiddle"),c=t("./brute"),h=c.partial,f=c.full,d=t("./sweep"),p=t("./median"),m=t("./partition"),v=128,g=1<<22,y=1<<22,b=m("!(lo>=p0)&&!(p1>=hi)",["p0","p1"]),x=m("lo===p0",["p0"]),_=m("lo<p0",["p0"]),w=m("hi<=p0",["p0"]),M=m("lo<=p0&&p0<=hi",["p0"]),k=m("lo<p0&&p0<=hi",["p0"]),A=6,T=2,S=l.mallocInt32(1024),E=l.mallocDouble(1024)},{"./brute":67,"./median":69,"./partition":70,"./sweep":72,"bit-twiddle":63,"typedarray-pool":533}],69:[function(t,e,r){"use strict";function n(t,e,r,n,i,a){for(var o=2*t,s=o*(r+1)+e,l=r+1;l<n;++l,s+=o)for(var u=i[s],c=l,h=o*(l-1);c>r&&i[h+e]>u;--c,h-=o){for(var f=h,d=h+o,p=0;p<o;++p,++f,++d){var m=i[f];i[f]=i[d],i[d]=m}var v=a[c];a[c]=a[c-1],a[c-1]=v}}function i(t,e,r,i,a,l){if(i<=r+1)return r;for(var u=r,c=i,h=i+r>>>1,f=2*t,d=h,p=a[f*h+e];u<c;){if(c-u<s){n(t,e,u,c,a,l),p=a[f*h+e];break}var m=c-u,v=Math.random()*m+u|0,g=a[f*v+e],y=Math.random()*m+u|0,b=a[f*y+e],x=Math.random()*m+u|0,_=a[f*x+e];g<=b?_>=b?(d=y,p=b):g>=_?(d=v,p=g):(d=x,p=_):b>=_?(d=y,p=b):_>=g?(d=v,p=g):(d=x,p=_);for(var w=f*(c-1),M=f*d,k=0;k<f;++k,++w,++M){var A=a[w];a[w]=a[M],a[M]=A}var T=l[c-1];l[c-1]=l[d],l[d]=T,d=o(t,e,u,c-1,a,l,p);for(var w=f*(c-1),M=f*d,k=0;k<f;++k,++w,++M){var A=a[w];a[w]=a[M],a[M]=A}var T=l[c-1];if(l[c-1]=l[d],l[d]=T,h<d){for(c=d-1;u<c&&a[f*(c-1)+e]===p;)c-=1;c+=1}else{if(!(d<h))break;for(u=d+1;u<c&&a[f*u+e]===p;)u+=1}}return o(t,e,r,h,a,l,a[f*h+e])}e.exports=i;var a=t("./partition"),o=a("lo<p0",["p0"]),s=8},{"./partition":70}],70:[function(t,e,r){"use strict";function n(t,e){var r="abcdef".split("").concat(e),n=[];return t.indexOf("lo")>=0&&n.push("lo=e[k+n]"),t.indexOf("hi")>=0&&n.push("hi=e[k+o]"),r.push(i.replace("_",n.join()).replace("$",t)),Function.apply(void 0,r)}e.exports=n;var i="for(var j=2*a,k=j*c,l=k,m=c,n=b,o=a+b,p=c;d>p;++p,k+=j){var _;if($)if(m===p)m+=1,l+=j;else{for(var s=0;j>s;++s){var t=e[k+s];e[k+s]=e[l],e[l++]=t}var u=f[p];f[p]=f[m],f[m++]=u}}return m"},{}],71:[function(t,e,r){"use strict";function n(t,e){e<=4*f?i(0,e-1,t):h(0,e-1,t)}function i(t,e,r){for(var n=2*(t+1),i=t+1;i<=e;++i){for(var a=r[n++],o=r[n++],s=i,l=n-2;s-- >t;){var u=r[l-2],c=r[l-1];if(u<a)break;if(u===a&&c<o)break;r[l]=u,r[l+1]=c,l-=2}r[l]=a,r[l+1]=o}}function a(t,e,r){t*=2,e*=2;var n=r[t],i=r[t+1];r[t]=r[e],r[t+1]=r[e+1],r[e]=n,r[e+1]=i}function o(t,e,r){t*=2,e*=2,r[t]=r[e],r[t+1]=r[e+1]}function s(t,e,r,n){t*=2,e*=2,r*=2;var i=n[t],a=n[t+1];n[t]=n[e],n[t+1]=n[e+1],n[e]=n[r],n[e+1]=n[r+1],n[r]=i,n[r+1]=a}function l(t,e,r,n,i){t*=2,e*=2,i[t]=i[e],i[e]=r,i[t+1]=i[e+1],i[e+1]=n}function u(t,e,r){t*=2,e*=2;var n=r[t],i=r[e];return!(n<i)&&(n!==i||r[t+1]>r[e+1])}function c(t,e,r,n){t*=2;var i=n[t];return i<e||i===e&&n[t+1]<r}function h(t,e,r){var n=(e-t+1)/6|0,d=t+n,p=e-n,m=t+e>>1,v=m-n,g=m+n,y=d,b=v,x=m,_=g,w=p,M=t+1,k=e-1,A=0;u(y,b,r)&&(A=y,y=b,b=A),u(_,w,r)&&(A=_,_=w,w=A),u(y,x,r)&&(A=y,y=x,x=A),u(b,x,r)&&(A=b,b=x,x=A),u(y,_,r)&&(A=y,y=_,_=A),u(x,_,r)&&(A=x,x=_,_=A),u(b,w,r)&&(A=b,b=w,w=A),u(b,x,r)&&(A=b,b=x,x=A),u(_,w,r)&&(A=_,_=w,w=A);for(var T=r[2*b],S=r[2*b+1],E=r[2*_],L=r[2*_+1],C=2*y,z=2*x,D=2*w,I=2*d,P=2*m,O=2*p,j=0;j<2;++j){var F=r[C+j],R=r[z+j],N=r[D+j];r[I+j]=F,r[P+j]=R,r[O+j]=N}o(v,t,r),o(g,e,r);for(var B=M;B<=k;++B)if(c(B,T,S,r))B!==M&&a(B,M,r),++M;else if(!c(B,E,L,r))for(;;){if(c(k,E,L,r)){c(k,T,S,r)?(s(B,M,k,r),++M,--k):(a(B,k,r),--k);break}if(--k<B)break}l(t,M-1,T,S,r),l(e,k+1,E,L,r),M-2-t<=f?i(t,M-2,r):h(t,M-2,r),e-(k+2)<=f?i(k+2,e,r):h(k+2,e,r),k-M<=f?i(M,k,r):h(M,k,r)}e.exports=n;var f=32},{}],72:[function(t,e,r){"use strict";function n(t){var e=h.nextPow2(t);p.length<e&&(c.free(p),p=c.mallocInt32(e)),m.length<e&&(c.free(m),m=c.mallocInt32(e)),v.length<e&&(c.free(v),v=c.mallocInt32(e)),g.length<e&&(c.free(g),g=c.mallocInt32(e)),y.length<e&&(c.free(y),y=c.mallocInt32(e)),b.length<e&&(c.free(b),b=c.mallocInt32(e));var r=8*e;x.length<r&&(c.free(x),x=c.mallocDouble(r))}function i(t,e,r,n){var i=e[n],a=t[r-1];t[i]=a,e[a]=i}function a(t,e,r,n){t[r]=n,e[n]=r}function o(t,e,r,n,o,s,l,u,c,h){for(var y=0,b=2*t,_=t-1,w=b-1,M=r;M<n;++M){var k=s[M],A=b*M;x[y++]=o[A+_],x[y++]=-(k+1),x[y++]=o[A+w],x[y++]=k}for(var M=l;M<u;++M){var k=h[M]+d,T=b*M;x[y++]=c[T+_],x[y++]=-k,x[y++]=c[T+w],x[y++]=k}var S=y>>>1;f(x,S);for(var E=0,L=0,M=0;M<S;++M){var C=0|x[2*M+1];if(C>=d)C=C-d|0,i(v,g,L--,C);else if(C>=0)i(p,m,E--,C);else if(C<=-d){C=-C-d|0;for(var z=0;z<E;++z){var D=e(p[z],C);if(void 0!==D)return D}a(v,g,L++,C)}else{C=-C-1|0;for(var z=0;z<L;++z){var D=e(C,v[z]);if(void 0!==D)return D}a(p,m,E++,C)}}}function s(t,e,r,n,o,s,l,u,c,h){for(var d=0,_=2*t,w=t-1,M=_-1,k=r;k<n;++k){var A=s[k]+1<<1,T=_*k;x[d++]=o[T+w],x[d++]=-A,x[d++]=o[T+M],x[d++]=A}for(var k=l;k<u;++k){var A=h[k]+1<<1,S=_*k;x[d++]=c[S+w],x[d++]=1|-A,x[d++]=c[S+M],x[d++]=1|A}var E=d>>>1;f(x,E);for(var L=0,C=0,z=0,k=0;k<E;++k){var D=0|x[2*k+1],I=1&D;if(k<E-1&&D>>1==x[2*k+3]>>1&&(I=2,k+=1),D<0){for(var P=-(D>>1)-1,O=0;O<z;++O){var j=e(y[O],P);if(void 0!==j)return j}if(0!==I)for(var O=0;O<L;++O){var j=e(p[O],P);if(void 0!==j)return j}if(1!==I)for(var O=0;O<C;++O){var j=e(v[O],P);if(void 0!==j)return j}0===I?a(p,m,L++,P):1===I?a(v,g,C++,P):2===I&&a(y,b,z++,P)}else{var P=(D>>1)-1;0===I?i(p,m,L--,P):1===I?i(v,g,C--,P):2===I&&i(y,b,z--,P)}}}function l(t,e,r,n,o,s,l,u,c,h,v,g){var y=0,b=2*t,_=e,w=e+t,M=1,k=1;n?k=d:M=d;for(var A=o;A<s;++A){var T=A+M,S=b*A;x[y++]=l[S+_],x[y++]=-T,x[y++]=l[S+w],x[y++]=T}for(var A=c;A<h;++A){var T=A+k,E=b*A;x[y++]=v[E+_],x[y++]=-T}var L=y>>>1;f(x,L);for(var C=0,A=0;A<L;++A){var z=0|x[2*A+1];if(z<0){var T=-z,D=!1;if(T>=d?(D=!n,T-=d):(D=!!n,T-=1),D)a(p,m,C++,T);else{var I=g[T],P=b*T,O=v[P+e+1],j=v[P+e+1+t];t:for(var F=0;F<C;++F){var R=p[F],N=b*R;if(!(j<l[N+e+1]||l[N+e+1+t]<O)){for(var B=e+2;B<t;++B)if(v[P+B+t]<l[N+B]||l[N+B+t]<v[P+B])continue t;var U,V=u[R];if(void 0!==(U=n?r(I,V):r(V,I)))return U}}}}else i(p,m,C--,z-M)}}function u(t,e,r,n,i,a,o,s,l,u,c){for(var h=0,m=2*t,v=e,g=e+t,y=n;y<i;++y){var b=y+d,_=m*y;x[h++]=a[_+v],x[h++]=-b,x[h++]=a[_+g],x[h++]=b}for(var y=s;y<l;++y){var b=y+1,w=m*y;x[h++]=u[w+v],x[h++]=-b}var M=h>>>1;f(x,M);for(var k=0,y=0;y<M;++y){var A=0|x[2*y+1];if(A<0){var b=-A;if(b>=d)p[k++]=b-d;else{b-=1;var T=c[b],S=m*b,E=u[S+e+1],L=u[S+e+1+t];t:for(var C=0;C<k;++C){var z=p[C],D=o[z];if(D===T)break;var I=m*z;if(!(L<a[I+e+1]||a[I+e+1+t]<E)){
10 for(var P=e+2;P<t;++P)if(u[S+P+t]<a[I+P]||a[I+P+t]<u[S+P])continue t;var O=r(D,T);if(void 0!==O)return O}}}}else{for(var b=A-d,C=k-1;C>=0;--C)if(p[C]===b){for(var P=C+1;P<k;++P)p[P-1]=p[P];break}--k}}}e.exports={init:n,sweepBipartite:o,sweepComplete:s,scanBipartite:l,scanComplete:u};var c=t("typedarray-pool"),h=t("bit-twiddle"),f=t("./sort"),d=1<<28,p=c.mallocInt32(1024),m=c.mallocInt32(1024),v=c.mallocInt32(1024),g=c.mallocInt32(1024),y=c.mallocInt32(1024),b=c.mallocInt32(1024),x=c.mallocDouble(8192)},{"./sort":71,"bit-twiddle":63,"typedarray-pool":533}],73:[function(t,e,r){"use strict";function n(t){if(t>Z)throw new RangeError("Invalid typed array length");var e=new Uint8Array(t);return e.__proto__=i.prototype,e}function i(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return l(t)}return a(t,e,r)}function a(t,e,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return t instanceof ArrayBuffer?h(t,e,r):"string"==typeof t?u(t,e):f(t)}function o(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function s(t,e,r){return o(t),t<=0?n(t):void 0!==e?"string"==typeof r?n(t).fill(e,r):n(t).fill(e):n(t)}function l(t){return o(t),n(t<0?0:0|d(t))}function u(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!i.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var r=0|m(t,e),a=n(r),o=a.write(t,e);return o!==r&&(a=a.slice(0,o)),a}function c(t){for(var e=t.length<0?0:0|d(t.length),r=n(e),i=0;i<e;i+=1)r[i]=255&t[i];return r}function h(t,e,r){if(e<0||t.byteLength<e)throw new RangeError("'offset' is out of bounds");if(t.byteLength<e+(r||0))throw new RangeError("'length' is out of bounds");var n;return n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),n.__proto__=i.prototype,n}function f(t){if(i.isBuffer(t)){var e=0|d(t.length),r=n(e);return 0===r.length?r:(t.copy(r,0,0,e),r)}if(t){if(G(t)||"length"in t)return"number"!=typeof t.length||Y(t.length)?n(0):c(t);if("Buffer"===t.type&&Array.isArray(t.data))return c(t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function d(t){if(t>=Z)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Z.toString(16)+" bytes");return 0|t}function p(t){return+t!=t&&(t=0),i.alloc(+t)}function m(t,e){if(i.isBuffer(t))return t.length;if(G(t)||t instanceof ArrayBuffer)return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return B(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return q(t).length;default:if(n)return B(t).length;e=(""+e).toLowerCase(),n=!0}}function v(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if(r>>>=0,e>>>=0,r<=e)return"";for(t||(t="utf8");;)switch(t){case"hex":return z(this,e,r);case"utf8":case"utf-8":return S(this,e,r);case"ascii":return L(this,e,r);case"latin1":case"binary":return C(this,e,r);case"base64":return T(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return D(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function g(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function y(t,e,r,n,a){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,Y(r)&&(r=a?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(a)return-1;r=t.length-1}else if(r<0){if(!a)return-1;r=0}if("string"==typeof e&&(e=i.from(e,n)),i.isBuffer(e))return 0===e.length?-1:b(t,e,r,n,a);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):b(t,[e],r,n,a);throw new TypeError("val must be string, number or Buffer")}function b(t,e,r,n,i){function a(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}var o=1,s=t.length,l=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;o=2,s/=2,l/=2,r/=2}var u;if(i){var c=-1;for(u=r;u<s;u++)if(a(t,u)===a(e,c===-1?0:u-c)){if(c===-1&&(c=u),u-c+1===l)return c*o}else c!==-1&&(u-=u-c),c=-1}else for(r+l>s&&(r=s-l),u=r;u>=0;u--){for(var h=!0,f=0;f<l;f++)if(a(t,u+f)!==a(e,f)){h=!1;break}if(h)return u}return-1}function x(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;var a=e.length;if(a%2!=0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var o=0;o<n;++o){var s=parseInt(e.substr(2*o,2),16);if(Y(s))return o;t[r+o]=s}return o}function _(t,e,r,n){return H(B(e,t.length-r),t,r,n)}function w(t,e,r,n){return H(U(e),t,r,n)}function M(t,e,r,n){return w(t,e,r,n)}function k(t,e,r,n){return H(q(e),t,r,n)}function A(t,e,r,n){return H(V(e,t.length-r),t,r,n)}function T(t,e,r){return 0===e&&r===t.length?X.fromByteArray(t):X.fromByteArray(t.slice(e,r))}function S(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var a=t[i],o=null,s=a>239?4:a>223?3:a>191?2:1;if(i+s<=r){var l,u,c,h;switch(s){case 1:a<128&&(o=a);break;case 2:l=t[i+1],128==(192&l)&&(h=(31&a)<<6|63&l)>127&&(o=h);break;case 3:l=t[i+1],u=t[i+2],128==(192&l)&&128==(192&u)&&(h=(15&a)<<12|(63&l)<<6|63&u)>2047&&(h<55296||h>57343)&&(o=h);break;case 4:l=t[i+1],u=t[i+2],c=t[i+3],128==(192&l)&&128==(192&u)&&128==(192&c)&&(h=(15&a)<<18|(63&l)<<12|(63&u)<<6|63&c)>65535&&h<1114112&&(o=h)}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return E(n)}function E(t){var e=t.length;if(e<=J)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=J));return r}function L(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function C(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function z(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var i="",a=e;a<r;++a)i+=N(t[a]);return i}function D(t,e,r){for(var n=t.slice(e,r),i="",a=0;a<n.length;a+=2)i+=String.fromCharCode(n[a]+256*n[a+1]);return i}function I(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function P(t,e,r,n,a,o){if(!i.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>a||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function O(t,e,r,n,i,a){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function j(t,e,r,n,i){return e=+e,r>>>=0,i||O(t,e,r,4,3.4028234663852886e38,-3.4028234663852886e38),W.write(t,e,r,n,23,4),r+4}function F(t,e,r,n,i){return e=+e,r>>>=0,i||O(t,e,r,8,1.7976931348623157e308,-1.7976931348623157e308),W.write(t,e,r,n,52,8),r+8}function R(t){if(t=t.trim().replace(K,""),t.length<2)return"";for(;t.length%4!=0;)t+="=";return t}function N(t){return t<16?"0"+t.toString(16):t.toString(16)}function B(t,e){e=e||1/0;for(var r,n=t.length,i=null,a=[],o=0;o<n;++o){if((r=t.charCodeAt(o))>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(e-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;a.push(r)}else if(r<2048){if((e-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function U(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}function V(t,e){for(var r,n,i,a=[],o=0;o<t.length&&!((e-=2)<0);++o)r=t.charCodeAt(o),n=r>>8,i=r%256,a.push(i),a.push(n);return a}function q(t){return X.toByteArray(R(t))}function H(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function G(t){return"function"==typeof ArrayBuffer.isView&&ArrayBuffer.isView(t)}function Y(t){return t!==t}var X=t("base64-js"),W=t("ieee754");r.Buffer=i,r.SlowBuffer=p,r.INSPECT_MAX_BYTES=50;var Z=2147483647;r.kMaxLength=Z,i.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()}catch(t){return!1}}(),i.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),"undefined"!=typeof Symbol&&Symbol.species&&i[Symbol.species]===i&&Object.defineProperty(i,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),i.poolSize=8192,i.from=function(t,e,r){return a(t,e,r)},i.prototype.__proto__=Uint8Array.prototype,i.__proto__=Uint8Array,i.alloc=function(t,e,r){return s(t,e,r)},i.allocUnsafe=function(t){return l(t)},i.allocUnsafeSlow=function(t){return l(t)},i.isBuffer=function(t){return null!=t&&t._isBuffer===!0},i.compare=function(t,e){if(!i.isBuffer(t)||!i.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,a=0,o=Math.min(r,n);a<o;++a)if(t[a]!==e[a]){r=t[a],n=e[a];break}return r<n?-1:n<r?1:0},i.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},i.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return i.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=i.allocUnsafe(e),a=0;for(r=0;r<t.length;++r){var o=t[r];if(!i.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,a),a+=o.length}return n},i.byteLength=m,i.prototype._isBuffer=!0,i.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)g(this,e,e+1);return this},i.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)g(this,e,e+3),g(this,e+1,e+2);return this},i.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)g(this,e,e+7),g(this,e+1,e+6),g(this,e+2,e+5),g(this,e+3,e+4);return this},i.prototype.toString=function(){var t=this.length;return 0===t?"":0===arguments.length?S(this,0,t):v.apply(this,arguments)},i.prototype.equals=function(t){if(!i.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===i.compare(this,t)},i.prototype.inspect=function(){var t="",e=r.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(t+=" ... ")),"<Buffer "+t+">"},i.prototype.compare=function(t,e,r,n,a){if(!i.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===a&&(a=this.length),e<0||r>t.length||n<0||a>this.length)throw new RangeError("out of range index");if(n>=a&&e>=r)return 0;if(n>=a)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,a>>>=0,this===t)return 0;for(var o=a-n,s=r-e,l=Math.min(o,s),u=this.slice(n,a),c=t.slice(e,r),h=0;h<l;++h)if(u[h]!==c[h]){o=u[h],s=c[h];break}return o<s?-1:s<o?1:0},i.prototype.includes=function(t,e,r){return this.indexOf(t,e,r)!==-1},i.prototype.indexOf=function(t,e,r){return y(this,t,e,r,!0)},i.prototype.lastIndexOf=function(t,e,r){return y(this,t,e,r,!1)},i.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return x(this,t,e,r);case"utf8":case"utf-8":return _(this,t,e,r);case"ascii":return w(this,t,e,r);case"latin1":case"binary":return M(this,t,e,r);case"base64":return k(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,t,e,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var J=4096;i.prototype.slice=function(t,e){var r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r)<0&&(t=0):t>r&&(t=r),e<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);var n=this.subarray(t,e);return n.__proto__=i.prototype,n},i.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||I(t,e,this.length);for(var n=this[t],i=1,a=0;++a<e&&(i*=256);)n+=this[t+a]*i;return n},i.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||I(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},i.prototype.readUInt8=function(t,e){return t>>>=0,e||I(t,1,this.length),this[t]},i.prototype.readUInt16LE=function(t,e){return t>>>=0,e||I(t,2,this.length),this[t]|this[t+1]<<8},i.prototype.readUInt16BE=function(t,e){return t>>>=0,e||I(t,2,this.length),this[t]<<8|this[t+1]},i.prototype.readUInt32LE=function(t,e){return t>>>=0,e||I(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},i.prototype.readUInt32BE=function(t,e){return t>>>=0,e||I(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},i.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||I(t,e,this.length);for(var n=this[t],i=1,a=0;++a<e&&(i*=256);)n+=this[t+a]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*e)),n},i.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||I(t,e,this.length);for(var n=e,i=1,a=this[t+--n];n>0&&(i*=256);)a+=this[t+--n]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*e)),a},i.prototype.readInt8=function(t,e){return t>>>=0,e||I(t,1,this.length),128&this[t]?(255-this[t]+1)*-1:this[t]},i.prototype.readInt16LE=function(t,e){t>>>=0,e||I(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},i.prototype.readInt16BE=function(t,e){t>>>=0,e||I(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},i.prototype.readInt32LE=function(t,e){return t>>>=0,e||I(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},i.prototype.readInt32BE=function(t,e){return t>>>=0,e||I(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},i.prototype.readFloatLE=function(t,e){return t>>>=0,e||I(t,4,this.length),W.read(this,t,!0,23,4)},i.prototype.readFloatBE=function(t,e){return t>>>=0,e||I(t,4,this.length),W.read(this,t,!1,23,4)},i.prototype.readDoubleLE=function(t,e){return t>>>=0,e||I(t,8,this.length),W.read(this,t,!0,52,8)},i.prototype.readDoubleBE=function(t,e){return t>>>=0,e||I(t,8,this.length),W.read(this,t,!1,52,8)},i.prototype.writeUIntLE=function(t,e,r,n){if(t=+t,e>>>=0,r>>>=0,!n){P(this,t,e,r,Math.pow(2,8*r)-1,0)}var i=1,a=0;for(this[e]=255&t;++a<r&&(i*=256);)this[e+a]=t/i&255;return e+r},i.prototype.writeUIntBE=function(t,e,r,n){if(t=+t,e>>>=0,r>>>=0,!n){P(this,t,e,r,Math.pow(2,8*r)-1,0)}var i=r-1,a=1;for(this[e+i]=255&t;--i>=0&&(a*=256);)this[e+i]=t/a&255;return e+r},i.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,1,255,0),this[e]=255&t,e+1},i.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},i.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},i.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},i.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},i.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);P(this,t,e,r,i-1,-i)}var a=0,o=1,s=0;for(this[e]=255&t;++a<r&&(o*=256);)t<0&&0===s&&0!==this[e+a-1]&&(s=1),this[e+a]=(t/o>>0)-s&255;return e+r},i.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);P(this,t,e,r,i-1,-i)}var a=r-1,o=1,s=0;for(this[e+a]=255&t;--a>=0&&(o*=256);)t<0&&0===s&&0!==this[e+a+1]&&(s=1),this[e+a]=(t/o>>0)-s&255;return e+r},i.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},i.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},i.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},i.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},i.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},i.prototype.writeFloatLE=function(t,e,r){return j(this,t,e,!0,r)},i.prototype.writeFloatBE=function(t,e,r){return j(this,t,e,!1,r)},i.prototype.writeDoubleLE=function(t,e,r){return F(this,t,e,!0,r)},i.prototype.writeDoubleBE=function(t,e,r){return F(this,t,e,!1,r)},i.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var i,a=n-r;if(this===t&&r<e&&e<n)for(i=a-1;i>=0;--i)t[i+e]=this[i+r];else if(a<1e3)for(i=0;i<a;++i)t[i+e]=this[i+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+a),e);return a},i.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===t.length){var a=t.charCodeAt(0);a<256&&(t=a)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!i.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0);var o;if("number"==typeof t)for(o=e;o<r;++o)this[o]=t;else{var s=i.isBuffer(t)?t:new i(t,n),l=s.length;for(o=0;o<r-e;++o)this[o+e]=s[o%l]}return this};var K=/[^+\/0-9A-Za-z-_]/g},{"base64-js":74,ieee754:283}],74:[function(t,e,r){"use strict";function n(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===t[e-2]?2:"="===t[e-1]?1:0}function i(t){return 3*t.length/4-n(t)}function a(t){var e,r,i,a,o,s,l=t.length;o=n(t),s=new h(3*l/4-o),i=o>0?l-4:l;var u=0;for(e=0,r=0;e<i;e+=4,r+=3)a=c[t.charCodeAt(e)]<<18|c[t.charCodeAt(e+1)]<<12|c[t.charCodeAt(e+2)]<<6|c[t.charCodeAt(e+3)],s[u++]=a>>16&255,s[u++]=a>>8&255,s[u++]=255&a;return 2===o?(a=c[t.charCodeAt(e)]<<2|c[t.charCodeAt(e+1)]>>4,s[u++]=255&a):1===o&&(a=c[t.charCodeAt(e)]<<10|c[t.charCodeAt(e+1)]<<4|c[t.charCodeAt(e+2)]>>2,s[u++]=a>>8&255,s[u++]=255&a),s}function o(t){return u[t>>18&63]+u[t>>12&63]+u[t>>6&63]+u[63&t]}function s(t,e,r){for(var n,i=[],a=e;a<r;a+=3)n=(t[a]<<16)+(t[a+1]<<8)+t[a+2],i.push(o(n));return i.join("")}function l(t){for(var e,r=t.length,n=r%3,i="",a=[],o=0,l=r-n;o<l;o+=16383)a.push(s(t,o,o+16383>l?l:o+16383));return 1===n?(e=t[r-1],i+=u[e>>2],i+=u[e<<4&63],i+="=="):2===n&&(e=(t[r-2]<<8)+t[r-1],i+=u[e>>10],i+=u[e>>4&63],i+=u[e<<2&63],i+="="),a.push(i),a.join("")}r.byteLength=i,r.toByteArray=a,r.fromByteArray=l;for(var u=[],c=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",d=0,p=f.length;d<p;++d)u[d]=f[d],c[f.charCodeAt(d)]=d;c["-".charCodeAt(0)]=62,c["_".charCodeAt(0)]=63},{}],75:[function(t,e,r){"use strict";function n(t){return[Math.min(t[0],t[1]),Math.max(t[0],t[1])]}function i(t,e){return t[0]-e[0]||t[1]-e[1]}function a(t){return t.map(n).sort(i)}function o(t,e,r){return e in t?t[e]:r}function s(t,e,r){Array.isArray(e)?(r=r||{},e=e||[]):(r=e||{},e=[]);var n=!!o(r,"delaunay",!0),i=!!o(r,"interior",!0),s=!!o(r,"exterior",!0),f=!!o(r,"infinity",!1);if(!i&&!s||0===t.length)return[];var d=l(t,e);if(n||i!==s||f){for(var p=u(t.length,a(e)),m=0;m<d.length;++m){var v=d[m];p.addTriangle(v[0],v[1],v[2])}return n&&c(t,p),s?i?f?h(p,0,f):p.cells():h(p,1,f):h(p,-1)}return d}var l=t("./lib/monotone"),u=t("./lib/triangulation"),c=t("./lib/delaunay"),h=t("./lib/filter");e.exports=s},{"./lib/delaunay":76,"./lib/filter":77,"./lib/monotone":78,"./lib/triangulation":79}],76:[function(t,e,r){"use strict";function n(t,e,r,n,i,o){var s=e.opposite(n,i);if(!(s<0)){if(i<n){var l=n;n=i,i=l,l=o,o=s,s=l}e.isConstraint(n,i)||a(t[n],t[i],t[o],t[s])<0&&r.push(n,i)}}function i(t,e){for(var r=[],i=t.length,o=e.stars,s=0;s<i;++s)for(var l=o[s],u=1;u<l.length;u+=2){var c=l[u];if(!(c<s)&&!e.isConstraint(s,c)){for(var h=l[u-1],f=-1,d=1;d<l.length;d+=2)if(l[d-1]===c){f=l[d];break}f<0||a(t[s],t[c],t[h],t[f])<0&&r.push(s,c)}}for(;r.length>0;){for(var c=r.pop(),s=r.pop(),h=-1,f=-1,l=o[s],p=1;p<l.length;p+=2){var m=l[p-1],v=l[p];m===c?f=v:v===c&&(h=m)}h<0||f<0||(a(t[s],t[c],t[h],t[f])>=0||(e.flip(s,c),n(t,e,r,h,s,f),n(t,e,r,s,f,h),n(t,e,r,f,c,h),n(t,e,r,c,h,f)))}}var a=t("robust-in-sphere")[4];t("binary-search-bounds");e.exports=i},{"binary-search-bounds":80,"robust-in-sphere":498}],77:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o){this.cells=t,this.neighbor=e,this.flags=n,this.constraint=r,this.active=i,this.next=a,this.boundary=o}function i(t,e){return t[0]-e[0]||t[1]-e[1]||t[2]-e[2]}function a(t,e){for(var r=t.cells(),a=r.length,o=0;o<a;++o){var s=r[o],l=s[0],u=s[1],c=s[2];u<c?u<l&&(s[0]=u,s[1]=c,s[2]=l):c<l&&(s[0]=c,s[1]=l,s[2]=u)}r.sort(i);for(var h=new Array(a),o=0;o<h.length;++o)h[o]=0;var f=[],d=[],p=new Array(3*a),m=new Array(3*a),v=null;e&&(v=[]);for(var g=new n(r,p,m,h,f,d,v),o=0;o<a;++o)for(var s=r[o],y=0;y<3;++y){var l=s[y],u=s[(y+1)%3],b=p[3*o+y]=g.locate(u,l,t.opposite(u,l)),x=m[3*o+y]=t.isConstraint(l,u);b<0&&(x?d.push(o):(f.push(o),h[o]=1),e&&v.push([u,l,-1]))}return g}function o(t,e,r){for(var n=0,i=0;i<t.length;++i)e[i]===r&&(t[n++]=t[i]);return t.length=n,t}function s(t,e,r){var n=a(t,r);if(0===e)return r?n.cells.concat(n.boundary):n.cells;for(var i=1,s=n.active,l=n.next,u=n.flags,c=n.cells,h=n.constraint,f=n.neighbor;s.length>0||l.length>0;){for(;s.length>0;){var d=s.pop();if(u[d]!==-i){u[d]=i;for(var p=(c[d],0);p<3;++p){var m=f[3*d+p];m>=0&&0===u[m]&&(h[3*d+p]?l.push(m):(s.push(m),u[m]=i))}}}var v=l;l=s,s=v,l.length=0,i=-i}var g=o(c,u,e);return r?g.concat(n.boundary):g}var l=t("binary-search-bounds");e.exports=s,n.prototype.locate=function(){var t=[0,0,0];return function(e,r,n){var a=e,o=r,s=n;return r<n?r<e&&(a=r,o=n,s=e):n<e&&(a=n,o=e,s=r),a<0?-1:(t[0]=a,t[1]=o,t[2]=s,l.eq(this.cells,t,i))}}()},{"binary-search-bounds":80}],78:[function(t,e,r){"use strict";function n(t,e,r,n,i){this.a=t,this.b=e,this.idx=r,this.lowerIds=n,this.upperIds=i}function i(t,e,r,n){this.a=t,this.b=e,this.type=r,this.idx=n}function a(t,e){var r=t.a[0]-e.a[0]||t.a[1]-e.a[1]||t.type-e.type;return r||(t.type!==p&&(r=d(t.a,t.b,e.b))?r:t.idx-e.idx)}function o(t,e){return d(t.a,t.b,e)}function s(t,e,r,n,i){for(var a=f.lt(e,n,o),s=f.gt(e,n,o),l=a;l<s;++l){for(var u=e[l],c=u.lowerIds,h=c.length;h>1&&d(r[c[h-2]],r[c[h-1]],n)>0;)t.push([c[h-1],c[h-2],i]),h-=1;c.length=h,c.push(i);for(var p=u.upperIds,h=p.length;h>1&&d(r[p[h-2]],r[p[h-1]],n)<0;)t.push([p[h-2],p[h-1],i]),h-=1;p.length=h,p.push(i)}}function l(t,e){var r;return(r=t.a[0]<e.a[0]?d(t.a,t.b,e.a):d(e.b,e.a,t.a))?r:(r=e.b[0]<t.b[0]?d(t.a,t.b,e.b):d(e.b,e.a,t.b))||t.idx-e.idx}function u(t,e,r){var i=f.le(t,r,l),a=t[i],o=a.upperIds,s=o[o.length-1];a.upperIds=[s],t.splice(i+1,0,new n(r.a,r.b,r.idx,[s],o))}function c(t,e,r){var n=r.a;r.a=r.b,r.b=n;var i=f.eq(t,r,l),a=t[i];t[i-1].upperIds=a.upperIds,t.splice(i,1)}function h(t,e){for(var r=t.length,o=e.length,l=[],h=0;h<r;++h)l.push(new i(t[h],null,p,h));for(var h=0;h<o;++h){var f=e[h],d=t[f[0]],g=t[f[1]];d[0]<g[0]?l.push(new i(d,g,v,h),new i(g,d,m,h)):d[0]>g[0]&&l.push(new i(g,d,v,h),new i(d,g,m,h))}l.sort(a);for(var y=l[0].a[0]-(1+Math.abs(l[0].a[0]))*Math.pow(2,-52),b=[new n([y,1],[y,0],-1,[],[],[],[])],x=[],h=0,_=l.length;h<_;++h){var w=l[h],M=w.type;M===p?s(x,b,t,w.a,w.idx):M===v?u(b,t,w):c(b,t,w)}return x}var f=t("binary-search-bounds"),d=t("robust-orientation")[3],p=0,m=1,v=2;e.exports=h},{"binary-search-bounds":80,"robust-orientation":500}],79:[function(t,e,r){"use strict";function n(t,e){this.stars=t,this.edges=e}function i(t,e,r){for(var n=1,i=t.length;n<i;n+=2)if(t[n-1]===e&&t[n]===r)return t[n-1]=t[i-2],t[n]=t[i-1],void(t.length=i-2)}function a(t,e){for(var r=new Array(t),i=0;i<t;++i)r[i]=[];return new n(r,e)}var o=t("binary-search-bounds");e.exports=a;var s=n.prototype;s.isConstraint=function(){function t(t,e){return t[0]-e[0]||t[1]-e[1]}var e=[0,0];return function(r,n){return e[0]=Math.min(r,n),e[1]=Math.max(r,n),o.eq(this.edges,e,t)>=0}}(),s.removeTriangle=function(t,e,r){var n=this.stars;i(n[t],e,r),i(n[e],r,t),i(n[r],t,e)},s.addTriangle=function(t,e,r){var n=this.stars;n[t].push(e,r),n[e].push(r,t),n[r].push(t,e)},s.opposite=function(t,e){for(var r=this.stars[e],n=1,i=r.length;n<i;n+=2)if(r[n]===t)return r[n-1];return-1},s.flip=function(t,e){var r=this.opposite(t,e),n=this.opposite(e,t);this.removeTriangle(t,e,r),this.removeTriangle(e,t,n),this.addTriangle(t,n,r),this.addTriangle(e,r,n)},s.edges=function(){for(var t=this.stars,e=[],r=0,n=t.length;r<n;++r)for(var i=t[r],a=0,o=i.length;a<o;a+=2)e.push([i[a],i[a+1]]);return e},s.cells=function(){for(var t=this.stars,e=[],r=0,n=t.length;r<n;++r)for(var i=t[r],a=0,o=i.length;a<o;a+=2){var s=i[a],l=i[a+1];r<Math.min(s,l)&&e.push([r,s,l])}return e}},{"binary-search-bounds":80}],80:[function(t,e,r){"use strict";function n(t,e,r,n,i){var a=["function ",t,"(a,l,h,",n.join(","),"){",i?"":"var i=",r?"l-1":"h+1",";while(l<=h){var m=(l+h)>>>1,x=a[m]"];return i?e.indexOf("c")<0?a.push(";if(x===y){return m}else if(x<=y){"):a.push(";var p=c(x,y);if(p===0){return m}else if(p<=0){"):a.push(";if(",e,"){i=m;"),r?a.push("l=m+1}else{h=m-1}"):a.push("h=m-1}else{l=m+1}"),a.push("}"),i?a.push("return -1};"):a.push("return i};"),a.join("")}function i(t,e,r,i){return new Function([n("A","x"+t+"y",e,["y"],i),n("P","c(x,y)"+t+"0",e,["y","c"],i),"function dispatchBsearch",r,"(a,y,c,l,h){if(typeof(c)==='function'){return P(a,(l===void 0)?0:l|0,(h===void 0)?a.length-1:h|0,y,c)}else{return A(a,(c===void 0)?0:c|0,(l===void 0)?a.length-1:l|0,y)}}return dispatchBsearch",r].join(""))()}e.exports={ge:i(">=",!1,"GE"),gt:i(">",!1,"GT"),lt:i("<",!0,"LT"),le:i("<=",!0,"LE"),eq:i("-",!0,"EQ",!0)}},{}],81:[function(t,e,r){"use strict";function n(t){for(var e=1,r=1;r<t.length;++r)for(var n=0;n<r;++n)if(t[r]<t[n])e=-e;else if(t[n]===t[r])return 0;return e}e.exports=n},{}],82:[function(t,e,r){"use strict";function n(t,e){for(var r=0,n=t.length,i=0;i<n;++i)r+=t[i]*e[i];return r}function i(t){var e=t.length;if(0===e)return[];var r=(t[0].length,o([t.length+1,t.length+1],1)),i=o([t.length+1],1);r[e][e]=0;for(var a=0;a<e;++a){for(var l=0;l<=a;++l)r[l][a]=r[a][l]=2*n(t[a],t[l]);i[a]=n(t[a],t[a])}for(var u=s(r,i),c=0,h=u[e+1],a=0;a<h.length;++a)c+=h[a];for(var f=new Array(e),a=0;a<e;++a){for(var h=u[a],d=0,l=0;l<h.length;++l)d+=h[l];f[a]=d/c}return f}function a(t){if(0===t.length)return[];for(var e=t[0].length,r=o([e]),n=i(t),a=0;a<t.length;++a)for(var s=0;s<e;++s)r[s]+=t[a][s]*n[a];return r}var o=t("dup"),s=t("robust-linear-solve");a.barycenetric=i,e.exports=a},{dup:121,"robust-linear-solve":499}],83:[function(t,e,r){function n(t){for(var e=i(t),r=0,n=0;n<t.length;++n)for(var a=t[n],o=0;o<e.length;++o)r+=Math.pow(a[o]-e[o],2);return Math.sqrt(r/t.length)}e.exports=n;var i=t("circumcenter")},{circumcenter:82}],84:[function(t,e,r){function n(t,e,r){return e<r?t<e?e:t>r?r:t:t<r?r:t>e?e:t}e.exports=n},{}],85:[function(t,e,r){"use strict";function n(t){var e=_(t);return[M(e,-1/0),M(e,1/0)]}function i(t,e){for(var r=new Array(e.length),n=0;n<e.length;++n){var i=e[n],a=t[i[0]],o=t[i[1]];r[n]=[M(Math.min(a[0],o[0]),-1/0),M(Math.min(a[1],o[1]),-1/0),M(Math.max(a[0],o[0]),1/0),M(Math.max(a[1],o[1]),1/0)]}return r}function a(t){for(var e=new Array(t.length),r=0;r<t.length;++r){var n=t[r];e[r]=[M(n[0],-1/0),M(n[1],-1/0),M(n[0],1/0),M(n[1],1/0)]}return e}function o(t,e,r){var n=[];return g(r,function(r,i){var a=e[r],o=e[i];if(a[0]!==o[0]&&a[0]!==o[1]&&a[1]!==o[0]&&a[1]!==o[1]){var s=t[a[0]],l=t[a[1]],u=t[o[0]],c=t[o[1]];y(s,l,u,c)&&n.push([r,i])}}),n}function s(t,e,r,n){var i=[];return g(r,n,function(r,n){var a=e[r];if(a[0]!==n&&a[1]!==n){var o=t[n],s=t[a[0]],l=t[a[1]];y(s,l,o,o)&&i.push([r,n])}}),i}function l(t,e,r,n,i){var a,o,s=t.map(function(t){return[b(t[0]),b(t[1])]});for(a=0;a<r.length;++a){var l=r[a];o=l[0];var u=l[1],c=e[o],h=e[u],f=k(w(t[c[0]]),w(t[c[1]]),w(t[h[0]]),w(t[h[1]]));if(f){var d=t.length;t.push([_(f[0]),_(f[1])]),s.push(f),n.push([o,d],[u,d])}}for(n.sort(function(t,e){if(t[0]!==e[0])return t[0]-e[0];var r=s[t[1]],n=s[e[1]];return x(r[0],n[0])||x(r[1],n[1])}),a=n.length-1;a>=0;--a){var p=n[a];o=p[0];var m=e[o],v=m[0],g=m[1],y=t[v],M=t[g];if((y[0]-M[0]||y[1]-M[1])<0){var A=v;v=g,g=A}m[0]=v;var T,S=m[1]=p[1];for(i&&(T=m[2]);a>0&&n[a-1][0]===o;){var p=n[--a],E=p[1];i?e.push([S,E,T]):e.push([S,E]),S=E}i?e.push([S,g,T]):e.push([S,g])}return s}function u(t,e,r){for(var i=e.length,a=new v(i),o=[],s=0;s<e.length;++s){var l=e[s],u=n(l[0]),c=n(l[1]);o.push([M(u[0],-1/0),M(c[0],-1/0),M(u[1],1/0),M(c[1],1/0)])}g(o,function(t,e){a.link(t,e)});for(var h=!0,f=new Array(i),s=0;s<i;++s){var d=a.find(s);d!==s&&(h=!1,t[d]=[Math.min(t[s][0],t[d][0]),Math.min(t[s][1],t[d][1])])}if(h)return null;for(var p=0,s=0;s<i;++s){var d=a.find(s);d===s?(f[s]=p,t[p++]=t[s]):f[s]=-1}t.length=p;for(var s=0;s<i;++s)f[s]<0&&(f[s]=f[a.find(s)]);return f}function c(t,e){return t[0]-e[0]||t[1]-e[1]}function h(t,e){var r=t[0]-e[0]||t[1]-e[1];return r||(t[2]<e[2]?-1:t[2]>e[2]?1:0)}function f(t,e,r){if(0!==t.length){if(e)for(var n=0;n<t.length;++n){var i=t[n],a=e[i[0]],o=e[i[1]];i[0]=Math.min(a,o),i[1]=Math.max(a,o)}else for(var n=0;n<t.length;++n){var i=t[n],a=i[0],o=i[1];i[0]=Math.min(a,o),i[1]=Math.max(a,o)}r?t.sort(h):t.sort(c);for(var s=1,n=1;n<t.length;++n){var l=t[n-1],u=t[n];(u[0]!==l[0]||u[1]!==l[1]||r&&u[2]!==l[2])&&(t[s++]=u)}t.length=s}}function d(t,e,r){var n=u(t,[],a(t));return f(e,n,r),!!n}function p(t,e,r){var n=i(t,e),c=o(t,e,n),h=a(t),d=s(t,e,n,h),p=l(t,e,c,d,r),m=u(t,p,h);return f(e,m,r),!!m||(c.length>0||d.length>0)}function m(t,e,r){var n;if(r){n=e;for(var i=new Array(e.length),a=0;a<e.length;++a){var o=e[a];i[a]=[o[0],o[1],r[a]]}e=i}for(var s=d(t,e,!!r);p(t,e,!!r);)s=!0;if(r&&s){n.length=0,r.length=0;for(var a=0;a<e.length;++a){var o=e[a];n.push([o[0],o[1]]),r.push(o[2])}}return s}e.exports=m
11 ;var v=t("union-find"),g=t("box-intersect"),y=t("robust-segment-intersect"),b=t("big-rat"),x=t("big-rat/cmp"),_=t("big-rat/to-float"),w=t("rat-vec"),M=t("nextafter"),k=t("./lib/rat-seg-intersect")},{"./lib/rat-seg-intersect":86,"big-rat":49,"big-rat/cmp":47,"big-rat/to-float":61,"box-intersect":66,nextafter:461,"rat-vec":487,"robust-segment-intersect":503,"union-find":534}],86:[function(t,e,r){"use strict";function n(t,e){return s(a(t[0],e[1]),a(t[1],e[0]))}function i(t,e,r,i){var a=u(e,t),s=u(i,r),f=n(a,s);if(0===l(f))return null;var d=u(t,r),p=n(s,d),m=o(p,f),v=h(a,m);return c(t,v)}e.exports=i;var a=t("big-rat/mul"),o=t("big-rat/div"),s=t("big-rat/sub"),l=t("big-rat/sign"),u=t("rat-vec/sub"),c=t("rat-vec/add"),h=t("rat-vec/muls")},{"big-rat/div":48,"big-rat/mul":58,"big-rat/sign":59,"big-rat/sub":60,"rat-vec/add":486,"rat-vec/muls":488,"rat-vec/sub":489}],87:[function(t,e,r){(function(t){var r=function(){"use strict";function e(r,n,i,a){function s(r,i){if(null===r)return null;if(0==i)return r;var h,f;if("object"!=typeof r)return r;if(e.__isArray(r))h=[];else if(e.__isRegExp(r))h=new RegExp(r.source,o(r)),r.lastIndex&&(h.lastIndex=r.lastIndex);else if(e.__isDate(r))h=new Date(r.getTime());else{if(c&&t.isBuffer(r))return h=new t(r.length),r.copy(h),h;void 0===a?(f=Object.getPrototypeOf(r),h=Object.create(f)):(h=Object.create(a),f=a)}if(n){var d=l.indexOf(r);if(d!=-1)return u[d];l.push(r),u.push(h)}for(var p in r){var m;f&&(m=Object.getOwnPropertyDescriptor(f,p)),m&&null==m.set||(h[p]=s(r[p],i-1))}return h}"object"==typeof n&&(i=n.depth,a=n.prototype,n.filter,n=n.circular);var l=[],u=[],c=void 0!==t;return void 0===n&&(n=!0),void 0===i&&(i=1/0),s(r,i)}function r(t){return Object.prototype.toString.call(t)}function n(t){return"object"==typeof t&&"[object Date]"===r(t)}function i(t){return"object"==typeof t&&"[object Array]"===r(t)}function a(t){return"object"==typeof t&&"[object RegExp]"===r(t)}function o(t){var e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),e}return e.clonePrototype=function(t){if(null===t)return null;var e=function(){};return e.prototype=t,new e},e.__objToStr=r,e.__isDate=n,e.__isArray=i,e.__isRegExp=a,e.__getRegExpFlags=o,e}();"object"==typeof e&&e.exports&&(e.exports=r)}).call(this,t("buffer").Buffer)},{buffer:73}],88:[function(t,e,r){"use strict";function n(t,e){null==e&&(e=!0);var r=t[0],n=t[1],a=t[2],o=t[3];return null==o&&(o=e?1:255),e&&(r*=255,n*=255,a*=255,o*=255),r=255&i(r,0,255),n=255&i(n,0,255),a=255&i(a,0,255),o=255&i(o,0,255),16777216*r+(n<<16)+(a<<8)+o}var i=t("clamp");e.exports=n},{clamp:84}],89:[function(t,e,r){e.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},{}],90:[function(t,e,r){"use strict";function n(t){var e,r,n=[],s=1;if("string"==typeof t)if(i[t])n=i[t].slice(),r="rgb";else if("transparent"===t)s=0,r="rgb",n=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(t)){var l=t.slice(1),u=l.length,c=u<=4;s=1,c?(n=[parseInt(l[0]+l[0],16),parseInt(l[1]+l[1],16),parseInt(l[2]+l[2],16)],4===u&&(s=parseInt(l[3]+l[3],16)/255)):(n=[parseInt(l[0]+l[1],16),parseInt(l[2]+l[3],16),parseInt(l[4]+l[5],16)],8===u&&(s=parseInt(l[6]+l[7],16)/255)),n[0]||(n[0]=0),n[1]||(n[1]=0),n[2]||(n[2]=0),r="rgb"}else if(e=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(t)){var h=e[1],l=h.replace(/a$/,"");r=l;var u="cmyk"===l?4:"gray"===l?1:3;n=e[2].trim().split(/\s*,\s*/).map(function(t,e){if(/%$/.test(t))return e===u?parseFloat(t)/100:"rgb"===l?255*parseFloat(t)/100:parseFloat(t);if("h"===l[e]){if(/deg$/.test(t))return parseFloat(t);if(void 0!==o[t])return o[t]}return parseFloat(t)}),h===l&&n.push(1),s=void 0===n[u]?1:n[u],n=n.slice(0,u)}else t.length>10&&/[0-9](?:\s|\/)/.test(t)&&(n=t.match(/([0-9]+)/g).map(function(t){return parseFloat(t)}),r=t.match(/([a-z])/gi).join("").toLowerCase());else"number"==typeof t?(r="rgb",n=[t>>>16,(65280&t)>>>8,255&t]):a(t)?(null!=t.r?(n=[t.r,t.g,t.b],r="rgb"):null!=t.red?(n=[t.red,t.green,t.blue],r="rgb"):null!=t.h?(n=[t.h,t.s,t.l],r="hsl"):null!=t.hue&&(n=[t.hue,t.saturation,t.lightness],r="hsl"),null!=t.a?s=t.a:null!=t.alpha?s=t.alpha:null!=t.opacity&&(s=t.opacity/100)):(Array.isArray(t)||ArrayBuffer.isView(t))&&(n=[t[0],t[1],t[2]],r="rgb",s=4===t.length?t[3]:1);return{space:r,values:n,alpha:s}}e.exports=n;var i=t("color-name"),a=t("is-plain-obj"),o={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}},{"color-name":89,"is-plain-obj":290}],91:[function(t,e,r){"use strict";var n=t("color-parse"),i=t("color-space/hsl"),a=t("clamp");e.exports=function(t,e){null==e&&(e=!0);var r=n(t);if(!r.space)return[];if(Array.isArray(t))return t;var o,s=r.values,l=s.length;for(o=0;o<l;o++)s[o]=a(s[o],0,255);if("h"===r.space[0]&&(s=i.rgb(s)),e)for(o=0;o<l;o++)s[o]/=255;return s.push(a(r.alpha,0,1)),s}},{clamp:84,"color-parse":90,"color-space/hsl":92}],92:[function(t,e,r){"use strict";var n=t("./rgb");e.exports={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(t){var e,r,n,i,a,o=t[0]/360,s=t[1]/100,l=t[2]/100;if(0===s)return a=255*l,[a,a,a];r=l<.5?l*(1+s):l+s-l*s,e=2*l-r,i=[0,0,0];for(var u=0;u<3;u++)n=o+1/3*-(u-1),n<0?n++:n>1&&n--,a=6*n<1?e+6*(r-e)*n:2*n<1?r:3*n<2?e+(r-e)*(2/3-n)*6:e,i[u]=255*a;return i}},n.hsl=function(t){var e,r,n,i=t[0]/255,a=t[1]/255,o=t[2]/255,s=Math.min(i,a,o),l=Math.max(i,a,o),u=l-s;return l===s?e=0:i===l?e=(a-o)/u:a===l?e=2+(o-i)/u:o===l&&(e=4+(i-a)/u),e=Math.min(60*e,360),e<0&&(e+=360),n=(s+l)/2,r=l===s?0:n<=.5?u/(l+s):u/(2-l-s),[e,100*r,100*n]}},{"./rgb":93}],93:[function(t,e,r){"use strict";e.exports={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]}},{}],94:[function(t,e,r){e.exports={jet:[{index:0,rgb:[0,0,131]},{index:.125,rgb:[0,60,170]},{index:.375,rgb:[5,255,255]},{index:.625,rgb:[255,255,0]},{index:.875,rgb:[250,0,0]},{index:1,rgb:[128,0,0]}],hsv:[{index:0,rgb:[255,0,0]},{index:.169,rgb:[253,255,2]},{index:.173,rgb:[247,255,2]},{index:.337,rgb:[0,252,4]},{index:.341,rgb:[0,252,10]},{index:.506,rgb:[1,249,255]},{index:.671,rgb:[2,0,253]},{index:.675,rgb:[8,0,253]},{index:.839,rgb:[255,0,251]},{index:.843,rgb:[255,0,245]},{index:1,rgb:[255,0,6]}],hot:[{index:0,rgb:[0,0,0]},{index:.3,rgb:[230,0,0]},{index:.6,rgb:[255,210,0]},{index:1,rgb:[255,255,255]}],cool:[{index:0,rgb:[0,255,255]},{index:1,rgb:[255,0,255]}],spring:[{index:0,rgb:[255,0,255]},{index:1,rgb:[255,255,0]}],summer:[{index:0,rgb:[0,128,102]},{index:1,rgb:[255,255,102]}],autumn:[{index:0,rgb:[255,0,0]},{index:1,rgb:[255,255,0]}],winter:[{index:0,rgb:[0,0,255]},{index:1,rgb:[0,255,128]}],bone:[{index:0,rgb:[0,0,0]},{index:.376,rgb:[84,84,116]},{index:.753,rgb:[169,200,200]},{index:1,rgb:[255,255,255]}],copper:[{index:0,rgb:[0,0,0]},{index:.804,rgb:[255,160,102]},{index:1,rgb:[255,199,127]}],greys:[{index:0,rgb:[0,0,0]},{index:1,rgb:[255,255,255]}],yignbu:[{index:0,rgb:[8,29,88]},{index:.125,rgb:[37,52,148]},{index:.25,rgb:[34,94,168]},{index:.375,rgb:[29,145,192]},{index:.5,rgb:[65,182,196]},{index:.625,rgb:[127,205,187]},{index:.75,rgb:[199,233,180]},{index:.875,rgb:[237,248,217]},{index:1,rgb:[255,255,217]}],greens:[{index:0,rgb:[0,68,27]},{index:.125,rgb:[0,109,44]},{index:.25,rgb:[35,139,69]},{index:.375,rgb:[65,171,93]},{index:.5,rgb:[116,196,118]},{index:.625,rgb:[161,217,155]},{index:.75,rgb:[199,233,192]},{index:.875,rgb:[229,245,224]},{index:1,rgb:[247,252,245]}],yiorrd:[{index:0,rgb:[128,0,38]},{index:.125,rgb:[189,0,38]},{index:.25,rgb:[227,26,28]},{index:.375,rgb:[252,78,42]},{index:.5,rgb:[253,141,60]},{index:.625,rgb:[254,178,76]},{index:.75,rgb:[254,217,118]},{index:.875,rgb:[255,237,160]},{index:1,rgb:[255,255,204]}],bluered:[{index:0,rgb:[0,0,255]},{index:1,rgb:[255,0,0]}],rdbu:[{index:0,rgb:[5,10,172]},{index:.35,rgb:[106,137,247]},{index:.5,rgb:[190,190,190]},{index:.6,rgb:[220,170,132]},{index:.7,rgb:[230,145,90]},{index:1,rgb:[178,10,28]}],picnic:[{index:0,rgb:[0,0,255]},{index:.1,rgb:[51,153,255]},{index:.2,rgb:[102,204,255]},{index:.3,rgb:[153,204,255]},{index:.4,rgb:[204,204,255]},{index:.5,rgb:[255,255,255]},{index:.6,rgb:[255,204,255]},{index:.7,rgb:[255,153,255]},{index:.8,rgb:[255,102,204]},{index:.9,rgb:[255,102,102]},{index:1,rgb:[255,0,0]}],rainbow:[{index:0,rgb:[150,0,90]},{index:.125,rgb:[0,0,200]},{index:.25,rgb:[0,25,255]},{index:.375,rgb:[0,152,255]},{index:.5,rgb:[44,255,150]},{index:.625,rgb:[151,255,0]},{index:.75,rgb:[255,234,0]},{index:.875,rgb:[255,111,0]},{index:1,rgb:[255,0,0]}],portland:[{index:0,rgb:[12,51,131]},{index:.25,rgb:[10,136,186]},{index:.5,rgb:[242,211,56]},{index:.75,rgb:[242,143,56]},{index:1,rgb:[217,30,30]}],blackbody:[{index:0,rgb:[0,0,0]},{index:.2,rgb:[230,0,0]},{index:.4,rgb:[230,210,0]},{index:.7,rgb:[255,255,255]},{index:1,rgb:[160,200,255]}],earth:[{index:0,rgb:[0,0,130]},{index:.1,rgb:[0,180,180]},{index:.2,rgb:[40,210,40]},{index:.4,rgb:[230,230,50]},{index:.6,rgb:[120,70,20]},{index:1,rgb:[255,255,255]}],electric:[{index:0,rgb:[0,0,0]},{index:.15,rgb:[30,0,100]},{index:.4,rgb:[120,0,100]},{index:.6,rgb:[160,90,0]},{index:.8,rgb:[230,200,0]},{index:1,rgb:[255,250,220]}],alpha:[{index:0,rgb:[255,255,255,0]},{index:0,rgb:[255,255,255,1]}],viridis:[{index:0,rgb:[68,1,84]},{index:.13,rgb:[71,44,122]},{index:.25,rgb:[59,81,139]},{index:.38,rgb:[44,113,142]},{index:.5,rgb:[33,144,141]},{index:.63,rgb:[39,173,129]},{index:.75,rgb:[92,200,99]},{index:.88,rgb:[170,220,50]},{index:1,rgb:[253,231,37]}],inferno:[{index:0,rgb:[0,0,4]},{index:.13,rgb:[31,12,72]},{index:.25,rgb:[85,15,109]},{index:.38,rgb:[136,34,106]},{index:.5,rgb:[186,54,85]},{index:.63,rgb:[227,89,51]},{index:.75,rgb:[249,140,10]},{index:.88,rgb:[249,201,50]},{index:1,rgb:[252,255,164]}],magma:[{index:0,rgb:[0,0,4]},{index:.13,rgb:[28,16,68]},{index:.25,rgb:[79,18,123]},{index:.38,rgb:[129,37,129]},{index:.5,rgb:[181,54,122]},{index:.63,rgb:[229,80,100]},{index:.75,rgb:[251,135,97]},{index:.88,rgb:[254,194,135]},{index:1,rgb:[252,253,191]}],plasma:[{index:0,rgb:[13,8,135]},{index:.13,rgb:[75,3,161]},{index:.25,rgb:[125,3,168]},{index:.38,rgb:[168,34,150]},{index:.5,rgb:[203,70,121]},{index:.63,rgb:[229,107,93]},{index:.75,rgb:[248,148,65]},{index:.88,rgb:[253,195,40]},{index:1,rgb:[240,249,33]}],warm:[{index:0,rgb:[125,0,179]},{index:.13,rgb:[172,0,187]},{index:.25,rgb:[219,0,170]},{index:.38,rgb:[255,0,130]},{index:.5,rgb:[255,63,74]},{index:.63,rgb:[255,123,0]},{index:.75,rgb:[234,176,0]},{index:.88,rgb:[190,228,0]},{index:1,rgb:[147,255,0]}],cool:[{index:0,rgb:[125,0,179]},{index:.13,rgb:[116,0,218]},{index:.25,rgb:[98,74,237]},{index:.38,rgb:[68,146,231]},{index:.5,rgb:[0,204,197]},{index:.63,rgb:[0,247,146]},{index:.75,rgb:[0,255,88]},{index:.88,rgb:[40,255,8]},{index:1,rgb:[147,255,0]}],"rainbow-soft":[{index:0,rgb:[125,0,179]},{index:.1,rgb:[199,0,180]},{index:.2,rgb:[255,0,121]},{index:.3,rgb:[255,108,0]},{index:.4,rgb:[222,194,0]},{index:.5,rgb:[150,255,0]},{index:.6,rgb:[0,255,55]},{index:.7,rgb:[0,246,150]},{index:.8,rgb:[50,167,222]},{index:.9,rgb:[103,51,235]},{index:1,rgb:[124,0,186]}],bathymetry:[{index:0,rgb:[40,26,44]},{index:.13,rgb:[59,49,90]},{index:.25,rgb:[64,76,139]},{index:.38,rgb:[63,110,151]},{index:.5,rgb:[72,142,158]},{index:.63,rgb:[85,174,163]},{index:.75,rgb:[120,206,163]},{index:.88,rgb:[187,230,172]},{index:1,rgb:[253,254,204]}],cdom:[{index:0,rgb:[47,15,62]},{index:.13,rgb:[87,23,86]},{index:.25,rgb:[130,28,99]},{index:.38,rgb:[171,41,96]},{index:.5,rgb:[206,67,86]},{index:.63,rgb:[230,106,84]},{index:.75,rgb:[242,149,103]},{index:.88,rgb:[249,193,135]},{index:1,rgb:[254,237,176]}],chlorophyll:[{index:0,rgb:[18,36,20]},{index:.13,rgb:[25,63,41]},{index:.25,rgb:[24,91,59]},{index:.38,rgb:[13,119,72]},{index:.5,rgb:[18,148,80]},{index:.63,rgb:[80,173,89]},{index:.75,rgb:[132,196,122]},{index:.88,rgb:[175,221,162]},{index:1,rgb:[215,249,208]}],density:[{index:0,rgb:[54,14,36]},{index:.13,rgb:[89,23,80]},{index:.25,rgb:[110,45,132]},{index:.38,rgb:[120,77,178]},{index:.5,rgb:[120,113,213]},{index:.63,rgb:[115,151,228]},{index:.75,rgb:[134,185,227]},{index:.88,rgb:[177,214,227]},{index:1,rgb:[230,241,241]}],"freesurface-blue":[{index:0,rgb:[30,4,110]},{index:.13,rgb:[47,14,176]},{index:.25,rgb:[41,45,236]},{index:.38,rgb:[25,99,212]},{index:.5,rgb:[68,131,200]},{index:.63,rgb:[114,156,197]},{index:.75,rgb:[157,181,203]},{index:.88,rgb:[200,208,216]},{index:1,rgb:[241,237,236]}],"freesurface-red":[{index:0,rgb:[60,9,18]},{index:.13,rgb:[100,17,27]},{index:.25,rgb:[142,20,29]},{index:.38,rgb:[177,43,27]},{index:.5,rgb:[192,87,63]},{index:.63,rgb:[205,125,105]},{index:.75,rgb:[216,162,148]},{index:.88,rgb:[227,199,193]},{index:1,rgb:[241,237,236]}],oxygen:[{index:0,rgb:[64,5,5]},{index:.13,rgb:[106,6,15]},{index:.25,rgb:[144,26,7]},{index:.38,rgb:[168,64,3]},{index:.5,rgb:[188,100,4]},{index:.63,rgb:[206,136,11]},{index:.75,rgb:[220,174,25]},{index:.88,rgb:[231,215,44]},{index:1,rgb:[248,254,105]}],par:[{index:0,rgb:[51,20,24]},{index:.13,rgb:[90,32,35]},{index:.25,rgb:[129,44,34]},{index:.38,rgb:[159,68,25]},{index:.5,rgb:[182,99,19]},{index:.63,rgb:[199,134,22]},{index:.75,rgb:[212,171,35]},{index:.88,rgb:[221,210,54]},{index:1,rgb:[225,253,75]}],phase:[{index:0,rgb:[145,105,18]},{index:.13,rgb:[184,71,38]},{index:.25,rgb:[186,58,115]},{index:.38,rgb:[160,71,185]},{index:.5,rgb:[110,97,218]},{index:.63,rgb:[50,123,164]},{index:.75,rgb:[31,131,110]},{index:.88,rgb:[77,129,34]},{index:1,rgb:[145,105,18]}],salinity:[{index:0,rgb:[42,24,108]},{index:.13,rgb:[33,50,162]},{index:.25,rgb:[15,90,145]},{index:.38,rgb:[40,118,137]},{index:.5,rgb:[59,146,135]},{index:.63,rgb:[79,175,126]},{index:.75,rgb:[120,203,104]},{index:.88,rgb:[193,221,100]},{index:1,rgb:[253,239,154]}],temperature:[{index:0,rgb:[4,35,51]},{index:.13,rgb:[23,51,122]},{index:.25,rgb:[85,59,157]},{index:.38,rgb:[129,79,143]},{index:.5,rgb:[175,95,130]},{index:.63,rgb:[222,112,101]},{index:.75,rgb:[249,146,66]},{index:.88,rgb:[249,196,65]},{index:1,rgb:[232,250,91]}],turbidity:[{index:0,rgb:[34,31,27]},{index:.13,rgb:[65,50,41]},{index:.25,rgb:[98,69,52]},{index:.38,rgb:[131,89,57]},{index:.5,rgb:[161,112,59]},{index:.63,rgb:[185,140,66]},{index:.75,rgb:[202,174,88]},{index:.88,rgb:[216,209,126]},{index:1,rgb:[233,246,171]}],"velocity-blue":[{index:0,rgb:[17,32,64]},{index:.13,rgb:[35,52,116]},{index:.25,rgb:[29,81,156]},{index:.38,rgb:[31,113,162]},{index:.5,rgb:[50,144,169]},{index:.63,rgb:[87,173,176]},{index:.75,rgb:[149,196,189]},{index:.88,rgb:[203,221,211]},{index:1,rgb:[254,251,230]}],"velocity-green":[{index:0,rgb:[23,35,19]},{index:.13,rgb:[24,64,38]},{index:.25,rgb:[11,95,45]},{index:.38,rgb:[39,123,35]},{index:.5,rgb:[95,146,12]},{index:.63,rgb:[152,165,18]},{index:.75,rgb:[201,186,69]},{index:.88,rgb:[233,216,137]},{index:1,rgb:[255,253,205]}],cubehelix:[{index:0,rgb:[0,0,0]},{index:.07,rgb:[22,5,59]},{index:.13,rgb:[60,4,105]},{index:.2,rgb:[109,1,135]},{index:.27,rgb:[161,0,147]},{index:.33,rgb:[210,2,142]},{index:.4,rgb:[251,11,123]},{index:.47,rgb:[255,29,97]},{index:.53,rgb:[255,54,69]},{index:.6,rgb:[255,85,46]},{index:.67,rgb:[255,120,34]},{index:.73,rgb:[255,157,37]},{index:.8,rgb:[241,191,57]},{index:.87,rgb:[224,220,93]},{index:.93,rgb:[218,241,142]},{index:1,rgb:[227,253,198]}]}},{}],95:[function(t,e,r){"use strict";function n(t){var e,r,n,u,c,h,f,d,p,m,v,g,y,b=[],x=[],_=[],w=[];if(o.isPlainObject(t)||(t={}),p=t.nshades||72,d=t.format||"hex",f=t.colormap,f||(f="jet"),"string"==typeof f){if(f=f.toLowerCase(),!l[f])throw Error(f+" not a supported colorscale");h=s(l[f])}else{if(!Array.isArray(f))throw Error("unsupported colormap option",f);h=s(f)}if(h.length>p)throw new Error(f+" map requires nshades to be at least size "+h.length);for(v=Array.isArray(t.alpha)?2!==t.alpha.length?[1,1]:s(t.alpha):"number"==typeof t.alpha?[t.alpha,t.alpha]:[1,1],e=h.map(function(t){return Math.round(t.index*p)}),v[0]<0&&(v[0]=0),v[1]<0&&(v[0]=0),v[0]>1&&(v[0]=1),v[1]>1&&(v[0]=1),y=0;y<e.length;++y)g=h[y].index,r=h[y].rgb,4===r.length&&r[3]>=0&&r[3]<=1||(r[3]=v[0]+(v[1]-v[0])*g);for(y=0;y<e.length-1;++y)c=e[y+1]-e[y],n=h[y].rgb,u=h[y+1].rgb,b=b.concat(o.linspace(n[0],u[0],c)),x=x.concat(o.linspace(n[1],u[1],c)),_=_.concat(o.linspace(n[2],u[2],c)),w=w.concat(o.linspace(n[3],u[3],c));return b=b.map(Math.round),x=x.map(Math.round),_=_.map(Math.round),m=o.zip(b,x,_,w),"hex"===d&&(m=m.map(i)),"rgbaString"===d&&(m=m.map(a)),m}function i(t){for(var e,r="#",n=0;n<3;++n)e=t[n],e=e.toString(16),r+=("00"+e).substr(e.length);return r}function a(t){return"rgba("+t.join(",")+")"}var o=t("arraytools"),s=t("clone"),l=t("./colorScales");e.exports=n},{"./colorScales":94,arraytools:42,clone:87}],96:[function(t,e,r){"use strict";function n(t,e,r){var n=s(t[0],-e[0]),i=s(t[1],-e[1]),a=s(r[0],-e[0]),o=s(r[1],-e[1]),c=u(l(n,a),l(i,o));return c[c.length-1]>=0}function i(t,e,r,i){var s=a(e,r,i);if(0===s){var l=o(a(t,e,r)),u=o(a(t,e,i));if(l===u){if(0===l){var c=n(t,e,r);return c===n(t,e,i)?0:c?1:-1}return 0}return 0===u?l>0?-1:n(t,e,i)?-1:1:0===l?u>0?1:n(t,e,r)?1:-1:o(u-l)}var h=a(t,e,r);return h>0?s>0&&a(t,e,i)>0?1:-1:h<0?s>0||a(t,e,i)>0?1:-1:a(t,e,i)>0?1:n(t,e,r)?1:-1}e.exports=i;var a=t("robust-orientation"),o=t("signum"),s=t("two-sum"),l=t("robust-product"),u=t("robust-sum")},{"robust-orientation":500,"robust-product":501,"robust-sum":505,signum:507,"two-sum":532}],97:[function(t,e,r){function n(t,e){return t-e}function i(t,e){var r=t.length,i=t.length-e.length;if(i)return i;switch(r){case 0:return 0;case 1:return t[0]-e[0];case 2:return t[0]+t[1]-e[0]-e[1]||a(t[0],t[1])-a(e[0],e[1]);case 3:var o=t[0]+t[1],s=e[0]+e[1];if(i=o+t[2]-(s+e[2]))return i;var l=a(t[0],t[1]),u=a(e[0],e[1]);return a(l,t[2])-a(u,e[2])||a(l+t[2],o)-a(u+e[2],s);case 4:var c=t[0],h=t[1],f=t[2],d=t[3],p=e[0],m=e[1],v=e[2],g=e[3];return c+h+f+d-(p+m+v+g)||a(c,h,f,d)-a(p,m,v,g,p)||a(c+h,c+f,c+d,h+f,h+d,f+d)-a(p+m,p+v,p+g,m+v,m+g,v+g)||a(c+h+f,c+h+d,c+f+d,h+f+d)-a(p+m+v,p+m+g,p+v+g,m+v+g);default:for(var y=t.slice().sort(n),b=e.slice().sort(n),x=0;x<r;++x)if(i=y[x]-b[x])return i;return 0}}e.exports=i;var a=Math.min},{}],98:[function(t,e,r){"use strict";function n(t,e){return i(t,e)||a(t)-a(e)}var i=t("compare-cell"),a=t("cell-orientation");e.exports=n},{"cell-orientation":81,"compare-cell":97}],99:[function(t,e,r){"use strict";function n(t){var e=t.length;if(0===e)return[];if(1===e)return[[0]];var r=t[0].length;return 0===r?[]:1===r?i(t):2===r?a(t):o(t,r)}var i=t("./lib/ch1d"),a=t("./lib/ch2d"),o=t("./lib/chnd");e.exports=n},{"./lib/ch1d":100,"./lib/ch2d":101,"./lib/chnd":102}],100:[function(t,e,r){"use strict";function n(t){for(var e=0,r=0,n=1;n<t.length;++n)t[n][0]<t[e][0]&&(e=n),t[n][0]>t[r][0]&&(r=n);return e<r?[[e],[r]]:e>r?[[r],[e]]:[[e]]}e.exports=n},{}],101:[function(t,e,r){"use strict";function n(t){var e=i(t),r=e.length;if(r<=2)return[];for(var n=new Array(r),a=e[r-1],o=0;o<r;++o){var s=e[o];n[o]=[a,s],a=s}return n}e.exports=n;var i=t("monotone-convex-hull-2d")},{"monotone-convex-hull-2d":444}],102:[function(t,e,r){"use strict";function n(t,e){for(var r=t.length,n=new Array(r),i=0;i<e.length;++i)n[i]=t[e[i]];for(var a=e.length,i=0;i<r;++i)e.indexOf(i)<0&&(n[a++]=t[i]);return n}function i(t,e){for(var r=t.length,n=e.length,i=0;i<r;++i)for(var a=t[i],o=0;o<a.length;++o){var s=a[o];if(s<n)a[o]=e[s];else{s-=n;for(var l=0;l<n;++l)s>=e[l]&&(s+=1);a[o]=s}}return t}function a(t,e){try{return o(t,!0)}catch(u){var r=s(t);if(r.length<=e)return[];var a=n(t,r),l=o(a,!0);return i(l,r)}}e.exports=a;var o=t("incremental-convex-hull"),s=t("affine-hull")},{"affine-hull":39,"incremental-convex-hull":284}],103:[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"}},{}],104:[function(t,e,r){function n(t){return t=Math.round(t),t<0?0:t>255?255:t}function i(t){return t<0?0:t>1?1:t}function a(t){return n("%"===t[t.length-1]?parseFloat(t)/100*255:parseInt(t))}function o(t){return i("%"===t[t.length-1]?parseFloat(t)/100:parseFloat(t))}function s(t,e,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}function l(t){var e=t.replace(/ /g,"").toLowerCase();if(e in u)return u[e].slice();if("#"===e[0]){if(4===e.length){var r=parseInt(e.substr(1),16);return r>=0&&r<=4095?[(3840&r)>>4|(3840&r)>>8,240&r|(240&r)>>4,15&r|(15&r)<<4,1]:null}if(7===e.length){var r=parseInt(e.substr(1),16);return r>=0&&r<=16777215?[(16711680&r)>>16,(65280&r)>>8,255&r,1]:null}return null}var i=e.indexOf("("),l=e.indexOf(")");if(i!==-1&&l+1===e.length){var c=e.substr(0,i),h=e.substr(i+1,l-(i+1)).split(","),f=1;switch(c){case"rgba":if(4!==h.length)return null;f=o(h.pop());case"rgb":return 3!==h.length?null:[a(h[0]),a(h[1]),a(h[2]),f];case"hsla":if(4!==h.length)return null;f=o(h.pop());case"hsl":if(3!==h.length)return null;var d=(parseFloat(h[0])%360+360)%360/360,p=o(h[1]),m=o(h[2]),v=m<=.5?m*(p+1):m+p-m*p,g=2*m-v;return[n(255*s(g,v,d+1/3)),n(255*s(g,v,d)),n(255*s(g,v,d-1/3)),f];default:return null}}return null}var u={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],
12 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]};try{r.parseCSSColor=l}catch(t){}},{}],105:[function(t,e,r){"use strict";function n(t,e,r,n,i,a){var o=6*i*i-6*i,s=3*i*i-4*i+1,l=-6*i*i+6*i,u=3*i*i-2*i;if(t.length){a||(a=new Array(t.length));for(var c=t.length-1;c>=0;--c)a[c]=o*t[c]+s*e[c]+l*r[c]+u*n[c];return a}return o*t+s*e+l*r[c]+u*n}function i(t,e,r,n,i,a){var o=i-1,s=i*i,l=o*o,u=(1+2*i)*l,c=i*l,h=s*(3-2*i),f=s*o;if(t.length){a||(a=new Array(t.length));for(var d=t.length-1;d>=0;--d)a[d]=u*t[d]+c*e[d]+h*r[d]+f*n[d];return a}return u*t+c*e+h*r+f*n}e.exports=i,e.exports.derivative=n},{}],106:[function(t,e,r){"use strict";function n(){this.argTypes=[],this.shimArgs=[],this.arrayArgs=[],this.arrayBlockIndices=[],this.scalarArgs=[],this.offsetArgs=[],this.offsetArgIndex=[],this.indexArgs=[],this.shapeArgs=[],this.funcName="",this.pre=null,this.body=null,this.post=null,this.debug=!1}function i(t){var e=new n;e.pre=t.pre,e.body=t.body,e.post=t.post;var r=t.args.slice(0);e.argTypes=r;for(var i=0;i<r.length;++i){var o=r[i];if("array"===o||"object"==typeof o&&o.blockIndices){if(e.argTypes[i]="array",e.arrayArgs.push(i),e.arrayBlockIndices.push(o.blockIndices?o.blockIndices:0),e.shimArgs.push("array"+i),i<e.pre.args.length&&e.pre.args[i].count>0)throw new Error("cwise: pre() block may not reference array args");if(i<e.post.args.length&&e.post.args[i].count>0)throw new Error("cwise: post() block may not reference array args")}else if("scalar"===o)e.scalarArgs.push(i),e.shimArgs.push("scalar"+i);else if("index"===o){if(e.indexArgs.push(i),i<e.pre.args.length&&e.pre.args[i].count>0)throw new Error("cwise: pre() block may not reference array index");if(i<e.body.args.length&&e.body.args[i].lvalue)throw new Error("cwise: body() block may not write to array index");if(i<e.post.args.length&&e.post.args[i].count>0)throw new Error("cwise: post() block may not reference array index")}else if("shape"===o){if(e.shapeArgs.push(i),i<e.pre.args.length&&e.pre.args[i].lvalue)throw new Error("cwise: pre() block may not write to array shape");if(i<e.body.args.length&&e.body.args[i].lvalue)throw new Error("cwise: body() block may not write to array shape");if(i<e.post.args.length&&e.post.args[i].lvalue)throw new Error("cwise: post() block may not write to array shape")}else{if("object"!=typeof o||!o.offset)throw new Error("cwise: Unknown argument type "+r[i]);e.argTypes[i]="offset",e.offsetArgs.push({array:o.array,offset:o.offset}),e.offsetArgIndex.push(i)}}if(e.arrayArgs.length<=0)throw new Error("cwise: No array arguments specified");if(e.pre.args.length>r.length)throw new Error("cwise: Too many arguments in pre() block");if(e.body.args.length>r.length)throw new Error("cwise: Too many arguments in body() block");if(e.post.args.length>r.length)throw new Error("cwise: Too many arguments in post() block");return e.debug=!!t.printCode||!!t.debug,e.funcName=t.funcName||"cwise",e.blockSize=t.blockSize||64,a(e)}var a=t("./lib/thunk.js");e.exports=i},{"./lib/thunk.js":108}],107:[function(t,e,r){"use strict";function n(t,e,r){var n,i,a=t.length,o=e.arrayArgs.length,s=e.indexArgs.length>0,l=[],u=[],c=0,h=0;for(n=0;n<a;++n)u.push(["i",n,"=0"].join(""));for(i=0;i<o;++i)for(n=0;n<a;++n)h=c,c=t[n],0===n?u.push(["d",i,"s",n,"=t",i,"p",c].join("")):u.push(["d",i,"s",n,"=(t",i,"p",c,"-s",h,"*t",i,"p",h,")"].join(""));for(l.push("var "+u.join(",")),n=a-1;n>=0;--n)c=t[n],l.push(["for(i",n,"=0;i",n,"<s",c,";++i",n,"){"].join(""));for(l.push(r),n=0;n<a;++n){for(h=c,c=t[n],i=0;i<o;++i)l.push(["p",i,"+=d",i,"s",n].join(""));s&&(n>0&&l.push(["index[",h,"]-=s",h].join("")),l.push(["++index[",c,"]"].join(""))),l.push("}")}return l.join("\n")}function i(t,e,r,i){for(var a=e.length,o=r.arrayArgs.length,s=r.blockSize,l=r.indexArgs.length>0,u=[],c=0;c<o;++c)u.push(["var offset",c,"=p",c].join(""));for(var c=t;c<a;++c)u.push(["for(var j"+c+"=SS[",e[c],"]|0;j",c,">0;){"].join("")),u.push(["if(j",c,"<",s,"){"].join("")),u.push(["s",e[c],"=j",c].join("")),u.push(["j",c,"=0"].join("")),u.push(["}else{s",e[c],"=",s].join("")),u.push(["j",c,"-=",s,"}"].join("")),l&&u.push(["index[",e[c],"]=j",c].join(""));for(var c=0;c<o;++c){for(var h=["offset"+c],f=t;f<a;++f)h.push(["j",f,"*t",c,"p",e[f]].join(""));u.push(["p",c,"=(",h.join("+"),")"].join(""))}u.push(n(e,r,i));for(var c=t;c<a;++c)u.push("}");return u.join("\n")}function a(t){for(var e=0,r=t[0].length;e<r;){for(var n=1;n<t.length;++n)if(t[n][e]!==t[0][e])return e;++e}return e}function o(t,e,r){for(var n=t.body,i=[],a=[],o=0;o<t.args.length;++o){var s=t.args[o];if(!(s.count<=0)){var l=new RegExp(s.name,"g"),u="",c=e.arrayArgs.indexOf(o);switch(e.argTypes[o]){case"offset":var h=e.offsetArgIndex.indexOf(o);c=e.offsetArgs[h].array,u="+q"+h;case"array":u="p"+c+u;var f="l"+o,d="a"+c;if(0===e.arrayBlockIndices[c])1===s.count?"generic"===r[c]?s.lvalue?(i.push(["var ",f,"=",d,".get(",u,")"].join("")),n=n.replace(l,f),a.push([d,".set(",u,",",f,")"].join(""))):n=n.replace(l,[d,".get(",u,")"].join("")):n=n.replace(l,[d,"[",u,"]"].join("")):"generic"===r[c]?(i.push(["var ",f,"=",d,".get(",u,")"].join("")),n=n.replace(l,f),s.lvalue&&a.push([d,".set(",u,",",f,")"].join(""))):(i.push(["var ",f,"=",d,"[",u,"]"].join("")),n=n.replace(l,f),s.lvalue&&a.push([d,"[",u,"]=",f].join("")));else{for(var p=[s.name],m=[u],v=0;v<Math.abs(e.arrayBlockIndices[c]);v++)p.push("\\s*\\[([^\\]]+)\\]"),m.push("$"+(v+1)+"*t"+c+"b"+v);if(l=new RegExp(p.join(""),"g"),u=m.join("+"),"generic"===r[c])throw new Error("cwise: Generic arrays not supported in combination with blocks!");n=n.replace(l,[d,"[",u,"]"].join(""))}break;case"scalar":n=n.replace(l,"Y"+e.scalarArgs.indexOf(o));break;case"index":n=n.replace(l,"index");break;case"shape":n=n.replace(l,"shape")}}}return[i.join("\n"),n,a.join("\n")].join("\n").trim()}function s(t){for(var e=new Array(t.length),r=!0,n=0;n<t.length;++n){var i=t[n],a=i.match(/\d+/);a=a?a[0]:"",0===i.charAt(0)?e[n]="u"+i.charAt(1)+a:e[n]=i.charAt(0)+a,n>0&&(r=r&&e[n]===e[n-1])}return r?e[0]:e.join("")}function l(t,e){for(var r=e[1].length-Math.abs(t.arrayBlockIndices[0])|0,l=new Array(t.arrayArgs.length),c=new Array(t.arrayArgs.length),h=0;h<t.arrayArgs.length;++h)c[h]=e[2*h],l[h]=e[2*h+1];for(var f=[],d=[],p=[],m=[],v=[],h=0;h<t.arrayArgs.length;++h){t.arrayBlockIndices[h]<0?(p.push(0),m.push(r),f.push(r),d.push(r+t.arrayBlockIndices[h])):(p.push(t.arrayBlockIndices[h]),m.push(t.arrayBlockIndices[h]+r),f.push(0),d.push(t.arrayBlockIndices[h]));for(var g=[],y=0;y<l[h].length;y++)p[h]<=l[h][y]&&l[h][y]<m[h]&&g.push(l[h][y]-p[h]);v.push(g)}for(var b=["SS"],x=["'use strict'"],_=[],y=0;y<r;++y)_.push(["s",y,"=SS[",y,"]"].join(""));for(var h=0;h<t.arrayArgs.length;++h){b.push("a"+h),b.push("t"+h),b.push("p"+h);for(var y=0;y<r;++y)_.push(["t",h,"p",y,"=t",h,"[",p[h]+y,"]"].join(""));for(var y=0;y<Math.abs(t.arrayBlockIndices[h]);++y)_.push(["t",h,"b",y,"=t",h,"[",f[h]+y,"]"].join(""))}for(var h=0;h<t.scalarArgs.length;++h)b.push("Y"+h);if(t.shapeArgs.length>0&&_.push("shape=SS.slice(0)"),t.indexArgs.length>0){for(var w=new Array(r),h=0;h<r;++h)w[h]="0";_.push(["index=[",w.join(","),"]"].join(""))}for(var h=0;h<t.offsetArgs.length;++h){for(var M=t.offsetArgs[h],k=[],y=0;y<M.offset.length;++y)0!==M.offset[y]&&(1===M.offset[y]?k.push(["t",M.array,"p",y].join("")):k.push([M.offset[y],"*t",M.array,"p",y].join("")));0===k.length?_.push("q"+h+"=0"):_.push(["q",h,"=",k.join("+")].join(""))}var A=u([].concat(t.pre.thisVars).concat(t.body.thisVars).concat(t.post.thisVars));_=_.concat(A),x.push("var "+_.join(","));for(var h=0;h<t.arrayArgs.length;++h)x.push("p"+h+"|=0");t.pre.body.length>3&&x.push(o(t.pre,t,c));var T=o(t.body,t,c),S=a(v);S<r?x.push(i(S,v[0],t,T)):x.push(n(v[0],t,T)),t.post.body.length>3&&x.push(o(t.post,t,c)),t.debug&&console.log("-----Generated cwise routine for ",e,":\n"+x.join("\n")+"\n----------");var E=[t.funcName||"unnamed","_cwise_loop_",l[0].join("s"),"m",S,s(c)].join("");return new Function(["function ",E,"(",b.join(","),"){",x.join("\n"),"} return ",E].join(""))()}var u=t("uniq");e.exports=l},{uniq:535}],108:[function(t,e,r){"use strict";function n(t){var e=["'use strict'","var CACHED={}"],r=[],n=t.funcName+"_cwise_thunk";e.push(["return function ",n,"(",t.shimArgs.join(","),"){"].join(""));for(var a=[],o=[],s=[["array",t.arrayArgs[0],".shape.slice(",Math.max(0,t.arrayBlockIndices[0]),t.arrayBlockIndices[0]<0?","+t.arrayBlockIndices[0]+")":")"].join("")],l=[],u=[],c=0;c<t.arrayArgs.length;++c){var h=t.arrayArgs[c];r.push(["t",h,"=array",h,".dtype,","r",h,"=array",h,".order"].join("")),a.push("t"+h),a.push("r"+h),o.push("t"+h),o.push("r"+h+".join()"),s.push("array"+h+".data"),s.push("array"+h+".stride"),s.push("array"+h+".offset|0"),c>0&&(l.push("array"+t.arrayArgs[0]+".shape.length===array"+h+".shape.length+"+(Math.abs(t.arrayBlockIndices[0])-Math.abs(t.arrayBlockIndices[c]))),u.push("array"+t.arrayArgs[0]+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[0])+"]===array"+h+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[c])+"]"))}t.arrayArgs.length>1&&(e.push("if (!("+l.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same dimensionality!')"),e.push("for(var shapeIndex=array"+t.arrayArgs[0]+".shape.length-"+Math.abs(t.arrayBlockIndices[0])+"; shapeIndex-->0;) {"),e.push("if (!("+u.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same shape!')"),e.push("}"));for(var c=0;c<t.scalarArgs.length;++c)s.push("scalar"+t.scalarArgs[c]);return r.push(["type=[",o.join(","),"].join()"].join("")),r.push("proc=CACHED[type]"),e.push("var "+r.join(",")),e.push(["if(!proc){","CACHED[type]=proc=compile([",a.join(","),"])}","return proc(",s.join(","),")}"].join("")),t.debug&&console.log("-----Generated thunk:\n"+e.join("\n")+"\n----------"),new Function("compile",e.join("\n"))(i.bind(void 0,t))}var i=t("./compile.js");e.exports=n},{"./compile.js":107}],109:[function(t,e,r){e.exports=t("cwise-compiler")},{"cwise-compiler":106}],110:[function(e,r,n){!function(e,i){"object"==typeof n&&void 0!==r?i(n):"function"==typeof t&&t.amd?t(["exports"],i):i(e.d3=e.d3||{})}(this,function(t){"use strict";function e(t){return function(e,r){return o(t(e),r)}}function r(t,e){return[t,e]}function n(t,e,r){var n=(e-t)/Math.max(0,r),i=Math.floor(Math.log(n)/Math.LN10),a=n/Math.pow(10,i);return i>=0?(a>=k?10:a>=A?5:a>=T?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(a>=k?10:a>=A?5:a>=T?2:1)}function i(t,e,r){var n=Math.abs(e-t)/Math.max(0,r),i=Math.pow(10,Math.floor(Math.log(n)/Math.LN10)),a=n/i;return a>=k?i*=10:a>=A?i*=5:a>=T&&(i*=2),e<t?-i:i}function a(t){return t.length}var o=function(t,e){return t<e?-1:t>e?1:t>=e?0:0/0},s=function(t){return 1===t.length&&(t=e(t)),{left:function(e,r,n,i){for(null==n&&(n=0),null==i&&(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(null==n&&(n=0),null==i&&(i=e.length);n<i;){var a=n+i>>>1;t(e[a],r)>0?i=a:n=a+1}return n}}},l=s(o),u=l.right,c=l.left,h=function(t,e){null==e&&(e=r);for(var n=0,i=t.length-1,a=t[0],o=new Array(i<0?0:i);n<i;)o[n]=e(a,a=t[++n]);return o},f=function(t,e,n){var i,a,o,s,l=t.length,u=e.length,c=new Array(l*u);for(null==n&&(n=r),i=o=0;i<l;++i)for(s=t[i],a=0;a<u;++a,++o)c[o]=n(s,e[a]);return c},d=function(t,e){return e<t?-1:e>t?1:e>=t?0:0/0},p=function(t){return null===t?0/0:+t},m=function(t,e){var r,n,i=t.length,a=0,o=-1,s=0,l=0;if(null==e)for(;++o<i;)isNaN(r=p(t[o]))||(n=r-s,s+=n/++a,l+=n*(r-s));else for(;++o<i;)isNaN(r=p(e(t[o],o,t)))||(n=r-s,s+=n/++a,l+=n*(r-s));if(a>1)return l/(a-1)},v=function(t,e){var r=m(t,e);return r?Math.sqrt(r):r},g=function(t,e){var r,n,i,a=t.length,o=-1;if(null==e){for(;++o<a;)if(null!=(r=t[o])&&r>=r)for(n=i=r;++o<a;)null!=(r=t[o])&&(n>r&&(n=r),i<r&&(i=r))}else for(;++o<a;)if(null!=(r=e(t[o],o,t))&&r>=r)for(n=i=r;++o<a;)null!=(r=e(t[o],o,t))&&(n>r&&(n=r),i<r&&(i=r));return[n,i]},y=Array.prototype,b=y.slice,x=y.map,_=function(t){return function(){return t}},w=function(t){return t},M=function(t,e,r){t=+t,e=+e,r=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+r;for(var n=-1,i=0|Math.max(0,Math.ceil((e-t)/r)),a=new Array(i);++n<i;)a[n]=t+n*r;return a},k=Math.sqrt(50),A=Math.sqrt(10),T=Math.sqrt(2),S=function(t,e,r){var i,a,o,s=e<t,l=-1;if(s&&(i=t,t=e,e=i),0===(o=n(t,e,r))||!isFinite(o))return[];if(o>0)for(t=Math.ceil(t/o),e=Math.floor(e/o),a=new Array(i=Math.ceil(e-t+1));++l<i;)a[l]=(t+l)*o;else for(t=Math.floor(t*o),e=Math.ceil(e*o),a=new Array(i=Math.ceil(t-e+1));++l<i;)a[l]=(t-l)/o;return s&&a.reverse(),a},E=function(t){return Math.ceil(Math.log(t.length)/Math.LN2)+1},L=function(){function t(t){var a,o,s=t.length,l=new Array(s);for(a=0;a<s;++a)l[a]=e(t[a],a,t);var c=r(l),h=c[0],f=c[1],d=n(l,h,f);Array.isArray(d)||(d=i(h,f,d),d=M(Math.ceil(h/d)*d,Math.floor(f/d)*d,d));for(var p=d.length;d[0]<=h;)d.shift(),--p;for(;d[p-1]>f;)d.pop(),--p;var m,v=new Array(p+1);for(a=0;a<=p;++a)m=v[a]=[],m.x0=a>0?d[a-1]:h,m.x1=a<p?d[a]:f;for(a=0;a<s;++a)o=l[a],h<=o&&o<=f&&v[u(d,o,0,p)].push(t[a]);return v}var e=w,r=g,n=E;return t.value=function(r){return arguments.length?(e="function"==typeof r?r:_(r),t):e},t.domain=function(e){return arguments.length?(r="function"==typeof e?e:_([e[0],e[1]]),t):r},t.thresholds=function(e){return arguments.length?(n="function"==typeof e?e:_(Array.isArray(e)?b.call(e):e),t):n},t},C=function(t,e,r){if(null==r&&(r=p),n=t.length){if((e=+e)<=0||n<2)return+r(t[0],0,t);if(e>=1)return+r(t[n-1],n-1,t);var n,i=(n-1)*e,a=Math.floor(i),o=+r(t[a],a,t);return o+(+r(t[a+1],a+1,t)-o)*(i-a)}},z=function(t,e,r){return t=x.call(t,p).sort(o),Math.ceil((r-e)/(2*(C(t,.75)-C(t,.25))*Math.pow(t.length,-1/3)))},D=function(t,e,r){return Math.ceil((r-e)/(3.5*v(t)*Math.pow(t.length,-1/3)))},I=function(t,e){var r,n,i=t.length,a=-1;if(null==e){for(;++a<i;)if(null!=(r=t[a])&&r>=r)for(n=r;++a<i;)null!=(r=t[a])&&r>n&&(n=r)}else for(;++a<i;)if(null!=(r=e(t[a],a,t))&&r>=r)for(n=r;++a<i;)null!=(r=e(t[a],a,t))&&r>n&&(n=r);return n},P=function(t,e){var r,n=t.length,i=n,a=-1,o=0;if(null==e)for(;++a<n;)isNaN(r=p(t[a]))?--i:o+=r;else for(;++a<n;)isNaN(r=p(e(t[a],a,t)))?--i:o+=r;if(i)return o/i},O=function(t,e){var r,n=t.length,i=-1,a=[];if(null==e)for(;++i<n;)isNaN(r=p(t[i]))||a.push(r);else for(;++i<n;)isNaN(r=p(e(t[i],i,t)))||a.push(r);return C(a.sort(o),.5)},j=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(n=t[i],e=n.length;--e>=0;)r[--o]=n[e];return r},F=function(t,e){var r,n,i=t.length,a=-1;if(null==e){for(;++a<i;)if(null!=(r=t[a])&&r>=r)for(n=r;++a<i;)null!=(r=t[a])&&n>r&&(n=r)}else for(;++a<i;)if(null!=(r=e(t[a],a,t))&&r>=r)for(n=r;++a<i;)null!=(r=e(t[a],a,t))&&n>r&&(n=r);return n},R=function(t,e){for(var r=e.length,n=new Array(r);r--;)n[r]=t[e[r]];return n},N=function(t,e){if(r=t.length){var r,n,i=0,a=0,s=t[a];for(null==e&&(e=o);++i<r;)(e(n=t[i],s)<0||0!==e(s,s))&&(s=n,a=i);return 0===e(s,s)?a:void 0}},B=function(t,e,r){for(var n,i,a=(null==r?t.length:r)-(e=null==e?0:+e);a;)i=Math.random()*a--|0,n=t[a+e],t[a+e]=t[i+e],t[i+e]=n;return t},U=function(t,e){var r,n=t.length,i=-1,a=0;if(null==e)for(;++i<n;)(r=+t[i])&&(a+=r);else for(;++i<n;)(r=+e(t[i],i,t))&&(a+=r);return a},V=function(t){if(!(i=t.length))return[];for(var e=-1,r=F(t,a),n=new Array(r);++e<r;)for(var i,o=-1,s=n[e]=new Array(i);++o<i;)s[o]=t[o][e];return n},q=function(){return V(arguments)};t.bisect=u,t.bisectRight=u,t.bisectLeft=c,t.ascending=o,t.bisector=s,t.cross=f,t.descending=d,t.deviation=v,t.extent=g,t.histogram=L,t.thresholdFreedmanDiaconis=z,t.thresholdScott=D,t.thresholdSturges=E,t.max=I,t.mean=P,t.median=O,t.merge=j,t.min=F,t.pairs=h,t.permute=R,t.quantile=C,t.range=M,t.scan=N,t.shuffle=B,t.sum=U,t.ticks=S,t.tickIncrement=n,t.tickStep=i,t.transpose=V,t.variance=m,t.zip=q,Object.defineProperty(t,"__esModule",{value:!0})})},{}],111:[function(e,r,n){!function(e,i){"object"==typeof n&&void 0!==r?i(n):"function"==typeof t&&t.amd?t(["exports"],i):i(e.d3=e.d3||{})}(this,function(t){"use strict";function e(){}function r(t,r){var n=new e;if(t instanceof e)t.each(function(t,e){n.set(e,t)});else if(Array.isArray(t)){var i,a=-1,o=t.length;if(null==r)for(;++a<o;)n.set(a,t[a]);else for(;++a<o;)n.set(r(i=t[a],a,t),i)}else if(t)for(var s in t)n.set(s,t[s]);return n}function n(){return{}}function i(t,e,r){t[e]=r}function a(){return r()}function o(t,e,r){t.set(e,r)}function s(){}function l(t,e){var r=new s;if(t instanceof s)t.each(function(t){r.add(t)});else if(t){var n=-1,i=t.length;if(null==e)for(;++n<i;)r.add(t[n]);else for(;++n<i;)r.add(e(t[n],n,t))}return r}e.prototype=r.prototype={constructor:e,has:function(t){return"$"+t in this},get:function(t){return this["$"+t]},set:function(t,e){return this["$"+t]=e,this},remove:function(t){var e="$"+t;return e in this&&delete this[e]},clear:function(){for(var t in this)"$"===t[0]&&delete this[t]},keys:function(){var t=[];for(var e in this)"$"===e[0]&&t.push(e.slice(1));return t},values:function(){var t=[];for(var e in this)"$"===e[0]&&t.push(this[e]);return t},entries:function(){var t=[];for(var e in this)"$"===e[0]&&t.push({key:e.slice(1),value:this[e]});return t},size:function(){var t=0;for(var e in this)"$"===e[0]&&++t;return t},empty:function(){for(var t in this)if("$"===t[0])return!1;return!0},each:function(t){for(var e in this)"$"===e[0]&&t(this[e],e.slice(1),this)}};var u=function(){function t(e,n,i,a){if(n>=c.length)return null!=l?l(e):null!=s?e.sort(s):e;for(var o,u,h,f=-1,d=e.length,p=c[n++],m=r(),v=i();++f<d;)(h=m.get(o=p(u=e[f])+""))?h.push(u):m.set(o,[u]);return m.each(function(e,r){a(v,r,t(e,n,i,a))}),v}function e(t,r){if(++r>c.length)return t;var n,i=h[r-1];return null!=l&&r>=c.length?n=t.entries():(n=[],t.each(function(t,i){n.push({key:i,values:e(t,r)})})),null!=i?n.sort(function(t,e){return i(t.key,e.key)}):n}var s,l,u,c=[],h=[];return u={object:function(e){return t(e,0,n,i)},map:function(e){return t(e,0,a,o)},entries:function(r){return e(t(r,0,a,o),0)},key:function(t){return c.push(t),u},sortKeys:function(t){return h[c.length-1]=t,u},sortValues:function(t){return s=t,u},rollup:function(t){return l=t,u}}},c=r.prototype;s.prototype=l.prototype={constructor:s,has:c.has,add:function(t){return t+="",this["$"+t]=t,this},remove:c.remove,clear:c.clear,values:c.keys,size:c.size,empty:c.empty,each:c.each};var h=function(t){var e=[];for(var r in t)e.push(r);return e},f=function(t){var e=[];for(var r in t)e.push(t[r]);return e},d=function(t){var e=[];for(var r in t)e.push({key:r,value:t[r]});return e};t.nest=u,t.set=l,t.map=r,t.keys=h,t.values=f,t.entries=d,Object.defineProperty(t,"__esModule",{value:!0})})},{}],112:[function(e,r,n){!function(e,i){"object"==typeof n&&void 0!==r?i(n):"function"==typeof t&&t.amd?t(["exports"],i):i(e.d3=e.d3||{})}(this,function(t){"use strict";function e(t,e){var r=Object.create(t.prototype);for(var n in e)r[n]=e[n];return r}function r(){}function n(t){var e;return t=(t+"").trim().toLowerCase(),(e=z.exec(t))?(e=parseInt(e[1],16),new l(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1)):(e=D.exec(t))?i(parseInt(e[1],16)):(e=I.exec(t))?new l(e[1],e[2],e[3],1):(e=P.exec(t))?new l(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=O.exec(t))?a(e[1],e[2],e[3],e[4]):(e=j.exec(t))?a(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=F.exec(t))?u(e[1],e[2]/100,e[3]/100,1):(e=R.exec(t))?u(e[1],e[2]/100,e[3]/100,e[4]):N.hasOwnProperty(t)?i(N[t]):"transparent"===t?new l(0/0,0/0,0/0,0):null}function i(t){return new l(t>>16&255,t>>8&255,255&t,1)}function a(t,e,r,n){return n<=0&&(t=e=r=0/0),new l(t,e,r,n)}function o(t){return t instanceof r||(t=n(t)),t?(t=t.rgb(),new l(t.r,t.g,t.b,t.opacity)):new l}function s(t,e,r,n){return 1===arguments.length?o(t):new l(t,e,r,null==n?1:n)}function l(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}function u(t,e,r,n){return n<=0?t=e=r=0/0:r<=0||r>=1?t=e=0/0:e<=0&&(t=0/0),new f(t,e,r,n)}function c(t){if(t instanceof f)return new f(t.h,t.s,t.l,t.opacity);if(t instanceof r||(t=n(t)),!t)return new f;if(t instanceof f)return t;t=t.rgb();var e=t.r/255,i=t.g/255,a=t.b/255,o=Math.min(e,i,a),s=Math.max(e,i,a),l=0/0,u=s-o,c=(s+o)/2;return u?(l=e===s?(i-a)/u+6*(i<a):i===s?(a-e)/u+2:(e-i)/u+4,u/=c<.5?s+o:2-s-o,l*=60):u=c>0&&c<1?0:l,new f(l,u,c,t.opacity)}function h(t,e,r,n){return 1===arguments.length?c(t):new f(t,e,r,null==n?1:n)}function f(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}function d(t,e,r){return 255*(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)}function p(t){if(t instanceof v)return new v(t.l,t.a,t.b,t.opacity);if(t instanceof M){var e=t.h*B;return new v(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}t instanceof l||(t=o(t));var r=x(t.r),n=x(t.g),i=x(t.b),a=g((.4124564*r+.3575761*n+.1804375*i)/V),s=g((.2126729*r+.7151522*n+.072175*i)/q);return new v(116*s-16,500*(a-s),200*(s-g((.0193339*r+.119192*n+.9503041*i)/H)),t.opacity)}function m(t,e,r,n){return 1===arguments.length?p(t):new v(t,e,r,null==n?1:n)}function v(t,e,r,n){this.l=+t,this.a=+e,this.b=+r,this.opacity=+n}function g(t){return t>W?Math.pow(t,1/3):t/X+G}function y(t){return t>Y?t*t*t:X*(t-G)}function b(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function x(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function _(t){if(t instanceof M)return new M(t.h,t.c,t.l,t.opacity);t instanceof v||(t=p(t));var e=Math.atan2(t.b,t.a)*U;return new M(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function w(t,e,r,n){return 1===arguments.length?_(t):new M(t,e,r,null==n?1:n)}function M(t,e,r,n){this.h=+t,this.c=+e,this.l=+r,this.opacity=+n}function k(t){if(t instanceof T)return new T(t.h,t.s,t.l,t.opacity);t instanceof l||(t=o(t));var e=t.r/255,r=t.g/255,n=t.b/255,i=(rt*n+tt*e-et*r)/(rt+tt-et),a=n-i,s=($*(r-i)-K*a)/Q,u=Math.sqrt(s*s+a*a)/($*i*(1-i)),c=u?Math.atan2(s,a)*U-120:0/0;return new T(c<0?c+360:c,u,i,t.opacity)}function A(t,e,r,n){return 1===arguments.length?k(t):new T(t,e,r,null==n?1:n)}function T(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}var S=function(t,e,r){t.prototype=e.prototype=r,r.constructor=t},E="\\s*([+-]?\\d+)\\s*",L="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",C="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",z=/^#([0-9a-f]{3})$/,D=/^#([0-9a-f]{6})$/,I=new RegExp("^rgb\\("+[E,E,E]+"\\)$"),P=new RegExp("^rgb\\("+[C,C,C]+"\\)$"),O=new RegExp("^rgba\\("+[E,E,E,L]+"\\)$"),j=new RegExp("^rgba\\("+[C,C,C,L]+"\\)$"),F=new RegExp("^hsl\\("+[L,C,C]+"\\)$"),R=new RegExp("^hsla\\("+[L,C,C,L]+"\\)$"),N={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};S(r,n,{displayable:function(){return this.rgb().displayable()},toString:function(){return this.rgb()+""}}),S(l,s,e(r,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new l(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new l(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return 0<=this.r&&this.r<=255&&0<=this.g&&this.g<=255&&0<=this.b&&this.b<=255&&0<=this.opacity&&this.opacity<=1},toString:function(){var t=this.opacity;return t=isNaN(t)?1:Math.max(0,Math.min(1,t)),(1===t?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}})),S(f,h,e(r,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new f(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new f(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,i=2*r-n;return new l(d(t>=240?t-240:t+120,i,n),d(t,i,n),d(t<120?t+240:t-120,i,n),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1}}));var B=Math.PI/180,U=180/Math.PI,V=.95047,q=1,H=1.08883,G=4/29,Y=6/29,X=3*Y*Y,W=Y*Y*Y;S(v,m,e(r,{brighter:function(t){return new v(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new v(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,r=isNaN(this.b)?t:t-this.b/200;return t=q*y(t),e=V*y(e),r=H*y(r),new l(b(3.2404542*e-1.5371385*t-.4985314*r),b(-.969266*e+1.8760108*t+.041556*r),b(.0556434*e-.2040259*t+1.0572252*r),this.opacity)}})),S(M,w,e(r,{brighter:function(t){return new M(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker:function(t){return new M(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb:function(){return p(this).rgb()}}));var Z=-.14861,J=1.78277,K=-.29227,Q=-.90649,$=1.97294,tt=$*Q,et=$*J,rt=J*K-Q*Z;S(T,A,e(r,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new T(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new T(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*B,e=+this.l,r=isNaN(this.s)?0:this.s*e*(1-e),n=Math.cos(t),i=Math.sin(t);return new l(255*(e+r*(Z*n+J*i)),255*(e+r*(K*n+Q*i)),255*(e+r*($*n)),this.opacity)}})),t.color=n,t.rgb=s,t.hsl=h,t.lab=m,t.hcl=w,t.cubehelix=A,Object.defineProperty(t,"__esModule",{value:!0})})},{}],113:[function(e,r,n){!function(e,i){"object"==typeof n&&void 0!==r?i(n):"function"==typeof t&&t.amd?t(["exports"],i):i(e.d3=e.d3||{})}(this,function(t){"use strict";function e(){for(var t,e=0,n=arguments.length,i={};e<n;++e){if(!(t=arguments[e]+"")||t in i)throw new Error("illegal type: "+t);i[t]=[]}return new r(i)}function r(t){this._=t}function n(t,e){return t.trim().split(/^|\s+/).map(function(t){var r="",n=t.indexOf(".");if(n>=0&&(r=t.slice(n+1),t=t.slice(0,n)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:r}})}function i(t,e){for(var r,n=0,i=t.length;n<i;++n)if((r=t[n]).name===e)return r.value}function a(t,e,r){for(var n=0,i=t.length;n<i;++n)if(t[n].name===e){t[n]=o,t=t.slice(0,n).concat(t.slice(n+1));break}return null!=r&&t.push({name:e,value:r}),t}var o={value:function(){}};r.prototype=e.prototype={constructor:r,on:function(t,e){var r,o=this._,s=n(t+"",o),l=-1,u=s.length;{if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++l<u;)if(r=(t=s[l]).type)o[r]=a(o[r],t.name,e);else if(null==e)for(r in o)o[r]=a(o[r],t.name,null);return this}for(;++l<u;)if((r=(t=s[l]).type)&&(r=i(o[r],t.name)))return r}},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new r(t)},call:function(t,e){if((r=arguments.length-2)>0)for(var r,n,i=new Array(r),a=0;a<r;++a)i[a]=arguments[a+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(n=this._[t],a=0,r=n.length;a<r;++a)n[a].value.apply(e,i)},apply:function(t,e,r){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var n=this._[t],i=0,a=n.length;i<a;++i)n[i].value.apply(e,r)}},t.dispatch=e,Object.defineProperty(t,"__esModule",{value:!0})})},{}],114:[function(e,r,n){!function(i,a){"object"==typeof n&&void 0!==r?a(n,e("d3-quadtree"),e("d3-collection"),e("d3-dispatch"),e("d3-timer")):"function"==typeof t&&t.amd?t(["exports","d3-quadtree","d3-collection","d3-dispatch","d3-timer"],a):a(i.d3=i.d3||{},i.d3,i.d3,i.d3,i.d3)}(this,function(t,e,r,n,i){"use strict";function a(t){return t.x+t.vx}function o(t){return t.y+t.vy}function s(t){return t.index}function l(t,e){var r=t.get(e)
13 ;if(!r)throw new Error("missing: "+e);return r}function u(t){return t.x}function c(t){return t.y}var h=function(t,e){function r(){var r,i,a=n.length,o=0,s=0;for(r=0;r<a;++r)i=n[r],o+=i.x,s+=i.y;for(o=o/a-t,s=s/a-e,r=0;r<a;++r)i=n[r],i.x-=o,i.y-=s}var n;return null==t&&(t=0),null==e&&(e=0),r.initialize=function(t){n=t},r.x=function(e){return arguments.length?(t=+e,r):t},r.y=function(t){return arguments.length?(e=+t,r):e},r},f=function(t){return function(){return t}},d=function(){return 1e-6*(Math.random()-.5)},p=function(t){function r(){function t(t,e,r,n,i){var a=t.data,o=t.r,s=m+o;{if(!a)return e>f+s||n<f-s||r>p+s||i<p-s;if(a.index>h.index){var l=f-a.x-a.vx,c=p-a.y-a.vy,g=l*l+c*c;g<s*s&&(0===l&&(l=d(),g+=l*l),0===c&&(c=d(),g+=c*c),g=(s-(g=Math.sqrt(g)))/g*u,h.vx+=(l*=g)*(s=(o*=o)/(v+o)),h.vy+=(c*=g)*s,a.vx-=l*(s=1-s),a.vy-=c*s)}}}for(var r,i,h,f,p,m,v,g=s.length,y=0;y<c;++y)for(i=e.quadtree(s,a,o).visitAfter(n),r=0;r<g;++r)h=s[r],m=l[h.index],v=m*m,f=h.x+h.vx,p=h.y+h.vy,i.visit(t)}function n(t){if(t.data)return t.r=l[t.data.index];for(var e=t.r=0;e<4;++e)t[e]&&t[e].r>t.r&&(t.r=t[e].r)}function i(){if(s){var e,r,n=s.length;for(l=new Array(n),e=0;e<n;++e)r=s[e],l[r.index]=+t(r,e,s)}}var s,l,u=1,c=1;return"function"!=typeof t&&(t=f(null==t?1:+t)),r.initialize=function(t){s=t,i()},r.iterations=function(t){return arguments.length?(c=+t,r):c},r.strength=function(t){return arguments.length?(u=+t,r):u},r.radius=function(e){return arguments.length?(t="function"==typeof e?e:f(+e),i(),r):t},r},m=function(t){function e(t){return 1/Math.min(p[t.source.index],p[t.target.index])}function n(e){for(var r=0,n=t.length;r<b;++r)for(var i,a,o,s,l,h,f,p=0;p<n;++p)i=t[p],a=i.source,o=i.target,s=o.x+o.vx-a.x-a.vx||d(),l=o.y+o.vy-a.y-a.vy||d(),h=Math.sqrt(s*s+l*l),h=(h-c[p])/h*e*u[p],s*=h,l*=h,o.vx-=s*(f=m[p]),o.vy-=l*f,a.vx+=s*(f=1-f),a.vy+=l*f}function i(){if(h){var e,n,i=h.length,s=t.length,f=r.map(h,v);for(e=0,p=new Array(i);e<s;++e)n=t[e],n.index=e,"object"!=typeof n.source&&(n.source=l(f,n.source)),"object"!=typeof n.target&&(n.target=l(f,n.target)),p[n.source.index]=(p[n.source.index]||0)+1,p[n.target.index]=(p[n.target.index]||0)+1;for(e=0,m=new Array(s);e<s;++e)n=t[e],m[e]=p[n.source.index]/(p[n.source.index]+p[n.target.index]);u=new Array(s),a(),c=new Array(s),o()}}function a(){if(h)for(var e=0,r=t.length;e<r;++e)u[e]=+g(t[e],e,t)}function o(){if(h)for(var e=0,r=t.length;e<r;++e)c[e]=+y(t[e],e,t)}var u,c,h,p,m,v=s,g=e,y=f(30),b=1;return null==t&&(t=[]),n.initialize=function(t){h=t,i()},n.links=function(e){return arguments.length?(t=e,i(),n):t},n.id=function(t){return arguments.length?(v=t,n):v},n.iterations=function(t){return arguments.length?(b=+t,n):b},n.strength=function(t){return arguments.length?(g="function"==typeof t?t:f(+t),a(),n):g},n.distance=function(t){return arguments.length?(y="function"==typeof t?t:f(+t),o(),n):y},n},v=10,g=Math.PI*(3-Math.sqrt(5)),y=function(t){function e(){a(),y.call("tick",l),u<c&&(m.stop(),y.call("end",l))}function a(){var e,r,n=t.length;for(u+=(f-u)*h,p.each(function(t){t(u)}),e=0;e<n;++e)r=t[e],null==r.fx?r.x+=r.vx*=d:(r.x=r.fx,r.vx=0),null==r.fy?r.y+=r.vy*=d:(r.y=r.fy,r.vy=0)}function o(){for(var e,r=0,n=t.length;r<n;++r){if(e=t[r],e.index=r,isNaN(e.x)||isNaN(e.y)){var i=v*Math.sqrt(r),a=r*g;e.x=i*Math.cos(a),e.y=i*Math.sin(a)}(isNaN(e.vx)||isNaN(e.vy))&&(e.vx=e.vy=0)}}function s(e){return e.initialize&&e.initialize(t),e}var l,u=1,c=.001,h=1-Math.pow(c,1/300),f=0,d=.6,p=r.map(),m=i.timer(e),y=n.dispatch("tick","end");return null==t&&(t=[]),o(),l={tick:a,restart:function(){return m.restart(e),l},stop:function(){return m.stop(),l},nodes:function(e){return arguments.length?(t=e,o(),p.each(s),l):t},alpha:function(t){return arguments.length?(u=+t,l):u},alphaMin:function(t){return arguments.length?(c=+t,l):c},alphaDecay:function(t){return arguments.length?(h=+t,l):+h},alphaTarget:function(t){return arguments.length?(f=+t,l):f},velocityDecay:function(t){return arguments.length?(d=1-t,l):1-d},force:function(t,e){return arguments.length>1?(null==e?p.remove(t):p.set(t,s(e)),l):p.get(t)},find:function(e,r,n){var i,a,o,s,l,u=0,c=t.length;for(null==n?n=1/0:n*=n,u=0;u<c;++u)s=t[u],i=e-s.x,a=r-s.y,(o=i*i+a*a)<n&&(l=s,n=o);return l},on:function(t,e){return arguments.length>1?(y.on(t,e),l):y.on(t)}}},b=function(){function t(t){var r,l=a.length,h=e.quadtree(a,u,c).visitAfter(n);for(s=t,r=0;r<l;++r)o=a[r],h.visit(i)}function r(){if(a){var t,e,r=a.length;for(l=new Array(r),t=0;t<r;++t)e=a[t],l[e.index]=+h(e,t,a)}}function n(t){var e,r,n,i,a,o=0;if(t.length){for(n=i=a=0;a<4;++a)(e=t[a])&&(r=e.value)&&(o+=r,n+=r*e.x,i+=r*e.y);t.x=n/o,t.y=i/o}else{e=t,e.x=e.data.x,e.y=e.data.y;do{o+=l[e.data.index]}while(e=e.next)}t.value=o}function i(t,e,r,n){if(!t.value)return!0;var i=t.x-o.x,a=t.y-o.y,u=n-e,c=i*i+a*a;if(u*u/v<c)return c<m&&(0===i&&(i=d(),c+=i*i),0===a&&(a=d(),c+=a*a),c<p&&(c=Math.sqrt(p*c)),o.vx+=i*t.value*s/c,o.vy+=a*t.value*s/c),!0;if(!(t.length||c>=m)){(t.data!==o||t.next)&&(0===i&&(i=d(),c+=i*i),0===a&&(a=d(),c+=a*a),c<p&&(c=Math.sqrt(p*c)));do{t.data!==o&&(u=l[t.data.index]*s/c,o.vx+=i*u,o.vy+=a*u)}while(t=t.next)}}var a,o,s,l,h=f(-30),p=1,m=1/0,v=.81;return t.initialize=function(t){a=t,r()},t.strength=function(e){return arguments.length?(h="function"==typeof e?e:f(+e),r(),t):h},t.distanceMin=function(e){return arguments.length?(p=e*e,t):Math.sqrt(p)},t.distanceMax=function(e){return arguments.length?(m=e*e,t):Math.sqrt(m)},t.theta=function(e){return arguments.length?(v=e*e,t):Math.sqrt(v)},t},x=function(t){function e(t){for(var e,r=0,o=n.length;r<o;++r)e=n[r],e.vx+=(a[r]-e.x)*i[r]*t}function r(){if(n){var e,r=n.length;for(i=new Array(r),a=new Array(r),e=0;e<r;++e)i[e]=isNaN(a[e]=+t(n[e],e,n))?0:+o(n[e],e,n)}}var n,i,a,o=f(.1);return"function"!=typeof t&&(t=f(null==t?0:+t)),e.initialize=function(t){n=t,r()},e.strength=function(t){return arguments.length?(o="function"==typeof t?t:f(+t),r(),e):o},e.x=function(n){return arguments.length?(t="function"==typeof n?n:f(+n),r(),e):t},e},_=function(t){function e(t){for(var e,r=0,o=n.length;r<o;++r)e=n[r],e.vy+=(a[r]-e.y)*i[r]*t}function r(){if(n){var e,r=n.length;for(i=new Array(r),a=new Array(r),e=0;e<r;++e)i[e]=isNaN(a[e]=+t(n[e],e,n))?0:+o(n[e],e,n)}}var n,i,a,o=f(.1);return"function"!=typeof t&&(t=f(null==t?0:+t)),e.initialize=function(t){n=t,r()},e.strength=function(t){return arguments.length?(o="function"==typeof t?t:f(+t),r(),e):o},e.y=function(n){return arguments.length?(t="function"==typeof n?n:f(+n),r(),e):t},e};t.forceCenter=h,t.forceCollide=p,t.forceLink=m,t.forceManyBody=b,t.forceSimulation=y,t.forceX=x,t.forceY=_,Object.defineProperty(t,"__esModule",{value:!0})})},{"d3-collection":111,"d3-dispatch":113,"d3-quadtree":116,"d3-timer":117}],115:[function(e,r,n){!function(i,a){"object"==typeof n&&void 0!==r?a(n,e("d3-color")):"function"==typeof t&&t.amd?t(["exports","d3-color"],a):a(i.d3=i.d3||{},i.d3)}(this,function(t,e){"use strict";function r(t,e,r,n,i){var a=t*t,o=a*t;return((1-3*t+3*a-o)*e+(4-6*a+3*o)*r+(1+3*t+3*a-3*o)*n+o*i)/6}function n(t,e){return function(r){return t+r*e}}function i(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}function a(t,e){var r=e-t;return r?n(t,r>180||r<-180?r-360*Math.round(r/360):r):S(isNaN(t)?e:t)}function o(t){return 1==(t=+t)?s:function(e,r){return r-e?i(e,r,t):S(isNaN(e)?r:e)}}function s(t,e){var r=e-t;return r?n(t,r):S(isNaN(t)?e:t)}function l(t){return function(r){var n,i,a=r.length,o=new Array(a),s=new Array(a),l=new Array(a);for(n=0;n<a;++n)i=e.rgb(r[n]),o[n]=i.r||0,s[n]=i.g||0,l[n]=i.b||0;return o=t(o),s=t(s),l=t(l),i.opacity=1,function(t){return i.r=o(t),i.g=s(t),i.b=l(t),i+""}}}function u(t){return function(){return t}}function c(t){return function(e){return t(e)+""}}function h(t){return"none"===t?U:(_||(_=document.createElement("DIV"),w=document.documentElement,M=document.defaultView),_.style.transform=t,t=M.getComputedStyle(w.appendChild(_),null).getPropertyValue("transform"),w.removeChild(_),t=t.slice(7,-1).split(","),V(+t[0],+t[1],+t[2],+t[3],+t[4],+t[5]))}function f(t){return null==t?U:(k||(k=document.createElementNS("http://www.w3.org/2000/svg","g")),k.setAttribute("transform",t),(t=k.transform.baseVal.consolidate())?(t=t.matrix,V(t.a,t.b,t.c,t.d,t.e,t.f)):U)}function d(t,e,r,n){function i(t){return t.length?t.pop()+" ":""}function a(t,n,i,a,o,s){if(t!==i||n!==a){var l=o.push("translate(",null,e,null,r);s.push({i:l-4,x:I(t,i)},{i:l-2,x:I(n,a)})}else(i||a)&&o.push("translate("+i+e+a+r)}function o(t,e,r,a){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),a.push({i:r.push(i(r)+"rotate(",null,n)-2,x:I(t,e)})):e&&r.push(i(r)+"rotate("+e+n)}function s(t,e,r,a){t!==e?a.push({i:r.push(i(r)+"skewX(",null,n)-2,x:I(t,e)}):e&&r.push(i(r)+"skewX("+e+n)}function l(t,e,r,n,a,o){if(t!==r||e!==n){var s=a.push(i(a)+"scale(",null,",",null,")");o.push({i:s-4,x:I(t,r)},{i:s-2,x:I(e,n)})}else 1===r&&1===n||a.push(i(a)+"scale("+r+","+n+")")}return function(e,r){var n=[],i=[];return e=t(e),r=t(r),a(e.translateX,e.translateY,r.translateX,r.translateY,n,i),o(e.rotate,r.rotate,n,i),s(e.skewX,r.skewX,n,i),l(e.scaleX,e.scaleY,r.scaleX,r.scaleY,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 p(t){return((t=Math.exp(t))+1/t)/2}function m(t){return((t=Math.exp(t))-1/t)/2}function v(t){return((t=Math.exp(2*t))-1)/(t+1)}function g(t){return function(r,n){var i=t((r=e.hsl(r)).h,(n=e.hsl(n)).h),a=s(r.s,n.s),o=s(r.l,n.l),l=s(r.opacity,n.opacity);return function(t){return r.h=i(t),r.s=a(t),r.l=o(t),r.opacity=l(t),r+""}}}function y(t,r){var n=s((t=e.lab(t)).l,(r=e.lab(r)).l),i=s(t.a,r.a),a=s(t.b,r.b),o=s(t.opacity,r.opacity);return function(e){return t.l=n(e),t.a=i(e),t.b=a(e),t.opacity=o(e),t+""}}function b(t){return function(r,n){var i=t((r=e.hcl(r)).h,(n=e.hcl(n)).h),a=s(r.c,n.c),o=s(r.l,n.l),l=s(r.opacity,n.opacity);return function(t){return r.h=i(t),r.c=a(t),r.l=o(t),r.opacity=l(t),r+""}}}function x(t){return function r(n){function i(r,i){var a=t((r=e.cubehelix(r)).h,(i=e.cubehelix(i)).h),o=s(r.s,i.s),l=s(r.l,i.l),u=s(r.opacity,i.opacity);return function(t){return r.h=a(t),r.s=o(t),r.l=l(Math.pow(t,n)),r.opacity=u(t),r+""}}return n=+n,i.gamma=r,i}(1)}var _,w,M,k,A=function(t){var e=t.length-1;return function(n){var i=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),a=t[i],o=t[i+1],s=i>0?t[i-1]:2*a-o,l=i<e-1?t[i+2]:2*o-a;return r((n-i/e)*e,s,a,o,l)}},T=function(t){var e=t.length;return function(n){var i=Math.floor(((n%=1)<0?++n:n)*e),a=t[(i+e-1)%e],o=t[i%e],s=t[(i+1)%e],l=t[(i+2)%e];return r((n-i/e)*e,a,o,s,l)}},S=function(t){return function(){return t}},E=function t(r){function n(t,r){var n=i((t=e.rgb(t)).r,(r=e.rgb(r)).r),a=i(t.g,r.g),o=i(t.b,r.b),l=s(t.opacity,r.opacity);return function(e){return t.r=n(e),t.g=a(e),t.b=o(e),t.opacity=l(e),t+""}}var i=o(r);return n.gamma=t,n}(1),L=l(A),C=l(T),z=function(t,e){var r,n=e?e.length:0,i=t?Math.min(n,t.length):0,a=new Array(n),o=new Array(n);for(r=0;r<i;++r)a[r]=R(t[r],e[r]);for(;r<n;++r)o[r]=e[r];return function(t){for(r=0;r<i;++r)o[r]=a[r](t);return o}},D=function(t,e){var r=new Date;return t=+t,e-=t,function(n){return r.setTime(t+e*n),r}},I=function(t,e){return t=+t,e-=t,function(r){return t+e*r}},P=function(t,e){var r,n={},i={};null!==t&&"object"==typeof t||(t={}),null!==e&&"object"==typeof e||(e={});for(r in e)r in t?n[r]=R(t[r],e[r]):i[r]=e[r];return function(t){for(r in n)i[r]=n[r](t);return i}},O=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,j=new RegExp(O.source,"g"),F=function(t,e){var r,n,i,a=O.lastIndex=j.lastIndex=0,o=-1,s=[],l=[];for(t+="",e+="";(r=O.exec(t))&&(n=j.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:I(r,n)})),a=j.lastIndex;return a<e.length&&(i=e.slice(a),s[o]?s[o]+=i:s[++o]=i),s.length<2?l[0]?c(l[0].x):u(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("")})},R=function(t,r){var n,i=typeof r;return null==r||"boolean"===i?S(r):("number"===i?I:"string"===i?(n=e.color(r))?(r=n,E):F:r instanceof e.color?E:r instanceof Date?D:Array.isArray(r)?z:isNaN(r)?P:I)(t,r)},N=function(t,e){return t=+t,e-=t,function(r){return Math.round(t+e*r)}},B=180/Math.PI,U={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1},V=function(t,e,r,n,i,a){var o,s,l;return(o=Math.sqrt(t*t+e*e))&&(t/=o,e/=o),(l=t*r+e*n)&&(r-=t*l,n-=e*l),(s=Math.sqrt(r*r+n*n))&&(r/=s,n/=s,l/=s),t*n<e*r&&(t=-t,e=-e,l=-l,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(e,t)*B,skewX:Math.atan(l)*B,scaleX:o,scaleY:s}},q=d(h,"px, ","px)","deg)"),H=d(f,", ",")",")"),G=Math.SQRT2,Y=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,h=l-a,f=c*c+h*h;if(f<1e-12)n=Math.log(u/o)/G,r=function(t){return[i+t*c,a+t*h,o*Math.exp(G*t*n)]};else{var d=Math.sqrt(f),g=(u*u-o*o+4*f)/(2*o*2*d),y=(u*u-o*o-4*f)/(2*u*2*d),b=Math.log(Math.sqrt(g*g+1)-g),x=Math.log(Math.sqrt(y*y+1)-y);n=(x-b)/G,r=function(t){var e=t*n,r=p(b),s=o/(2*d)*(r*v(G*e+b)-m(b));return[i+s*c,a+s*h,o*r/p(G*e+b)]}}return r.duration=1e3*n,r},X=g(a),W=g(s),Z=b(a),J=b(s),K=x(a),Q=x(s),$=function(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t(n/(e-1));return r};t.interpolate=R,t.interpolateArray=z,t.interpolateBasis=A,t.interpolateBasisClosed=T,t.interpolateDate=D,t.interpolateNumber=I,t.interpolateObject=P,t.interpolateRound=N,t.interpolateString=F,t.interpolateTransformCss=q,t.interpolateTransformSvg=H,t.interpolateZoom=Y,t.interpolateRgb=E,t.interpolateRgbBasis=L,t.interpolateRgbBasisClosed=C,t.interpolateHsl=X,t.interpolateHslLong=W,t.interpolateLab=y,t.interpolateHcl=Z,t.interpolateHclLong=J,t.interpolateCubehelix=K,t.interpolateCubehelixLong=Q,t.quantize=$,Object.defineProperty(t,"__esModule",{value:!0})})},{"d3-color":112}],116:[function(e,r,n){!function(e,i){"object"==typeof n&&void 0!==r?i(n):"function"==typeof t&&t.amd?t(["exports"],i):i(e.d3=e.d3||{})}(this,function(t){"use strict";function e(t,e,r,n){if(isNaN(e)||isNaN(r))return t;var i,a,o,s,l,u,c,h,f,d=t._root,p={data:n},m=t._x0,v=t._y0,g=t._x1,y=t._y1;if(!d)return t._root=p,t;for(;d.length;)if((u=e>=(a=(m+g)/2))?m=a:g=a,(c=r>=(o=(v+y)/2))?v=o:y=o,i=d,!(d=d[h=c<<1|u]))return i[h]=p,t;if(s=+t._x.call(null,d.data),l=+t._y.call(null,d.data),e===s&&r===l)return p.next=d,i?i[h]=p:t._root=p,t;do{i=i?i[h]=new Array(4):t._root=new Array(4),(u=e>=(a=(m+g)/2))?m=a:g=a,(c=r>=(o=(v+y)/2))?v=o:y=o}while((h=c<<1|u)==(f=(l>=o)<<1|s>=a));return i[f]=d,i[h]=p,t}function r(t){var r,n,i,a,o=t.length,s=new Array(o),l=new Array(o),u=1/0,c=1/0,h=-1/0,f=-1/0;for(n=0;n<o;++n)isNaN(i=+this._x.call(null,r=t[n]))||isNaN(a=+this._y.call(null,r))||(s[n]=i,l[n]=a,i<u&&(u=i),i>h&&(h=i),a<c&&(c=a),a>f&&(f=a));for(h<u&&(u=this._x0,h=this._x1),f<c&&(c=this._y0,f=this._y1),this.cover(u,c).cover(h,f),n=0;n<o;++n)e(this,s[n],l[n],t[n]);return this}function n(t){for(var e=0,r=t.length;e<r;++e)this.remove(t[e]);return this}function i(t){return t[0]}function a(t){return t[1]}function o(t,e,r){var n=new s(null==e?i:e,null==r?a:r,0/0,0/0,0/0,0/0);return null==t?n:n.addAll(t)}function s(t,e,r,n,i,a){this._x=t,this._y=e,this._x0=r,this._y0=n,this._x1=i,this._y1=a,this._root=void 0}function l(t){for(var e={data:t.data},r=e;t=t.next;)r=r.next={data:t.data};return e}var u=function(t){var r=+this._x.call(null,t),n=+this._y.call(null,t);return e(this.cover(r,n),r,n,t)},c=function(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var r=this._x0,n=this._y0,i=this._x1,a=this._y1;if(isNaN(r))i=(r=Math.floor(t))+1,a=(n=Math.floor(e))+1;else{if(!(r>t||t>i||n>e||e>a))return this;var o,s,l=i-r,u=this._root;switch(s=(e<(n+a)/2)<<1|t<(r+i)/2){case 0:do{o=new Array(4),o[s]=u,u=o}while(l*=2,i=r+l,a=n+l,t>i||e>a);break;case 1:do{o=new Array(4),o[s]=u,u=o}while(l*=2,r=i-l,a=n+l,r>t||e>a);break;case 2:do{o=new Array(4),o[s]=u,u=o}while(l*=2,i=r+l,n=a-l,t>i||n>e);break;case 3:do{o=new Array(4),o[s]=u,u=o}while(l*=2,r=i-l,n=a-l,r>t||n>e)}this._root&&this._root.length&&(this._root=u)}return this._x0=r,this._y0=n,this._x1=i,this._y1=a,this},h=function(){var t=[];return this.visit(function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)}),t},f=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},d=function(t,e,r,n,i){this.node=t,this.x0=e,this.y0=r,this.x1=n,this.y1=i},p=function(t,e,r){var n,i,a,o,s,l,u,c=this._x0,h=this._y0,f=this._x1,p=this._y1,m=[],v=this._root;for(v&&m.push(new d(v,c,h,f,p)),null==r?r=1/0:(c=t-r,h=e-r,f=t+r,p=e+r,r*=r);l=m.pop();)if(!(!(v=l.node)||(i=l.x0)>f||(a=l.y0)>p||(o=l.x1)<c||(s=l.y1)<h))if(v.length){var g=(i+o)/2,y=(a+s)/2;m.push(new d(v[3],g,y,o,s),new d(v[2],i,y,g,s),new d(v[1],g,a,o,y),new d(v[0],i,a,g,y)),(u=(e>=y)<<1|t>=g)&&(l=m[m.length-1],m[m.length-1]=m[m.length-1-u],m[m.length-1-u]=l)}else{var b=t-+this._x.call(null,v.data),x=e-+this._y.call(null,v.data),_=b*b+x*x;if(_<r){var w=Math.sqrt(r=_);c=t-w,h=e-w,f=t+w,p=e+w,n=v.data}}return n},m=function(t){if(isNaN(a=+this._x.call(null,t))||isNaN(o=+this._y.call(null,t)))return this;var e,r,n,i,a,o,s,l,u,c,h,f,d=this._root,p=this._x0,m=this._y0,v=this._x1,g=this._y1;if(!d)return this;if(d.length)for(;;){if((u=a>=(s=(p+v)/2))?p=s:v=s,(c=o>=(l=(m+g)/2))?m=l:g=l,e=d,!(d=d[h=c<<1|u]))return this;if(!d.length)break;(e[h+1&3]||e[h+2&3]||e[h+3&3])&&(r=e,f=h)}for(;d.data!==t;)if(n=d,!(d=d.next))return this;return(i=d.next)&&delete d.next,n?(i?n.next=i:delete n.next,this):e?(i?e[h]=i:delete e[h],(d=e[0]||e[1]||e[2]||e[3])&&d===(e[3]||e[2]||e[1]||e[0])&&!d.length&&(r?r[f]=d:this._root=d),this):(this._root=i,this)},v=function(){return this._root},g=function(){var t=0;return this.visit(function(e){if(!e.length)do{++t}while(e=e.next)}),t},y=function(t){var e,r,n,i,a,o,s=[],l=this._root;for(l&&s.push(new d(l,this._x0,this._y0,this._x1,this._y1));e=s.pop();)if(!t(l=e.node,n=e.x0,i=e.y0,a=e.x1,o=e.y1)&&l.length){var u=(n+a)/2,c=(i+o)/2;(r=l[3])&&s.push(new d(r,u,c,a,o)),(r=l[2])&&s.push(new d(r,n,c,u,o)),(r=l[1])&&s.push(new d(r,u,i,a,c)),(r=l[0])&&s.push(new d(r,n,i,u,c))}return this},b=function(t){var e,r=[],n=[];for(this._root&&r.push(new d(this._root,this._x0,this._y0,this._x1,this._y1));e=r.pop();){var i=e.node;if(i.length){var a,o=e.x0,s=e.y0,l=e.x1,u=e.y1,c=(o+l)/2,h=(s+u)/2;(a=i[0])&&r.push(new d(a,o,s,c,h)),(a=i[1])&&r.push(new d(a,c,s,l,h)),(a=i[2])&&r.push(new d(a,o,h,c,u)),(a=i[3])&&r.push(new d(a,c,h,l,u))}n.push(e)}for(;e=n.pop();)t(e.node,e.x0,e.y0,e.x1,e.y1);return this},x=function(t){return arguments.length?(this._x=t,this):this._x},_=function(t){return arguments.length?(this._y=t,this):this._y},w=o.prototype=s.prototype;w.copy=function(){var t,e,r=new s(this._x,this._y,this._x0,this._y0,this._x1,this._y1),n=this._root;if(!n)return r;if(!n.length)return r._root=l(n),r;for(t=[{source:n,target:r._root=new Array(4)}];n=t.pop();)for(var i=0;i<4;++i)(e=n.source[i])&&(e.length?t.push({source:e,target:n.target[i]=new Array(4)}):n.target[i]=l(e));return r},w.add=u,w.addAll=r,w.cover=c,w.data=h,w.extent=f,w.find=p,w.remove=m,w.removeAll=n,w.root=v,w.size=g,w.visit=y,w.visitAfter=b,w.x=x,w.y=_,t.quadtree=o,Object.defineProperty(t,"__esModule",{value:!0})})},{}],117:[function(e,r,n){!function(e,i){"object"==typeof n&&void 0!==r?i(n):"function"==typeof t&&t.amd?t(["exports"],i):i(e.d3=e.d3||{})}(this,function(t){"use strict";function e(){return g||(x(r),g=b.now()+y)}function r(){g=0}function n(){this._call=this._time=this._next=null}function i(t,e,r){var i=new n;return i.restart(t,e,r),i}function a(){e(),++f;for(var t,r=c;r;)(t=g-r._time)>=0&&r._call.call(null,t),r=r._next;--f}function o(){g=(v=b.now())+y,f=d=0;try{a()}finally{f=0,l(),g=0}}function s(){var t=b.now(),e=t-v;e>m&&(y-=e,v=t)}function l(){for(var t,e,r=c,n=1/0;r;)r._call?(n>r._time&&(n=r._time),t=r,r=r._next):(e=r._next,r._next=null,r=t?t._next=e:c=e);h=t,u(n)}function u(t){if(!f){d&&(d=clearTimeout(d));var e=t-g;e>24?(t<1/0&&(d=setTimeout(o,e)),p&&(p=clearInterval(p))):(p||(v=g,p=setInterval(s,m)),f=1,x(o))}}var c,h,f=0,d=0,p=0,m=1e3,v=0,g=0,y=0,b="object"==typeof performance&&performance.now?performance:Date,x="function"==typeof requestAnimationFrame?requestAnimationFrame:function(t){setTimeout(t,17)};n.prototype=i.prototype={constructor:n,restart:function(t,r,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?e():+n)+(null==r?0:+r),this._next||h===this||(h?h._next=this:c=this,h=this),this._call=t,this._time=n,u()},stop:function(){this._call&&(this._call=null,this._time=1/0,u())}};var _=function(t,e,r){var i=new n;return e=null==e?0:+e,i.restart(function(r){i.stop(),t(r+e)},e,r),i},w=function(t,r,i){var a=new n,o=r;return null==r?(a.restart(t,r,i),a):(r=+r,i=null==i?e():+i,a.restart(function e(n){n+=o,a.restart(e,o+=r,i),t(n)},r,i),a)};t.now=e,t.timer=i,t.timerFlush=a,t.timeout=_,t.interval=w,Object.defineProperty(t,"__esModule",{value:!0})})},{}],118:[function(e,r,n){!function(){function e(t){return t&&(t.ownerDocument||t.document||t).documentElement}function n(t){return t&&(t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView)}function i(t,e){return t<e?-1:t>e?1:t>=e?0:0/0}function a(t){return null===t?0/0:+t}function o(t){return!isNaN(t)}function s(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}}}function l(t){return t.length}function u(t){for(var e=1;t*e%1;)e*=10;return e}function c(t,e){for(var r in e)Object.defineProperty(t.prototype,r,{value:e[r],enumerable:!1})}function h(){this._=Object.create(null)}function f(t){return(t+="")===_o||t[0]===wo?wo+t:t}function d(t){return(t+="")[0]===wo?t.slice(1):t}function p(t){return f(t)in this._}function m(t){return(t=f(t))in this._&&delete this._[t]}function v(){var t=[];for(var e in this._)t.push(d(e));return t}function g(){var t=0;for(var e in this._)++t;return t}function y(){for(var t in this._)return!1;return!0}function b(){this._=Object.create(null)}function x(t){return t}function _(t,e,r){return function(){var n=r.apply(e,arguments);return n===e?t:n}}function w(t,e){if(e in t)return e;e=e.charAt(0).toUpperCase()+e.slice(1);for(var r=0,n=Mo.length;r<n;++r){var i=Mo[r]+e;if(i in t)return i}}function M(){}function k(){}function A(t){function e(){for(var e,n=r,i=-1,a=n.length;++i<a;)(e=n[i].on)&&e.apply(this,arguments);return t}var r=[],n=new h;return e.on=function(e,i){var a,o=n.get(e);return arguments.length<2?o&&o.on:(o&&(o.on=null,r=r.slice(0,a=r.indexOf(o)).concat(r.slice(a+1)),n.remove(e)),i&&r.push(n.set(e,{on:i})),t)},e}function T(){uo.event.preventDefault()}function S(){for(var t,e=uo.event;t=e.sourceEvent;)e=t;return e}function E(t){for(var e=new k,r=0,n=arguments.length;++r<n;)e[arguments[r]]=A(e);return e.of=function(r,n){return function(i){try{var a=i.sourceEvent=uo.event;i.target=t,uo.event=i,e[i.type].apply(r,n)}finally{uo.event=a}}},e}function L(t){return Ao(t,Lo),t}function C(t){return"function"==typeof t?t:function(){return To(t,this)}}function z(t){return"function"==typeof t?t:function(){return So(t,this)}}function D(t,e){function r(){this.removeAttribute(t)}function n(){this.removeAttributeNS(t.space,t.local)}function i(){this.setAttribute(t,e)}function a(){this.setAttributeNS(t.space,t.local,e)}function o(){var r=e.apply(this,arguments);null==r?this.removeAttribute(t):this.setAttribute(t,r)}function s(){var r=e.apply(this,arguments);null==r?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,r)}return t=uo.ns.qualify(t),null==e?t.local?n:r:"function"==typeof e?t.local?s:o:t.local?a:i}function I(t){return t.trim().replace(/\s+/g," ")}function P(t){return new RegExp("(?:^|\\s+)"+uo.requote(t)+"(?:\\s+|$)","g")}function O(t){return(t+"").trim().split(/^|\s+/)}function j(t,e){function r(){for(var r=-1;++r<i;)t[r](this,e)}function n(){for(var r=-1,n=e.apply(this,arguments);++r<i;)t[r](this,n)}t=O(t).map(F);var i=t.length;return"function"==typeof e?n:r}function F(t){var e=P(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",I(i+" "+t))):r.setAttribute("class",I(i.replace(e," ")))}}function R(t,e,r){function n(){this.style.removeProperty(t)}function i(){this.style.setProperty(t,e,r)}function a(){var n=e.apply(this,arguments);null==n?this.style.removeProperty(t):this.style.setProperty(t,n,r)}return null==e?n:"function"==typeof e?a:i}function N(t,e){function r(){delete this[t]}function n(){this[t]=e}function i(){var r=e.apply(this,arguments);null==r?delete this[t]:this[t]=r}return null==e?r:"function"==typeof e?i:n}function B(t){function e(){var e=this.ownerDocument,r=this.namespaceURI;return r===Co&&e.documentElement.namespaceURI===Co?e.createElement(t):e.createElementNS(r,t)}function r(){return this.ownerDocument.createElementNS(t.space,t.local)}return"function"==typeof t?t:(t=uo.ns.qualify(t)).local?r:e}function U(){var t=this.parentNode;t&&t.removeChild(this)}function V(t){return{__data__:t}}function q(t){return function(){return Eo(this,t)}}function H(t){return arguments.length||(t=i),function(e,r){return e&&r?t(e.__data__,r.__data__):!e-!r}}function G(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 Y(t){return Ao(t,Do),t}function X(t){var e,r;return function(n,i,a){var o,s=t[a].update,l=s.length;for(a!=r&&(r=a,e=0),i>=e&&(e=i+1);!(o=s[e])&&++e<l;);return o}}function W(t,e,r){function n(){var e=this[o];e&&(this.removeEventListener(t,e,e.$),delete this[o])}function i(){var i=l(e,ho(arguments));n.call(this),this.addEventListener(t,this[o]=i,i.$=r),i._=e}function a(){var e,r=new RegExp("^__on([^.]+)"+uo.requote(t)+"$");for(var n in this)if(e=n.match(r)){var i=this[n];this.removeEventListener(e[1],i,i.$),delete this[n]}}var o="__on"+t,s=t.indexOf("."),l=Z;s>0&&(t=t.slice(0,s));var u=Io.get(t);return u&&(t=u,l=J),s?e?i:n:e?M:a}function Z(t,e){return function(r){var n=uo.event;uo.event=r,e[0]=this.__data__;try{t.apply(this,e)}finally{uo.event=n}}}function J(t,e){var r=Z(t,e);return function(t){var e=this,n=t.relatedTarget;n&&(n===e||8&n.compareDocumentPosition(e))||r.call(e,t)}}function K(t){var r=".dragsuppress-"+ ++Oo,i="click"+r,a=uo.select(n(t)).on("touchmove"+r,T).on("dragstart"+r,T).on("selectstart"+r,T);if(null==Po&&(Po=!("onselectstart"in t)&&w(t.style,"userSelect")),Po){var o=e(t).style,s=o[Po];o[Po]="none"}return function(t){if(a.on(r,null),Po&&(o[Po]=s),t){var e=function(){a.on(i,null)};a.on(i,function(){T(),e()},!0),setTimeout(e,0)}}}function Q(t,e){e.changedTouches&&(e=e.changedTouches[0]);var r=t.ownerSVGElement||t;if(r.createSVGPoint){var i=r.createSVGPoint();if(jo<0){var a=n(t);if(a.scrollX||a.scrollY){r=uo.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var o=r[0][0].getScreenCTM();jo=!(o.f||o.e),r.remove()}}return jo?(i.x=e.pageX,i.y=e.pageY):(i.x=e.clientX,i.y=e.clientY),i=i.matrixTransform(t.getScreenCTM().inverse()),[i.x,i.y]}var s=t.getBoundingClientRect();return[e.clientX-s.left-t.clientLeft,e.clientY-s.top-t.clientTop]}function $(){return uo.event.changedTouches[0].identifier}function tt(t){return t>0?1:t<0?-1:0}function et(t,e,r){return(e[0]-t[0])*(r[1]-t[1])-(e[1]-t[1])*(r[0]-t[0])}function rt(t){return t>1?0:t<-1?No:Math.acos(t)}function nt(t){return t>1?Vo:t<-1?-Vo:Math.asin(t)}function it(t){return((t=Math.exp(t))-1/t)/2}function at(t){return((t=Math.exp(t))+1/t)/2}function ot(t){return((t=Math.exp(2*t))-1)/(t+1)}function st(t){return(t=Math.sin(t/2))*t}function lt(){}function ut(t,e,r){return this instanceof ut?(this.h=+t,this.s=+e,void(this.l=+r)):arguments.length<2?t instanceof ut?new ut(t.h,t.s,t.l):Mt(""+t,kt,ut):new ut(t,e,r)}function ct(t,e,r){function n(t){return t>360?t-=360:t<0&&(t+=360),t<60?a+(o-a)*t/60:t<180?o:t<240?a+(o-a)*(240-t)/60:a}function i(t){return Math.round(255*n(t))}var a,o;return t=isNaN(t)?0:(t%=360)<0?t+360:t,e=isNaN(e)?0:e<0?0:e>1?1:e,r=r<0?0:r>1?1:r,o=r<=.5?r*(1+e):r+e-r*e,a=2*r-o,new bt(i(t+120),i(t),i(t-120))}function ht(t,e,r){return this instanceof ht?(this.h=+t,this.c=+e,void(this.l=+r)):arguments.length<2?t instanceof ht?new ht(t.h,t.c,t.l):t instanceof dt?mt(t.l,t.a,t.b):mt((t=At((t=uo.rgb(t)).r,t.g,t.b)).l,t.a,t.b):new ht(t,e,r)}function ft(t,e,r){return isNaN(t)&&(t=0),isNaN(e)&&(e=0),new dt(r,Math.cos(t*=qo)*e,Math.sin(t)*e)}function dt(t,e,r){return this instanceof dt?(this.l=+t,this.a=+e,void(this.b=+r)):arguments.length<2?t instanceof dt?new dt(t.l,t.a,t.b):t instanceof ht?ft(t.h,t.c,t.l):At((t=bt(t)).r,t.g,t.b):new dt(t,e,r)}function pt(t,e,r){var n=(t+16)/116,i=n+e/500,a=n-r/200;return i=vt(i)*Qo,n=vt(n)*$o,a=vt(a)*ts,new bt(yt(3.2404542*i-1.5371385*n-.4985314*a),yt(-.969266*i+1.8760108*n+.041556*a),yt(.0556434*i-.2040259*n+1.0572252*a))}function mt(t,e,r){return t>0?new ht(Math.atan2(r,e)*Ho,Math.sqrt(e*e+r*r),t):new ht(0/0,0/0,t)}function vt(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function gt(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function yt(t){return Math.round(255*(t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function bt(t,e,r){return this instanceof bt?(this.r=~~t,this.g=~~e,void(this.b=~~r)):arguments.length<2?t instanceof bt?new bt(t.r,t.g,t.b):Mt(""+t,bt,ct):new bt(t,e,r)}function xt(t){return new bt(t>>16,t>>8&255,255&t)}function _t(t){return xt(t)+""}function wt(t){return t<16?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function Mt(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(St(i[0]),St(i[1]),St(i[2]))}return(a=ns.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 kt(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=0/0,i=l>0&&l<1?0:n),new ut(n,i,l)}function At(t,e,r){t=Tt(t),e=Tt(e),r=Tt(r);var n=gt((.4124564*t+.3575761*e+.1804375*r)/Qo),i=gt((.2126729*t+.7151522*e+.072175*r)/$o);return dt(116*i-16,500*(n-i),200*(i-gt((.0193339*t+.119192*e+.9503041*r)/ts)))}function Tt(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function St(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}function Et(t){return"function"==typeof t?t:function(){return t}}function Lt(t){return function(e,r,n){return 2===arguments.length&&"function"==typeof r&&(n=r,r=null),Ct(e,r,t,n)}}function Ct(t,e,r,n){function i(){var t,e=l.status;if(!e&&Dt(l)||e>=200&&e<300||304===e){try{t=r.call(a,l)}catch(t){return void o.error.call(a,t)}o.load.call(a,t)}else o.error.call(a,l)}var a={},o=uo.dispatch("beforesend","progress","load","error"),s={},l=new XMLHttpRequest,u=null;return!this.XDomainRequest||"withCredentials"in l||!/^(http(s)?:)?\/\//.test(t)||(l=new XDomainRequest),"onload"in l?l.onload=l.onerror=i:l.onreadystatechange=function(){l.readyState>3&&i()},l.onprogress=function(t){var e=uo.event;uo.event=t;try{o.progress.call(a,l)}finally{uo.event=e}},a.header=function(t,e){return t=(t+"").toLowerCase(),arguments.length<2?s[t]:(null==e?delete s[t]:s[t]=e+"",a)},a.mimeType=function(t){return arguments.length?(e=null==t?null:t+"",a):e},a.responseType=function(t){return arguments.length?(u=t,a):u},a.response=function(t){return r=t,a},["get","post"].forEach(function(t){a[t]=function(){return a.send.apply(a,[t].concat(ho(arguments)))}}),a.send=function(r,n,i){if(2===arguments.length&&"function"==typeof n&&(i=n,n=null),l.open(r,t,!0),null==e||"accept"in s||(s.accept=e+",*/*"),
14 l.setRequestHeader)for(var c in s)l.setRequestHeader(c,s[c]);return null!=e&&l.overrideMimeType&&l.overrideMimeType(e),null!=u&&(l.responseType=u),null!=i&&a.on("error",i).on("load",function(t){i(null,t)}),o.beforesend.call(a,l),l.send(null==n?null:n),a},a.abort=function(){return l.abort(),a},uo.rebind(a,o,"on"),null==n?a:a.get(zt(n))}function zt(t){return 1===t.length?function(e,r){t(null==e?r:null)}:t}function Dt(t){var e=t.responseType;return e&&"text"!==e?t.response:t.responseText}function It(t,e,r){var n=arguments.length;n<2&&(e=0),n<3&&(r=Date.now());var i=r+e,a={c:t,t:i,n:null};return as?as.n=a:is=a,as=a,os||(ss=clearTimeout(ss),os=1,ls(Pt)),a}function Pt(){var t=Ot(),e=jt()-t;e>24?(isFinite(e)&&(clearTimeout(ss),ss=setTimeout(Pt,e)),os=0):(os=1,ls(Pt))}function Ot(){for(var t=Date.now(),e=is;e;)t>=e.t&&e.c(t-e.t)&&(e.c=null),e=e.n;return t}function jt(){for(var t,e=is,r=1/0;e;)e.c?(e.t<r&&(r=e.t),e=(t=e).n):e=t?t.n=e.n:is=e.n;return as=t,r}function Ft(t,e){return e-(t?Math.ceil(Math.log(t)/Math.LN10):1)}function Rt(t,e){var r=Math.pow(10,3*xo(8-e));return{scale:e>8?function(t){return t/r}:function(t){return t*r},symbol:t}}function Nt(t){var e=t.decimal,r=t.thousands,n=t.grouping,i=t.currency,a=n&&r?function(t,e){for(var i=t.length,a=[],o=0,s=n[0],l=0;i>0&&s>0&&(l+s+1>e&&(s=Math.max(1,e-l)),a.push(t.substring(i-=s,i+s)),!((l+=s+1)>e));)s=n[o=(o+1)%n.length];return a.reverse().join(r)}:x;return function(t){var r=cs.exec(t),n=r[1]||" ",o=r[2]||">",s=r[3]||"-",l=r[4]||"",u=r[5],c=+r[6],h=r[7],f=r[8],d=r[9],p=1,m="",v="",g=!1,y=!0;switch(f&&(f=+f.substring(1)),(u||"0"===n&&"="===o)&&(u=n="0",o="="),d){case"n":h=!0,d="g";break;case"%":p=100,v="%",d="f";break;case"p":p=100,v="%",d="r";break;case"b":case"o":case"x":case"X":"#"===l&&(m="0"+d.toLowerCase());case"c":y=!1;case"d":g=!0,f=0;break;case"s":p=-1,d="r"}"$"===l&&(m=i[0],v=i[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=hs.get(d)||Bt;var b=u&&h;return function(t){var r=v;if(g&&t%1)return"";var i=t<0||0===t&&1/t<0?(t=-t,"-"):"-"===s?"":s;if(p<0){var l=uo.formatPrefix(t,f);t=l.scale(t),r=l.symbol+v}else t*=p;t=d(t,f);var x,_,w=t.lastIndexOf(".");if(w<0){var M=y?t.lastIndexOf("e"):-1;M<0?(x=t,_=""):(x=t.substring(0,M),_=t.substring(M))}else x=t.substring(0,w),_=e+t.substring(w+1);!u&&h&&(x=a(x,1/0));var k=m.length+x.length+_.length+(b?0:i.length),A=k<c?new Array(k=c-k+1).join(n):"";return b&&(x=a(A+x,A.length?c-_.length:1/0)),i+=m,t=x+_,("<"===o?i+t+A:">"===o?A+i+t:"^"===o?A.substring(0,k>>=1)+i+t+A.substring(k):i+(b?t:A+t))+r}}}function Bt(t){return t+""}function Ut(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function Vt(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 ds(r-1)),1),r}function a(t,r){return e(t=new ds(+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}function s(t,e,r){try{ds=Ut;var n=new Ut;return n._=t,o(n,e,r)}finally{ds=Date}}t.floor=t,t.round=n,t.ceil=i,t.offset=a,t.range=o;var l=t.utc=qt(t);return l.floor=l,l.round=qt(n),l.ceil=qt(i),l.offset=qt(a),l.range=s,t}function qt(t){return function(e,r){try{ds=Ut;var n=new Ut;return n._=e,t(n,r)._}finally{ds=Date}}}function Ht(t){function e(t){function e(e){for(var r,i,a,o=[],s=-1,l=0;++s<n;)37===t.charCodeAt(s)&&(o.push(t.slice(l,s)),null!=(i=ms[r=t.charAt(++s)])&&(r=t.charAt(++s)),(a=E[r])&&(r=a(e,null==i?"e"===r?" ":"0":i)),o.push(r),l=s+1);return o.push(t.slice(l,s)),o.join("")}var n=t.length;return e.parse=function(e){var n={y:1900,m:0,d:1,H:0,M:0,S:0,L:0,Z:null};if(r(n,t,e,0)!=e.length)return null;"p"in n&&(n.H=n.H%12+12*n.p);var i=null!=n.Z&&ds!==Ut,a=new(i?Ut:ds);return"j"in n?a.setFullYear(n.y,0,n.j):"W"in n||"U"in n?("w"in n||(n.w="W"in n?1:0),a.setFullYear(n.y,0,1),a.setFullYear(n.y,0,"W"in n?(n.w+6)%7+7*n.W-(a.getDay()+5)%7:n.w+7*n.U-(a.getDay()+6)%7)):a.setFullYear(n.y,n.m,n.d),a.setHours(n.H+(n.Z/100|0),n.M+n.Z%100,n.S,n.L),i?a._:a},e.toString=function(){return t},e}function r(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=L[o in ms?e.charAt(s++):o])||(n=a(t,r,n))<0)return-1}else if(i!=r.charCodeAt(n++))return-1}return n}function n(t,e,r){w.lastIndex=0;var n=w.exec(e.slice(r));return n?(t.w=M.get(n[0].toLowerCase()),r+n[0].length):-1}function i(t,e,r){x.lastIndex=0;var n=x.exec(e.slice(r));return n?(t.w=_.get(n[0].toLowerCase()),r+n[0].length):-1}function a(t,e,r){T.lastIndex=0;var n=T.exec(e.slice(r));return n?(t.m=S.get(n[0].toLowerCase()),r+n[0].length):-1}function o(t,e,r){k.lastIndex=0;var n=k.exec(e.slice(r));return n?(t.m=A.get(n[0].toLowerCase()),r+n[0].length):-1}function s(t,e,n){return r(t,E.c.toString(),e,n)}function l(t,e,n){return r(t,E.x.toString(),e,n)}function u(t,e,n){return r(t,E.X.toString(),e,n)}function c(t,e,r){var n=b.get(e.slice(r,r+=2).toLowerCase());return null==n?-1:(t.p=n,r)}var h=t.dateTime,f=t.date,d=t.time,p=t.periods,m=t.days,v=t.shortDays,g=t.months,y=t.shortMonths;e.utc=function(t){function r(t){try{ds=Ut;var e=new ds;return e._=t,n(e)}finally{ds=Date}}var n=e(t);return r.parse=function(t){try{ds=Ut;var e=n.parse(t);return e&&e._}finally{ds=Date}},r.toString=n.toString,r},e.multi=e.utc.multi=ce;var b=uo.map(),x=Yt(m),_=Xt(m),w=Yt(v),M=Xt(v),k=Yt(g),A=Xt(g),T=Yt(y),S=Xt(y);p.forEach(function(t,e){b.set(t.toLowerCase(),e)});var E={a:function(t){return v[t.getDay()]},A:function(t){return m[t.getDay()]},b:function(t){return y[t.getMonth()]},B:function(t){return g[t.getMonth()]},c:e(h),d:function(t,e){return Gt(t.getDate(),e,2)},e:function(t,e){return Gt(t.getDate(),e,2)},H:function(t,e){return Gt(t.getHours(),e,2)},I:function(t,e){return Gt(t.getHours()%12||12,e,2)},j:function(t,e){return Gt(1+fs.dayOfYear(t),e,3)},L:function(t,e){return Gt(t.getMilliseconds(),e,3)},m:function(t,e){return Gt(t.getMonth()+1,e,2)},M:function(t,e){return Gt(t.getMinutes(),e,2)},p:function(t){return p[+(t.getHours()>=12)]},S:function(t,e){return Gt(t.getSeconds(),e,2)},U:function(t,e){return Gt(fs.sundayOfYear(t),e,2)},w:function(t){return t.getDay()},W:function(t,e){return Gt(fs.mondayOfYear(t),e,2)},x:e(f),X:e(d),y:function(t,e){return Gt(t.getFullYear()%100,e,2)},Y:function(t,e){return Gt(t.getFullYear()%1e4,e,4)},Z:le,"%":function(){return"%"}},L={a:n,A:i,b:a,B:o,c:s,d:re,e:re,H:ie,I:ie,j:ne,L:se,m:ee,M:ae,p:c,S:oe,U:Zt,w:Wt,W:Jt,x:l,X:u,y:Qt,Y:Kt,Z:$t,"%":ue};return e}function Gt(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 Yt(t){return new RegExp("^(?:"+t.map(uo.requote).join("|")+")","i")}function Xt(t){for(var e=new h,r=-1,n=t.length;++r<n;)e.set(t[r].toLowerCase(),r);return e}function Wt(t,e,r){vs.lastIndex=0;var n=vs.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function Zt(t,e,r){vs.lastIndex=0;var n=vs.exec(e.slice(r));return n?(t.U=+n[0],r+n[0].length):-1}function Jt(t,e,r){vs.lastIndex=0;var n=vs.exec(e.slice(r));return n?(t.W=+n[0],r+n[0].length):-1}function Kt(t,e,r){vs.lastIndex=0;var n=vs.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function Qt(t,e,r){vs.lastIndex=0;var n=vs.exec(e.slice(r,r+2));return n?(t.y=te(+n[0]),r+n[0].length):-1}function $t(t,e,r){return/^[+-]\d{4}$/.test(e=e.slice(r,r+5))?(t.Z=-e,r+5):-1}function te(t){return t+(t>68?1900:2e3)}function ee(t,e,r){vs.lastIndex=0;var n=vs.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function re(t,e,r){vs.lastIndex=0;var n=vs.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function ne(t,e,r){vs.lastIndex=0;var n=vs.exec(e.slice(r,r+3));return n?(t.j=+n[0],r+n[0].length):-1}function ie(t,e,r){vs.lastIndex=0;var n=vs.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function ae(t,e,r){vs.lastIndex=0;var n=vs.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function oe(t,e,r){vs.lastIndex=0;var n=vs.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function se(t,e,r){vs.lastIndex=0;var n=vs.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function le(t){var e=t.getTimezoneOffset(),r=e>0?"-":"+",n=xo(e)/60|0,i=xo(e)%60;return r+Gt(n,"0",2)+Gt(i,"0",2)}function ue(t,e,r){gs.lastIndex=0;var n=gs.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function ce(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)}}function he(){}function fe(t,e,r){var n=r.s=t+e,i=n-t,a=n-i;r.t=t-a+(e-i)}function de(t,e){t&&_s.hasOwnProperty(t.type)&&_s[t.type](t,e)}function pe(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 me(t,e){var r=-1,n=t.length;for(e.polygonStart();++r<n;)pe(t[r],e,1);e.polygonEnd()}function ve(){function t(t,e){t*=qo,e=e*qo/2+No/4;var r=t-n,o=r>=0?1:-1,s=o*r,l=Math.cos(e),u=Math.sin(e),c=a*u,h=i*l+c*Math.cos(s),f=c*o*Math.sin(s);Ms.add(Math.atan2(f,h)),n=t,i=l,a=u}var e,r,n,i,a;ks.point=function(o,s){ks.point=t,n=(e=o)*qo,i=Math.cos(s=(r=s)*qo/2+No/4),a=Math.sin(s)},ks.lineEnd=function(){t(e,r)}}function ge(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 ye(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function be(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 xe(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function _e(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function we(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 Me(t){return[Math.atan2(t[1],t[0]),nt(t[2])]}function ke(t,e){return xo(t[0]-e[0])<Fo&&xo(t[1]-e[1])<Fo}function Ae(t,e){t*=qo;var r=Math.cos(e*=qo);Te(r*Math.cos(t),r*Math.sin(t),Math.sin(e))}function Te(t,e,r){++As,Ss+=(t-Ss)/As,Es+=(e-Es)/As,Ls+=(r-Ls)/As}function Se(){function t(t,i){t*=qo;var a=Math.cos(i*=qo),o=a*Math.cos(t),s=a*Math.sin(t),l=Math.sin(i),u=Math.atan2(Math.sqrt((u=r*l-n*s)*u+(u=n*o-e*l)*u+(u=e*s-r*o)*u),e*o+r*s+n*l);Ts+=u,Cs+=u*(e+(e=o)),zs+=u*(r+(r=s)),Ds+=u*(n+(n=l)),Te(e,r,n)}var e,r,n;js.point=function(i,a){i*=qo;var o=Math.cos(a*=qo);e=o*Math.cos(i),r=o*Math.sin(i),n=Math.sin(a),js.point=t,Te(e,r,n)}}function Ee(){js.point=Ae}function Le(){function t(t,e){t*=qo;var r=Math.cos(e*=qo),o=r*Math.cos(t),s=r*Math.sin(t),l=Math.sin(e),u=i*l-a*s,c=a*o-n*l,h=n*s-i*o,f=Math.sqrt(u*u+c*c+h*h),d=n*o+i*s+a*l,p=f&&-rt(d)/f,m=Math.atan2(f,d);Is+=p*u,Ps+=p*c,Os+=p*h,Ts+=m,Cs+=m*(n+(n=o)),zs+=m*(i+(i=s)),Ds+=m*(a+(a=l)),Te(n,i,a)}var e,r,n,i,a;js.point=function(o,s){e=o,r=s,js.point=t,o*=qo;var l=Math.cos(s*=qo);n=l*Math.cos(o),i=l*Math.sin(o),a=Math.sin(s),Te(n,i,a)},js.lineEnd=function(){t(e,r),js.lineEnd=Ee,js.point=Ae}}function Ce(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 ze(){return!0}function De(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(ke(r,n)){i.lineStart();for(var s=0;s<e;++s)i.point((r=t[s])[0],r[1]);return void i.lineEnd()}var l=new Pe(r,t,null,!0),u=new Pe(r,null,l,!1);l.o=u,a.push(l),o.push(u),l=new Pe(n,t,null,!1),u=new Pe(n,null,l,!0),l.o=u,a.push(l),o.push(u)}}),o.sort(e),Ie(a),Ie(o),a.length){for(var s=0,l=r,u=o.length;s<u;++s)o[s].e=l=!l;for(var c,h,f=a[0];;){for(var d=f,p=!0;d.v;)if((d=d.n)===f)return;c=d.z,i.lineStart();do{if(d.v=d.o.v=!0,d.e){if(p)for(var s=0,u=c.length;s<u;++s)i.point((h=c[s])[0],h[1]);else n(d.x,d.n.x,1,i);d=d.n}else{if(p){c=d.p.z;for(var s=c.length-1;s>=0;--s)i.point((h=c[s])[0],h[1])}else n(d.x,d.p.x,-1,i);d=d.p}d=d.o,c=d.z,p=!p}while(!d.v);i.lineEnd()}}}function Ie(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 Pe(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 Oe(t,e,r,n){return function(i,a){function o(e,r){var n=i(e,r);t(e=n[0],r=n[1])&&a.point(e,r)}function s(t,e){var r=i(t,e);v.point(r[0],r[1])}function l(){y.point=s,v.lineStart()}function u(){y.point=o,v.lineEnd()}function c(t,e){m.push([t,e]);var r=i(t,e);x.point(r[0],r[1])}function h(){x.lineStart(),m=[]}function f(){c(m[0][0],m[0][1]),x.lineEnd();var t,e=x.clean(),r=b.buffer(),n=r.length;if(m.pop(),p.push(m),m=null,n)if(1&e){t=r[0];var i,n=t.length-1,o=-1;if(n>0){for(_||(a.polygonStart(),_=!0),a.lineStart();++o<n;)a.point((i=t[o])[0],i[1]);a.lineEnd()}}else n>1&&2&e&&r.push(r.pop().concat(r.shift())),d.push(r.filter(je))}var d,p,m,v=e(a),g=i.invert(n[0],n[1]),y={point:o,lineStart:l,lineEnd:u,polygonStart:function(){y.point=c,y.lineStart=h,y.lineEnd=f,d=[],p=[]},polygonEnd:function(){y.point=o,y.lineStart=l,y.lineEnd=u,d=uo.merge(d);var t=Ve(g,p);d.length?(_||(a.polygonStart(),_=!0),De(d,Re,t,r,a)):t&&(_||(a.polygonStart(),_=!0),a.lineStart(),r(null,null,1,a),a.lineEnd()),_&&(a.polygonEnd(),_=!1),d=p=null},sphere:function(){a.polygonStart(),a.lineStart(),r(null,null,1,a),a.lineEnd(),a.polygonEnd()}},b=Fe(),x=e(b),_=!1;return y}}function je(t){return t.length>1}function Fe(){var t,e=[];return{lineStart:function(){e.push(t=[])},point:function(e,r){t.push([e,r])},lineEnd:M,buffer:function(){var r=e;return e=[],t=null,r},rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))}}}function Re(t,e){return((t=t.x)[0]<0?t[1]-Vo-Fo:Vo-t[1])-((e=e.x)[0]<0?e[1]-Vo-Fo:Vo-e[1])}function Ne(t){var e,r=0/0,n=0/0,i=0/0;return{lineStart:function(){t.lineStart(),e=1},point:function(a,o){var s=a>0?No:-No,l=xo(a-r);xo(l-No)<Fo?(t.point(r,n=(n+o)/2>0?Vo:-Vo),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(s,n),t.point(a,n),e=0):i!==s&&l>=No&&(xo(r-i)<Fo&&(r-=i*Fo),xo(a-s)<Fo&&(a-=s*Fo),n=Be(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=0/0},clean:function(){return 2-e}}}function Be(t,e,r,n){var i,a,o=Math.sin(t-r);return xo(o)>Fo?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}function Ue(t,e,r,n){var i;if(null==t)i=r*Vo,n.point(-No,i),n.point(0,i),n.point(No,i),n.point(No,0),n.point(No,-i),n.point(0,-i),n.point(-No,-i),n.point(-No,0),n.point(-No,i);else if(xo(t[0]-e[0])>Fo){var a=t[0]<e[0]?No:-No;i=r*a/2,n.point(-a,i),n.point(0,i),n.point(a,i)}else n.point(e[0],e[1])}function Ve(t,e){var r=t[0],n=t[1],i=[Math.sin(r),-Math.cos(r),0],a=0,o=0;Ms.reset();for(var s=0,l=e.length;s<l;++s){var u=e[s],c=u.length;if(c)for(var h=u[0],f=h[0],d=h[1]/2+No/4,p=Math.sin(d),m=Math.cos(d),v=1;;){v===c&&(v=0),t=u[v];var g=t[0],y=t[1]/2+No/4,b=Math.sin(y),x=Math.cos(y),_=g-f,w=_>=0?1:-1,M=w*_,k=M>No,A=p*b;if(Ms.add(Math.atan2(A*w*Math.sin(M),m*x+A*Math.cos(M))),a+=k?_+w*Bo:_,k^f>=r^g>=r){var T=be(ge(h),ge(t));we(T);var S=be(i,T);we(S);var E=(k^_>=0?-1:1)*nt(S[2]);(n>E||n===E&&(T[0]||T[1]))&&(o+=k^_>=0?1:-1)}if(!v++)break;f=g,p=b,m=x,h=t}}return(a<-Fo||a<Fo&&Ms<-Fo)^1&o}function qe(t){function e(t,e){return Math.cos(t)*Math.cos(e)>a}function r(t){var r,a,l,u,c;return{lineStart:function(){u=l=!1,c=1},point:function(h,f){var d,p=[h,f],m=e(h,f),v=o?m?0:i(h,f):m?i(h+(h<0?No:-No),f):0;if(!r&&(u=l=m)&&t.lineStart(),m!==l&&(d=n(r,p),(ke(r,d)||ke(p,d))&&(p[0]+=Fo,p[1]+=Fo,m=e(p[0],p[1]))),m!==l)c=0,m?(t.lineStart(),d=n(p,r),t.point(d[0],d[1])):(d=n(r,p),t.point(d[0],d[1]),t.lineEnd()),r=d;else if(s&&r&&o^m){var g;v&a||!(g=n(p,r,!0))||(c=0,o?(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||r&&ke(r,p)||t.point(p[0],p[1]),r=p,l=m,a=v},lineEnd:function(){l&&t.lineEnd(),r=null},clean:function(){return c|(u&&l)<<1}}}function n(t,e,r){var n=ge(t),i=ge(e),o=[1,0,0],s=be(n,i),l=ye(s,s),u=s[0],c=l-u*u;if(!c)return!r&&t;var h=a*l/c,f=-a*u/c,d=be(o,s),p=_e(o,h);xe(p,_e(s,f));var m=d,v=ye(p,m),g=ye(m,m),y=v*v-g*(ye(p,p)-1);if(!(y<0)){var b=Math.sqrt(y),x=_e(m,(-v-b)/g);if(xe(x,p),x=Me(x),!r)return x;var _,w=t[0],M=e[0],k=t[1],A=e[1];M<w&&(_=w,w=M,M=_);var T=M-w,S=xo(T-No)<Fo,E=S||T<Fo;if(!S&&A<k&&(_=k,k=A,A=_),E?S?k+A>0^x[1]<(xo(x[0]-w)<Fo?k:A):k<=x[1]&&x[1]<=A:T>No^(w<=x[0]&&x[0]<=M)){var L=_e(m,(-v+b)/g);return xe(L,p),[x,Me(L)]}}}function i(e,r){var n=o?t:No-t,i=0;return e<-n?i|=1:e>n&&(i|=2),r<-n?i|=4:r>n&&(i|=8),i}var a=Math.cos(t),o=a>0,s=xo(a)>Fo;return Oe(e,r,vr(t,6*qo),o?[0,-t]:[-No,t-No])}function He(t,e,r,n){return function(i){var a,o=i.a,s=i.b,l=o.x,u=o.y,c=s.x,h=s.y,f=0,d=1,p=c-l,m=h-u;if(a=t-l,p||!(a>0)){if(a/=p,p<0){if(a<f)return;a<d&&(d=a)}else if(p>0){if(a>d)return;a>f&&(f=a)}if(a=r-l,p||!(a<0)){if(a/=p,p<0){if(a>d)return;a>f&&(f=a)}else if(p>0){if(a<f)return;a<d&&(d=a)}if(a=e-u,m||!(a>0)){if(a/=m,m<0){if(a<f)return;a<d&&(d=a)}else if(m>0){if(a>d)return;a>f&&(f=a)}if(a=n-u,m||!(a<0)){if(a/=m,m<0){if(a>d)return;a>f&&(f=a)}else if(m>0){if(a<f)return;a<d&&(d=a)}return f>0&&(i.a={x:l+f*p,y:u+f*m}),d<1&&(i.b={x:l+d*p,y:u+d*m}),i}}}}}}function Ge(t,e,r,n){function i(n,i){return xo(n[0]-t)<Fo?i>0?0:3:xo(n[0]-r)<Fo?i>0?2:1:xo(n[1]-e)<Fo?i>0?1:0:i>0?3:2}function a(t,e){return o(t.x,e.x)}function o(t,e){var r=i(t,1),n=i(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]}return function(s){function l(t){for(var e=0,r=v.length,n=t[1],i=0;i<r;++i)for(var a,o=1,s=v[i],l=s.length,u=s[0];o<l;++o)a=s[o],u[1]<=n?a[1]>n&&et(u,a,t)>0&&++e:a[1]<=n&&et(u,a,t)<0&&--e,u=a;return 0!==e}function u(a,s,l,u){var c=0,h=0;if(null==a||(c=i(a,l))!==(h=i(s,l))||o(a,s)<0^l>0)do{u.point(0===c||3===c?t:r,c>1?n:e)}while((c=(c+l+4)%4)!==h);else u.point(s[0],s[1])}function c(i,a){return t<=i&&i<=r&&e<=a&&a<=n}function h(t,e){c(t,e)&&s.point(t,e)}function f(){L.point=p,v&&v.push(g=[]),k=!0,M=!1,_=w=0/0}function d(){m&&(p(y,b),x&&M&&S.rejoin(),m.push(S.buffer())),L.point=h,M&&s.lineEnd()}function p(t,e){t=Math.max(-Rs,Math.min(Rs,t)),e=Math.max(-Rs,Math.min(Rs,e));var r=c(t,e);if(v&&g.push([t,e]),k)y=t,b=e,x=r,k=!1,r&&(s.lineStart(),s.point(t,e));else if(r&&M)s.point(t,e);else{var n={a:{x:_,y:w},b:{x:t,y:e}};E(n)?(M||(s.lineStart(),s.point(n.a.x,n.a.y)),s.point(n.b.x,n.b.y),r||s.lineEnd(),A=!1):r&&(s.lineStart(),s.point(t,e),A=!1)}_=t,w=e,M=r}var m,v,g,y,b,x,_,w,M,k,A,T=s,S=Fe(),E=He(t,e,r,n),L={point:h,lineStart:f,lineEnd:d,polygonStart:function(){s=S,m=[],v=[],A=!0},polygonEnd:function(){s=T,m=uo.merge(m);var e=l([t,n]),r=A&&e,i=m.length;(r||i)&&(s.polygonStart(),r&&(s.lineStart(),u(null,null,1,s),s.lineEnd()),i&&De(m,a,e,u,s),s.polygonEnd()),m=v=g=null}};return L}}function Ye(t){var e=0,r=No/3,n=lr(t),i=n(e,r);return i.parallels=function(t){return arguments.length?n(e=t[0]*No/180,r=t[1]*No/180):[e/No*180,r/No*180]},i}function Xe(t,e){function r(t,e){var r=Math.sqrt(a-2*i*Math.sin(e))/i;return[r*Math.sin(t*=i),o-r*Math.cos(t)]}var n=Math.sin(t),i=(n+Math.sin(e))/2,a=1+n*(2*i-n),o=Math.sqrt(a)/i;return r.invert=function(t,e){var r=o-e;return[Math.atan2(t,r)/i,nt((a-(t*t+r*r)*i*i)/(2*i))]},r}function We(){function t(t,e){Bs+=i*t-n*e,n=t,i=e}var e,r,n,i;Gs.point=function(a,o){Gs.point=t,e=n=a,r=i=o},Gs.lineEnd=function(){t(e,r)}}function Ze(t,e){t<Us&&(Us=t),t>qs&&(qs=t),e<Vs&&(Vs=e),e>Hs&&(Hs=e)}function Je(){function t(t,e){o.push("M",t,",",e,a)}function e(t,e){o.push("M",t,",",e),s.point=r}function r(t,e){o.push("L",t,",",e)}function n(){s.point=t}function i(){o.push("Z")}var a=Ke(4.5),o=[],s={point:t,lineStart:function(){s.point=e},lineEnd:n,polygonStart:function(){s.lineEnd=i},polygonEnd:function(){s.lineEnd=n,s.point=t},pointRadius:function(t){return a=Ke(t),s},result:function(){if(o.length){var t=o.join("");return o=[],t}}};return s}function Ke(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function Qe(t,e){Ss+=t,Es+=e,++Ls}function $e(){function t(t,n){var i=t-e,a=n-r,o=Math.sqrt(i*i+a*a);Cs+=o*(e+t)/2,zs+=o*(r+n)/2,Ds+=o,Qe(e=t,r=n)}var e,r;Xs.point=function(n,i){Xs.point=t,Qe(e=n,r=i)}}function tr(){Xs.point=Qe}function er(){function t(t,e){var r=t-n,a=e-i,o=Math.sqrt(r*r+a*a);Cs+=o*(n+t)/2,zs+=o*(i+e)/2,Ds+=o,o=i*t-n*e,Is+=o*(n+t),Ps+=o*(i+e),Os+=3*o,Qe(n=t,i=e)}var e,r,n,i;Xs.point=function(a,o){Xs.point=t,Qe(e=n=a,r=i=o)},Xs.lineEnd=function(){t(e,r)}}function rr(t){function e(e,r){t.moveTo(e+o,r),t.arc(e,r,o,0,Bo)}function r(e,r){t.moveTo(e,r),s.point=n}function n(e,r){t.lineTo(e,r)}function i(){s.point=e}function a(){t.closePath()}var o=4.5,s={point:e,lineStart:function(){s.point=r},lineEnd:i,polygonStart:function(){s.lineEnd=a},polygonEnd:function(){s.lineEnd=i,s.point=e},pointRadius:function(t){return o=t,s},result:M};return s}function nr(t){function e(t){return(s?n:r)(t)}function r(e){return or(e,function(r,n){r=t(r,n),e.point(r[0],r[1])})}function n(e){function r(r,n){r=t(r,n),e.point(r[0],r[1])}function n(){b=0/0,k.point=a,e.lineStart()}function a(r,n){var a=ge([r,n]),o=t(r,n);i(b,x,y,_,w,M,b=o[0],x=o[1],y=r,_=a[0],w=a[1],M=a[2],s,e),e.point(b,x)}function o(){k.point=r,e.lineEnd()}function l(){n(),k.point=u,k.lineEnd=c}function u(t,e){a(h=t,f=e),d=b,p=x,m=_,v=w,g=M,k.point=a}function c(){i(b,x,y,_,w,M,d,p,h,m,v,g,s,e),k.lineEnd=o,o()}var h,f,d,p,m,v,g,y,b,x,_,w,M,k={point:r,lineStart:n,lineEnd:o,polygonStart:function(){e.polygonStart(),k.lineStart=l},polygonEnd:function(){e.polygonEnd(),k.lineStart=n}};return k}function i(e,r,n,s,l,u,c,h,f,d,p,m,v,g){var y=c-e,b=h-r,x=y*y+b*b;if(x>4*a&&v--){var _=s+d,w=l+p,M=u+m,k=Math.sqrt(_*_+w*w+M*M),A=Math.asin(M/=k),T=xo(xo(M)-1)<Fo||xo(n-f)<Fo?(n+f)/2:Math.atan2(w,_),S=t(T,A),E=S[0],L=S[1],C=E-e,z=L-r,D=b*C-y*z;(D*D/x>a||xo((y*C+b*z)/x-.5)>.3||s*d+l*p+u*m<o)&&(i(e,r,n,s,l,u,E,L,T,_/=k,w/=k,M,v,g),g.point(E,L),i(E,L,T,_,w,M,c,h,f,d,p,m,v,g))}}var a=.5,o=Math.cos(30*qo),s=16;return e.precision=function(t){return arguments.length?(s=(a=t*t)>0&&16,e):Math.sqrt(a)},e}function ir(t){var e=nr(function(e,r){return t([e*Ho,r*Ho])});return function(t){return ur(e(t))}}function ar(t){this.stream=t}function or(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 sr(t){return lr(function(){return t})()}function lr(t){function e(t){return t=s(t[0]*qo,t[1]*qo),[t[0]*f+l,u-t[1]*f]}function r(t){return(t=s.invert((t[0]-l)/f,(u-t[1])/f))&&[t[0]*Ho,t[1]*Ho]}function n(){s=Ce(o=fr(g,y,b),a);var t=a(m,v);return l=d-t[0]*f,u=p+t[1]*f,i()}function i(){return c&&(c.valid=!1,c=null),e}var a,o,s,l,u,c,h=nr(function(t,e){return t=a(t,e),[t[0]*f+l,u-t[1]*f]}),f=150,d=480,p=250,m=0,v=0,g=0,y=0,b=0,_=Fs,w=x,M=null,k=null;return e.stream=function(t){return c&&(c.valid=!1),c=ur(_(o,h(w(t)))),c.valid=!0,c},e.clipAngle=function(t){return arguments.length?(_=null==t?(M=t,Fs):qe((M=+t)*qo),i()):M},e.clipExtent=function(t){return arguments.length?(k=t,w=t?Ge(t[0][0],t[0][1],t[1][0],t[1][1]):x,i()):k},e.scale=function(t){return arguments.length?(f=+t,n()):f},e.translate=function(t){return arguments.length?(d=+t[0],p=+t[1],n()):[d,p]},e.center=function(t){return arguments.length?(m=t[0]%360*qo,v=t[1]%360*qo,n()):[m*Ho,v*Ho]},e.rotate=function(t){return arguments.length?(g=t[0]%360*qo,y=t[1]%360*qo,b=t.length>2?t[2]%360*qo:0,n()):[g*Ho,y*Ho,b*Ho]},uo.rebind(e,h,"precision"),function(){return a=t.apply(this,arguments),e.invert=a.invert&&r,n()}}function ur(t){return or(t,function(e,r){t.point(e*qo,r*qo)})}function cr(t,e){return[t,e]}function hr(t,e){return[t>No?t-Bo:t<-No?t+Bo:t,e]}function fr(t,e,r){return t?e||r?Ce(pr(t),mr(e,r)):pr(t):e||r?mr(e,r):hr}function dr(t){return function(e,r){return e+=t,[e>No?e-Bo:e<-No?e+Bo:e,r]}}function pr(t){var e=dr(t);return e.invert=dr(-t),e}function mr(t,e){function r(t,e){var r=Math.cos(e),s=Math.cos(t)*r,l=Math.sin(t)*r,u=Math.sin(e),c=u*n+s*i;return[Math.atan2(l*a-c*o,s*n-u*i),nt(c*a+l*o)]}var n=Math.cos(t),i=Math.sin(t),a=Math.cos(e),o=Math.sin(e);return r.invert=function(t,e){var r=Math.cos(e),s=Math.cos(t)*r,l=Math.sin(t)*r,u=Math.sin(e),c=u*a-l*o;return[Math.atan2(l*a+u*o,s*n+c*i),nt(c*n-s*i)]},r}function vr(t,e){var r=Math.cos(t),n=Math.sin(t);return function(i,a,o,s){var l=o*e;null!=i?(i=gr(r,i),a=gr(r,a),(o>0?i<a:i>a)&&(i+=o*Bo)):(i=t+o*Bo,a=t-.5*l);for(var u,c=i;o>0?c>a:c<a;c-=l)s.point((u=Me([r,-n*Math.cos(c),-n*Math.sin(c)]))[0],u[1])}}function gr(t,e){var r=ge(e);r[0]-=t,we(r);var n=rt(-r[1]);return((-r[2]<0?-n:n)+2*Math.PI-Fo)%(2*Math.PI)}function yr(t,e,r){var n=uo.range(t,e-Fo,r).concat(e);return function(t){return n.map(function(e){return[t,e]})}}function br(t,e,r){var n=uo.range(t,e-Fo,r).concat(e);return function(t){return n.map(function(e){return[e,t]})}}function xr(t){return t.source}function _r(t){return t.target}function wr(t,e,r,n){var i=Math.cos(e),a=Math.sin(e),o=Math.cos(n),s=Math.sin(n),l=i*Math.cos(t),u=i*Math.sin(t),c=o*Math.cos(r),h=o*Math.sin(r),f=2*Math.asin(Math.sqrt(st(n-e)+i*o*st(r-t))),d=1/Math.sin(f),p=f?function(t){var e=Math.sin(t*=f)*d,r=Math.sin(f-t)*d,n=r*l+e*c,i=r*u+e*h,o=r*a+e*s;return[Math.atan2(i,n)*Ho,Math.atan2(o,Math.sqrt(n*n+i*i))*Ho]}:function(){return[t*Ho,e*Ho]};return p.distance=f,p}function Mr(){function t(t,i){var a=Math.sin(i*=qo),o=Math.cos(i),s=xo((t*=qo)-e),l=Math.cos(s);Ws+=Math.atan2(Math.sqrt((s=o*Math.sin(s))*s+(s=n*a-r*o*l)*s),r*a+n*o*l),e=t,r=a,n=o}var e,r,n;Zs.point=function(i,a){e=i*qo,r=Math.sin(a*=qo),n=Math.cos(a),Zs.point=t},Zs.lineEnd=function(){Zs.point=Zs.lineEnd=M}}function kr(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}function Ar(t,e){function r(t,e){o>0?e<-Vo+Fo&&(e=-Vo+Fo):e>Vo-Fo&&(e=Vo-Fo);var r=o/Math.pow(i(e),a);return[r*Math.sin(a*t),o-r*Math.cos(a*t)]}var n=Math.cos(t),i=function(t){return Math.tan(No/4+t/2)},a=t===e?Math.sin(t):Math.log(n/Math.cos(e))/Math.log(i(e)/i(t)),o=n*Math.pow(i(t),a)/a;return a?(r.invert=function(t,e){var r=o-e,n=tt(a)*Math.sqrt(t*t+r*r);return[Math.atan2(t,r)/a,2*Math.atan(Math.pow(o/n,1/a))-Vo]},r):Sr}function Tr(t,e){function r(t,e){var r=a-e;return[r*Math.sin(i*t),a-r*Math.cos(i*t)]}var n=Math.cos(t),i=t===e?Math.sin(t):(n-Math.cos(e))/(e-t),a=n/i+t;return xo(i)<Fo?cr:(r.invert=function(t,e){var r=a-e;return[Math.atan2(t,r)/i,a-tt(i)*Math.sqrt(t*t+r*r)]},r)}function Sr(t,e){return[t,Math.log(Math.tan(No/4+e/2))]}function Er(t){var e,r=sr(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=No*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)}function Lr(t,e){return[Math.log(Math.tan(No/4+e/2)),-t]}function Cr(t){return t[0]}function zr(t){return t[1]}function Dr(t){for(var e=t.length,r=[0,1],n=2,i=2;i<e;i++){for(;n>1&&et(t[r[n-2]],t[r[n-1]],t[i])<=0;)--n;r[n++]=i}return r.slice(0,n)}function Ir(t,e){return t[0]-e[0]||t[1]-e[1]}function Pr(t,e,r){return(r[0]-e[0])*(t[1]-e[1])<(r[1]-e[1])*(t[0]-e[0])}function Or(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,h=n[1]-u,f=(s*(l-u)-h*(i-a))/(h*o-s*c);return[i+f*o,l+f*c]}function jr(t){var e=t[0],r=t[t.length-1];return!(e[0]-r[0]||e[1]-r[1])}function Fr(){an(this),this.edge=this.site=this.circle=null}function Rr(t){var e=sl.pop()||new Fr;return e.site=t,e}function Nr(t){Zr(t),il.remove(t),sl.push(t),an(t)}function Br(t){var e=t.circle,r=e.x,n=e.cy,i={x:r,y:n},a=t.P,o=t.N,s=[t];Nr(t);for(var l=a;l.circle&&xo(r-l.circle.x)<Fo&&xo(n-l.circle.cy)<Fo;)a=l.P,s.unshift(l),Nr(l),l=a;s.unshift(l),Zr(l);for(var u=o;u.circle&&xo(r-u.circle.x)<Fo&&xo(n-u.circle.cy)<Fo;)o=u.N,s.push(u),Nr(u),u=o;s.push(u),Zr(u);var c,h=s.length;for(c=1;c<h;++c)u=s[c],l=s[c-1],en(u.edge,l.site,u.site,i);l=s[0],u=s[h-1],u.edge=$r(l.site,u.site,null,i),Wr(l),Wr(u)}function Ur(t){for(var e,r,n,i,a=t.x,o=t.y,s=il._;s;)if((n=Vr(s,o)-a)>Fo)s=s.L;else{if(!((i=a-qr(s,o))>Fo)){n>-Fo?(e=s.P,r=s):i>-Fo?(e=s,r=s.N):e=r=s;break}if(!s.R){e=s;break}s=s.R}var l=Rr(t);if(il.insert(e,l),e||r){if(e===r)return Zr(e),r=Rr(e.site),il.insert(l,r),l.edge=r.edge=$r(e.site,l.site),Wr(e),void Wr(r);if(!r)return void(l.edge=$r(e.site,l.site));Zr(e),Zr(r);var u=e.site,c=u.x,h=u.y,f=t.x-c,d=t.y-h,p=r.site,m=p.x-c,v=p.y-h,g=2*(f*v-d*m),y=f*f+d*d,b=m*m+v*v,x={x:(v*y-d*b)/g+c,y:(f*b-m*y)/g+h};en(r.edge,u,p,x),l.edge=$r(u,t,null,x),r.edge=$r(t,p,null,x),Wr(e),Wr(r)}}function Vr(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;r=o.site;var s=r.x,l=r.y,u=l-e;if(!u)return s;var c=s-n,h=1/a-1/u,f=c/u;return h?(-f+Math.sqrt(f*f-2*h*(c*c/(-2*u)-l+u/2+i-a/2)))/h+n:(n+s)/2}function qr(t,e){var r=t.N;if(r)return Vr(r,e);var n=t.site;return n.y===e?n.x:1/0}function Hr(t){this.site=t,this.edges=[]}function Gr(t){for(var e,r,n,i,a,o,s,l,u,c,h=t[0][0],f=t[1][0],d=t[0][1],p=t[1][1],m=nl,v=m.length;v--;)if((a=m[v])&&a.prepare())for(s=a.edges,l=s.length,o=0;o<l;)c=s[o].end(),n=c.x,i=c.y,u=s[++o%l].start(),e=u.x,r=u.y,(xo(n-e)>Fo||xo(i-r)>Fo)&&(s.splice(o,0,new rn(tn(a.site,c,xo(n-h)<Fo&&p-i>Fo?{x:h,y:xo(e-h)<Fo?r:p}:xo(i-p)<Fo&&f-n>Fo?{x:xo(r-p)<Fo?e:f,y:p}:xo(n-f)<Fo&&i-d>Fo?{x:f,y:xo(e-f)<Fo?r:d}:xo(i-d)<Fo&&n-h>Fo?{x:xo(r-d)<Fo?e:h,y:d}:null),a.site,null)),++l)}function Yr(t,e){return e.angle-t.angle}function Xr(){an(this),this.x=this.y=this.arc=this.site=this.cy=null}function Wr(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,h=a.y-s,f=2*(l*h-u*c);if(!(f>=-Ro)){var d=l*l+u*u,p=c*c+h*h,m=(h*d-u*p)/f,v=(l*p-c*d)/f,h=v+s,g=ll.pop()||new Xr;g.arc=t,g.site=i,g.x=m+o,g.y=h+Math.sqrt(m*m+v*v),g.cy=h,t.circle=g;for(var y=null,b=ol._;b;)if(g.y<b.y||g.y===b.y&&g.x<=b.x){if(!b.L){y=b.P;break}b=b.L}else{if(!b.R){y=b;break}b=b.R}ol.insert(y,g),y||(al=g)}}}}function Zr(t){var e=t.circle;e&&(e.P||(al=e.N),ol.remove(e),ll.push(e),an(e),t.circle=null)}function Jr(t){for(var e,r=rl,n=He(t[0][0],t[0][1],t[1][0],t[1][1]),i=r.length;i--;)e=r[i],(!Kr(e,t)||!n(e)||xo(e.a.x-e.b.x)<Fo&&xo(e.a.y-e.b.y)<Fo)&&(e.a=e.b=null,r.splice(i,1))}function Kr(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,h=t.r,f=c.x,d=c.y,p=h.x,m=h.y,v=(f+p)/2,g=(d+m)/2;if(m===d){if(v<o||v>=s)return;if(f>p){if(a){if(a.y>=u)return}else a={x:v,y:l};r={x:v,y:u}}else{if(a){if(a.y<l)return}else a={x:v,y:u};r={x:v,y:l}}}else if(n=(f-p)/(m-d),i=g-n*v,n<-1||n>1)if(f>p){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(d<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 Qr(t,e){this.l=t,this.r=e,this.a=this.b=null}function $r(t,e,r,n){var i=new Qr(t,e);return rl.push(i),r&&en(i,t,e,r),n&&en(i,e,t,n),nl[t.i].edges.push(new rn(i,t,e)),nl[e.i].edges.push(new rn(i,e,t)),i}function tn(t,e,r){var n=new Qr(t,null);return n.a=e,n.b=r,rl.push(n),n}function en(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 rn(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 nn(){this._=null}function an(t){t.U=t.C=t.L=t.R=t.P=t.N=null}function on(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 sn(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 ln(t){for(;t.L;)t=t.L;return t}function un(t,e){var r,n,i,a=t.sort(cn).pop();for(rl=[],nl=new Array(t.length),il=new nn,ol=new nn;;)if(i=al,a&&(!i||a.y<i.y||a.y===i.y&&a.x<i.x))a.x===r&&a.y===n||(nl[a.i]=new Hr(a),Ur(a),r=a.x,n=a.y),a=t.pop();else{if(!i)break;Br(i.arc)}e&&(Jr(e),Gr(e));var o={cells:nl,edges:rl};return il=ol=rl=nl=null,o}function cn(t,e){
15 return e.y-t.y||e.x-t.x}function hn(t,e,r){return(t.x-r.x)*(e.y-t.y)-(t.x-e.x)*(r.y-t.y)}function fn(t){return t.x}function dn(t){return t.y}function pn(){return{leaf:!0,nodes:[],point:null,x:null,y:null}}function mn(t,e,r,n,i,a){if(!t(e,r,n,i,a)){var o=.5*(r+i),s=.5*(n+a),l=e.nodes;l[0]&&mn(t,l[0],r,n,o,s),l[1]&&mn(t,l[1],o,n,i,s),l[2]&&mn(t,l[2],r,s,o,a),l[3]&&mn(t,l[3],o,s,i,a)}}function vn(t,e,r,n,i,a,o){var s,l=1/0;return function t(u,c,h,f,d){if(!(c>a||h>o||f<n||d<i)){if(p=u.point){var p,m=e-u.x,v=r-u.y,g=m*m+v*v;if(g<l){var y=Math.sqrt(l=g);n=e-y,i=r-y,a=e+y,o=r+y,s=p}}for(var b=u.nodes,x=.5*(c+f),_=.5*(h+d),w=e>=x,M=r>=_,k=M<<1|w,A=k+4;k<A;++k)if(u=b[3&k])switch(3&k){case 0:t(u,c,h,x,_);break;case 1:t(u,x,h,f,_);break;case 2:t(u,c,_,x,d);break;case 3:t(u,x,_,f,d)}}}(t,n,i,a,o),s}function gn(t,e){t=uo.rgb(t),e=uo.rgb(e);var r=t.r,n=t.g,i=t.b,a=e.r-r,o=e.g-n,s=e.b-i;return function(t){return"#"+wt(Math.round(r+a*t))+wt(Math.round(n+o*t))+wt(Math.round(i+s*t))}}function yn(t,e){var r,n={},i={};for(r in t)r in e?n[r]=_n(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 bn(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}function xn(t,e){var r,n,i,a=cl.lastIndex=hl.lastIndex=0,o=-1,s=[],l=[];for(t+="",e+="";(r=cl.exec(t))&&(n=hl.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:bn(r,n)})),a=hl.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("")})}function _n(t,e){for(var r,n=uo.interpolators.length;--n>=0&&!(r=uo.interpolators[n](t,e)););return r}function wn(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(_n(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}}function Mn(t){return function(e){return e<=0?0:e>=1?1:t(e)}}function kn(t){return function(e){return 1-t(1-e)}}function An(t){return function(e){return.5*(e<.5?t(2*e):2-t(2-2*e))}}function Tn(t){return t*t}function Sn(t){return t*t*t}function En(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 Ln(t){return function(e){return Math.pow(e,t)}}function Cn(t){return 1-Math.cos(t*Vo)}function zn(t){return Math.pow(2,10*(t-1))}function Dn(t){return 1-Math.sqrt(1-t*t)}function In(t,e){var r;return arguments.length<2&&(e=.45),arguments.length?r=e/Bo*Math.asin(1/t):(t=1,r=e/4),function(n){return 1+t*Math.pow(2,-10*n)*Math.sin((n-r)*Bo/e)}}function Pn(t){return t||(t=1.70158),function(e){return e*e*((t+1)*e-t)}}function On(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 jn(t,e){t=uo.hcl(t),e=uo.hcl(e);var r=t.h,n=t.c,i=t.l,a=e.h-r,o=e.c-n,s=e.l-i;return isNaN(o)&&(o=0,n=isNaN(n)?e.c:n),isNaN(a)?(a=0,r=isNaN(r)?e.h:r):a>180?a-=360:a<-180&&(a+=360),function(t){return ft(r+a*t,n+o*t,i+s*t)+""}}function Fn(t,e){t=uo.hsl(t),e=uo.hsl(e);var r=t.h,n=t.s,i=t.l,a=e.h-r,o=e.s-n,s=e.l-i;return isNaN(o)&&(o=0,n=isNaN(n)?e.s:n),isNaN(a)?(a=0,r=isNaN(r)?e.h:r):a>180?a-=360:a<-180&&(a+=360),function(t){return ct(r+a*t,n+o*t,i+s*t)+""}}function Rn(t,e){t=uo.lab(t),e=uo.lab(e);var r=t.l,n=t.a,i=t.b,a=e.l-r,o=e.a-n,s=e.b-i;return function(t){return pt(r+a*t,n+o*t,i+s*t)+""}}function Nn(t,e){return e-=t,function(r){return Math.round(t+e*r)}}function Bn(t){var e=[t.a,t.b],r=[t.c,t.d],n=Vn(e),i=Un(e,r),a=Vn(qn(r,e,-i))||0;e[0]*r[1]<r[0]*e[1]&&(e[0]*=-1,e[1]*=-1,n*=-1,i*=-1),this.rotate=(n?Math.atan2(e[1],e[0]):Math.atan2(-r[0],r[1]))*Ho,this.translate=[t.e,t.f],this.scale=[n,a],this.skew=a?Math.atan2(i,a)*Ho:0}function Un(t,e){return t[0]*e[0]+t[1]*e[1]}function Vn(t){var e=Math.sqrt(Un(t,t));return e&&(t[0]/=e,t[1]/=e),e}function qn(t,e,r){return t[0]+=r*e[0],t[1]+=r*e[1],t}function Hn(t){return t.length?t.pop()+",":""}function Gn(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:bn(t[0],e[0])},{i:i-2,x:bn(t[1],e[1])})}else(e[0]||e[1])&&r.push("translate("+e+")")}function Yn(t,e,r,n){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),n.push({i:r.push(Hn(r)+"rotate(",null,")")-2,x:bn(t,e)})):e&&r.push(Hn(r)+"rotate("+e+")")}function Xn(t,e,r,n){t!==e?n.push({i:r.push(Hn(r)+"skewX(",null,")")-2,x:bn(t,e)}):e&&r.push(Hn(r)+"skewX("+e+")")}function Wn(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var i=r.push(Hn(r)+"scale(",null,",",null,")");n.push({i:i-4,x:bn(t[0],e[0])},{i:i-2,x:bn(t[1],e[1])})}else 1===e[0]&&1===e[1]||r.push(Hn(r)+"scale("+e+")")}function Zn(t,e){var r=[],n=[];return t=uo.transform(t),e=uo.transform(e),Gn(t.translate,e.translate,r,n),Yn(t.rotate,e.rotate,r,n),Xn(t.skew,e.skew,r,n),Wn(t.scale,e.scale,r,n),t=e=null,function(t){for(var e,i=-1,a=n.length;++i<a;)r[(e=n[i]).i]=e.x(t);return r.join("")}}function Jn(t,e){return e=(e-=t=+t)||1/e,function(r){return(r-t)/e}}function Kn(t,e){return e=(e-=t=+t)||1/e,function(r){return Math.max(0,Math.min(1,(r-t)/e))}}function Qn(t){for(var e=t.source,r=t.target,n=ti(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 $n(t){for(var e=[],r=t.parent;null!=r;)e.push(t),t=r,r=r.parent;return e.push(t),e}function ti(t,e){if(t===e)return t;for(var r=$n(t),n=$n(e),i=r.pop(),a=n.pop(),o=null;i===a;)o=i,i=r.pop(),a=n.pop();return o}function ei(t){t.fixed|=2}function ri(t){t.fixed&=-7}function ni(t){t.fixed|=4,t.px=t.x,t.py=t.y}function ii(t){t.fixed&=-5}function ai(t,e,r){var n=0,i=0;if(t.charge=0,!t.leaf)for(var a,o=t.nodes,s=o.length,l=-1;++l<s;)null!=(a=o[l])&&(ai(a,e,r),t.charge+=a.charge,n+=a.charge*a.cx,i+=a.charge*a.cy);if(t.point){t.leaf||(t.point.x+=Math.random()-.5,t.point.y+=Math.random()-.5);var u=e*r[t.point.index];t.charge+=t.pointCharge=u,n+=u*t.point.x,i+=u*t.point.y}t.cx=n/t.charge,t.cy=i/t.charge}function oi(t,e){return uo.rebind(t,e,"sort","children","value"),t.nodes=t,t.links=fi,t}function si(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 li(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 ui(t){return t.children}function ci(t){return t.value}function hi(t,e){return e.value-t.value}function fi(t){return uo.merge(t.map(function(t){return(t.children||[]).map(function(e){return{source:t,target:e}})}))}function di(t){return t.x}function pi(t){return t.y}function mi(t,e,r){t.y0=e,t.y=r}function vi(t){return uo.range(t.length)}function gi(t){for(var e=-1,r=t[0].length,n=[];++e<r;)n[e]=0;return n}function yi(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 bi(t){return t.reduce(xi,0)}function xi(t,e){return t+e[1]}function _i(t,e){return wi(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function wi(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 Mi(t){return[uo.min(t),uo.max(t)]}function ki(t,e){return t.value-e.value}function Ai(t,e){var r=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=r,r._pack_prev=e}function Ti(t,e){t._pack_next=e,e._pack_prev=t}function Si(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 Ei(t){function e(t){c=Math.min(t.x-t.r,c),h=Math.max(t.x+t.r,h),f=Math.min(t.y-t.r,f),d=Math.max(t.y+t.r,d)}if((r=t.children)&&(u=r.length)){var r,n,i,a,o,s,l,u,c=1/0,h=-1/0,f=1/0,d=-1/0;if(r.forEach(Li),n=r[0],n.x=-n.r,n.y=0,e(n),u>1&&(i=r[1],i.x=i.r,i.y=0,e(i),u>2))for(a=r[2],Di(n,i,a),e(a),Ai(n,a),n._pack_prev=a,Ai(a,i),i=n._pack_next,o=3;o<u;o++){Di(n,i,a=r[o]);var p=0,m=1,v=1;for(s=i._pack_next;s!==i;s=s._pack_next,m++)if(Si(s,a)){p=1;break}if(1==p)for(l=n._pack_prev;l!==s._pack_prev&&!Si(l,a);l=l._pack_prev,v++);p?(m<v||m==v&&i.r<n.r?Ti(n,i=s):Ti(n=l,i),o--):(Ai(n,a),i=a,e(a))}var g=(c+h)/2,y=(f+d)/2,b=0;for(o=0;o<u;o++)a=r[o],a.x-=g,a.y-=y,b=Math.max(b,a.r+Math.sqrt(a.x*a.x+a.y*a.y));t.r=b,r.forEach(Ci)}}function Li(t){t._pack_next=t._pack_prev=t}function Ci(t){delete t._pack_next,delete t._pack_prev}function zi(t,e,r,n){var i=t.children;if(t.x=e+=n*t.x,t.y=r+=n*t.y,t.r*=n,i)for(var a=-1,o=i.length;++a<o;)zi(i[a],e,r,n)}function Di(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;o*=o,n*=n;var l=.5+(n-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 Ii(t,e){return t.parent==e.parent?1:2}function Pi(t){var e=t.children;return e.length?e[0]:t.t}function Oi(t){var e,r=t.children;return(e=r.length)?r[e-1]:t.t}function ji(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 Fi(t){for(var e,r=0,n=0,i=t.children,a=i.length;--a>=0;)e=i[a],e.z+=r,e.m+=r,r+=e.s+(n+=e.c)}function Ri(t,e,r){return t.a.parent===e.parent?t.a:r}function Ni(t){return 1+uo.max(t,function(t){return t.y})}function Bi(t){return t.reduce(function(t,e){return t+e.x},0)/t.length}function Ui(t){var e=t.children;return e&&e.length?Ui(e[0]):t}function Vi(t){var e,r=t.children;return r&&(e=r.length)?Vi(r[e-1]):t}function qi(t){return{x:t.x,y:t.y,dx:t.dx,dy:t.dy}}function Hi(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 Gi(t){var e=t[0],r=t[t.length-1];return e<r?[e,r]:[r,e]}function Yi(t){return t.rangeExtent?t.rangeExtent():Gi(t.range())}function Xi(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 Wi(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 Zi(t){return t?{floor:function(e){return Math.floor(e/t)*t},ceil:function(e){return Math.ceil(e/t)*t}}:wl}function Ji(t,e,r,n){var i=[],a=[],o=0,s=Math.min(t.length,e.length)-1;for(t[s]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++o<=s;)i.push(r(t[o-1],t[o])),a.push(n(e[o-1],e[o]));return function(e){var r=uo.bisect(t,e,1,s)-1;return a[r](i[r](e))}}function Ki(t,e,r,n){function i(){var i=Math.min(t.length,e.length)>2?Ji:Xi,l=n?Kn:Jn;return o=i(t,e,l,r),s=i(e,t,l,_n),a}function a(t){return o(t)}var o,s;return a.invert=function(t){return s(t)},a.domain=function(e){return arguments.length?(t=e.map(Number),i()):t},a.range=function(t){return arguments.length?(e=t,i()):e},a.rangeRound=function(t){return a.range(t).interpolate(Nn)},a.clamp=function(t){return arguments.length?(n=t,i()):n},a.interpolate=function(t){return arguments.length?(r=t,i()):r},a.ticks=function(e){return ea(t,e)},a.tickFormat=function(e,r){return ra(t,e,r)},a.nice=function(e){return $i(t,e),i()},a.copy=function(){return Ki(t,e,r,n)},i()}function Qi(t,e){return uo.rebind(t,e,"range","rangeRound","interpolate","clamp")}function $i(t,e){return Wi(t,Zi(ta(t,e)[2])),Wi(t,Zi(ta(t,e)[2])),t}function ta(t,e){null==e&&(e=10);var r=Gi(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 ea(t,e){return uo.range.apply(uo,ta(t,e))}function ra(t,e,r){var n=ta(t,e);if(r){var i=cs.exec(r);if(i.shift(),"s"===i[8]){var a=uo.formatPrefix(Math.max(xo(n[0]),xo(n[1])));return i[7]||(i[7]="."+na(a.scale(n[2]))),i[8]="f",r=uo.format(i.join("")),function(t){return r(a.scale(t))+a.symbol}}i[7]||(i[7]="."+ia(i[8],n)),r=i.join("")}else r=",."+na(n[2])+"f";return uo.format(r)}function na(t){return-Math.floor(Math.log(t)/Math.LN10+.01)}function ia(t,e){var r=na(e[2]);return t in Ml?Math.abs(r-na(Math.max(xo(e[0]),xo(e[1]))))+ +("e"!==t):r-2*("%"===t)}function aa(t,e,r,n){function i(t){return(r?Math.log(t<0?0:t):-Math.log(t>0?0:-t))/Math.log(e)}function a(t){return r?Math.pow(e,t):-Math.pow(e,-t)}function o(e){return t(i(e))}return o.invert=function(e){return a(t.invert(e))},o.domain=function(e){return arguments.length?(r=e[0]>=0,t.domain((n=e.map(Number)).map(i)),o):n},o.base=function(r){return arguments.length?(e=+r,t.domain(n.map(i)),o):e},o.nice=function(){var e=Wi(n.map(i),r?Math:Al);return t.domain(e),n=e.map(a),o},o.ticks=function(){var t=Gi(n),o=[],s=t[0],l=t[1],u=Math.floor(i(s)),c=Math.ceil(i(l)),h=e%1?2:e;if(isFinite(c-u)){if(r){for(;u<c;u++)for(var f=1;f<h;f++)o.push(a(u)*f);o.push(a(u))}else for(o.push(a(u));u++<c;)for(var f=h-1;f>0;f--)o.push(a(u)*f);for(u=0;o[u]<s;u++);for(c=o.length;o[c-1]>l;c--);o=o.slice(u,c)}return o},o.tickFormat=function(t,r){if(!arguments.length)return kl;arguments.length<2?r=kl:"function"!=typeof r&&(r=uo.format(r));var n=Math.max(1,e*t/o.ticks().length);return function(t){var o=t/a(Math.round(i(t)));return o*e<e-.5&&(o*=e),o<=n?r(t):""}},o.copy=function(){return aa(t.copy(),e,r,n)},Qi(o,t)}function oa(t,e,r){function n(e){return t(i(e))}var i=sa(e),a=sa(1/e);return n.invert=function(e){return a(t.invert(e))},n.domain=function(e){return arguments.length?(t.domain((r=e.map(Number)).map(i)),n):r},n.ticks=function(t){return ea(r,t)},n.tickFormat=function(t,e){return ra(r,t,e)},n.nice=function(t){return n.domain($i(r,t))},n.exponent=function(o){return arguments.length?(i=sa(e=o),a=sa(1/e),t.domain(r.map(i)),n):e},n.copy=function(){return oa(t.copy(),e,r)},Qi(n,t)}function sa(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function la(t,e){function r(r){return a[((i.get(r)||("range"===e.t?i.set(r,t.push(r)):0/0))-1)%a.length]}function n(e,r){return uo.range(t.length).map(function(t){return e+r*t})}var i,a,o;return r.domain=function(n){if(!arguments.length)return t;t=[],i=new h;for(var a,o=-1,s=n.length;++o<s;)i.has(a=n[o])||i.set(a,t.push(a));return r[e.t].apply(r,e.a)},r.range=function(t){return arguments.length?(a=t,o=0,e={t:"range",a:arguments},r):a},r.rangePoints=function(i,s){arguments.length<2&&(s=0);var l=i[0],u=i[1],c=t.length<2?(l=(l+u)/2,0):(u-l)/(t.length-1+s);return a=n(l+c*s/2,c),o=0,e={t:"rangePoints",a:arguments},r},r.rangeRoundPoints=function(i,s){arguments.length<2&&(s=0);var l=i[0],u=i[1],c=t.length<2?(l=u=Math.round((l+u)/2),0):(u-l)/(t.length-1+s)|0;return a=n(l+Math.round(c*s/2+(u-l-(t.length-1+s)*c)/2),c),o=0,e={t:"rangeRoundPoints",a:arguments},r},r.rangeBands=function(i,s,l){arguments.length<2&&(s=0),arguments.length<3&&(l=s);var u=i[1]<i[0],c=i[u-0],h=i[1-u],f=(h-c)/(t.length-s+2*l);return a=n(c+f*l,f),u&&a.reverse(),o=f*(1-s),e={t:"rangeBands",a:arguments},r},r.rangeRoundBands=function(i,s,l){arguments.length<2&&(s=0),arguments.length<3&&(l=s);var u=i[1]<i[0],c=i[u-0],h=i[1-u],f=Math.floor((h-c)/(t.length-s+2*l));return a=n(c+Math.round((h-c-(t.length-s)*f)/2),f),u&&a.reverse(),o=Math.round(f*(1-s)),e={t:"rangeRoundBands",a:arguments},r},r.rangeBand=function(){return o},r.rangeExtent=function(){return Gi(e.a[0])},r.copy=function(){return la(t,e)},r.domain(t)}function ua(t,e){function r(){var r=0,i=e.length;for(s=[];++r<i;)s[r-1]=uo.quantile(t,r/i);return n}function n(t){if(!isNaN(t=+t))return e[uo.bisect(s,t)]}var s;return n.domain=function(e){return arguments.length?(t=e.map(a).filter(o).sort(i),r()):t},n.range=function(t){return arguments.length?(e=t,r()):e},n.quantiles=function(){return s},n.invertExtent=function(r){return r=e.indexOf(r),r<0?[0/0,0/0]:[r>0?s[r-1]:t[0],r<s.length?s[r]:t[t.length-1]]},n.copy=function(){return ua(t,e)},r()}function ca(t,e,r){function n(e){return r[Math.max(0,Math.min(o,Math.floor(a*(e-t))))]}function i(){return a=r.length/(e-t),o=r.length-1,n}var a,o;return n.domain=function(r){return arguments.length?(t=+r[0],e=+r[r.length-1],i()):[t,e]},n.range=function(t){return arguments.length?(r=t,i()):r},n.invertExtent=function(e){return e=r.indexOf(e),e=e<0?0/0:e/a+t,[e,e+1/a]},n.copy=function(){return ca(t,e,r)},i()}function ha(t,e){function r(r){if(r<=r)return e[uo.bisect(t,r)]}return r.domain=function(e){return arguments.length?(t=e,r):t},r.range=function(t){return arguments.length?(e=t,r):e},r.invertExtent=function(r){return r=e.indexOf(r),[t[r-1],t[r]]},r.copy=function(){return ha(t,e)},r}function fa(t){function e(t){return+t}return e.invert=e,e.domain=e.range=function(r){return arguments.length?(t=r.map(e),e):t},e.ticks=function(e){return ea(t,e)},e.tickFormat=function(e,r){return ra(t,e,r)},e.copy=function(){return fa(t)},e}function da(){return 0}function pa(t){return t.innerRadius}function ma(t){return t.outerRadius}function va(t){return t.startAngle}function ga(t){return t.endAngle}function ya(t){return t&&t.padAngle}function ba(t,e,r,n){return(t-r)*e-(e-n)*t>0?0:1}function xa(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,h=t[1]+u,f=e[0]+l,d=e[1]+u,p=(c+f)/2,m=(h+d)/2,v=f-c,g=d-h,y=v*v+g*g,b=r-n,x=c*d-f*h,_=(g<0?-1:1)*Math.sqrt(Math.max(0,b*b*y-x*x)),w=(x*g-v*_)/y,M=(-x*v-g*_)/y,k=(x*g+v*_)/y,A=(-x*v+g*_)/y,T=w-p,S=M-m,E=k-p,L=A-m;return T*T+S*S>E*E+L*L&&(w=k,M=A),[[w-l,M-u],[w*r/b,M*r/b]]}function _a(t){function e(e){function o(){u.push("M",a(t(c),s))}for(var l,u=[],c=[],h=-1,f=e.length,d=Et(r),p=Et(n);++h<f;)i.call(this,l=e[h],h)?c.push([+d.call(this,l,h),+p.call(this,l,h)]):c.length&&(o(),c=[]);return c.length&&o(),u.length?u.join(""):null}var r=Cr,n=zr,i=ze,a=wa,o=a.key,s=.7;return e.x=function(t){return arguments.length?(r=t,e):r},e.y=function(t){return arguments.length?(n=t,e):n},e.defined=function(t){return arguments.length?(i=t,e):i},e.interpolate=function(t){return arguments.length?(o="function"==typeof t?a=t:(a=zl.get(t)||wa).key,e):o},e.tension=function(t){return arguments.length?(s=t,e):s},e}function wa(t){return t.length>1?t.join("L"):t+"Z"}function Ma(t){return t.join("L")+"Z"}function ka(t){for(var e=0,r=t.length,n=t[0],i=[n[0],",",n[1]];++e<r;)i.push("H",(n[0]+(n=t[e])[0])/2,"V",n[1]);return r>1&&i.push("H",n[0]),i.join("")}function Aa(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 Ta(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 Sa(t,e){return t.length<4?wa(t):t[1]+Ca(t.slice(1,-1),za(t,e))}function Ea(t,e){return t.length<3?Ma(t):t[0]+Ca((t.push(t[0]),t),za([t[t.length-2]].concat(t,[t[1]]),e))}function La(t,e){return t.length<3?wa(t):t[0]+Ca(t,za(t,e))}function Ca(t,e){if(e.length<1||t.length!=e.length&&t.length!=e.length+2)return wa(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 za(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 Da(t){if(t.length<3)return wa(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",ja(Pl,o),",",ja(Pl,s)];for(t.push(t[r-1]);++e<=r;)n=t[e],o.shift(),o.push(n[0]),s.shift(),s.push(n[1]),Fa(l,o,s);return t.pop(),l.push("L",n),l.join("")}function Ia(t){if(t.length<4)return wa(t);for(var e,r=[],n=-1,i=t.length,a=[0],o=[0];++n<3;)e=t[n],a.push(e[0]),o.push(e[1]);for(r.push(ja(Pl,a)+","+ja(Pl,o)),--n;++n<i;)e=t[n],a.shift(),a.push(e[0]),o.shift(),o.push(e[1]),Fa(r,a,o);return r.join("")}function Pa(t){for(var e,r,n=-1,i=t.length,a=i+4,o=[],s=[];++n<4;)r=t[n%i],o.push(r[0]),s.push(r[1]);for(e=[ja(Pl,o),",",ja(Pl,s)],--n;++n<a;)r=t[n%i],o.shift(),o.push(r[0]),s.shift(),s.push(r[1]),Fa(e,o,s);return e.join("")}function Oa(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 Da(t)}function ja(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function Fa(t,e,r){t.push("C",ja(Dl,e),",",ja(Dl,r),",",ja(Il,e),",",ja(Il,r),",",ja(Pl,e),",",ja(Pl,r))}function Ra(t,e){return(e[1]-t[1])/(e[0]-t[0])}function Na(t){for(var e=0,r=t.length-1,n=[],i=t[0],a=t[1],o=n[0]=Ra(i,a);++e<r;)n[e]=(o+(o=Ra(i=a,a=t[e+1])))/2;return n[e]=o,n}function Ba(t){for(var e,r,n,i,a=[],o=Na(t),s=-1,l=t.length-1;++s<l;)e=Ra(t[s],t[s+1]),xo(e)<Fo?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));for(s=-1;++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}function Ua(t){return t.length<3?wa(t):t[0]+Ca(t,Ba(t))}function Va(t){for(var e,r,n,i=-1,a=t.length;++i<a;)e=t[i],r=e[0],n=e[1]-Vo,e[0]=r*Math.cos(n),e[1]=r*Math.sin(n);return t}function qa(t){function e(e){function l(){m.push("M",s(t(g),h),c,u(t(v.reverse()),h),"Z")}for(var f,d,p,m=[],v=[],g=[],y=-1,b=e.length,x=Et(r),_=Et(i),w=r===n?function(){return d}:Et(n),M=i===a?function(){return p}:Et(a);++y<b;)o.call(this,f=e[y],y)?(v.push([d=+x.call(this,f,y),p=+_.call(this,f,y)]),g.push([+w.call(this,f,y),+M.call(this,f,y)])):v.length&&(l(),v=[],g=[]);return v.length&&l(),m.length?m.join(""):null}var r=Cr,n=Cr,i=0,a=zr,o=ze,s=wa,l=s.key,u=s,c="L",h=.7;return e.x=function(t){return arguments.length?(r=n=t,e):n},e.x0=function(t){return arguments.length?(r=t,e):r},e.x1=function(t){return arguments.length?(n=t,e):n},e.y=function(t){return arguments.length?(i=a=t,e):a},e.y0=function(t){return arguments.length?(i=t,e):i},e.y1=function(t){return arguments.length?(a=t,e):a},e.defined=function(t){return arguments.length?(o=t,e):o},e.interpolate=function(t){return arguments.length?(l="function"==typeof t?s=t:(s=zl.get(t)||wa).key,u=s.reverse||s,c=s.closed?"M":"L",e):l},e.tension=function(t){return arguments.length?(h=t,e):h},e}function Ha(t){return t.radius}function Ga(t){return[t.x,t.y]}function Ya(t){return function(){var e=t.apply(this,arguments),r=e[0],n=e[1]-Vo;return[r*Math.cos(n),r*Math.sin(n)]}}function Xa(){return 64}function Wa(){return"circle"}function Za(t){var e=Math.sqrt(t/No);return"M0,"+e+"A"+e+","+e+" 0 1,1 0,"+-e+"A"+e+","+e+" 0 1,1 0,"+e+"Z"}function Ja(t){return function(){var e,r,n;(e=this[t])&&(n=e[r=e.active])&&(n.timer.c=null,n.timer.t=0/0,--e.count?delete e[r]:delete this[t],e.active+=.5,n.event&&n.event.interrupt.call(this,this.__data__,n.index))}}function Ka(t,e,r){return Ao(t,Ul),t.namespace=e,t.id=r,t}function Qa(t,e,r,n){var i=t.id,a=t.namespace;return G(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 $a(t){return null==t&&(t=""),function(){this.textContent=t}}function to(t){return null==t?"__transition__":"__transition_"+t+"__"}function eo(t,e,r,n,i){function a(t){var e=m.delay;if(u.t=e+l,e<=t)return o(t-e);u.c=o}function o(r){var i=p.active,a=p[i];a&&(a.timer.c=null,a.timer.t=0/0,--p.count,delete p[i],a.event&&a.event.interrupt.call(t,t.__data__,a.index));for(var o in p)if(+o<n){var h=p[o];h.timer.c=null,h.timer.t=0/0,--p.count,delete p[o]}u.c=s,It(function(){return u.c&&s(r||1)&&(u.c=null,u.t=0/0),1},0,l),p.active=n,m.event&&m.event.start.call(t,t.__data__,e),d=[],m.tween.forEach(function(r,n){(n=n.call(t,t.__data__,e))&&d.push(n)}),f=m.ease,c=m.duration}function s(i){for(var a=i/c,o=f(a),s=d.length;s>0;)d[--s].call(t,o);if(a>=1)return m.event&&m.event.end.call(t,t.__data__,e),--p.count?delete p[n]:delete t[r],1}var l,u,c,f,d,p=t[r]||(t[r]={active:0,count:0}),m=p[n];m||(l=i.time,u=It(a,0,l),m=p[n]={tween:new h,time:l,timer:u,delay:i.delay,duration:i.duration,ease:i.ease,index:e},i=null,++p.count)}function ro(t,e,r){t.attr("transform",function(t){var n=e(t);return"translate("+(isFinite(n)?n:r(t))+",0)"})}function no(t,e,r){t.attr("transform",function(t){var n=e(t);return"translate(0,"+(isFinite(n)?n:r(t))+")"})}function io(t){return t.toISOString()}function ao(t,e,r){function n(e){return t(e)}function i(t,r){var n=t[1]-t[0],i=n/r,a=uo.bisect(Jl,i);return a==Jl.length?[e.year,ta(t.map(function(t){return t/31536e6}),r)[2]]:a?e[i/Jl[a-1]<Jl[a]/i?a-1:a]:[$l,ta(t,r)[2]]}return n.invert=function(e){return oo(t.invert(e))},n.domain=function(e){return arguments.length?(t.domain(e),n):t.domain().map(oo)},n.nice=function(t,e){function r(r){return!isNaN(r)&&!t.range(r,oo(+r+1),e).length}var a=n.domain(),o=Gi(a),s=null==t?i(o,10):"number"==typeof t&&i(o,t);return s&&(t=s[0],e=s[1]),n.domain(Wi(a,e>1?{floor:function(e){for(;r(e=t.floor(e));)e=oo(e-1);return e},ceil:function(e){for(;r(e=t.ceil(e));)e=oo(+e+1);return e}}:t))},n.ticks=function(t,e){var r=Gi(n.domain()),a=null==t?i(r,10):"number"==typeof t?i(r,t):!t.range&&[{range:t},e];return a&&(t=a[0],e=a[1]),t.range(r[0],oo(+r[1]+1),e<1?1:e)},n.tickFormat=function(){return r},n.copy=function(){return ao(t.copy(),e,r)},Qi(n,t)}function oo(t){return new Date(t)}function so(t){return JSON.parse(t.responseText)}function lo(t){var e=fo.createRange();return e.selectNode(fo.body),e.createContextualFragment(t.responseText)}var uo={version:"3.5.17"},co=[].slice,ho=function(t){return co.call(t)},fo=this.document;if(fo)try{ho(fo.documentElement.childNodes)[0].nodeType}catch(t){ho=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}),fo)try{fo.createElement("DIV").style.setProperty("opacity",0,"")}catch(t){var po=this.Element.prototype,mo=po.setAttribute,vo=po.setAttributeNS,go=this.CSSStyleDeclaration.prototype,yo=go.setProperty;po.setAttribute=function(t,e){mo.call(this,t,e+"")},po.setAttributeNS=function(t,e,r){vo.call(this,t,e,r+"")},go.setProperty=function(t,e,r){yo.call(this,t,e+"",r)}}uo.ascending=i,uo.descending=function(t,e){return e<t?-1:e>t?1:e>=t?0:0/0},uo.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},uo.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},uo.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]},uo.sum=function(t,e){var r,n=0,i=t.length,a=-1;if(1===arguments.length)for(;++a<i;)o(r=+t[a])&&(n+=r);else for(;++a<i;)o(r=+e.call(t,t[a],a))&&(n+=r);return n},uo.mean=function(t,e){var r,n=0,i=t.length,s=-1,l=i;if(1===arguments.length)for(;++s<i;)o(r=a(t[s]))?n+=r:--l;else for(;++s<i;)o(r=a(e.call(t,t[s],s)))?n+=r:--l;if(l)return n/l},uo.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},uo.median=function(t,e){var r,n=[],s=t.length,l=-1;if(1===arguments.length)for(;++l<s;)o(r=a(t[l]))&&n.push(r);else for(;++l<s;)o(r=a(e.call(t,t[l],l)))&&n.push(r);if(n.length)return uo.quantile(n.sort(i),.5)},uo.variance=function(t,e){var r,n,i=t.length,s=0,l=0,u=-1,c=0;if(1===arguments.length)for(;++u<i;)o(r=a(t[u]))&&(n=r-s,s+=n/++c,l+=n*(r-s));else for(;++u<i;)o(r=a(e.call(t,t[u],u)))&&(n=r-s,s+=n/++c,l+=n*(r-s));if(c>1)return l/(c-1)},uo.deviation=function(){var t=uo.variance.apply(this,arguments);return t?Math.sqrt(t):t};var bo=s(i);uo.bisectLeft=bo.left,uo.bisect=uo.bisectRight=bo.right,uo.bisector=function(t){return s(1===t.length?function(e,r){return i(t(e),r)}:t)},uo.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},uo.permute=function(t,e){for(var r=e.length,n=new Array(r);r--;)n[r]=t[e[r]];return n},uo.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},uo.transpose=function(t){if(!(i=t.length))return[];for(var e=-1,r=uo.min(t,l),n=new Array(r);++e<r;)for(var i,a=-1,o=n[e]=new Array(i);++a<i;)o[a]=t[a][e];return n},uo.zip=function(){return uo.transpose(arguments)},uo.keys=function(t){var e=[];for(var r in t)e.push(r);return e},uo.values=function(t){var e=[];for(var r in t)e.push(t[r]);return e},uo.entries=function(t){var e=[];for(var r in t)e.push({key:r,value:t[r]});return e},uo.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(n=t[i],e=n.length;--e>=0;)r[--o]=n[e];return r};var xo=Math.abs;uo.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=u(xo(r)),o=-1;if(t*=a,e*=a,r*=a,r<0)for(;(n=t+r*++o)>e;)i.push(n/a);else for(;(n=t+r*++o)<e;)i.push(n/a);return i},uo.map=function(t,e){var r=new h;if(t instanceof h)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 _o="__proto__",wo="\0";c(h,{has:p,get:function(t){return this._[f(t)]},set:function(t,e){return this._[f(t)]=e},remove:m,keys:v,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:d(e),value:this._[e]});return t},size:g,empty:y,forEach:function(t){for(var e in this._)t.call(this,d(e),this._[e])}}),uo.nest=function(){function t(e,o,s){if(s>=a.length)return n?n.call(i,o):r?o.sort(r):o;for(var l,u,c,f,d=-1,p=o.length,m=a[s++],v=new h;++d<p;)(f=v.get(l=m(u=o[d])))?f.push(u):v.set(l,[u]);return e?(u=e(),c=function(r,n){u.set(r,t(e,n,s))}):(u={},c=function(r,n){u[r]=t(e,n,s)}),v.forEach(c),u}function e(t,r){if(r>=a.length)return t;var n=[],i=o[r++];return t.forEach(function(t,i){n.push({key:t,values:e(i,r)})}),i?n.sort(function(t,e){return i(t.key,e.key)}):n}var r,n,i={},a=[],o=[];return i.map=function(e,r){return t(r,e,0)},i.entries=function(r){return e(t(uo.map,r,0),0)},i.key=function(t){return a.push(t),i},i.sortKeys=function(t){return o[a.length-1]=t,i},i.sortValues=function(t){return r=t,i},i.rollup=function(t){return n=t,i},i},uo.set=function(t){var e=new b;if(t)for(var r=0,n=t.length;r<n;++r)e.add(t[r]);return e},c(b,{has:p,add:function(t){return this._[f(t+="")]=!0,t},remove:m,values:v,size:g,empty:y,forEach:function(t){for(var e in this._)t.call(this,d(e))}}),uo.behavior={},uo.rebind=function(t,e){for(var r,n=1,i=arguments.length;++n<i;)t[r=arguments[n]]=_(t,e,e[r]);return t};var Mo=["webkit","ms","moz","Moz","o","O"];uo.dispatch=function(){for(var t=new k,e=-1,r=arguments.length;++e<r;)t[arguments[e]]=A(t);return t},k.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}},uo.event=null,uo.requote=function(t){return t.replace(ko,"\\$&")};var ko=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,Ao={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var r in e)t[r]=e[r]},To=function(t,e){return e.querySelector(t)},So=function(t,e){return e.querySelectorAll(t)},Eo=function(t,e){var r=t.matches||t[w(t,"matchesSelector")];return(Eo=function(t,e){return r.call(t,e)})(t,e)};"function"==typeof Sizzle&&(To=function(t,e){return Sizzle(t,e)[0]||null},So=Sizzle,Eo=Sizzle.matchesSelector),uo.selection=function(){return uo.select(fo.documentElement)};var Lo=uo.selection.prototype=[];Lo.select=function(t){var e,r,n,i,a=[];t=C(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)),
16 r&&"__data__"in i&&(r.__data__=i.__data__)):e.push(null)}return L(a)},Lo.selectAll=function(t){var e,r,n=[];t=z(t);for(var i=-1,a=this.length;++i<a;)for(var o=this[i],s=-1,l=o.length;++s<l;)(r=o[s])&&(n.push(e=ho(t.call(r,r.__data__,s,i))),e.parentNode=r);return L(n)};var Co="http://www.w3.org/1999/xhtml",zo={svg:"http://www.w3.org/2000/svg",xhtml:Co,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};uo.ns={prefix:zo,qualify:function(t){var e=t.indexOf(":"),r=t;return e>=0&&"xmlns"!==(r=t.slice(0,e))&&(t=t.slice(e+1)),zo.hasOwnProperty(r)?{space:zo[r],local:t}:t}},Lo.attr=function(t,e){if(arguments.length<2){if("string"==typeof t){var r=this.node();return t=uo.ns.qualify(t),t.local?r.getAttributeNS(t.space,t.local):r.getAttribute(t)}for(e in t)this.each(D(e,t[e]));return this}return this.each(D(t,e))},Lo.classed=function(t,e){if(arguments.length<2){if("string"==typeof t){var r=this.node(),n=(t=O(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(!P(t[i]).test(e))return!1;return!0}for(e in t)this.each(j(e,t[e]));return this}return this.each(j(t,e))},Lo.style=function(t,e,r){var i=arguments.length;if(i<3){if("string"!=typeof t){i<2&&(e="");for(r in t)this.each(R(r,t[r],e));return this}if(i<2){var a=this.node();return n(a).getComputedStyle(a,null).getPropertyValue(t)}r=""}return this.each(R(t,e,r))},Lo.property=function(t,e){if(arguments.length<2){if("string"==typeof t)return this.node()[t];for(e in t)this.each(N(e,t[e]));return this}return this.each(N(t,e))},Lo.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},Lo.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},Lo.append=function(t){return t=B(t),this.select(function(){return this.appendChild(t.apply(this,arguments))})},Lo.insert=function(t,e){return t=B(t),e=C(e),this.select(function(){return this.insertBefore(t.apply(this,arguments),e.apply(this,arguments)||null)})},Lo.remove=function(){return this.each(U)},Lo.data=function(t,e){function r(t,r){var n,i,a,o=t.length,c=r.length,f=Math.min(o,c),d=new Array(c),p=new Array(c),m=new Array(o);if(e){var v,g=new h,y=new Array(o);for(n=-1;++n<o;)(i=t[n])&&(g.has(v=e.call(i,i.__data__,n))?m[n]=i:g.set(v,i),y[n]=v);for(n=-1;++n<c;)(i=g.get(v=e.call(r,a=r[n],n)))?i!==!0&&(d[n]=i,i.__data__=a):p[n]=V(a),g.set(v,!0);for(n=-1;++n<o;)n in y&&g.get(y[n])!==!0&&(m[n]=t[n])}else{for(n=-1;++n<f;)i=t[n],a=r[n],i?(i.__data__=a,d[n]=i):p[n]=V(a);for(;n<c;++n)p[n]=V(r[n]);for(;n<o;++n)m[n]=t[n]}p.update=d,p.parentNode=d.parentNode=m.parentNode=t.parentNode,s.push(p),l.push(d),u.push(m)}var n,i,a=-1,o=this.length;if(!arguments.length){for(t=new Array(o=(n=this[0]).length);++a<o;)(i=n[a])&&(t[a]=i.__data__);return t}var s=Y([]),l=L([]),u=L([]);if("function"==typeof t)for(;++a<o;)r(n=this[a],t.call(n,n.parentNode.__data__,a));else for(;++a<o;)r(n=this[a],t);return l.enter=function(){return s},l.exit=function(){return u},l},Lo.datum=function(t){return arguments.length?this.property("__data__",t):this.property("__data__")},Lo.filter=function(t){var e,r,n,i=[];"function"!=typeof t&&(t=q(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 L(i)},Lo.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},Lo.sort=function(t){t=H.apply(this,arguments);for(var e=-1,r=this.length;++e<r;)this[e].sort(t);return this.order()},Lo.each=function(t){return G(this,function(e,r,n){t.call(e,e.__data__,r,n)})},Lo.call=function(t){var e=ho(arguments);return t.apply(e[0]=this,e),this},Lo.empty=function(){return!this.node()},Lo.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},Lo.size=function(){var t=0;return G(this,function(){++t}),t};var Do=[];uo.selection.enter=Y,uo.selection.enter.prototype=Do,Do.append=Lo.append,Do.empty=Lo.empty,Do.node=Lo.node,Do.call=Lo.call,Do.size=Lo.size,Do.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 L(o)},Do.insert=function(t,e){return arguments.length<2&&(e=X(this)),Lo.insert.call(this,t,e)},uo.select=function(t){var r;return"string"==typeof t?(r=[To(t,fo)],r.parentNode=fo.documentElement):(r=[t],r.parentNode=e(t)),L([r])},uo.selectAll=function(t){var e;return"string"==typeof t?(e=ho(So(t,fo)),e.parentNode=fo.documentElement):(e=ho(t),e.parentNode=null),L([e])},Lo.on=function(t,e,r){var n=arguments.length;if(n<3){if("string"!=typeof t){n<2&&(e=!1);for(r in t)this.each(W(r,t[r],e));return this}if(n<2)return(n=this.node()["__on"+t])&&n._;r=!1}return this.each(W(t,e,r))};var Io=uo.map({mouseenter:"mouseover",mouseleave:"mouseout"});fo&&Io.forEach(function(t){"on"+t in fo&&Io.remove(t)});var Po,Oo=0;uo.mouse=function(t){return Q(t,S())};var jo=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;uo.touch=function(t,e,r){if(arguments.length<3&&(r=e,e=S().changedTouches),e)for(var n,i=0,a=e.length;i<a;++i)if((n=e[i]).identifier===r)return Q(t,n)},uo.behavior.drag=function(){function t(){this.on("mousedown.drag",a).on("touchstart.drag",o)}function e(t,e,n,a,o){return function(){function s(){var t,r,n=e(f,m);n&&(t=n[0]-b[0],r=n[1]-b[1],p|=t|r,b=n,d({type:"drag",x:n[0]+u[0],y:n[1]+u[1],dx:t,dy:r}))}function l(){e(f,m)&&(g.on(a+v,null).on(o+v,null),y(p),d({type:"dragend"}))}var u,c=this,h=uo.event.target.correspondingElement||uo.event.target,f=c.parentNode,d=r.of(c,arguments),p=0,m=t(),v=".drag"+(null==m?"":"-"+m),g=uo.select(n(h)).on(a+v,s).on(o+v,l),y=K(h),b=e(f,m);i?(u=i.apply(c,arguments),u=[u.x-b[0],u.y-b[1]]):u=[0,0],d({type:"dragstart"})}}var r=E(t,"drag","dragstart","dragend"),i=null,a=e(M,uo.mouse,n,"mousemove","mouseup"),o=e($,uo.touch,x,"touchmove","touchend");return t.origin=function(e){return arguments.length?(i=e,t):i},uo.rebind(t,r,"on")},uo.touches=function(t,e){return arguments.length<2&&(e=S().touches),e?ho(e).map(function(e){var r=Q(t,e);return r.identifier=e.identifier,r}):[]};var Fo=1e-6,Ro=Fo*Fo,No=Math.PI,Bo=2*No,Uo=Bo-Fo,Vo=No/2,qo=No/180,Ho=180/No,Go=Math.SQRT2;uo.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,h=l-a,f=c*c+h*h;if(f<Ro)n=Math.log(u/o)/Go,r=function(t){return[i+t*c,a+t*h,o*Math.exp(Go*t*n)]};else{var d=Math.sqrt(f),p=(u*u-o*o+4*f)/(2*o*2*d),m=(u*u-o*o-4*f)/(2*u*2*d),v=Math.log(Math.sqrt(p*p+1)-p),g=Math.log(Math.sqrt(m*m+1)-m);n=(g-v)/Go,r=function(t){var e=t*n,r=at(v),s=o/(2*d)*(r*ot(Go*e+v)-it(v));return[i+s*c,a+s*h,o*r/at(Go*e+v)]}}return r.duration=1e3*n,r},uo.behavior.zoom=function(){function t(t){t.on(z,h).on(Xo+".zoom",d).on("dblclick.zoom",p).on(P,f)}function e(t){return[(t[0]-k.x)/k.k,(t[1]-k.y)/k.k]}function r(t){return[t[0]*k.k+k.x,t[1]*k.k+k.y]}function i(t){k.k=Math.max(S[0],Math.min(S[1],t))}function a(t,e){e=r(e),k.x+=t[0]-e[0],k.y+=t[1]-e[1]}function o(e,r,n,o){e.__chart__={x:k.x,y:k.y,k:k.k},i(Math.pow(2,o)),a(v=r,n),e=uo.select(e),L>0&&(e=e.transition().duration(L)),e.call(t.event)}function s(){_&&_.domain(x.range().map(function(t){return(t-k.x)/k.k}).map(x.invert)),M&&M.domain(w.range().map(function(t){return(t-k.y)/k.k}).map(w.invert))}function l(t){C++||t({type:"zoomstart"})}function u(t){s(),t({type:"zoom",scale:k.k,translate:[k.x,k.y]})}function c(t){--C||(t({type:"zoomend"}),v=null)}function h(){function t(){s=1,a(uo.mouse(i),f),u(o)}function r(){h.on(D,null).on(I,null),d(s),c(o)}var i=this,o=O.of(i,arguments),s=0,h=uo.select(n(i)).on(D,t).on(I,r),f=e(uo.mouse(i)),d=K(i);Bl.call(i),l(o)}function f(){function t(){var t=uo.touches(p);return d=k.k,t.forEach(function(t){t.identifier in v&&(v[t.identifier]=e(t))}),t}function r(){var e=uo.event.target;uo.select(e).on(x,n).on(_,s),w.push(e);for(var r=uo.event.changedTouches,i=0,a=r.length;i<a;++i)v[r[i].identifier]=null;var l=t(),u=Date.now();if(1===l.length){if(u-b<500){var c=l[0];o(p,c,v[c.identifier],Math.floor(Math.log(k.k)/Math.LN2)+1),T()}b=u}else if(l.length>1){var c=l[0],h=l[1],f=c[0]-h[0],d=c[1]-h[1];g=f*f+d*d}}function n(){var t,e,r,n,o=uo.touches(p);Bl.call(p);for(var s=0,l=o.length;s<l;++s,n=null)if(r=o[s],n=v[r.identifier]){if(e)break;t=r,e=n}if(n){var c=(c=r[0]-t[0])*c+(c=r[1]-t[1])*c,h=g&&Math.sqrt(c/g);t=[(t[0]+r[0])/2,(t[1]+r[1])/2],e=[(e[0]+n[0])/2,(e[1]+n[1])/2],i(h*d)}b=null,a(t,e),u(m)}function s(){if(uo.event.touches.length){for(var e=uo.event.changedTouches,r=0,n=e.length;r<n;++r)delete v[e[r].identifier];for(var i in v)return void t()}uo.selectAll(w).on(y,null),M.on(z,h).on(P,f),A(),c(m)}var d,p=this,m=O.of(p,arguments),v={},g=0,y=".zoom-"+uo.event.changedTouches[0].identifier,x="touchmove"+y,_="touchend"+y,w=[],M=uo.select(p),A=K(p);r(),l(m),M.on(z,null).on(P,r)}function d(){var t=O.of(this,arguments);y?clearTimeout(y):(Bl.call(this),m=e(v=g||uo.mouse(this)),l(t)),y=setTimeout(function(){y=null,c(t)},50),T(),i(Math.pow(2,.002*Yo())*k.k),a(v,m),u(t)}function p(){var t=uo.mouse(this),r=Math.log(k.k)/Math.LN2;o(this,t,e(t),uo.event.shiftKey?Math.ceil(r)-1:Math.floor(r)+1)}var m,v,g,y,b,x,_,w,M,k={x:0,y:0,k:1},A=[960,500],S=Wo,L=250,C=0,z="mousedown.zoom",D="mousemove.zoom",I="mouseup.zoom",P="touchstart.zoom",O=E(t,"zoomstart","zoom","zoomend");return Xo||(Xo="onwheel"in fo?(Yo=function(){return-uo.event.deltaY*(uo.event.deltaMode?120:1)},"wheel"):"onmousewheel"in fo?(Yo=function(){return uo.event.wheelDelta},"mousewheel"):(Yo=function(){return-uo.event.detail},"MozMousePixelScroll")),t.event=function(t){t.each(function(){var t=O.of(this,arguments),e=k;Rl?uo.select(this).transition().each("start.zoom",function(){k=this.__chart__||{x:0,y:0,k:1},l(t)}).tween("zoom:zoom",function(){var r=A[0],n=A[1],i=v?v[0]:r/2,a=v?v[1]:n/2,o=uo.interpolateZoom([(i-k.x)/k.k,(a-k.y)/k.k,r/k.k],[(i-e.x)/e.k,(a-e.y)/e.k,r/e.k]);return function(e){var n=o(e),s=r/n[2];this.__chart__=k={x:i-n[0]*s,y:a-n[1]*s,k:s},u(t)}}).each("interrupt.zoom",function(){c(t)}).each("end.zoom",function(){c(t)}):(this.__chart__=k,l(t),u(t),c(t))})},t.translate=function(e){return arguments.length?(k={x:+e[0],y:+e[1],k:k.k},s(),t):[k.x,k.y]},t.scale=function(e){return arguments.length?(k={x:k.x,y:k.y,k:null},i(+e),s(),t):k.k},t.scaleExtent=function(e){return arguments.length?(S=null==e?Wo:[+e[0],+e[1]],t):S},t.center=function(e){return arguments.length?(g=e&&[+e[0],+e[1]],t):g},t.size=function(e){return arguments.length?(A=e&&[+e[0],+e[1]],t):A},t.duration=function(e){return arguments.length?(L=+e,t):L},t.x=function(e){return arguments.length?(_=e,x=e.copy(),k={x:0,y:0,k:1},t):_},t.y=function(e){return arguments.length?(M=e,w=e.copy(),k={x:0,y:0,k:1},t):M},uo.rebind(t,O,"on")};var Yo,Xo,Wo=[0,1/0];uo.color=lt,lt.prototype.toString=function(){return this.rgb()+""},uo.hsl=ut;var Zo=ut.prototype=new lt;Zo.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),new ut(this.h,this.s,this.l/t)},Zo.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new ut(this.h,this.s,t*this.l)},Zo.rgb=function(){return ct(this.h,this.s,this.l)},uo.hcl=ht;var Jo=ht.prototype=new lt;Jo.brighter=function(t){return new ht(this.h,this.c,Math.min(100,this.l+Ko*(arguments.length?t:1)))},Jo.darker=function(t){return new ht(this.h,this.c,Math.max(0,this.l-Ko*(arguments.length?t:1)))},Jo.rgb=function(){return ft(this.h,this.c,this.l).rgb()},uo.lab=dt;var Ko=18,Qo=.95047,$o=1,ts=1.08883,es=dt.prototype=new lt;es.brighter=function(t){return new dt(Math.min(100,this.l+Ko*(arguments.length?t:1)),this.a,this.b)},es.darker=function(t){return new dt(Math.max(0,this.l-Ko*(arguments.length?t:1)),this.a,this.b)},es.rgb=function(){return pt(this.l,this.a,this.b)},uo.rgb=bt;var rs=bt.prototype=new lt;rs.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 bt(Math.min(255,e/t),Math.min(255,r/t),Math.min(255,n/t))):new bt(i,i,i)},rs.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new bt(t*this.r,t*this.g,t*this.b)},rs.hsl=function(){return kt(this.r,this.g,this.b)},rs.toString=function(){return"#"+wt(this.r)+wt(this.g)+wt(this.b)};var ns=uo.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});ns.forEach(function(t,e){ns.set(t,xt(e))}),uo.functor=Et,uo.xhr=Lt(x),uo.dsv=function(t,e){function r(t,r,a){arguments.length<3&&(a=r,r=null);var o=Ct(t,e,null==r?n:i(r),a);return o.row=function(t){return arguments.length?o.response(null==(r=t)?n:i(t)):r},o}function n(t){return r.parse(t.responseText)}function i(t){return function(e){return r.parse(e.responseText,t)}}function a(e){return e.map(o).join(t)}function o(t){return s.test(t)?'"'+t.replace(/\"/g,'""')+'"':t}var s=new RegExp('["'+t+"\n]"),l=t.charCodeAt(0);return r.parse=function(t,e){var n;return r.parseRows(t,function(t,r){if(n)return n(t,r-1);var i=new Function("d","return {"+t.map(function(t,e){return JSON.stringify(t)+": d["+e+"]"}).join(",")+"}");n=e?function(t,r){return e(i(t),r)}:i})},r.parseRows=function(t,e){function r(){if(c>=u)return o;if(i)return i=!1,a;var e=c;if(34===t.charCodeAt(e)){for(var r=e;r++<u;)if(34===t.charCodeAt(r)){if(34!==t.charCodeAt(r+1))break;++r}c=r+2;var n=t.charCodeAt(r+1);return 13===n?(i=!0,10===t.charCodeAt(r+2)&&++c):10===n&&(i=!0),t.slice(e+1,r).replace(/""/g,'"')}for(;c<u;){var n=t.charCodeAt(c++),s=1;if(10===n)i=!0;else if(13===n)i=!0,10===t.charCodeAt(c)&&(++c,++s);else if(n!==l)continue;return t.slice(e,c-s)}return t.slice(e)}for(var n,i,a={},o={},s=[],u=t.length,c=0,h=0;(n=r())!==o;){for(var f=[];n!==a&&n!==o;)f.push(n),n=r();e&&null==(f=e(f,h++))||s.push(f)}return s},r.format=function(e){if(Array.isArray(e[0]))return r.formatRows(e);var n=new b,i=[];return e.forEach(function(t){for(var e in t)n.has(e)||i.push(n.add(e))}),[i.map(o).join(t)].concat(e.map(function(e){return i.map(function(t){return o(e[t])}).join(t)})).join("\n")},r.formatRows=function(t){return t.map(a).join("\n")},r},uo.csv=uo.dsv(",","text/csv"),uo.tsv=uo.dsv("\t","text/tab-separated-values");var is,as,os,ss,ls=this[w(this,"requestAnimationFrame")]||function(t){setTimeout(t,17)};uo.timer=function(){It.apply(this,arguments)},uo.timer.flush=function(){Ot(),jt()},uo.round=function(t,e){return e?Math.round(t*(e=Math.pow(10,e)))/e:Math.round(t)};var us=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"].map(Rt);uo.formatPrefix=function(t,e){var r=0;return(t=+t)&&(t<0&&(t*=-1),e&&(t=uo.round(t,Ft(t,e))),r=1+Math.floor(1e-12+Math.log(t)/Math.LN10),r=Math.max(-24,Math.min(24,3*Math.floor((r-1)/3)))),us[8+r/3]};var cs=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,hs=uo.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(t,e){return(t=uo.round(t,Ft(t,e))).toFixed(Math.max(0,Math.min(20,Ft(t*(1+1e-15),e))))}}),fs=uo.time={},ds=Date;Ut.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(){ps.setUTCDate.apply(this._,arguments)},setDay:function(){ps.setUTCDay.apply(this._,arguments)},setFullYear:function(){ps.setUTCFullYear.apply(this._,arguments)},setHours:function(){ps.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){ps.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){ps.setUTCMinutes.apply(this._,arguments)},setMonth:function(){ps.setUTCMonth.apply(this._,arguments)},setSeconds:function(){ps.setUTCSeconds.apply(this._,arguments)},setTime:function(){ps.setTime.apply(this._,arguments)}};var ps=Date.prototype;fs.year=Vt(function(t){return t=fs.day(t),t.setMonth(0,1),t},function(t,e){t.setFullYear(t.getFullYear()+e)},function(t){return t.getFullYear()}),fs.years=fs.year.range,fs.years.utc=fs.year.utc.range,fs.day=Vt(function(t){var e=new ds(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}),fs.days=fs.day.range,fs.days.utc=fs.day.utc.range,fs.dayOfYear=function(t){var e=fs.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=fs[t]=Vt(function(t){return(t=fs.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=fs.year(t).getDay();return Math.floor((fs.dayOfYear(t)+(r+e)%7)/7)-(r!==e)});fs[t+"s"]=r.range,fs[t+"s"].utc=r.utc.range,fs[t+"OfYear"]=function(t){var r=fs.year(t).getDay();return Math.floor((fs.dayOfYear(t)+(r+e)%7)/7)}}),fs.week=fs.sunday,fs.weeks=fs.sunday.range,fs.weeks.utc=fs.sunday.utc.range,fs.weekOfYear=fs.sundayOfYear;var ms={"-":"",_:" ",0:"0"},vs=/^\s*\d+/,gs=/^%/;uo.locale=function(t){return{numberFormat:Nt(t),timeFormat:Ht(t)}};var ys=uo.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"]});uo.format=ys.numberFormat,uo.geo={},he.prototype={s:0,t:0,add:function(t){fe(t,this.t,bs),fe(bs.s,this.s,this),this.s?this.t+=bs.t:this.s=bs.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var bs=new he;uo.geo.stream=function(t,e){t&&xs.hasOwnProperty(t.type)?xs[t.type](t,e):de(t,e)};var xs={Feature:function(t,e){de(t.geometry,e)},FeatureCollection:function(t,e){for(var r=t.features,n=-1,i=r.length;++n<i;)de(r[n].geometry,e)}},_s={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){pe(t.coordinates,e,0)},MultiLineString:function(t,e){for(var r=t.coordinates,n=-1,i=r.length;++n<i;)pe(r[n],e,0)},Polygon:function(t,e){me(t.coordinates,e)},MultiPolygon:function(t,e){for(var r=t.coordinates,n=-1,i=r.length;++n<i;)me(r[n],e)},GeometryCollection:function(t,e){for(var r=t.geometries,n=-1,i=r.length;++n<i;)de(r[n],e)}};uo.geo.area=function(t){return ws=0,uo.geo.stream(t,ks),ws};var ws,Ms=new he,ks={sphere:function(){ws+=4*No},point:M,lineStart:M,lineEnd:M,polygonStart:function(){Ms.reset(),ks.lineStart=ve},polygonEnd:function(){var t=2*Ms;ws+=t<0?4*No+t:t,ks.lineStart=ks.lineEnd=ks.point=M}};uo.geo.bounds=function(){function t(t,e){b.push(x=[c=t,f=t]),e<h&&(h=e),e>d&&(d=e)}function e(e,r){var n=ge([e*qo,r*qo]);if(g){var i=be(g,n),a=[i[1],-i[0],0],o=be(a,i);we(o),o=Me(o);var l=e-p,u=l>0?1:-1,m=o[0]*Ho*u,v=xo(l)>180;if(v^(u*p<m&&m<u*e)){var y=o[1]*Ho;y>d&&(d=y)}else if(m=(m+360)%360-180,v^(u*p<m&&m<u*e)){var y=-o[1]*Ho;y<h&&(h=y)}else r<h&&(h=r),r>d&&(d=r);v?e<p?s(c,e)>s(c,f)&&(f=e):s(e,f)>s(c,f)&&(c=e):f>=c?(e<c&&(c=e),e>f&&(f=e)):e>p?s(c,e)>s(c,f)&&(f=e):s(e,f)>s(c,f)&&(c=e)}else t(e,r);g=n,p=e}function r(){_.point=e}function n(){x[0]=c,x[1]=f,_.point=t,g=null}function i(t,r){if(g){var n=t-p;y+=xo(n)>180?n+(n>0?360:-360):n}else m=t,v=r;ks.point(t,r),e(t,r)}function a(){ks.lineStart()}function o(){i(m,v),ks.lineEnd(),xo(y)>Fo&&(c=-(f=180)),x[0]=c,x[1]=f,g=null}function s(t,e){return(e-=t)<0?e+360:e}function l(t,e){return t[0]-e[0]}function u(t,e){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t<e[0]||e[1]<t}var c,h,f,d,p,m,v,g,y,b,x,_={point:t,lineStart:r,lineEnd:n,polygonStart:function(){_.point=i,_.lineStart=a,_.lineEnd=o,y=0,ks.polygonStart()},polygonEnd:function(){ks.polygonEnd(),_.point=t,_.lineStart=r,_.lineEnd=n,Ms<0?(c=-(f=180),h=-(d=90)):y>Fo?d=90:y<-Fo&&(h=-90),x[0]=c,x[1]=f}};return function(t){d=f=-(c=h=1/0),b=[],uo.geo.stream(t,_);var e=b.length;if(e){b.sort(l);for(var r,n=1,i=b[0],a=[i];n<e;++n)r=b[n],u(r[0],i)||u(r[1],i)?(s(i[0],r[1])>s(i[0],i[1])&&(i[1]=r[1]),s(r[0],i[1])>s(i[0],i[1])&&(i[0]=r[0])):a.push(i=r);for(var o,r,p=-1/0,e=a.length-1,n=0,i=a[e];n<=e;i=r,++n)r=a[n],(o=s(i[1],r[0]))>p&&(p=o,c=r[0],f=i[1])}return b=x=null,1/0===c||1/0===h?[[0/0,0/0],[0/0,0/0]]:[[c,h],[f,d]]}}(),uo.geo.centroid=function(t){As=Ts=Ss=Es=Ls=Cs=zs=Ds=Is=Ps=Os=0,uo.geo.stream(t,js);var e=Is,r=Ps,n=Os,i=e*e+r*r+n*n;return i<Ro&&(e=Cs,r=zs,n=Ds,Ts<Fo&&(e=Ss,r=Es,n=Ls),(i=e*e+r*r+n*n)<Ro)?[0/0,0/0]:[Math.atan2(r,e)*Ho,nt(n/Math.sqrt(i))*Ho]};var As,Ts,Ss,Es,Ls,Cs,zs,Ds,Is,Ps,Os,js={sphere:M,point:Ae,lineStart:Se,lineEnd:Ee,polygonStart:function(){js.lineStart=Le},polygonEnd:function(){js.lineStart=Se}},Fs=Oe(ze,Ne,Ue,[-No,-No/2]),Rs=1e9;uo.geo.clipExtent=function(){var t,e,r,n,i,a,o={stream:function(t){return i&&(i.valid=!1),i=a(t),i.valid=!0,i},extent:function(s){return arguments.length?(a=Ge(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]])},(uo.geo.conicEqualArea=function(){return Ye(Xe)}).raw=Xe,uo.geo.albers=function(){return uo.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},uo.geo.albersUsa=function(){function t(t){var a=t[0],o=t[1];return e=null,r(a,o),e||(n(a,o),e)||i(a,o),e}var e,r,n,i,a=uo.geo.albers(),o=uo.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),s=uo.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),l={point:function(t,r){e=[t,r]}};return t.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)},t.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()}}},t.precision=function(e){return arguments.length?(a.precision(e),o.precision(e),s.precision(e),t):a.precision()},t.scale=function(e){return arguments.length?(a.scale(e),o.scale(.35*e),s.scale(e),t.translate(a.translate())):a.scale()},t.translate=function(e){if(!arguments.length)return a.translate();var u=a.scale(),c=+e[0],h=+e[1];return r=a.translate(e).clipExtent([[c-.455*u,h-.238*u],[c+.455*u,h+.238*u]]).stream(l).point,n=o.translate([c-.307*u,h+.201*u]).clipExtent([[c-.425*u+Fo,h+.12*u+Fo],[c-.214*u-Fo,h+.234*u-Fo]]).stream(l).point,i=s.translate([c-.205*u,h+.212*u]).clipExtent([[c-.214*u+Fo,h+.166*u+Fo],[c-.115*u-Fo,h+.234*u-Fo]]).stream(l).point,t},t.scale(1070)};var Ns,Bs,Us,Vs,qs,Hs,Gs={point:M,lineStart:M,lineEnd:M,polygonStart:function(){Bs=0,Gs.lineStart=We},polygonEnd:function(){Gs.lineStart=Gs.lineEnd=Gs.point=M,Ns+=xo(Bs/2)}},Ys={point:Ze,lineStart:M,lineEnd:M,polygonStart:M,polygonEnd:M},Xs={point:Qe,lineStart:$e,lineEnd:tr,polygonStart:function(){Xs.lineStart=er},polygonEnd:function(){Xs.point=Qe,Xs.lineStart=$e,Xs.lineEnd=tr}};uo.geo.path=function(){function t(t){return t&&("function"==typeof s&&a.pointRadius(+s.apply(this,arguments)),o&&o.valid||(o=i(a)),uo.geo.stream(t,o)),a.result()}function e(){return o=null,t}var r,n,i,a,o,s=4.5;return t.area=function(t){return Ns=0,uo.geo.stream(t,i(Gs)),Ns},t.centroid=function(t){return Ss=Es=Ls=Cs=zs=Ds=Is=Ps=Os=0,uo.geo.stream(t,i(Xs)),Os?[Is/Os,Ps/Os]:Ds?[Cs/Ds,zs/Ds]:Ls?[Ss/Ls,Es/Ls]:[0/0,0/0]},t.bounds=function(t){return qs=Hs=-(Us=Vs=1/0),uo.geo.stream(t,i(Ys)),[[Us,Vs],[qs,Hs]]},t.projection=function(t){return arguments.length?(i=(r=t)?t.stream||ir(t):x,e()):r},t.context=function(t){return arguments.length?(a=null==(n=t)?new Je:new rr(t),"function"!=typeof s&&a.pointRadius(s),e()):n},t.pointRadius=function(e){return arguments.length?(s="function"==typeof e?e:(a.pointRadius(+e),+e),t):s},t.projection(uo.geo.albersUsa()).context(null)},uo.geo.transform=function(t){return{stream:function(e){var r=new ar(e);for(var n in t)r[n]=t[n];return r}}},ar.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()}},uo.geo.projection=sr,uo.geo.projectionMutator=lr,(uo.geo.equirectangular=function(){return sr(cr)}).raw=cr.invert=cr,uo.geo.rotation=function(t){function e(e){return e=t(e[0]*qo,e[1]*qo),e[0]*=Ho,e[1]*=Ho,e}return t=fr(t[0]%360*qo,t[1]*qo,t.length>2?t[2]*qo:0),e.invert=function(e){return e=t.invert(e[0]*qo,e[1]*qo),e[0]*=Ho,e[1]*=Ho,e},e},hr.invert=cr,uo.geo.circle=function(){function t(){var t="function"==typeof n?n.apply(this,arguments):n,e=fr(-t[0]*qo,-t[1]*qo,0).invert,i=[];return r(null,null,1,{point:function(t,r){i.push(t=e(t,r)),t[0]*=Ho,t[1]*=Ho}}),{type:"Polygon",coordinates:[i]}}var e,r,n=[0,0],i=6;return t.origin=function(e){return arguments.length?(n=e,t):n},t.angle=function(n){return arguments.length?(r=vr((e=+n)*qo,i*qo),t):e},t.precision=function(n){return arguments.length?(r=vr(e*qo,(i=+n)*qo),t):i},t.angle(90)},uo.geo.distance=function(t,e){var r,n=(e[0]-t[0])*qo,i=t[1]*qo,a=e[1]*qo,o=Math.sin(n),s=Math.cos(n),l=Math.sin(i),u=Math.cos(i),c=Math.sin(a),h=Math.cos(a);return Math.atan2(Math.sqrt((r=h*o)*r+(r=u*c-l*h*s)*r),l*c+u*h*s)},uo.geo.graticule=function(){function t(){return{type:"MultiLineString",coordinates:e()}}function e(){return uo.range(Math.ceil(a/v)*v,i,v).map(f).concat(uo.range(Math.ceil(u/g)*g,l,g).map(d)).concat(uo.range(Math.ceil(n/p)*p,r,p).filter(function(t){return xo(t%v)>Fo}).map(c)).concat(uo.range(Math.ceil(s/m)*m,o,m).filter(function(t){return xo(t%g)>Fo}).map(h))}var r,n,i,a,o,s,l,u,c,h,f,d,p=10,m=p,v=90,g=360,y=2.5;return t.lines=function(){return e().map(function(t){return{type:"LineString",coordinates:t}})},t.outline=function(){return{type:"Polygon",coordinates:[f(a).concat(d(l).slice(1),f(i).reverse().slice(1),d(u).reverse().slice(1))]}},t.extent=function(e){return arguments.length?t.majorExtent(e).minorExtent(e):t.minorExtent()},t.majorExtent=function(e){return arguments.length?(a=+e[0][0],i=+e[1][0],u=+e[0][1],l=+e[1][1],a>i&&(e=a,a=i,i=e),u>l&&(e=u,u=l,l=e),t.precision(y)):[[a,u],[i,l]]},t.minorExtent=function(e){return arguments.length?(n=+e[0][0],r=+e[1][0],s=+e[0][1],o=+e[1][1],n>r&&(e=n,n=r,r=e),s>o&&(e=s,s=o,o=e),t.precision(y)):[[n,s],[r,o]]},t.step=function(e){return arguments.length?t.majorStep(e).minorStep(e):t.minorStep()},t.majorStep=function(e){return arguments.length?(v=+e[0],g=+e[1],t):[v,g]},t.minorStep=function(e){return arguments.length?(p=+e[0],m=+e[1],t):[p,m]},t.precision=function(e){return arguments.length?(y=+e,c=yr(s,o,90),h=br(n,r,y),f=yr(u,l,90),d=br(a,i,y),t):y},t.majorExtent([[-180,-90+Fo],[180,90-Fo]]).minorExtent([[-180,-80-Fo],[180,80+Fo]])},uo.geo.greatArc=function(){function t(){return{type:"LineString",coordinates:[e||n.apply(this,arguments),r||i.apply(this,arguments)]}}var e,r,n=xr,i=_r;return t.distance=function(){return uo.geo.distance(e||n.apply(this,arguments),r||i.apply(this,arguments))},t.source=function(r){return arguments.length?(n=r,e="function"==typeof r?null:r,t):n},t.target=function(e){return arguments.length?(i=e,r="function"==typeof e?null:e,t):i},t.precision=function(){return arguments.length?t:0},t},uo.geo.interpolate=function(t,e){return wr(t[0]*qo,t[1]*qo,e[0]*qo,e[1]*qo)},uo.geo.length=function(t){return Ws=0,uo.geo.stream(t,Zs),Ws};var Ws,Zs={sphere:M,point:M,lineStart:Mr,lineEnd:M,polygonStart:M,polygonEnd:M},Js=kr(function(t){return Math.sqrt(2/(1+t))},function(t){return 2*Math.asin(t/2)});(uo.geo.azimuthalEqualArea=function(){return sr(Js)}).raw=Js;var Ks=kr(function(t){var e=Math.acos(t);return e&&e/Math.sin(e)},x);(uo.geo.azimuthalEquidistant=function(){return sr(Ks)}).raw=Ks,(uo.geo.conicConformal=function(){return Ye(Ar)}).raw=Ar,
17 (uo.geo.conicEquidistant=function(){return Ye(Tr)}).raw=Tr;var Qs=kr(function(t){return 1/t},Math.atan);(uo.geo.gnomonic=function(){return sr(Qs)}).raw=Qs,Sr.invert=function(t,e){return[t,2*Math.atan(Math.exp(e))-Vo]},(uo.geo.mercator=function(){return Er(Sr)}).raw=Sr;var $s=kr(function(){return 1},Math.asin);(uo.geo.orthographic=function(){return sr($s)}).raw=$s;var tl=kr(function(t){return 1/(1+t)},function(t){return 2*Math.atan(t)});(uo.geo.stereographic=function(){return sr(tl)}).raw=tl,Lr.invert=function(t,e){return[-e,2*Math.atan(Math.exp(t))-Vo]},(uo.geo.transverseMercator=function(){var t=Er(Lr),e=t.center,r=t.rotate;return t.center=function(t){return t?e([-t[1],t[0]]):(t=e(),[t[1],-t[0]])},t.rotate=function(t){return t?r([t[0],t[1],t.length>2?t[2]+90:90]):(t=r(),[t[0],t[1],t[2]-90])},r([0,0,90])}).raw=Lr,uo.geom={},uo.geom.hull=function(t){function e(t){if(t.length<3)return[];var e,i=Et(r),a=Et(n),o=t.length,s=[],l=[];for(e=0;e<o;e++)s.push([+i.call(this,t[e],e),+a.call(this,t[e],e),e]);for(s.sort(Ir),e=0;e<o;e++)l.push([s[e][0],-s[e][1]]);var u=Dr(s),c=Dr(l),h=c[0]===u[0],f=c[c.length-1]===u[u.length-1],d=[];for(e=u.length-1;e>=0;--e)d.push(t[s[u[e]][2]]);for(e=+h;e<c.length-f;++e)d.push(t[s[c[e]][2]]);return d}var r=Cr,n=zr;return arguments.length?e(t):(e.x=function(t){return arguments.length?(r=t,e):r},e.y=function(t){return arguments.length?(n=t,e):n},e)},uo.geom.polygon=function(t){return Ao(t,el),t};var el=uo.geom.polygon.prototype=[];el.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},el.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]},el.clip=function(t){for(var e,r,n,i,a,o,s=jr(t),l=-1,u=this.length-jr(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;)o=e[r],Pr(o,c,i)?(Pr(a,c,i)||t.push(Or(a,o,c,i)),t.push(o)):Pr(a,c,i)&&t.push(Or(a,o,c,i)),a=o;s&&t.push(t[0]),c=i}return t};var rl,nl,il,al,ol,sl=[],ll=[];Hr.prototype.prepare=function(){for(var t,e=this.edges,r=e.length;r--;)t=e[r].edge,t.b&&t.a||e.splice(r,1);return e.sort(Yr),e.length},rn.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}},nn.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=ln(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;)n=r.U,r===n.L?(i=n.R,i&&i.C?(r.C=i.C=!1,n.C=!0,t=n):(t===r.R&&(on(this,r),t=r,r=t.U),r.C=!1,n.C=!0,sn(this,n))):(i=n.L,i&&i.C?(r.C=i.C=!1,n.C=!0,t=n):(t===r.L&&(sn(this,r),t=r,r=t.U),r.C=!1,n.C=!0,on(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?ln(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)return void(t.C=!1);do{if(t===this._)break;if(t===i.L){if(e=i.R,e.C&&(e.C=!1,i.C=!0,on(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,sn(this,e),e=i.R),e.C=i.C,i.C=e.R.C=!1,on(this,i),t=this._;break}}else if(e=i.L,e.C&&(e.C=!1,i.C=!0,sn(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,on(this,e),e=i.L),e.C=i.C,i.C=e.L.C=!1,sn(this,i),t=this._;break}e.C=!0,t=i,i=i.U}while(!t.C);t&&(t.C=!1)}}},uo.geom.voronoi=function(t){function e(t){var e=new Array(t.length),n=s[0][0],i=s[0][1],a=s[1][0],o=s[1][1];return un(r(t),s).cells.forEach(function(r,s){var l=r.edges,u=r.site;(e[s]=l.length?l.map(function(t){var e=t.start();return[e.x,e.y]}):u.x>=n&&u.x<=a&&u.y>=i&&u.y<=o?[[n,o],[a,o],[a,i],[n,i]]:[]).point=t[s]}),e}function r(t){return t.map(function(t,e){return{x:Math.round(a(t,e)/Fo)*Fo,y:Math.round(o(t,e)/Fo)*Fo,i:e}})}var n=Cr,i=zr,a=n,o=i,s=ul;return t?e(t):(e.links=function(t){return un(r(t)).edges.filter(function(t){return t.l&&t.r}).map(function(e){return{source:t[e.l.i],target:t[e.r.i]}})},e.triangles=function(t){var e=[];return un(r(t)).cells.forEach(function(r,n){for(var i,a=r.site,o=r.edges.sort(Yr),s=-1,l=o.length,u=o[l-1].edge,c=u.l===a?u.r:u.l;++s<l;)u,i=c,u=o[s].edge,c=u.l===a?u.r:u.l,n<i.i&&n<c.i&&hn(a,i,c)<0&&e.push([t[n],t[i.i],t[c.i]])}),e},e.x=function(t){return arguments.length?(a=Et(n=t),e):n},e.y=function(t){return arguments.length?(o=Et(i=t),e):i},e.clipExtent=function(t){return arguments.length?(s=null==t?ul:t,e):s===ul?null:s},e.size=function(t){return arguments.length?e.clipExtent(t&&[[0,0],t]):s===ul?null:s&&s[1]},e)};var ul=[[-1e6,-1e6],[1e6,1e6]];uo.geom.delaunay=function(t){return uo.geom.voronoi().triangles(t)},uo.geom.quadtree=function(t,e,r,n,i){function a(t){function a(t,e,r,n,i,a,o,s){if(!isNaN(r)&&!isNaN(n))if(t.leaf){var l=t.x,c=t.y;if(null!=l)if(xo(l-r)+xo(c-n)<.01)u(t,e,r,n,i,a,o,s);else{var h=t.point;t.x=t.y=t.point=null,u(t,h,l,c,i,a,o,s),u(t,e,r,n,i,a,o,s)}else t.x=r,t.y=n,t.point=e}else u(t,e,r,n,i,a,o,s)}function u(t,e,r,n,i,o,s,l){var u=.5*(i+s),c=.5*(o+l),h=r>=u,f=n>=c,d=f<<1|h;t.leaf=!1,t=t.nodes[d]||(t.nodes[d]=pn()),h?i=u:s=u,f?o=c:l=c,a(t,e,r,n,i,o,s,l)}var c,h,f,d,p,m,v,g,y,b=Et(s),x=Et(l);if(null!=e)m=e,v=r,g=n,y=i;else if(g=y=-(m=v=1/0),h=[],f=[],p=t.length,o)for(d=0;d<p;++d)c=t[d],c.x<m&&(m=c.x),c.y<v&&(v=c.y),c.x>g&&(g=c.x),c.y>y&&(y=c.y),h.push(c.x),f.push(c.y);else for(d=0;d<p;++d){var _=+b(c=t[d],d),w=+x(c,d);_<m&&(m=_),w<v&&(v=w),_>g&&(g=_),w>y&&(y=w),h.push(_),f.push(w)}var M=g-m,k=y-v;M>k?y=v+M:g=m+k;var A=pn();if(A.add=function(t){a(A,t,+b(t,++d),+x(t,d),m,v,g,y)},A.visit=function(t){mn(t,A,m,v,g,y)},A.find=function(t){return vn(A,t[0],t[1],m,v,g,y)},d=-1,null==e){for(;++d<p;)a(A,t[d],h[d],f[d],m,v,g,y);--d}else t.forEach(A.add);return h=f=t=c=null,A}var o,s=Cr,l=zr;return(o=arguments.length)?(s=fn,l=dn,3===o&&(i=r,n=e,r=e=0),a(t)):(a.x=function(t){return arguments.length?(s=t,a):s},a.y=function(t){return arguments.length?(l=t,a):l},a.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]),a):null==e?null:[[e,r],[n,i]]},a.size=function(t){return arguments.length?(null==t?e=r=n=i=null:(e=r=0,n=+t[0],i=+t[1]),a):null==e?null:[n-e,i-r]},a)},uo.interpolateRgb=gn,uo.interpolateObject=yn,uo.interpolateNumber=bn,uo.interpolateString=xn;var cl=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,hl=new RegExp(cl.source,"g");uo.interpolate=_n,uo.interpolators=[function(t,e){var r=typeof e;return("string"===r?ns.has(e.toLowerCase())||/^(#|rgb\(|hsl\()/i.test(e)?gn:xn:e instanceof lt?gn:Array.isArray(e)?wn:"object"===r&&isNaN(e)?yn:bn)(t,e)}],uo.interpolateArray=wn;var fl=function(){return x},dl=uo.map({linear:fl,poly:Ln,quad:function(){return Tn},cubic:function(){return Sn},sin:function(){return Cn},exp:function(){return zn},circle:function(){return Dn},elastic:In,back:Pn,bounce:function(){return On}}),pl=uo.map({in:x,out:kn,"in-out":An,"out-in":function(t){return An(kn(t))}});uo.ease=function(t){var e=t.indexOf("-"),r=e>=0?t.slice(0,e):t,n=e>=0?t.slice(e+1):"in";return r=dl.get(r)||fl,n=pl.get(n)||x,Mn(n(r.apply(null,co.call(arguments,1))))},uo.interpolateHcl=jn,uo.interpolateHsl=Fn,uo.interpolateLab=Rn,uo.interpolateRound=Nn,uo.transform=function(t){var e=fo.createElementNS(uo.ns.prefix.svg,"g");return(uo.transform=function(t){if(null!=t){e.setAttribute("transform",t);var r=e.transform.baseVal.consolidate()}return new Bn(r?r.matrix:ml)})(t)},Bn.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var ml={a:1,b:0,c:0,d:1,e:0,f:0};uo.interpolateTransform=Zn,uo.layout={},uo.layout.bundle=function(){return function(t){for(var e=[],r=-1,n=t.length;++r<n;)e.push(Qn(t[r]));return e}},uo.layout.chord=function(){function t(){var t,u,h,f,d,p={},m=[],v=uo.range(a),g=[];for(r=[],n=[],t=0,f=-1;++f<a;){for(u=0,d=-1;++d<a;)u+=i[f][d];m.push(u),g.push(uo.range(a)),t+=u}for(o&&v.sort(function(t,e){return o(m[t],m[e])}),s&&g.forEach(function(t,e){t.sort(function(t,r){return s(i[e][t],i[e][r])})}),t=(Bo-c*a)/t,u=0,f=-1;++f<a;){for(h=u,d=-1;++d<a;){var y=v[f],b=g[y][d],x=i[y][b],_=u,w=u+=x*t;p[y+"-"+b]={index:y,subindex:b,startAngle:_,endAngle:w,value:x}}n[y]={index:y,startAngle:h,endAngle:u,value:m[y]},u+=c}for(f=-1;++f<a;)for(d=f-1;++d<a;){var M=p[f+"-"+d],k=p[d+"-"+f];(M.value||k.value)&&r.push(M.value<k.value?{source:k,target:M}:{source:M,target:k})}l&&e()}function e(){r.sort(function(t,e){return l((t.source.value+t.target.value)/2,(e.source.value+e.target.value)/2)})}var r,n,i,a,o,s,l,u={},c=0;return u.matrix=function(t){return arguments.length?(a=(i=t)&&i.length,r=n=null,u):i},u.padding=function(t){return arguments.length?(c=t,r=n=null,u):c},u.sortGroups=function(t){return arguments.length?(o=t,r=n=null,u):o},u.sortSubgroups=function(t){return arguments.length?(s=t,r=null,u):s},u.sortChords=function(t){return arguments.length?(l=t,r&&e(),u):l},u.chords=function(){return r||t(),r},u.groups=function(){return n||t(),n},u},uo.layout.force=function(){function t(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/g<l){if(l<m){var u=e.charge/l;t.px-=a*u,t.py-=o*u}return!0}if(e.point&&l&&l<m){var u=e.pointCharge/l;t.px-=a*u,t.py-=o*u}}return!e.charge}}function e(t){t.px=uo.event.x,t.py=uo.event.y,l.resume()}var r,n,i,a,o,s,l={},u=uo.dispatch("start","tick","end"),c=[1,1],h=.9,f=vl,d=gl,p=-30,m=yl,v=.1,g=.64,y=[],b=[];return l.tick=function(){if((i*=.99)<.005)return r=null,u.end({type:"end",alpha:i=0}),!0;var e,n,l,f,d,m,g,x,_,w=y.length,M=b.length;for(n=0;n<M;++n)l=b[n],f=l.source,d=l.target,x=d.x-f.x,_=d.y-f.y,(m=x*x+_*_)&&(m=i*o[n]*((m=Math.sqrt(m))-a[n])/m,x*=m,_*=m,d.x-=x*(g=f.weight+d.weight?f.weight/(f.weight+d.weight):.5),d.y-=_*g,f.x+=x*(g=1-g),f.y+=_*g);if((g=i*v)&&(x=c[0]/2,_=c[1]/2,n=-1,g))for(;++n<w;)l=y[n],l.x+=(x-l.x)*g,l.y+=(_-l.y)*g;if(p)for(ai(e=uo.geom.quadtree(y),i,s),n=-1;++n<w;)(l=y[n]).fixed||e.visit(t(l));for(n=-1;++n<w;)l=y[n],l.fixed?(l.x=l.px,l.y=l.py):(l.x-=(l.px-(l.px=l.x))*h,l.y-=(l.py-(l.py=l.y))*h);u.tick({type:"tick",alpha:i})},l.nodes=function(t){return arguments.length?(y=t,l):y},l.links=function(t){return arguments.length?(b=t,l):b},l.size=function(t){return arguments.length?(c=t,l):c},l.linkDistance=function(t){return arguments.length?(f="function"==typeof t?t:+t,l):f},l.distance=l.linkDistance,l.linkStrength=function(t){return arguments.length?(d="function"==typeof t?t:+t,l):d},l.friction=function(t){return arguments.length?(h=+t,l):h},l.charge=function(t){return arguments.length?(p="function"==typeof t?t:+t,l):p},l.chargeDistance=function(t){return arguments.length?(m=t*t,l):Math.sqrt(m)},l.gravity=function(t){return arguments.length?(v=+t,l):v},l.theta=function(t){return arguments.length?(g=t*t,l):Math.sqrt(g)},l.alpha=function(t){return arguments.length?(t=+t,i?t>0?i=t:(r.c=null,r.t=0/0,r=null,u.end({type:"end",alpha:i=0})):t>0&&(u.start({type:"start",alpha:i=t}),r=It(l.tick)),l):i},l.start=function(){function t(t,n){if(!r){for(r=new Array(i),l=0;l<i;++l)r[l]=[];for(l=0;l<u;++l){var a=b[l];r[a.source.index].push(a.target),r[a.target.index].push(a.source)}}for(var o,s=r[e],l=-1,c=s.length;++l<c;)if(!isNaN(o=s[l][t]))return o;return Math.random()*n}var e,r,n,i=y.length,u=b.length,h=c[0],m=c[1];for(e=0;e<i;++e)(n=y[e]).index=e,n.weight=0;for(e=0;e<u;++e)n=b[e],"number"==typeof n.source&&(n.source=y[n.source]),"number"==typeof n.target&&(n.target=y[n.target]),++n.source.weight,++n.target.weight;for(e=0;e<i;++e)n=y[e],isNaN(n.x)&&(n.x=t("x",h)),isNaN(n.y)&&(n.y=t("y",m)),isNaN(n.px)&&(n.px=n.x),isNaN(n.py)&&(n.py=n.y);if(a=[],"function"==typeof f)for(e=0;e<u;++e)a[e]=+f.call(this,b[e],e);else for(e=0;e<u;++e)a[e]=f;if(o=[],"function"==typeof d)for(e=0;e<u;++e)o[e]=+d.call(this,b[e],e);else for(e=0;e<u;++e)o[e]=d;if(s=[],"function"==typeof p)for(e=0;e<i;++e)s[e]=+p.call(this,y[e],e);else for(e=0;e<i;++e)s[e]=p;return l.resume()},l.resume=function(){return l.alpha(.1)},l.stop=function(){return l.alpha(0)},l.drag=function(){if(n||(n=uo.behavior.drag().origin(x).on("dragstart.force",ei).on("drag.force",e).on("dragend.force",ri)),!arguments.length)return n;this.on("mouseover.force",ni).on("mouseout.force",ii).call(n)},uo.rebind(l,u,"on")};var vl=20,gl=1,yl=1/0;uo.layout.hierarchy=function(){function t(i){var a,o=[i],s=[];for(i.depth=0;null!=(a=o.pop());)if(s.push(a),(u=r.call(t,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;n&&(a.value=0),a.children=u}else n&&(a.value=+n.call(t,a,a.depth)||0),delete a.children;return li(i,function(t){var r,i;e&&(r=t.children)&&r.sort(e),n&&(i=t.parent)&&(i.value+=t.value)}),s}var e=hi,r=ui,n=ci;return t.sort=function(r){return arguments.length?(e=r,t):e},t.children=function(e){return arguments.length?(r=e,t):r},t.value=function(e){return arguments.length?(n=e,t):n},t.revalue=function(e){return n&&(si(e,function(t){t.children&&(t.value=0)}),li(e,function(e){var r;e.children||(e.value=+n.call(t,e,e.depth)||0),(r=e.parent)&&(r.value+=e.value)})),e},t},uo.layout.partition=function(){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}}function e(t){var r=t.children,n=0;if(r&&(i=r.length))for(var i,a=-1;++a<i;)n=Math.max(n,e(r[a]));return 1+n}function r(r,a){var o=n.call(this,r,a);return t(o[0],0,i[0],i[1]/e(o[0])),o}var n=uo.layout.hierarchy(),i=[1,1];return r.size=function(t){return arguments.length?(i=t,r):i},oi(r,n)},uo.layout.pie=function(){function t(o){var s,l=o.length,u=o.map(function(r,n){return+e.call(t,r,n)}),c=+("function"==typeof n?n.apply(this,arguments):n),h=("function"==typeof i?i.apply(this,arguments):i)-c,f=Math.min(Math.abs(h)/l,+("function"==typeof a?a.apply(this,arguments):a)),d=f*(h<0?-1:1),p=uo.sum(u),m=p?(h-l*d)/p:0,v=uo.range(l),g=[];return null!=r&&v.sort(r===bl?function(t,e){return u[e]-u[t]}:function(t,e){return r(o[t],o[e])}),v.forEach(function(t){g[t]={data:o[t],value:s=u[t],startAngle:c,endAngle:c+=s*m+d,padAngle:f}}),g}var e=Number,r=bl,n=0,i=Bo,a=0;return t.value=function(r){return arguments.length?(e=r,t):e},t.sort=function(e){return arguments.length?(r=e,t):r},t.startAngle=function(e){return arguments.length?(n=e,t):n},t.endAngle=function(e){return arguments.length?(i=e,t):i},t.padAngle=function(e){return arguments.length?(a=e,t):a},t};var bl={};uo.layout.stack=function(){function t(s,l){if(!(f=s.length))return s;var u=s.map(function(r,n){return e.call(t,r,n)}),c=u.map(function(e){return e.map(function(e,r){return[a.call(t,e,r),o.call(t,e,r)]})}),h=r.call(t,c,l);u=uo.permute(u,h),c=uo.permute(c,h);var f,d,p,m,v=n.call(t,c,l),g=u[0].length;for(p=0;p<g;++p)for(i.call(t,u[0][p],m=v[p],c[0][p][1]),d=1;d<f;++d)i.call(t,u[d][p],m+=c[d-1][p][1],c[d][p][1]);return s}var e=x,r=vi,n=gi,i=mi,a=di,o=pi;return t.values=function(r){return arguments.length?(e=r,t):e},t.order=function(e){return arguments.length?(r="function"==typeof e?e:xl.get(e)||vi,t):r},t.offset=function(e){return arguments.length?(n="function"==typeof e?e:_l.get(e)||gi,t):n},t.x=function(e){return arguments.length?(a=e,t):a},t.y=function(e){return arguments.length?(o=e,t):o},t.out=function(e){return arguments.length?(i=e,t):i},t};var xl=uo.map({"inside-out":function(t){var e,r,n=t.length,i=t.map(yi),a=t.map(bi),o=uo.range(n).sort(function(t,e){return i[t]-i[e]}),s=0,l=0,u=[],c=[];for(e=0;e<n;++e)r=o[e],s<l?(s+=a[r],u.push(r)):(l+=a[r],c.push(r));return c.reverse().concat(u)},reverse:function(t){return uo.range(t.length).reverse()},default:vi}),_l=uo.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,h=t[0],f=h.length,d=[];for(d[0]=l=u=0,r=1;r<f;++r){for(e=0,i=0;e<c;++e)i+=t[e][r][1];for(e=0,a=0,s=h[r][0]-h[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]}d[r]=l-=i?a/i*s:0,l<u&&(u=l)}for(r=0;r<f;++r)d[r]-=u;return d},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:gi});uo.layout.histogram=function(){function t(t,a){for(var o,s,l=[],u=t.map(r,this),c=n.call(this,u,a),h=i.call(this,c,u,a),a=-1,f=u.length,d=h.length-1,p=e?1:1/f;++a<d;)o=l[a]=[],o.dx=h[a+1]-(o.x=h[a]),o.y=0;if(d>0)for(a=-1;++a<f;)(s=u[a])>=c[0]&&s<=c[1]&&(o=l[uo.bisect(h,s,1,d)-1],o.y+=p,o.push(t[a]));return l}var e=!0,r=Number,n=Mi,i=_i;return t.value=function(e){return arguments.length?(r=e,t):r},t.range=function(e){return arguments.length?(n=Et(e),t):n},t.bins=function(e){return arguments.length?(i="number"==typeof e?function(t){return wi(t,e)}:Et(e),t):i},t.frequency=function(r){return arguments.length?(e=!!r,t):e},t},uo.layout.pack=function(){function t(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,li(s,function(t){t.r=+c(t.value)}),li(s,Ei),n){var h=n*(e?1:Math.max(2*s.r/l,2*s.r/u))/2;li(s,function(t){t.r+=h}),li(s,Ei),li(s,function(t){t.r-=h})}return zi(s,l/2,u/2,e?1:1/Math.max(2*s.r/l,2*s.r/u)),o}var e,r=uo.layout.hierarchy().sort(ki),n=0,i=[1,1];return t.size=function(e){return arguments.length?(i=e,t):i},t.radius=function(r){return arguments.length?(e=null==r||"function"==typeof r?r:+r,t):e},t.padding=function(e){return arguments.length?(n=+e,t):n},oi(t,r)},uo.layout.tree=function(){function t(t,i){var c=o.call(this,t,i),h=c[0],f=e(h);if(li(f,r),f.parent.m=-f.z,si(f,n),u)si(h,a);else{var d=h,p=h,m=h;si(h,function(t){t.x<d.x&&(d=t),t.x>p.x&&(p=t),t.depth>m.depth&&(m=t)});var v=s(d,p)/2-d.x,g=l[0]/(p.x+s(p,d)/2+v),y=l[1]/(m.depth||1);si(h,function(t){t.x=(t.x+v)*g,t.y=t.depth*y})}return c}function e(t){for(var e,r={A:null,children:[t]},n=[r];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]}function r(t){var e=t.children,r=t.parent.children,n=t.i?r[t.i-1]:null;if(e.length){Fi(t);var a=(e[0].z+e[e.length-1].z)/2;n?(t.z=n.z+s(t._,n._),t.m=t.z-a):t.z=a}else n&&(t.z=n.z+s(t._,n._));t.parent.A=i(t,n,t.parent.A||r[0])}function n(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function i(t,e,r){if(e){for(var n,i=t,a=t,o=e,l=i.parent.children[0],u=i.m,c=a.m,h=o.m,f=l.m;o=Oi(o),i=Pi(i),o&&i;)l=Pi(l),a=Oi(a),a.a=t,n=o.z+h-i.z-u+s(o._,i._),n>0&&(ji(Ri(o,t,r),t,n),u+=n,c+=n),h+=o.m,u+=i.m,f+=l.m,c+=a.m;o&&!Oi(a)&&(a.t=o,a.m+=h-c),i&&!Pi(l)&&(l.t=i,l.m+=u-f,r=t)}return r}function a(t){t.x*=l[0],t.y=t.depth*l[1]}var o=uo.layout.hierarchy().sort(null).value(null),s=Ii,l=[1,1],u=null;return t.separation=function(e){return arguments.length?(s=e,t):s},t.size=function(e){return arguments.length?(u=null==(l=e)?a:null,t):u?null:l},t.nodeSize=function(e){return arguments.length?(u=null==(l=e)?null:a,t):u?l:null},oi(t,o)},uo.layout.cluster=function(){function t(t,a){var o,s=e.call(this,t,a),l=s[0],u=0;li(l,function(t){var e=t.children;e&&e.length?(t.x=Bi(e),t.y=Ni(e)):(t.x=o?u+=r(t,o):0,t.y=0,o=t)});var c=Ui(l),h=Vi(l),f=c.x-r(c,h)/2,d=h.x+r(h,c)/2;return li(l,i?function(t){t.x=(t.x-l.x)*n[0],t.y=(l.y-t.y)*n[1]}:function(t){t.x=(t.x-f)/(d-f)*n[0],t.y=(1-(l.y?t.y/l.y:1))*n[1]}),s}var e=uo.layout.hierarchy().sort(null).value(null),r=Ii,n=[1,1],i=!1;return t.separation=function(e){return arguments.length?(r=e,t):r},t.size=function(e){return arguments.length?(i=null==(n=e),t):i?null:n},t.nodeSize=function(e){return arguments.length?(i=null!=(n=e),t):i?n:null},oi(t,e)},uo.layout.treemap=function(){function t(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 e(r){var a=r.children;if(a&&a.length){var o,s,l,u=h(r),c=[],f=a.slice(),p=1/0,m="slice"===d?u.dx:"dice"===d?u.dy:"slice-dice"===d?1&r.depth?u.dy:u.dx:Math.min(u.dx,u.dy);for(t(f,u.dx*u.dy/r.value),c.area=0;(l=f.length)>0;)c.push(o=f[l-1]),c.area+=o.area,"squarify"!==d||(s=n(c,m))<=p?(f.pop(),p=s):(c.area-=c.pop().area,i(c,m,u,!1),m=Math.min(u.dx,u.dy),c.length=c.area=0,p=1/0);c.length&&(i(c,m,u,!0),c.length=c.area=0),a.forEach(e)}}function r(e){var n=e.children;if(n&&n.length){var a,o=h(e),s=n.slice(),l=[];for(t(s,o.dx*o.dy/e.value),l.area=0;a=s.pop();)l.push(a),l.area+=a.area,null!=a.z&&(i(l,a.z?o.dx:o.dy,o,!s.length),l.length=l.area=0);n.forEach(r)}}function n(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 n*=n,e*=e,n?Math.max(e*i*p/n,n/(e*a*p)):1/0}function i(t,e,r,n){var i,a=-1,o=t.length,s=r.x,u=r.y,c=e?l(t.area/e):0;if(e==r.dx){for((n||c>r.dy)&&(c=r.dy);++a<o;)i=t[a],i.x=s,i.y=u,i.dy=c,s+=i.dx=Math.min(r.x+r.dx-s,c?l(i.area/c):0);i.z=!0,i.dx+=r.x+r.dx-s,r.y+=c,r.dy-=c}else{for((n||c>r.dx)&&(c=r.dx);++a<o;)i=t[a],i.x=s,i.y=u,i.dx=c,u+=i.dy=Math.min(r.y+r.dy-u,c?l(i.area/c):0);i.z=!1,i.dy+=r.y+r.dy-u,r.x+=c,r.dx-=c}}function a(n){var i=o||s(n),a=i[0];return a.x=a.y=0,a.value?(a.dx=u[0],a.dy=u[1]):a.dx=a.dy=0,o&&s.revalue(a),t([a],a.dx*a.dy/a.value),(o?r:e)(a),f&&(o=i),i}var o,s=uo.layout.hierarchy(),l=Math.round,u=[1,1],c=null,h=qi,f=!1,d="squarify",p=.5*(1+Math.sqrt(5));return a.size=function(t){return arguments.length?(u=t,a):u},a.padding=function(t){function e(e){var r=t.call(a,e,e.depth);return null==r?qi(e):Hi(e,"number"==typeof r?[r,r,r,r]:r)}function r(e){return Hi(e,t)}if(!arguments.length)return c;var n;return h=null==(c=t)?qi:"function"==(n=typeof t)?e:"number"===n?(t=[t,t,t,t],r):r,a},a.round=function(t){return arguments.length?(l=t?Math.round:Number,a):l!=Number},a.sticky=function(t){return arguments.length?(f=t,o=null,a):f},a.ratio=function(t){return arguments.length?(p=t,a):p},a.mode=function(t){return arguments.length?(d=t+"",a):d},oi(a,s)},uo.random={normal:function(t,e){var r=arguments.length;return r<2&&(e=1),r<1&&(t=0),function(){var r,n,i;do{r=2*Math.random()-1,n=2*Math.random()-1,i=r*r+n*n}while(!i||i>1);return t+e*r*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var t=uo.random.normal.apply(uo,arguments);return function(){return Math.exp(t())}},bates:function(t){var e=uo.random.irwinHall(t);return function(){return e()/t}},irwinHall:function(t){return function(){for(var e=0,r=0;r<t;r++)e+=Math.random();return e}}},uo.scale={};var wl={floor:x,ceil:x};uo.scale.linear=function(){return Ki([0,1],[0,1],_n,!1)};var Ml={s:1,g:1,p:1,r:1,e:1};uo.scale.log=function(){return aa(uo.scale.linear().domain([0,1]),10,!0,[1,10])};var kl=uo.format(".0e"),Al={floor:function(t){return-Math.ceil(-t)},ceil:function(t){return-Math.floor(-t)}};uo.scale.pow=function(){return oa(uo.scale.linear(),1,[0,1])},uo.scale.sqrt=function(){return uo.scale.pow().exponent(.5)},uo.scale.ordinal=function(){return la([],{t:"range",a:[[]]})},uo.scale.category10=function(){return uo.scale.ordinal().range(Tl)},uo.scale.category20=function(){return uo.scale.ordinal().range(Sl)},uo.scale.category20b=function(){return uo.scale.ordinal().range(El)},uo.scale.category20c=function(){return uo.scale.ordinal().range(Ll)};var Tl=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(_t),Sl=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(_t),El=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(_t),Ll=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(_t);uo.scale.quantile=function(){return ua([],[])},uo.scale.quantize=function(){return ca(0,1,[0,1])},uo.scale.threshold=function(){return ha([.5],[0,1])},uo.scale.identity=function(){return fa([0,1])},uo.svg={},uo.svg.arc=function(){function t(){var t=Math.max(0,+r.apply(this,arguments)),u=Math.max(0,+n.apply(this,arguments)),c=o.apply(this,arguments)-Vo,h=s.apply(this,arguments)-Vo,f=Math.abs(h-c),d=c>h?0:1;if(u<t&&(p=u,u=t,t=p),f>=Uo)return e(u,d)+(t?e(t,1-d):"")+"Z";var p,m,v,g,y,b,x,_,w,M,k,A,T=0,S=0,E=[];if((g=(+l.apply(this,arguments)||0)/2)&&(v=a===Cl?Math.sqrt(t*t+u*u):+a.apply(this,arguments),d||(S*=-1),u&&(S=nt(v/u*Math.sin(g))),t&&(T=nt(v/t*Math.sin(g)))),u){y=u*Math.cos(c+S),b=u*Math.sin(c+S),x=u*Math.cos(h-S),_=u*Math.sin(h-S);var L=Math.abs(h-c-2*S)<=No?0:1;if(S&&ba(y,b,x,_)===d^L){var C=(c+h)/2;y=u*Math.cos(C),b=u*Math.sin(C),x=_=null}}else y=b=0;if(t){w=t*Math.cos(h-T),M=t*Math.sin(h-T),k=t*Math.cos(c+T),A=t*Math.sin(c+T);var z=Math.abs(c-h+2*T)<=No?0:1;if(T&&ba(w,M,k,A)===1-d^z){var D=(c+h)/2;w=t*Math.cos(D),M=t*Math.sin(D),k=A=null}}else w=M=0;if(f>Fo&&(p=Math.min(Math.abs(u-t)/2,+i.apply(this,arguments)))>.001){m=t<u^d?0:1;var I=p,P=p;if(f<No){var O=null==k?[w,M]:null==x?[y,b]:Or([y,b],[k,A],[x,_],[w,M]),j=y-O[0],F=b-O[1],R=x-O[0],N=_-O[1],B=1/Math.sin(Math.acos((j*R+F*N)/(Math.sqrt(j*j+F*F)*Math.sqrt(R*R+N*N)))/2),U=Math.sqrt(O[0]*O[0]+O[1]*O[1]);P=Math.min(p,(t-U)/(B-1)),I=Math.min(p,(u-U)/(B+1))}if(null!=x){var V=xa(null==k?[w,M]:[k,A],[y,b],u,I,d),q=xa([x,_],[w,M],u,I,d);p===I?E.push("M",V[0],"A",I,",",I," 0 0,",m," ",V[1],"A",u,",",u," 0 ",1-d^ba(V[1][0],V[1][1],q[1][0],q[1][1]),",",d," ",q[1],"A",I,",",I," 0 0,",m," ",q[0]):E.push("M",V[0],"A",I,",",I," 0 1,",m," ",q[0])}else E.push("M",y,",",b);if(null!=k){var H=xa([y,b],[k,A],t,-P,d),G=xa([w,M],null==x?[y,b]:[x,_],t,-P,d);p===P?E.push("L",G[0],"A",P,",",P," 0 0,",m," ",G[1],"A",t,",",t," 0 ",d^ba(G[1][0],G[1][1],H[1][0],H[1][1]),",",1-d," ",H[1],"A",P,",",P," 0 0,",m," ",H[0]):E.push("L",G[0],"A",P,",",P," 0 0,",m," ",H[0])}else E.push("L",w,",",M)}else E.push("M",y,",",b),null!=x&&E.push("A",u,",",u," 0 ",L,",",d," ",x,",",_),E.push("L",w,",",M),null!=k&&E.push("A",t,",",t," 0 ",z,",",1-d," ",k,",",A);return E.push("Z"),E.join("")}function e(t,e){return"M0,"+t+"A"+t+","+t+" 0 1,"+e+" 0,"+-t+"A"+t+","+t+" 0 1,"+e+" 0,"+t}var r=pa,n=ma,i=da,a=Cl,o=va,s=ga,l=ya;return t.innerRadius=function(e){return arguments.length?(r=Et(e),t):r},t.outerRadius=function(e){return arguments.length?(n=Et(e),t):n},t.cornerRadius=function(e){return arguments.length?(i=Et(e),t):i},t.padRadius=function(e){return arguments.length?(a=e==Cl?Cl:Et(e),t):a},t.startAngle=function(e){return arguments.length?(o=Et(e),t):o},t.endAngle=function(e){return arguments.length?(s=Et(e),t):s},t.padAngle=function(e){return arguments.length?(l=Et(e),t):l},t.centroid=function(){var t=(+r.apply(this,arguments)+ +n.apply(this,arguments))/2,e=(+o.apply(this,arguments)+ +s.apply(this,arguments))/2-Vo;return[Math.cos(e)*t,Math.sin(e)*t]},t};var Cl="auto";uo.svg.line=function(){return _a(x)};var zl=uo.map({linear:wa,"linear-closed":Ma,step:ka,"step-before":Aa,"step-after":Ta,basis:Da,"basis-open":Ia,"basis-closed":Pa,bundle:Oa,cardinal:La,"cardinal-open":Sa,"cardinal-closed":Ea,monotone:Ua});zl.forEach(function(t,e){e.key=t,e.closed=/-closed$/.test(t)});var Dl=[0,2/3,1/3,0],Il=[0,1/3,2/3,0],Pl=[0,1/6,2/3,1/6];uo.svg.line.radial=function(){var t=_a(Va);return t.radius=t.x,delete t.x,t.angle=t.y,delete t.y,t},Aa.reverse=Ta,Ta.reverse=Aa,uo.svg.area=function(){return qa(x)},uo.svg.area.radial=function(){var t=qa(Va);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},uo.svg.chord=function(){function t(t,s){var l=e(this,a,t,s),u=e(this,o,t,s);return"M"+l.p0+n(l.r,l.p1,l.a1-l.a0)+(r(l,u)?i(l.r,l.p1,l.r,l.p0):i(l.r,l.p1,u.r,u.p0)+n(u.r,u.p1,u.a1-u.a0)+i(u.r,u.p1,l.r,l.p0))+"Z"}function e(t,e,r,n){var i=e.call(t,r,n),a=s.call(t,i,n),o=l.call(t,i,n)-Vo,c=u.call(t,i,n)-Vo;return{r:a,a0:o,a1:c,p0:[a*Math.cos(o),a*Math.sin(o)],p1:[a*Math.cos(c),a*Math.sin(c)]}}function r(t,e){return t.a0==e.a0&&t.a1==e.a1}function n(t,e,r){return"A"+t+","+t+" 0 "+ +(r>No)+",1 "+e}function i(t,e,r,n){return"Q 0,0 "+n}var a=xr,o=_r,s=Ha,l=va,u=ga;return t.radius=function(e){return arguments.length?(s=Et(e),t):s},t.source=function(e){return arguments.length?(a=Et(e),t):a},t.target=function(e){return arguments.length?(o=Et(e),t):o},t.startAngle=function(e){return arguments.length?(l=Et(e),t):l},t.endAngle=function(e){return arguments.length?(u=Et(e),t):u},t},uo.svg.diagonal=function(){function t(t,i){var a=e.call(this,t,i),o=r.call(this,t,i),s=(a.y+o.y)/2,l=[a,{x:a.x,y:s},{x:o.x,y:s},o];return l=l.map(n),"M"+l[0]+"C"+l[1]+" "+l[2]+" "+l[3]}var e=xr,r=_r,n=Ga;return t.source=function(r){return arguments.length?(e=Et(r),t):e},t.target=function(e){return arguments.length?(r=Et(e),t):r},t.projection=function(e){return arguments.length?(n=e,t):n},t},uo.svg.diagonal.radial=function(){var t=uo.svg.diagonal(),e=Ga,r=t.projection;return t.projection=function(t){return arguments.length?r(Ya(e=t)):e},t},uo.svg.symbol=function(){function t(t,n){return(Ol.get(e.call(this,t,n))||Za)(r.call(this,t,n))}var e=Wa,r=Xa;return t.type=function(r){return arguments.length?(e=Et(r),t):e},t.size=function(e){return arguments.length?(r=Et(e),t):r},t};var Ol=uo.map({circle:Za,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*Fl)),r=e*Fl;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/jl),r=e*jl/2;return"M0,"+r+"L"+e+","+-r+" "+-e+","+-r+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/jl),r=e*jl/2;return"M0,"+-r+"L"+e+","+r+" "+-e+","+r+"Z"}});uo.svg.symbolTypes=Ol.keys();var jl=Math.sqrt(3),Fl=Math.tan(30*qo);Lo.transition=function(t){for(var e,r,n=Rl||++Vl,i=to(t),a=[],o=Nl||{time:Date.now(),ease:En,delay:0,duration:250},s=-1,l=this.length;++s<l;){a.push(e=[]);for(var u=this[s],c=-1,h=u.length;++c<h;)(r=u[c])&&eo(r,c,i,n,o),e.push(r)}return Ka(a,i,n)},Lo.interrupt=function(t){return this.each(null==t?Bl:Ja(to(t)))};var Rl,Nl,Bl=Ja(to()),Ul=[],Vl=0;Ul.call=Lo.call,Ul.empty=Lo.empty,Ul.node=Lo.node,Ul.size=Lo.size,uo.transition=function(t,e){return t&&t.transition?Rl?t.transition(e):t:uo.selection().transition(t)},uo.transition.prototype=Ul,Ul.select=function(t){var e,r,n,i=this.id,a=this.namespace,o=[];t=C(t);for(var s=-1,l=this.length;++s<l;){o.push(e=[]);for(var u=this[s],c=-1,h=u.length;++c<h;)(n=u[c])&&(r=t.call(n,n.__data__,c,s))?("__data__"in n&&(r.__data__=n.__data__),eo(r,c,a,i,n[a][i]),e.push(r)):e.push(null)}return Ka(o,a,i)},Ul.selectAll=function(t){var e,r,n,i,a,o=this.id,s=this.namespace,l=[];t=z(t);for(var u=-1,c=this.length;++u<c;)for(var h=this[u],f=-1,d=h.length;++f<d;)if(n=h[f]){a=n[s][o],r=t.call(n,n.__data__,f,u),l.push(e=[]);for(var p=-1,m=r.length;++p<m;)(i=r[p])&&eo(i,p,s,o,a),e.push(i)}return Ka(l,s,o)},Ul.filter=function(t){var e,r,n,i=[];"function"!=typeof t&&(t=q(t));for(var a=0,o=this.length;a<o;a++){i.push(e=[]);for(var r=this[a],s=0,l=r.length;s<l;s++)(n=r[s])&&t.call(n,n.__data__,s,a)&&e.push(n)}return Ka(i,this.namespace,this.id)},Ul.tween=function(t,e){var r=this.id,n=this.namespace;return arguments.length<2?this.node()[n][r].tween.get(t):G(this,null==e?function(e){e[n][r].tween.remove(t)}:function(i){i[n][r].tween.set(t,e)})},Ul.attr=function(t,e){function r(){this.removeAttribute(s)}function n(){this.removeAttributeNS(s.space,s.local)}function i(t){return null==t?r:(t+="",function(){var e,r=this.getAttribute(s)
18 ;return r!==t&&(e=o(r,t),function(t){this.setAttribute(s,e(t))})})}function a(t){return null==t?n:(t+="",function(){var e,r=this.getAttributeNS(s.space,s.local);return r!==t&&(e=o(r,t),function(t){this.setAttributeNS(s.space,s.local,e(t))})})}if(arguments.length<2){for(e in t)this.attr(e,t[e]);return this}var o="transform"==t?Zn:_n,s=uo.ns.qualify(t);return Qa(this,"attr."+t,e,s.local?a:i)},Ul.attrTween=function(t,e){function r(t,r){var n=e.call(this,t,r,this.getAttribute(i));return n&&function(t){this.setAttribute(i,n(t))}}function n(t,r){var n=e.call(this,t,r,this.getAttributeNS(i.space,i.local));return n&&function(t){this.setAttributeNS(i.space,i.local,n(t))}}var i=uo.ns.qualify(t);return this.tween("attr."+t,i.local?n:r)},Ul.style=function(t,e,r){function i(){this.style.removeProperty(t)}function a(e){return null==e?i:(e+="",function(){var i,a=n(this).getComputedStyle(this,null).getPropertyValue(t);return a!==e&&(i=_n(a,e),function(e){this.style.setProperty(t,i(e),r)})})}var o=arguments.length;if(o<3){if("string"!=typeof t){o<2&&(e="");for(r in t)this.style(r,t[r],e);return this}r=""}return Qa(this,"style."+t,e,a)},Ul.styleTween=function(t,e,r){function i(i,a){var o=e.call(this,i,a,n(this).getComputedStyle(this,null).getPropertyValue(t));return o&&function(e){this.style.setProperty(t,o(e),r)}}return arguments.length<3&&(r=""),this.tween("style."+t,i)},Ul.text=function(t){return Qa(this,"text",t,$a)},Ul.remove=function(){var t=this.namespace;return this.each("end.transition",function(){var e;this[t].count<2&&(e=this.parentNode)&&e.removeChild(this)})},Ul.ease=function(t){var e=this.id,r=this.namespace;return arguments.length<1?this.node()[r][e].ease:("function"!=typeof t&&(t=uo.ease.apply(uo,arguments)),G(this,function(n){n[r][e].ease=t}))},Ul.delay=function(t){var e=this.id,r=this.namespace;return arguments.length<1?this.node()[r][e].delay:G(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}))},Ul.duration=function(t){var e=this.id,r=this.namespace;return arguments.length<1?this.node()[r][e].duration:G(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}))},Ul.each=function(t,e){var r=this.id,n=this.namespace;if(arguments.length<2){var i=Nl,a=Rl;try{Rl=r,G(this,function(e,i,a){Nl=e[n][r],t.call(e,e.__data__,i,a)})}finally{Nl=i,Rl=a}}else G(this,function(i){var a=i[n][r];(a.event||(a.event=uo.dispatch("start","end","interrupt"))).on(t,e)});return this},Ul.transition=function(){for(var t,e,r,n,i=this.id,a=++Vl,o=this.namespace,s=[],l=0,u=this.length;l<u;l++){s.push(t=[]);for(var e=this[l],c=0,h=e.length;c<h;c++)(r=e[c])&&(n=r[o][i],eo(r,c,o,a,{time:n.time,ease:n.ease,delay:n.delay+n.duration,duration:n.duration})),t.push(r)}return Ka(s,o,a)},uo.svg.axis=function(){function t(t){t.each(function(){var t,u=uo.select(this),c=this.__chart__||r,h=this.__chart__=r.copy(),f=null==l?h.ticks?h.ticks.apply(h,s):h.domain():l,d=null==e?h.tickFormat?h.tickFormat.apply(h,s):x:e,p=u.selectAll(".tick").data(f,h),m=p.enter().insert("g",".domain").attr("class","tick").style("opacity",Fo),v=uo.transition(p.exit()).style("opacity",Fo).remove(),g=uo.transition(p.order()).style("opacity",1),y=Math.max(i,0)+o,b=Yi(h),_=u.selectAll(".domain").data([0]),w=(_.enter().append("path").attr("class","domain"),uo.transition(_));m.append("line"),m.append("text");var M,k,A,T,S=m.select("line"),E=g.select("line"),L=p.select("text").text(d),C=m.select("text"),z=g.select("text"),D="top"===n||"left"===n?-1:1;if("bottom"===n||"top"===n?(t=ro,M="x",A="y",k="x2",T="y2",L.attr("dy",D<0?"0em":".71em").style("text-anchor","middle"),w.attr("d","M"+b[0]+","+D*a+"V0H"+b[1]+"V"+D*a)):(t=no,M="y",A="x",k="y2",T="x2",L.attr("dy",".32em").style("text-anchor",D<0?"end":"start"),w.attr("d","M"+D*a+","+b[0]+"H0V"+b[1]+"H"+D*a)),S.attr(T,D*i),C.attr(A,D*y),E.attr(k,0).attr(T,D*i),z.attr(M,0).attr(A,D*y),h.rangeBand){var I=h,P=I.rangeBand()/2;c=h=function(t){return I(t)+P}}else c.rangeBand?c=h:v.call(t,h,c);m.call(t,c,h),g.call(t,h,h)})}var e,r=uo.scale.linear(),n=ql,i=6,a=6,o=3,s=[10],l=null;return t.scale=function(e){return arguments.length?(r=e,t):r},t.orient=function(e){return arguments.length?(n=e in Hl?e+"":ql,t):n},t.ticks=function(){return arguments.length?(s=ho(arguments),t):s},t.tickValues=function(e){return arguments.length?(l=e,t):l},t.tickFormat=function(r){return arguments.length?(e=r,t):e},t.tickSize=function(e){var r=arguments.length;return r?(i=+e,a=+arguments[r-1],t):i},t.innerTickSize=function(e){return arguments.length?(i=+e,t):i},t.outerTickSize=function(e){return arguments.length?(a=+e,t):a},t.tickPadding=function(e){return arguments.length?(o=+e,t):o},t.tickSubdivide=function(){return arguments.length&&t},t};var ql="bottom",Hl={top:1,right:1,bottom:1,left:1};uo.svg.brush=function(){function t(n){n.each(function(){var n=uo.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",a).on("touchstart.brush",a),o=n.selectAll(".background").data([0]);o.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),n.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var s=n.selectAll(".resize").data(m,x);s.exit().remove(),s.enter().append("g").attr("class",function(t){return"resize "+t}).style("cursor",function(t){return Gl[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"),s.style("display",t.empty()?"none":null);var l,h=uo.transition(n),f=uo.transition(o);u&&(l=Yi(u),f.attr("x",l[0]).attr("width",l[1]-l[0]),r(h)),c&&(l=Yi(c),f.attr("y",l[0]).attr("height",l[1]-l[0]),i(h)),e(h)})}function e(t){t.selectAll(".resize").attr("transform",function(t){return"translate("+h[+/e$/.test(t)]+","+f[+/^s/.test(t)]+")"})}function r(t){t.select(".extent").attr("x",h[0]),t.selectAll(".extent,.n>rect,.s>rect").attr("width",h[1]-h[0])}function i(t){t.select(".extent").attr("y",f[0]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",f[1]-f[0])}function a(){function a(){32==uo.event.keyCode&&(L||(b=null,z[0]-=h[1],z[1]-=f[1],L=2),T())}function m(){32==uo.event.keyCode&&2==L&&(z[0]+=h[1],z[1]+=f[1],L=0,T())}function v(){var t=uo.mouse(_),n=!1;x&&(t[0]+=x[0],t[1]+=x[1]),L||(uo.event.altKey?(b||(b=[(h[0]+h[1])/2,(f[0]+f[1])/2]),z[0]=h[+(t[0]<b[0])],z[1]=f[+(t[1]<b[1])]):b=null),S&&g(t,u,0)&&(r(k),n=!0),E&&g(t,c,1)&&(i(k),n=!0),n&&(e(k),M({type:"brush",mode:L?"move":"resize"}))}function g(t,e,r){var n,i,a=Yi(e),l=a[0],u=a[1],c=z[r],m=r?f:h,v=m[1]-m[0];if(L&&(l-=c,u-=v+c),n=(r?p:d)?Math.max(l,Math.min(u,t[r])):t[r],L?i=(n+=c)+v:(b&&(c=Math.max(l,Math.min(u,2*b[r]-n))),c<n?(i=n,n=c):i=c),m[0]!=n||m[1]!=i)return r?s=null:o=null,m[0]=n,m[1]=i,!0}function y(){v(),k.style("pointer-events","all").selectAll(".resize").style("display",t.empty()?"none":null),uo.select("body").style("cursor",null),D.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),C(),M({type:"brushend"})}var b,x,_=this,w=uo.select(uo.event.target),M=l.of(_,arguments),k=uo.select(_),A=w.datum(),S=!/^(n|s)$/.test(A)&&u,E=!/^(e|w)$/.test(A)&&c,L=w.classed("extent"),C=K(_),z=uo.mouse(_),D=uo.select(n(_)).on("keydown.brush",a).on("keyup.brush",m);if(uo.event.changedTouches?D.on("touchmove.brush",v).on("touchend.brush",y):D.on("mousemove.brush",v).on("mouseup.brush",y),k.interrupt().selectAll("*").interrupt(),L)z[0]=h[0]-z[0],z[1]=f[0]-z[1];else if(A){var I=+/w$/.test(A),P=+/^n/.test(A);x=[h[1-I]-z[0],f[1-P]-z[1]],z[0]=h[I],z[1]=f[P]}else uo.event.altKey&&(b=z.slice());k.style("pointer-events","none").selectAll(".resize").style("display",null),uo.select("body").style("cursor",w.style("cursor")),M({type:"brushstart"}),v()}var o,s,l=E(t,"brushstart","brush","brushend"),u=null,c=null,h=[0,0],f=[0,0],d=!0,p=!0,m=Yl[0];return t.event=function(t){t.each(function(){var t=l.of(this,arguments),e={x:h,y:f,i:o,j:s},r=this.__chart__||e;this.__chart__=e,Rl?uo.select(this).transition().each("start.brush",function(){o=r.i,s=r.j,h=r.x,f=r.y,t({type:"brushstart"})}).tween("brush:brush",function(){var r=wn(h,e.x),n=wn(f,e.y);return o=s=null,function(i){h=e.x=r(i),f=e.y=n(i),t({type:"brush",mode:"resize"})}}).each("end.brush",function(){o=e.i,s=e.j,t({type:"brush",mode:"resize"}),t({type:"brushend"})}):(t({type:"brushstart"}),t({type:"brush",mode:"resize"}),t({type:"brushend"}))})},t.x=function(e){return arguments.length?(u=e,m=Yl[!u<<1|!c],t):u},t.y=function(e){return arguments.length?(c=e,m=Yl[!u<<1|!c],t):c},t.clamp=function(e){return arguments.length?(u&&c?(d=!!e[0],p=!!e[1]):u?d=!!e:c&&(p=!!e),t):u&&c?[d,p]:u?d:c?p:null},t.extent=function(e){var r,n,i,a,l;return arguments.length?(u&&(r=e[0],n=e[1],c&&(r=r[0],n=n[0]),o=[r,n],u.invert&&(r=u(r),n=u(n)),n<r&&(l=r,r=n,n=l),r==h[0]&&n==h[1]||(h=[r,n])),c&&(i=e[0],a=e[1],u&&(i=i[1],a=a[1]),s=[i,a],c.invert&&(i=c(i),a=c(a)),a<i&&(l=i,i=a,a=l),i==f[0]&&a==f[1]||(f=[i,a])),t):(u&&(o?(r=o[0],n=o[1]):(r=h[0],n=h[1],u.invert&&(r=u.invert(r),n=u.invert(n)),n<r&&(l=r,r=n,n=l))),c&&(s?(i=s[0],a=s[1]):(i=f[0],a=f[1],c.invert&&(i=c.invert(i),a=c.invert(a)),a<i&&(l=i,i=a,a=l))),u&&c?[[r,i],[n,a]]:u?[r,n]:c&&[i,a])},t.clear=function(){return t.empty()||(h=[0,0],f=[0,0],o=s=null),t},t.empty=function(){return!!u&&h[0]==h[1]||!!c&&f[0]==f[1]},uo.rebind(t,l,"on")};var Gl={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Yl=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],Xl=fs.format=ys.timeFormat,Wl=Xl.utc,Zl=Wl("%Y-%m-%dT%H:%M:%S.%LZ");Xl.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?io:Zl,io.parse=function(t){var e=new Date(t);return isNaN(e)?null:e},io.toString=Zl.toString,fs.second=Vt(function(t){return new ds(1e3*Math.floor(t/1e3))},function(t,e){t.setTime(t.getTime()+1e3*Math.floor(e))},function(t){return t.getSeconds()}),fs.seconds=fs.second.range,fs.seconds.utc=fs.second.utc.range,fs.minute=Vt(function(t){return new ds(6e4*Math.floor(t/6e4))},function(t,e){t.setTime(t.getTime()+6e4*Math.floor(e))},function(t){return t.getMinutes()}),fs.minutes=fs.minute.range,fs.minutes.utc=fs.minute.utc.range,fs.hour=Vt(function(t){var e=t.getTimezoneOffset()/60;return new ds(36e5*(Math.floor(t/36e5-e)+e))},function(t,e){t.setTime(t.getTime()+36e5*Math.floor(e))},function(t){return t.getHours()}),fs.hours=fs.hour.range,fs.hours.utc=fs.hour.utc.range,fs.month=Vt(function(t){return t=fs.day(t),t.setDate(1),t},function(t,e){t.setMonth(t.getMonth()+e)},function(t){return t.getMonth()}),fs.months=fs.month.range,fs.months.utc=fs.month.utc.range;var Jl=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Kl=[[fs.second,1],[fs.second,5],[fs.second,15],[fs.second,30],[fs.minute,1],[fs.minute,5],[fs.minute,15],[fs.minute,30],[fs.hour,1],[fs.hour,3],[fs.hour,6],[fs.hour,12],[fs.day,1],[fs.day,2],[fs.week,1],[fs.month,1],[fs.month,3],[fs.year,1]],Ql=Xl.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",ze]]),$l={range:function(t,e,r){return uo.range(Math.ceil(t/r)*r,+e,r).map(oo)},floor:x,ceil:x};Kl.year=fs.year,fs.scale=function(){return ao(uo.scale.linear(),Kl,Ql)};var tu=Kl.map(function(t){return[t[0].utc,t[1]]}),eu=Wl.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",ze]]);tu.year=fs.year.utc,fs.scale.utc=function(){return ao(uo.scale.linear(),tu,eu)},uo.text=Lt(function(t){return t.responseText}),uo.json=function(t,e){return Ct(t,"application/json",so,e)},uo.html=function(t,e){return Ct(t,"text/html",lo,e)},uo.xml=Lt(function(t){return t.responseXML}),"function"==typeof t&&t.amd?(this.d3=uo,t(uo)):"object"==typeof r&&r.exports?r.exports=uo:this.d3=uo}()},{}],119:[function(t,e,r){"use strict";function n(t,e){this.point=t,this.index=e}function i(t,e){for(var r=t.point,n=e.point,i=r.length,a=0;a<i;++a){var o=n[a]-r[a];if(o)return o}return 0}function a(t,e,r){if(1===t)return r?[[-1,0]]:[];var n=e.map(function(t,e){return[t[0],e]});n.sort(function(t,e){return t[0]-e[0]});for(var i=new Array(t-1),a=1;a<t;++a){var o=n[a-1],s=n[a];i[a-1]=[o[1],s[1]]}return r&&i.push([-1,i[0][1]],[i[t-1][1],-1]),i}function o(t,e){var r=t.length;if(0===r)return[];var o=t[0].length;if(o<1)return[];if(1===o)return a(r,t,e);for(var u=new Array(r),c=1,h=0;h<r;++h){for(var f=t[h],d=new Array(o+1),p=0,m=0;m<o;++m){var v=f[m];d[m]=v,p+=v*v}d[o]=p,u[h]=new n(d,h),c=Math.max(p,c)}l(u,i),r=u.length;for(var g=new Array(r+o+1),y=new Array(r+o+1),b=(o+1)*(o+1)*c,x=new Array(o+1),h=0;h<=o;++h)x[h]=0;x[o]=b,g[0]=x.slice(),y[0]=-1;for(var h=0;h<=o;++h){var d=x.slice();d[h]=1,g[h+1]=d,y[h+1]=-1}for(var h=0;h<r;++h){var _=u[h];g[h+o+1]=_.point,y[h+o+1]=_.index}var w=s(g,!1);if(w=e?w.filter(function(t){for(var e=0,r=0;r<=o;++r){var n=y[t[r]];if(n<0&&++e>=2)return!1;t[r]=n}return!0}):w.filter(function(t){for(var e=0;e<=o;++e){var r=y[t[e]];if(r<0)return!1;t[e]=r}return!0}),1&o)for(var h=0;h<w.length;++h){var _=w[h],d=_[0];_[0]=_[1],_[1]=d}return w}var s=t("incremental-convex-hull"),l=t("uniq");e.exports=o},{"incremental-convex-hull":284,uniq:535}],120:[function(t,e,r){(function(t){function r(t,e){return d[0]=t,d[1]=e,f[0]}function n(t){return f[0]=t,d[0]}function i(t){return f[0]=t,d[1]}function a(t,e){return d[1]=t,d[0]=e,f[0]}function o(t){return f[0]=t,d[1]}function s(t){return f[0]=t,d[0]}function l(t,e){return p.writeUInt32LE(t,0,!0),p.writeUInt32LE(e,4,!0),p.readDoubleLE(0,!0)}function u(t){return p.writeDoubleLE(t,0,!0),p.readUInt32LE(0,!0)}function c(t){return p.writeDoubleLE(t,0,!0),p.readUInt32LE(4,!0)}var h=!1;if("undefined"!=typeof Float64Array){var f=new Float64Array(1),d=new Uint32Array(f.buffer);f[0]=1,h=!0,1072693248===d[1]?(e.exports=function(t){return f[0]=t,[d[0],d[1]]},e.exports.pack=r,e.exports.lo=n,e.exports.hi=i):1072693248===d[0]?(e.exports=function(t){return f[0]=t,[d[1],d[0]]},e.exports.pack=a,e.exports.lo=o,e.exports.hi=s):h=!1}if(!h){var p=new t(8);e.exports=function(t){return p.writeDoubleLE(t,0,!0),[p.readUInt32LE(0,!0),p.readUInt32LE(4,!0)]},e.exports.pack=l,e.exports.lo=u,e.exports.hi=c}e.exports.sign=function(t){return e.exports.hi(t)>>>31},e.exports.exponent=function(t){return(e.exports.hi(t)<<1>>>21)-1023},e.exports.fraction=function(t){var r=e.exports.lo(t),n=e.exports.hi(t),i=1048575&n;return 2146435072&n&&(i+=1<<20),[r,i]},e.exports.denormalized=function(t){return!(2146435072&e.exports.hi(t))}}).call(this,t("buffer").Buffer)},{buffer:73}],121:[function(t,e,r){"use strict";function n(t,e,r){var i=0|t[r];if(i<=0)return[];var a,o=new Array(i);if(r===t.length-1)for(a=0;a<i;++a)o[a]=e;else for(a=0;a<i;++a)o[a]=n(t,e,r+1);return o}function i(t,e){var r,n;for(r=new Array(t),n=0;n<t;++n)r[n]=e;return r}function a(t,e){switch(void 0===e&&(e=0),typeof t){case"number":if(t>0)return i(0|t,e);break;case"object":if("number"==typeof t.length)return n(t,e,0)}return[]}e.exports=a},{}],122:[function(t,e,r){"use strict";function n(t,e,r){r=r||2;var n=e&&e.length,a=n?e[0]*r:t.length,s=i(t,0,a,r,!0),l=[];if(!s)return l;var u,c,f,d,p,m,v;if(n&&(s=h(t,e,s,r)),t.length>80*r){u=f=t[0],c=d=t[1];for(var g=r;g<a;g+=r)p=t[g],m=t[g+1],p<u&&(u=p),m<c&&(c=m),p>f&&(f=p),m>d&&(d=m);v=Math.max(f-u,d-c)}return o(s,l,r,u,c,v),l}function i(t,e,r,n,i){var a,o;if(i===z(t,e,r,n)>0)for(a=e;a<r;a+=n)o=E(a,t[a],t[a+1],o);else for(a=r-n;a>=e;a-=n)o=E(a,t[a],t[a+1],o);return o&&w(o,o.next)&&(L(o),o=o.next),o}function a(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!w(n,n.next)&&0!==_(n.prev,n,n.next))n=n.next;else{if(L(n),(n=e=n.prev)===n.next)return null;r=!0}}while(r||n!==e);return e}function o(t,e,r,n,i,h,f){if(t){!f&&h&&m(t,n,i,h);for(var d,p,v=t;t.prev!==t.next;)if(d=t.prev,p=t.next,h?l(t,n,i,h):s(t))e.push(d.i/r),e.push(t.i/r),e.push(p.i/r),L(t),t=p.next,v=p.next;else if((t=p)===v){f?1===f?(t=u(t,e,r),o(t,e,r,n,i,h,2)):2===f&&c(t,e,r,n,i,h):o(a(t),e,r,n,i,h,1);break}}}function s(t){var e=t.prev,r=t,n=t.next;if(_(e,r,n)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(b(e.x,e.y,r.x,r.y,n.x,n.y,i.x,i.y)&&_(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function l(t,e,r,n){var i=t.prev,a=t,o=t.next;if(_(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,h=g(s,l,e,r,n),f=g(u,c,e,r,n),d=t.nextZ;d&&d.z<=f;){if(d!==t.prev&&d!==t.next&&b(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&_(d.prev,d,d.next)>=0)return!1;d=d.nextZ}for(d=t.prevZ;d&&d.z>=h;){if(d!==t.prev&&d!==t.next&&b(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&_(d.prev,d,d.next)>=0)return!1;d=d.prevZ}return!0}function u(t,e,r){var n=t;do{var i=n.prev,a=n.next.next;!w(i,a)&&M(i,n,n.next,a)&&A(i,a)&&A(a,i)&&(e.push(i.i/r),e.push(n.i/r),e.push(a.i/r),L(n),L(n.next),n=t=a),n=n.next}while(n!==t);return n}function c(t,e,r,n,i,s){var l=t;do{for(var u=l.next.next;u!==l.prev;){if(l.i!==u.i&&x(l,u)){var c=S(l,u);return l=a(l,l.next),c=a(c,c.next),o(l,e,r,n,i,s),void o(c,e,r,n,i,s)}u=u.next}l=l.next}while(l!==t)}function h(t,e,r,n){var o,s,l,u,c,h=[];for(o=0,s=e.length;o<s;o++)l=e[o]*n,u=o<s-1?e[o+1]*n:t.length,c=i(t,l,u,n,!1),c===c.next&&(c.steiner=!0),h.push(y(c));for(h.sort(f),o=0;o<h.length;o++)d(h[o],r),r=a(r,r.next);return r}function f(t,e){return t.x-e.x}function d(t,e){if(e=p(t,e)){var r=S(e,t);a(r,r.next)}}function p(t,e){var r,n=e,i=t.x,a=t.y,o=-1/0;do{if(a<=n.y&&a>=n.next.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.prev;var l,u=r,c=r.x,h=r.y,f=1/0;for(n=r.next;n!==u;)i>=n.x&&n.x>=c&&b(a<h?i:o,a,c,h,a<h?o:i,a,n.x,n.y)&&((l=Math.abs(a-n.y)/(i-n.x))<f||l===f&&n.x>r.x)&&A(n,t)&&(r=n,f=l),n=n.next;return r}function m(t,e,r,n){var i=t;do{null===i.z&&(i.z=g(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,v(i)}function v(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?(i=n,n=n.nextZ,l--):0!==l&&n?r.z<=n.z?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,l--):(i=r,r=r.nextZ,s--),a?a.nextZ=i:t=i,i.prevZ=a,a=i;r=n}a.nextZ=null,u*=2}while(o>1);return t}function g(t,e,r,n,i){return t=32767*(t-r)/i,e=32767*(e-n)/i,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t|e<<1}function y(t){var e=t,r=t;do{e.x<r.x&&(r=e),e=e.next}while(e!==t);return r}function b(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 x(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!k(t,e)&&A(t,e)&&A(e,t)&&T(t,e)}function _(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function w(t,e){return t.x===e.x&&t.y===e.y}function M(t,e,r,n){return!!(w(t,e)&&w(r,n)||w(t,n)&&w(r,e))||_(t,e,r)>0!=_(t,e,n)>0&&_(r,n,t)>0!=_(r,n,e)>0}function k(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&&M(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}function A(t,e){return _(t.prev,t,t.next)<0?_(t,e,t.next)>=0&&_(t,t.prev,e)>=0:_(t,e,t.prev)<0||_(t,t.next,e)<0}function T(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&&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}function S(t,e){var r=new C(t.i,t.x,t.y),n=new C(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 E(t,e,r,n){var i=new C(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 L(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 C(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 z(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}e.exports=n,n.deviation=function(t,e,r,n){var i=e&&e.length,a=i?e[0]*r:t.length,o=Math.abs(z(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(z(t,u,c,r))}var h=0;for(s=0;s<n.length;s+=3){var f=n[s]*r,d=n[s+1]*r,p=n[s+2]*r;h+=Math.abs((t[f]-t[p])*(t[d+1]-t[f+1])-(t[f]-t[d])*(t[p+1]-t[f+1]))}return 0===o&&0===h?0:Math.abs((h-o)/o)},n.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}},{}],123:[function(t,e,r){"use strict";function n(t,e){var r=t.length;if("number"!=typeof e){e=0;for(var n=0;n<r;++n){var a=t[n];e=Math.max(e,a[0],a[1])}e=1+(0|e)}e|=0;for(var o=new Array(e),n=0;n<e;++n)o[n]=[];for(var n=0;n<r;++n){var a=t[n];o[a[0]].push(a[1]),o[a[1]].push(a[0])}for(var s=0;s<e;++s)i(o[s],function(t,e){return t-e});return o}e.exports=n;var i=t("uniq")},{uniq:535}],124:[function(e,r,n){(function(i,a){!function(e,i){"object"==typeof n&&void 0!==r?r.exports=i():"function"==typeof t&&t.amd?t(i):e.ES6Promise=i()}(this,function(){"use strict";function t(t){return"function"==typeof t||"object"==typeof t&&null!==t}function r(t){return"function"==typeof t}function n(t){G=t}function o(t){Y=t}function s(){return function(){H(u)}}function l(){var t=setTimeout;return function(){return t(u,1)}}function u(){for(var t=0;t<q;t+=2){(0,Q[t])(Q[t+1]),Q[t]=void 0,Q[t+1]=void 0}q=0}function c(t,e){var r=arguments,n=this,i=new this.constructor(f);void 0===i[tt]&&z(i);var a=n._state;return a?function(){var t=r[a-1];Y(function(){return E(a,i,t,n._result)})}():k(n,i,t,e),i}function h(t){var e=this;if(t&&"object"==typeof t&&t.constructor===e)return t;var r=new e(f);return x(r,t),r}function f(){}function d(){return new TypeError("You cannot resolve a promise with itself")}function p(){return new TypeError("A promises callback cannot return that same promise.")}function m(t){try{return t.then}catch(t){return it.error=t,it}}function v(t,e,r,n){try{t.call(e,r,n)}catch(t){return t}}function g(t,e,r){Y(function(t){var n=!1,i=v(r,e,function(r){n||(n=!0,e!==r?x(t,r):w(t,r))},function(e){n||(n=!0,M(t,e))},"Settle: "+(t._label||" unknown promise"));!n&&i&&(n=!0,M(t,i))},t)}function y(t,e){e._state===rt?w(t,e._result):e._state===nt?M(t,e._result):k(e,void 0,function(e){return x(t,e)},function(e){return M(t,e)})}function b(t,e,n){e.constructor===t.constructor&&n===c&&e.constructor.resolve===h?y(t,e):n===it?M(t,it.error):void 0===n?w(t,e):r(n)?g(t,e,n):w(t,e)}function x(e,r){e===r?M(e,d()):t(r)?b(e,r,m(r)):w(e,r)}function _(t){t._onerror&&t._onerror(t._result),A(t)}function w(t,e){t._state===et&&(t._result=e,t._state=rt,0!==t._subscribers.length&&Y(A,t))}function M(t,e){t._state===et&&(t._state=nt,t._result=e,Y(_,t))}function k(t,e,r,n){var i=t._subscribers,a=i.length;t._onerror=null,i[a]=e,i[a+rt]=r,i[a+nt]=n,0===a&&t._state&&Y(A,t)}function A(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?E(r,n,i,a):i(a);t._subscribers.length=0}}function T(){this.error=null}function S(t,e){try{return t(e)}catch(t){return at.error=t,at}}function E(t,e,n,i){var a=r(n),o=void 0,s=void 0,l=void 0,u=void 0;if(a){if(o=S(n,i),o===at?(u=!0,s=o.error,o=null):l=!0,e===o)return void M(e,p())}else o=i,l=!0;e._state!==et||(a&&l?x(e,o):u?M(e,s):t===rt?w(e,o):t===nt&&M(e,o))}function L(t,e){try{e(function(e){x(t,e)},function(e){M(t,e)})}catch(e){M(t,e)}}function C(){return ot++}function z(t){t[tt]=ot++,t._state=void 0,t._result=void 0,t._subscribers=[]}function D(t,e){this._instanceConstructor=t,this.promise=new t(f),this.promise[tt]||z(this.promise),V(e)?(this._input=e,this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?w(this.promise,this._result):(this.length=this.length||0,this._enumerate(),0===this._remaining&&w(this.promise,this._result))):M(this.promise,I())}function I(){return new Error("Array Methods must be provided an Array")}function P(t){return new D(this,t).promise}function O(t){var e=this;return new e(V(t)?function(r,n){for(var i=t.length,a=0;a<i;a++)e.resolve(t[a]).then(r,n)}:function(t,e){return e(new TypeError("You must pass an array to race."))})}function j(t){var e=this,r=new e(f);return M(r,t),r}function F(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function R(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function N(t){this[tt]=C(),this._result=this._state=void 0,this._subscribers=[],f!==t&&("function"!=typeof t&&F(),this instanceof N?L(this,t):R())}function B(){var t=void 0;if(void 0!==a)t=a;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=N}var U=void 0;U=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)};var V=U,q=0,H=void 0,G=void 0,Y=function(t,e){Q[q]=t,Q[q+1]=e,2===(q+=2)&&(G?G(u):$())},X="undefined"!=typeof window?window:void 0,W=X||{},Z=W.MutationObserver||W.WebKitMutationObserver,J="undefined"==typeof self&&void 0!==i&&"[object process]"==={}.toString.call(i),K="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,Q=new Array(1e3),$=void 0;$=J?function(){return function(){return i.nextTick(u)}}():Z?function(){var t=0,e=new Z(u),r=document.createTextNode("");return e.observe(r,{characterData:!0}),function(){r.data=t=++t%2}}():K?function(){var t=new MessageChannel;return t.port1.onmessage=u,function(){return t.port2.postMessage(0)}}():void 0===X&&"function"==typeof e?function(){try{var t=e,r=t("vertx");return H=r.runOnLoop||r.runOnContext,s()}catch(t){return l()}}():l();var tt=Math.random().toString(36).substring(16),et=void 0,rt=1,nt=2,it=new T,at=new T,ot=0;return D.prototype._enumerate=function(){for(var t=this.length,e=this._input,r=0;this._state===et&&r<t;r++)this._eachEntry(e[r],r)},D.prototype._eachEntry=function(t,e){var r=this._instanceConstructor,n=r.resolve;if(n===h){var i=m(t);if(i===c&&t._state!==et)this._settledAt(t._state,e,t._result);else if("function"!=typeof i)this._remaining--,this._result[e]=t;else if(r===N){var a=new r(f);b(a,t,i),this._willSettleAt(a,e)}else this._willSettleAt(new r(function(e){return e(t)}),e)}else this._willSettleAt(n(t),e)},D.prototype._settledAt=function(t,e,r){var n=this.promise;n._state===et&&(this._remaining--,t===nt?M(n,r):this._result[e]=r),0===this._remaining&&w(n,this._result)},D.prototype._willSettleAt=function(t,e){var r=this;k(t,void 0,function(t){return r._settledAt(rt,e,t)},function(t){return r._settledAt(nt,e,t)})},N.all=P,N.race=O,N.resolve=h,N.reject=j,N._setScheduler=n,N._setAsap=o,N._asap=Y,N.prototype={constructor:N,then:c,catch:function(t){return this.then(null,t)}},B(),N.polyfill=B,N.Promise=N,N})}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:479}],125:[function(t,e,r){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function i(t){return"function"==typeof t}function a(t){return"number"==typeof t}function o(t){return"object"==typeof t&&null!==t}function s(t){return void 0===t}e.exports=n,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(t){if(!a(t)||t<0||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},n.prototype.emit=function(t){var e,r,n,a,l,u;if(this._events||(this._events={}),"error"===t&&(!this._events.error||o(this._events.error)&&!this._events.error.length)){if((e=arguments[1])instanceof Error)throw e;var c=new Error('Uncaught, unspecified "error" event. ('+e+")");throw c.context=e,c}if(r=this._events[t],s(r))return!1;if(i(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:a=Array.prototype.slice.call(arguments,1),r.apply(this,a)}else if(o(r))for(a=Array.prototype.slice.call(arguments,1),u=r.slice(),n=u.length,l=0;l<n;l++)u[l].apply(this,a);return!0},n.prototype.addListener=function(t,e){var r;if(!i(e))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",t,i(e.listener)?e.listener:e),this._events[t]?o(this._events[t])?this._events[t].push(e):this._events[t]=[this._events[t],e]:this._events[t]=e,o(this._events[t])&&!this._events[t].warned&&(r=s(this._maxListeners)?n.defaultMaxListeners:this._maxListeners)&&r>0&&this._events[t].length>r&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace()),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(t,e){function r(){this.removeListener(t,r),n||(n=!0,e.apply(this,arguments))}if(!i(e))throw TypeError("listener must be a function");var n=!1;return r.listener=e,this.on(t,r),this},n.prototype.removeListener=function(t,e){var r,n,a,s;if(!i(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(r=this._events[t],a=r.length,n=-1,r===e||i(r.listener)&&r.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(o(r)){for(s=a;s-- >0;)if(r[s]===e||r[s].listener&&r[s].listener===e){n=s;break}if(n<0)return this;1===r.length?(r.length=0,delete this._events[t]):r.splice(n,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},n.prototype.removeAllListeners=function(t){var e,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(r=this._events[t],i(r))this.removeListener(t,r);else if(r)for(;r.length;)this.removeListener(t,r[r.length-1]);return delete this._events[t],this},n.prototype.listeners=function(t){return this._events&&this._events[t]?i(this._events[t])?[this._events[t]]:this._events[t].slice():[]},n.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(i(e))return 1;if(e)return e.length}return 0},n.listenerCount=function(t,e){return t.listenerCount(e)}},{}],126:[function(t,e,r){"use strict";function n(t,e,r){var n=e||0,i=r||1
19 ;return[[t[12]+t[0],t[13]+t[1],t[14]+t[2],t[15]+t[3]],[t[12]-t[0],t[13]-t[1],t[14]-t[2],t[15]-t[3]],[t[12]+t[4],t[13]+t[5],t[14]+t[6],t[15]+t[7]],[t[12]-t[4],t[13]-t[5],t[14]-t[6],t[15]-t[7]],[n*t[12]+t[8],n*t[13]+t[9],n*t[14]+t[10],n*t[15]+t[11]],[i*t[12]-t[8],i*t[13]-t[9],i*t[14]-t[10],i*t[15]-t[11]]]}e.exports=n},{}],127:[function(t,e,r){"use strict";function n(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}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}},{}],128:[function(t,e,r){"use strict";function n(t){return new Function("f","var p = (f && f.properties || {}); return "+i(t))}function i(t){if(!t)return"true";var e=t[0];return t.length<=1?"any"===e?"false":"true":"("+("=="===e?o(t[1],t[2],"===",!1):"!="===e?o(t[1],t[2],"!==",!1):"<"===e||">"===e||"<="===e||">="===e?o(t[1],t[2],e,!0):"any"===e?s(t.slice(1),"||"):"all"===e?s(t.slice(1),"&&"):"none"===e?c(s(t.slice(1),"||")):"in"===e?l(t[1],t.slice(2)):"!in"===e?c(l(t[1],t.slice(2))):"has"===e?u(t[1]):"!has"===e?c(u([t[1]])):"true")+")"}function a(t){return"$type"===t?"f.type":"$id"===t?"f.id":"p["+JSON.stringify(t)+"]"}function o(t,e,r,n){var i=a(t),o="$type"===t?f.indexOf(e):JSON.stringify(e);return(n?"typeof "+i+"=== typeof "+o+"&&":"")+i+r+o}function s(t,e){return t.map(i).join(e)}function l(t,e){"$type"===t&&(e=e.map(function(t){return f.indexOf(t)}));var r=JSON.stringify(e.sort(h)),n=a(t);return e.length<=200?r+".indexOf("+n+") !== -1":"function(v, a, i, j) {while (i <= j) { var m = (i + j) >> 1; if (a[m] === v) return true; if (a[m] > v) j = m - 1; else i = m + 1;}return false; }("+n+", "+r+",0,"+(e.length-1)+")"}function u(t){return JSON.stringify(t)+" in p"}function c(t){return"!("+t+")"}function h(t,e){return t<e?-1:t>e?1:0}e.exports=n;var f=["Unknown","Point","LineString","Polygon"]},{}],129:[function(t,e,r){"use strict";function n(t,e,r){return Math.min(e,Math.max(t,r))}function i(t,e,r){this.dimension=t.length,this.bounds=[new Array(this.dimension),new Array(this.dimension)];for(var n=0;n<this.dimension;++n)this.bounds[0][n]=-1/0,this.bounds[1][n]=1/0;this._state=t.slice().reverse(),this._velocity=e.slice().reverse(),this._time=[r],this._scratch=[t.slice(),t.slice(),t.slice(),t.slice(),t.slice()]}function a(t){for(var e=new Array(t),r=0;r<t;++r)e[r]=0;return e}function o(t,e,r){switch(arguments.length){case 0:return new i([0],[0],0);case 1:if("number"==typeof t){var n=a(t);return new i(n,n,0)}return new i(t,a(t.length),0);case 2:if("number"==typeof e){var n=a(t.length);return new i(t,n,+e)}r=0;case 3:if(t.length!==e.length)throw new Error("state and velocity lengths must match");return new i(t,e,r)}}e.exports=o;var s=t("cubic-hermite"),l=t("binary-search-bounds"),u=i.prototype;u.flush=function(t){var e=l.gt(this._time,t)-1;e<=0||(this._time.splice(0,e),this._state.splice(0,e*this.dimension),this._velocity.splice(0,e*this.dimension))},u.curve=function(t){var e=this._time,r=e.length,i=l.le(e,t),a=this._scratch[0],o=this._state,u=this._velocity,c=this.dimension,h=this.bounds;if(i<0)for(var f=c-1,d=0;d<c;++d,--f)a[d]=o[f];else if(i>=r-1)for(var f=o.length-1,p=t-e[r-1],d=0;d<c;++d,--f)a[d]=o[f]+p*u[f];else{for(var f=c*(i+1)-1,m=e[i],v=e[i+1],g=v-m||1,y=this._scratch[1],b=this._scratch[2],x=this._scratch[3],_=this._scratch[4],w=!0,d=0;d<c;++d,--f)y[d]=o[f],x[d]=u[f]*g,b[d]=o[f+c],_[d]=u[f+c]*g,w=w&&y[d]===b[d]&&x[d]===_[d]&&0===x[d];if(w)for(var d=0;d<c;++d)a[d]=y[d];else s(y,x,b,_,(t-m)/g,a)}for(var M=h[0],k=h[1],d=0;d<c;++d)a[d]=n(M[d],k[d],a[d]);return a},u.dcurve=function(t){var e=this._time,r=e.length,n=l.le(e,t),i=this._scratch[0],a=this._state,o=this._velocity,u=this.dimension;if(n>=r-1)for(var c=a.length-1,h=(e[r-1],0);h<u;++h,--c)i[h]=o[c];else{for(var c=u*(n+1)-1,f=e[n],d=e[n+1],p=d-f||1,m=this._scratch[1],v=this._scratch[2],g=this._scratch[3],y=this._scratch[4],b=!0,h=0;h<u;++h,--c)m[h]=a[c],g[h]=o[c]*p,v[h]=a[c+u],y[h]=o[c+u]*p,b=b&&m[h]===v[h]&&g[h]===y[h]&&0===g[h];if(b)for(var h=0;h<u;++h)i[h]=0;else{s.derivative(m,g,v,y,(t-f)/p,i);for(var h=0;h<u;++h)i[h]/=p}}return i},u.lastT=function(){var t=this._time;return t[t.length-1]},u.stable=function(){for(var t=this._velocity,e=t.length,r=this.dimension-1;r>=0;--r)if(t[--e])return!1;return!0},u.jump=function(t){var e=this.lastT(),r=this.dimension;if(!(t<e||arguments.length!==r+1)){var i=this._state,a=this._velocity,o=i.length-this.dimension,s=this.bounds,l=s[0],u=s[1];this._time.push(e,t);for(var c=0;c<2;++c)for(var h=0;h<r;++h)i.push(i[o++]),a.push(0);this._time.push(t);for(var h=r;h>0;--h)i.push(n(l[h-1],u[h-1],arguments[h])),a.push(0)}},u.push=function(t){var e=this.lastT(),r=this.dimension;if(!(t<e||arguments.length!==r+1)){var i=this._state,a=this._velocity,o=i.length-this.dimension,s=t-e,l=this.bounds,u=l[0],c=l[1],h=s>1e-6?1/s:0;this._time.push(t);for(var f=r;f>0;--f){var d=n(u[f-1],c[f-1],arguments[f]);i.push(d),a.push((d-i[o++])*h)}}},u.set=function(t){var e=this.dimension;if(!(t<this.lastT()||arguments.length!==e+1)){var r=this._state,i=this._velocity,a=this.bounds,o=a[0],s=a[1];this._time.push(t);for(var l=e;l>0;--l)r.push(n(o[l-1],s[l-1],arguments[l])),i.push(0)}},u.move=function(t){var e=this.lastT(),r=this.dimension;if(!(t<=e||arguments.length!==r+1)){var i=this._state,a=this._velocity,o=i.length-this.dimension,s=this.bounds,l=s[0],u=s[1],c=t-e,h=c>1e-6?1/c:0;this._time.push(t);for(var f=r;f>0;--f){var d=arguments[f];i.push(n(l[f-1],u[f-1],i[o++]+d)),a.push(d*h)}}},u.idle=function(t){var e=this.lastT();if(!(t<e)){var r=this.dimension,i=this._state,a=this._velocity,o=i.length-r,s=this.bounds,l=s[0],u=s[1],c=t-e;this._time.push(t);for(var h=r-1;h>=0;--h)i.push(n(l[h],u[h],i[o]+c*a[o])),a.push(0),o+=1}}},{"binary-search-bounds":62,"cubic-hermite":105}],130:[function(t,e,r){"use strict";function n(t){t=t||{};var e,r,n=t.canvas||document.createElement("canvas"),a=t.family||"monospace",o=t.shape||[512,512],s=t.step||[32,32],l=t.size||16,u=t.chars||[32,126],c=Math.floor((s[0]-l)/2),h=t.radius||1.5*c,f=new i(l,c,h,0,a),d=t.align||!0;if("number"==typeof l&&(l+="px"),Array.isArray(u)){if(2===u.length&&"number"==typeof u[0]&&"number"==typeof u[1]){var p=[];for(e=u[0],r=0;e<=u[1];e++)p[r++]=String.fromCharCode(e);u=p}}else u=String(u).split("");o=o.slice(),n.width=o[0],n.height=o[1];var m=n.getContext("2d");m.fillStyle="#000",m.fillRect(0,0,n.width,n.height),m.font=l+" "+a,m.textBaseline="middle";var v=0,g=0,y=Math.min(u.length,Math.floor(o[0]/s[0])*Math.ceil(o[1]/s[1])),b=f.ctx.textAlign,x=f.buffer;for(f.ctx.textAlign="center",f.buffer=f.size/2,e=0;e<y;e++){var _=f.draw(u[e]),w=0;d&&(w=function(t){var e,r,n,i=t.data,a=t.width,o=t.height,s=0,l=0;for(r=0;r<o;r++){for(n=r*a*4,e=0;e<a;e++)if(i[n+4*e]>0){s=r;break}if(s)break}for(r=o;r--;){for(n=r*a*4,e=0;e<a;e++)if(i[n+4*e]>0){l=r;break}if(l)break}return s-.5*(s+(o-l))}(_)),m.putImageData(_,v,g-w),v+=s[0],v>o[0]-s[0]&&(v=0,g+=s[1])}return f.ctx.textAlign=b,f.buffer=x,n}var i=t("tiny-sdf");e.exports=n},{"tiny-sdf":525}],131:[function(t,e,r){"use strict";function n(t,e,r,n,i,a){this._color=t,this.key=e,this.value=r,this.left=n,this.right=i,this._count=a}function i(t){return new n(t._color,t.key,t.value,t.left,t.right,t._count)}function a(t,e){return new n(t,e.key,e.value,e.left,e.right,e._count)}function o(t){t._count=1+(t.left?t.left._count:0)+(t.right?t.right._count:0)}function s(t,e){this._compare=t,this.root=e}function l(t,e){if(e.left){var r=l(t,e.left);if(r)return r}var r=t(e.key,e.value);return r||(e.right?l(t,e.right):void 0)}function u(t,e,r,n){if(e(t,n.key)<=0){if(n.left){var i=u(t,e,r,n.left);if(i)return i}var i=r(n.key,n.value);if(i)return i}if(n.right)return u(t,e,r,n.right)}function c(t,e,r,n,i){var a,o=r(t,i.key),s=r(e,i.key);if(o<=0){if(i.left&&(a=c(t,e,r,n,i.left)))return a;if(s>0&&(a=n(i.key,i.value)))return a}if(s>0&&i.right)return c(t,e,r,n,i.right)}function h(t,e){this.tree=t,this._stack=e}function f(t,e){t.key=e.key,t.value=e.value,t.left=e.left,t.right=e.right,t._color=e._color,t._count=e._count}function d(t){for(var e,r,n,s,l=t.length-1;l>=0;--l){if(e=t[l],0===l)return void(e._color=g);if(r=t[l-1],r.left===e){if(n=r.right,n.right&&n.right._color===v){if(n=r.right=i(n),s=n.right=i(n.right),r.right=n.left,n.left=r,n.right=s,n._color=r._color,e._color=g,r._color=g,s._color=g,o(r),o(n),l>1){var u=t[l-2];u.left===r?u.left=n:u.right=n}return void(t[l-1]=n)}if(n.left&&n.left._color===v){if(n=r.right=i(n),s=n.left=i(n.left),r.right=s.left,n.left=s.right,s.left=r,s.right=n,s._color=r._color,r._color=g,n._color=g,e._color=g,o(r),o(n),o(s),l>1){var u=t[l-2];u.left===r?u.left=s:u.right=s}return void(t[l-1]=s)}if(n._color===g){if(r._color===v)return r._color=g,void(r.right=a(v,n));r.right=a(v,n);continue}if(n=i(n),r.right=n.left,n.left=r,n._color=r._color,r._color=v,o(r),o(n),l>1){var u=t[l-2];u.left===r?u.left=n:u.right=n}t[l-1]=n,t[l]=r,l+1<t.length?t[l+1]=e:t.push(e),l+=2}else{if(n=r.left,n.left&&n.left._color===v){if(n=r.left=i(n),s=n.left=i(n.left),r.left=n.right,n.right=r,n.left=s,n._color=r._color,e._color=g,r._color=g,s._color=g,o(r),o(n),l>1){var u=t[l-2];u.right===r?u.right=n:u.left=n}return void(t[l-1]=n)}if(n.right&&n.right._color===v){if(n=r.left=i(n),s=n.right=i(n.right),r.left=s.right,n.right=s.left,s.right=r,s.left=n,s._color=r._color,r._color=g,n._color=g,e._color=g,o(r),o(n),o(s),l>1){var u=t[l-2];u.right===r?u.right=s:u.left=s}return void(t[l-1]=s)}if(n._color===g){if(r._color===v)return r._color=g,void(r.left=a(v,n));r.left=a(v,n);continue}if(n=i(n),r.left=n.right,n.right=r,n._color=r._color,r._color=v,o(r),o(n),l>1){var u=t[l-2];u.right===r?u.right=n:u.left=n}t[l-1]=n,t[l]=r,l+1<t.length?t[l+1]=e:t.push(e),l+=2}}}function p(t,e){return t<e?-1:t>e?1:0}function m(t){return new s(t||p,null)}e.exports=m;var v=0,g=1,y=s.prototype;Object.defineProperty(y,"keys",{get:function(){var t=[];return this.forEach(function(e,r){t.push(e)}),t}}),Object.defineProperty(y,"values",{get:function(){var t=[];return this.forEach(function(e,r){t.push(r)}),t}}),Object.defineProperty(y,"length",{get:function(){return this.root?this.root._count:0}}),y.insert=function(t,e){for(var r=this._compare,i=this.root,l=[],u=[];i;){var c=r(t,i.key);l.push(i),u.push(c),i=c<=0?i.left:i.right}l.push(new n(v,t,e,null,null,1));for(var h=l.length-2;h>=0;--h){var i=l[h];u[h]<=0?l[h]=new n(i._color,i.key,i.value,l[h+1],i.right,i._count+1):l[h]=new n(i._color,i.key,i.value,i.left,l[h+1],i._count+1)}for(var h=l.length-1;h>1;--h){var f=l[h-1],i=l[h];if(f._color===g||i._color===g)break;var d=l[h-2];if(d.left===f)if(f.left===i){var p=d.right;if(!p||p._color!==v){if(d._color=v,d.left=f.right,f._color=g,f.right=d,l[h-2]=f,l[h-1]=i,o(d),o(f),h>=3){var m=l[h-3];m.left===d?m.left=f:m.right=f}break}f._color=g,d.right=a(g,p),d._color=v,h-=1}else{var p=d.right;if(!p||p._color!==v){if(f.right=i.left,d._color=v,d.left=i.right,i._color=g,i.left=f,i.right=d,l[h-2]=i,l[h-1]=f,o(d),o(f),o(i),h>=3){var m=l[h-3];m.left===d?m.left=i:m.right=i}break}f._color=g,d.right=a(g,p),d._color=v,h-=1}else if(f.right===i){var p=d.left;if(!p||p._color!==v){if(d._color=v,d.right=f.left,f._color=g,f.left=d,l[h-2]=f,l[h-1]=i,o(d),o(f),h>=3){var m=l[h-3];m.right===d?m.right=f:m.left=f}break}f._color=g,d.left=a(g,p),d._color=v,h-=1}else{var p=d.left;if(!p||p._color!==v){if(f.left=i.right,d._color=v,d.right=i.left,i._color=g,i.right=f,i.left=d,l[h-2]=i,l[h-1]=f,o(d),o(f),o(i),h>=3){var m=l[h-3];m.right===d?m.right=i:m.left=i}break}f._color=g,d.left=a(g,p),d._color=v,h-=1}}return l[0]._color=g,new s(r,l[0])},y.forEach=function(t,e,r){if(this.root)switch(arguments.length){case 1:return l(t,this.root);case 2:return u(e,this._compare,t,this.root);case 3:if(this._compare(e,r)>=0)return;return c(e,r,this._compare,t,this.root)}},Object.defineProperty(y,"begin",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.left;return new h(this,t)}}),Object.defineProperty(y,"end",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.right;return new h(this,t)}}),y.at=function(t){if(t<0)return new h(this,[]);for(var e=this.root,r=[];;){if(r.push(e),e.left){if(t<e.left._count){e=e.left;continue}t-=e.left._count}if(!t)return new h(this,r);if(t-=1,!e.right)break;if(t>=e.right._count)break;e=e.right}return new h(this,[])},y.ge=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a<=0&&(i=n.length),r=a<=0?r.left:r.right}return n.length=i,new h(this,n)},y.gt=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a<0&&(i=n.length),r=a<0?r.left:r.right}return n.length=i,new h(this,n)},y.lt=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a>0&&(i=n.length),r=a<=0?r.left:r.right}return n.length=i,new h(this,n)},y.le=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a>=0&&(i=n.length),r=a<0?r.left:r.right}return n.length=i,new h(this,n)},y.find=function(t){for(var e=this._compare,r=this.root,n=[];r;){var i=e(t,r.key);if(n.push(r),0===i)return new h(this,n);r=i<=0?r.left:r.right}return new h(this,[])},y.remove=function(t){var e=this.find(t);return e?e.remove():this},y.get=function(t){for(var e=this._compare,r=this.root;r;){var n=e(t,r.key);if(0===n)return r.value;r=n<=0?r.left:r.right}};var b=h.prototype;Object.defineProperty(b,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(b,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),b.clone=function(){return new h(this.tree,this._stack.slice())},b.remove=function(){var t=this._stack;if(0===t.length)return this.tree;var e=new Array(t.length),r=t[t.length-1];e[e.length-1]=new n(r._color,r.key,r.value,r.left,r.right,r._count);for(var i=t.length-2;i>=0;--i){var r=t[i];r.left===t[i+1]?e[i]=new n(r._color,r.key,r.value,e[i+1],r.right,r._count):e[i]=new n(r._color,r.key,r.value,r.left,e[i+1],r._count)}if(r=e[e.length-1],r.left&&r.right){var a=e.length;for(r=r.left;r.right;)e.push(r),r=r.right;var o=e[a-1];e.push(new n(r._color,o.key,o.value,r.left,r.right,r._count)),e[a-1].key=r.key,e[a-1].value=r.value;for(var i=e.length-2;i>=a;--i)r=e[i],e[i]=new n(r._color,r.key,r.value,r.left,e[i+1],r._count);e[a-1].left=e[a]}if(r=e[e.length-1],r._color===v){var l=e[e.length-2];l.left===r?l.left=null:l.right===r&&(l.right=null),e.pop();for(var i=0;i<e.length;++i)e[i]._count--;return new s(this.tree._compare,e[0])}if(r.left||r.right){r.left?f(r,r.left):r.right&&f(r,r.right),r._color=g;for(var i=0;i<e.length-1;++i)e[i]._count--;return new s(this.tree._compare,e[0])}if(1===e.length)return new s(this.tree._compare,null);for(var i=0;i<e.length;++i)e[i]._count--;var u=e[e.length-2];return d(e),u.left===r?u.left=null:u.right=null,new s(this.tree._compare,e[0])},Object.defineProperty(b,"key",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(b,"value",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(b,"index",{get:function(){var t=0,e=this._stack;if(0===e.length){var r=this.tree.root;return r?r._count:0}e[e.length-1].left&&(t=e[e.length-1].left._count);for(var n=e.length-2;n>=0;--n)e[n+1]===e[n].right&&(++t,e[n].left&&(t+=e[n].left._count));return t},enumerable:!0}),b.next=function(){var t=this._stack;if(0!==t.length){var e=t[t.length-1];if(e.right)for(e=e.right;e;)t.push(e),e=e.left;else for(t.pop();t.length>0&&t[t.length-1].right===e;)e=t[t.length-1],t.pop()}},Object.defineProperty(b,"hasNext",{get:function(){var t=this._stack;if(0===t.length)return!1;if(t[t.length-1].right)return!0;for(var e=t.length-1;e>0;--e)if(t[e-1].left===t[e])return!0;return!1}}),b.update=function(t){var e=this._stack;if(0===e.length)throw new Error("Can't update empty node!");var r=new Array(e.length),i=e[e.length-1];r[r.length-1]=new n(i._color,i.key,t,i.left,i.right,i._count);for(var a=e.length-2;a>=0;--a)i=e[a],i.left===e[a+1]?r[a]=new n(i._color,i.key,i.value,r[a+1],i.right,i._count):r[a]=new n(i._color,i.key,i.value,i.left,r[a+1],i._count);return new s(this.tree._compare,r[0])},b.prev=function(){var t=this._stack;if(0!==t.length){var e=t[t.length-1];if(e.left)for(e=e.left;e;)t.push(e),e=e.right;else for(t.pop();t.length>0&&t[t.length-1].left===e;)e=t[t.length-1],t.pop()}},Object.defineProperty(b,"hasPrev",{get:function(){var t=this._stack;if(0===t.length)return!1;if(t[t.length-1].left)return!0;for(var e=t.length-1;e>0;--e)if(t[e-1].right===t[e])return!0;return!1}})},{}],132:[function(t,e,r){function n(t){if(t<0)return Number("0/0");for(var e=o[0],r=o.length-1;r>0;--r)e+=o[r]/(t+r);var n=t+a+.5;return.5*Math.log(2*Math.PI)+(t+.5)*Math.log(n)-n+Math.log(e)-Math.log(t)}var i=[.9999999999998099,676.5203681218851,-1259.1392167224028,771.3234287776531,-176.6150291621406,12.507343278686905,-.13857109526572012,9984369578019572e-21,1.5056327351493116e-7],a=607/128,o=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,.0001580887032249125,-.00021026444172410488,.00021743961811521265,-.0001643181065367639,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22];e.exports=function t(e){if(e<.5)return Math.PI/(Math.sin(Math.PI*e)*t(1-e));if(e>100)return Math.exp(n(e));e-=1;for(var r=i[0],a=1;a<9;a++)r+=i[a]/(e+a);var o=e+7+.5;return Math.sqrt(2*Math.PI)*Math.pow(o,e+.5)*Math.exp(-o)*r},e.exports.log=n},{}],133:[function(t,e,r){function n(t){if("Polygon"===t.type)return i(t.coordinates);if("MultiPolygon"===t.type){for(var e=0,r=0;r<t.coordinates.length;r++)e+=i(t.coordinates[r]);return e}return null}function i(t){var e=0;if(t&&t.length>0){e+=Math.abs(a(t[0]));for(var r=1;r<t.length;r++)e-=Math.abs(a(t[r]))}return e}function a(t){var e=0;if(t.length>2){for(var r,n,i=0;i<t.length-1;i++)r=t[i],n=t[i+1],e+=o(n[0]-r[0])*(2+Math.sin(o(r[1]))+Math.sin(o(n[1])));e=e*s.RADIUS*s.RADIUS/2}return e}function o(t){return t*Math.PI/180}var s=t("wgs84");e.exports.geometry=n,e.exports.ring=a},{wgs84:557}],134:[function(t,e,r){function n(t,e){switch(t&&t.type||null){case"FeatureCollection":return t.features=t.features.map(i(n,e)),t;case"Feature":return t.geometry=n(t.geometry,e),t;case"Polygon":case"MultiPolygon":return a(t,e);default:return t}}function i(t,e){return function(r){return t(r,e)}}function a(t,e){return"Polygon"===t.type?t.coordinates=o(t.coordinates,e):"MultiPolygon"===t.type&&(t.coordinates=t.coordinates.map(i(o,e))),t}function o(t,e){e=!!e,t[0]=s(t[0],!e);for(var r=1;r<t.length;r++)t[r]=s(t[r],e);return t}function s(t,e){return l(t)===e?t:t.reverse()}function l(t){return u.ring(t)>=0}var u=t("geojson-area");e.exports=n},{"geojson-area":133}],135:[function(t,e,r){"use strict";function n(t,e,r,n,o,l,u,c){if(r/=e,n/=e,u>=r&&c<=n)return t;if(u>n||c<r)return null;for(var h=[],f=0;f<t.length;f++){var d,p,m=t[f],v=m.geometry,g=m.type;if(d=m.min[o],p=m.max[o],d>=r&&p<=n)h.push(m);else if(!(d>n||p<r)){var y=1===g?i(v,r,n,o):a(v,r,n,o,l,3===g);y.length&&h.push(s(m.tags,g,y,m.id))}}return h.length?h:null}function i(t,e,r,n){for(var i=[],a=0;a<t.length;a++){var o=t[a],s=o[n];s>=e&&s<=r&&i.push(o)}return i}function a(t,e,r,n,i,a){for(var s=[],l=0;l<t.length;l++){var u,c,h,f=0,d=0,p=null,m=t[l],v=m.area,g=m.dist,y=m.outer,b=m.length,x=[];for(c=0;c<b-1;c++)u=p||m[c],p=m[c+1],f=d||u[n],d=p[n],f<e?d>r?(x.push(i(u,p,e),i(u,p,r)),a||(x=o(s,x,v,g,y))):d>=e&&x.push(i(u,p,e)):f>r?d<e?(x.push(i(u,p,r),i(u,p,e)),a||(x=o(s,x,v,g,y))):d<=r&&x.push(i(u,p,r)):(x.push(u),d<e?(x.push(i(u,p,e)),a||(x=o(s,x,v,g,y))):d>r&&(x.push(i(u,p,r)),a||(x=o(s,x,v,g,y))));u=m[b-1],f=u[n],f>=e&&f<=r&&x.push(u),h=x[x.length-1],a&&h&&(x[0][0]!==h[0]||x[0][1]!==h[1])&&x.push(x[0]),o(s,x,v,g,y)}return s}function o(t,e,r,n,i){return e.length&&(e.area=r,e.dist=n,void 0!==i&&(e.outer=i),t.push(e)),[]}e.exports=n;var s=t("./feature")},{"./feature":137}],136:[function(t,e,r){"use strict";function n(t,e){var r=[];if("FeatureCollection"===t.type)for(var n=0;n<t.features.length;n++)i(r,t.features[n],e);else"Feature"===t.type?i(r,t,e):i(r,{geometry:t},e);return r}function i(t,e,r){if(null!==e.geometry){var n,s,l,c,h=e.geometry,f=h.type,d=h.coordinates,p=e.properties,m=e.id;if("Point"===f)t.push(u(p,1,[o(d)],m));else if("MultiPoint"===f)t.push(u(p,1,a(d),m));else if("LineString"===f)t.push(u(p,2,[a(d,r)],m));else if("MultiLineString"===f||"Polygon"===f){for(l=[],n=0;n<d.length;n++)c=a(d[n],r),"Polygon"===f&&(c.outer=0===n),l.push(c);t.push(u(p,"Polygon"===f?3:2,l,m))}else if("MultiPolygon"===f){for(l=[],n=0;n<d.length;n++)for(s=0;s<d[n].length;s++)c=a(d[n][s],r),c.outer=0===s,l.push(c);t.push(u(p,3,l,m))}else{if("GeometryCollection"!==f)throw new Error("Input data is not a valid GeoJSON object.");for(n=0;n<h.geometries.length;n++)i(t,{geometry:h.geometries[n],properties:p},r)}}}function a(t,e){for(var r=[],n=0;n<t.length;n++)r.push(o(t[n]));return e&&(l(r,e),s(r)),r}function o(t){var e=Math.sin(t[1]*Math.PI/180),r=t[0]/360+.5,n=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return n=n<0?0:n>1?1:n,[r,n,0]}function s(t){for(var e,r,n=0,i=0,a=0;a<t.length-1;a++)e=r||t[a],r=t[a+1],n+=e[0]*r[1]-r[0]*e[1],i+=Math.abs(r[0]-e[0])+Math.abs(r[1]-e[1]);t.area=Math.abs(n/2),t.dist=i}e.exports=n;var l=t("./simplify"),u=t("./feature")},{"./feature":137,"./simplify":139}],137:[function(t,e,r){"use strict";function n(t,e,r,n){var a={id:n||null,type:e,geometry:r,tags:t||null,min:[1/0,1/0],max:[-1/0,-1/0]};return i(a),a}function i(t){var e=t.geometry,r=t.min,n=t.max;if(1===t.type)a(r,n,e);else for(var i=0;i<e.length;i++)a(r,n,e[i]);return t}function a(t,e,r){for(var n,i=0;i<r.length;i++)n=r[i],t[0]=Math.min(n[0],t[0]),e[0]=Math.max(n[0],e[0]),t[1]=Math.min(n[1],t[1]),e[1]=Math.max(n[1],e[1])}e.exports=n},{}],138:[function(t,e,r){"use strict";function n(t,e){return new i(t,e)}function i(t,e){e=this.options=l(Object.create(this.options),e);var r=e.debug;r&&console.time("preprocess data");var n=1<<e.maxZoom,i=c(t,e.tolerance/(n*e.extent));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),i=d(i,e.buffer/e.extent,o),i.length&&this.splitTile(i,0,0,0),r&&(i.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 a(t,e,r){return 32*((1<<t)*r+e)+t}function o(t,e,r){return[r,(r-t[0])*(e[1]-t[1])/(e[0]-t[0])+t[1],1]}function s(t,e,r){return[(r-t[1])*(e[0]-t[0])/(e[1]-t[1])+t[0],r,1]}function l(t,e){for(var r in e)t[r]=e[r];return t}function u(t,e,r){var n=t.source;if(1!==n.length)return!1;var i=n[0];if(3!==i.type||i.geometry.length>1)return!1;var a=i.geometry[0].length;if(5!==a)return!1;for(var o=0;o<a;o++){var s=h.point(i.geometry[0][o],e,t.z2,t.x,t.y);if(s[0]!==-r&&s[0]!==e+r||s[1]!==-r&&s[1]!==e+r)return!1}return!0}e.exports=n;var c=t("./convert"),h=t("./transform"),f=t("./clip"),d=t("./wrap"),p=t("./tile");i.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,solidChildren:!1,tolerance:3,extent:4096,buffer:64,debug:0},i.prototype.splitTile=function(t,e,r,n,i,l,c){for(var h=[t,e,r,n],d=this.options,m=d.debug,v=null;h.length;){n=h.pop(),r=h.pop(),e=h.pop(),t=h.pop();var g=1<<e,y=a(e,r,n),b=this.tiles[y],x=e===d.maxZoom?0:d.tolerance/(g*d.extent);if(!b&&(m>1&&console.time("creation"),b=this.tiles[y]=p(t,g,r,n,x,e===d.maxZoom),this.tileCoords.push({z:e,x:r,y:n}),m)){m>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,r,n,b.numFeatures,b.numPoints,b.numSimplified),console.timeEnd("creation"));var _="z"+e;this.stats[_]=(this.stats[_]||0)+1,this.total++}if(b.source=t,i){if(e===d.maxZoom||e===i)continue;var w=1<<i-e;if(r!==Math.floor(l/w)||n!==Math.floor(c/w))continue}else if(e===d.indexMaxZoom||b.numPoints<=d.indexMaxPoints)continue;if(d.solidChildren||!u(b,d.extent,d.buffer)){b.source=null,m>1&&console.time("clipping");var M,k,A,T,S,E,L=.5*d.buffer/d.extent,C=.5-L,z=.5+L,D=1+L;M=k=A=T=null,S=f(t,g,r-L,r+z,0,o,b.min[0],b.max[0]),E=f(t,g,r+C,r+D,0,o,b.min[0],b.max[0]),S&&(M=f(S,g,n-L,n+z,1,s,b.min[1],b.max[1]),k=f(S,g,n+C,n+D,1,s,b.min[1],b.max[1])),E&&(A=f(E,g,n-L,n+z,1,s,b.min[1],b.max[1]),T=f(E,g,n+C,n+D,1,s,b.min[1],b.max[1])),m>1&&console.timeEnd("clipping"),t.length&&(h.push(M||[],e+1,2*r,2*n),h.push(k||[],e+1,2*r,2*n+1),h.push(A||[],e+1,2*r+1,2*n),h.push(T||[],e+1,2*r+1,2*n+1))}else i&&(v=e)}return v},i.prototype.getTile=function(t,e,r){var n=this.options,i=n.extent,o=n.debug,s=1<<t;e=(e%s+s)%s;var l=a(t,e,r);if(this.tiles[l])return h.tile(this.tiles[l],i);o>1&&console.log("drilling down to z%d-%d-%d",t,e,r);for(var c,f=t,d=e,p=r;!c&&f>0;)f--,d=Math.floor(d/2),p=Math.floor(p/2),c=this.tiles[a(f,d,p)];if(!c||!c.source)return null;if(o>1&&console.log("found parent tile z%d-%d-%d",f,d,p),u(c,i,n.buffer))return h.tile(c,i);o>1&&console.time("drilling down");var m=this.splitTile(c.source,f,d,p,t,e,r);if(o>1&&console.timeEnd("drilling down"),null!==m){var v=1<<t-m;l=a(m,Math.floor(e/v),Math.floor(r/v))}return this.tiles[l]?h.tile(this.tiles[l],i):null}},{"./clip":135,"./convert":136,"./tile":140,"./transform":141,"./wrap":142}],139:[function(t,e,r){"use strict";function n(t,e){var r,n,a,o,s=e*e,l=t.length,u=0,c=l-1,h=[];for(t[u][2]=1,t[c][2]=1;c;){for(n=0,r=u+1;r<c;r++)(a=i(t[r],t[u],t[c]))>n&&(o=r,n=a);n>s?(t[o][2]=n,h.push(u),h.push(o),u=o):(c=h.pop(),u=h.pop())}}function i(t,e,r){var n=e[0],i=e[1],a=r[0],o=r[1],s=t[0],l=t[1],u=a-n,c=o-i;if(0!==u||0!==c){var h=((s-n)*u+(l-i)*c)/(u*u+c*c);h>1?(n=a,i=o):h>0&&(n+=u*h,i+=c*h)}return u=s-n,c=l-i,u*u+c*c}e.exports=n},{}],140:[function(t,e,r){"use strict";function n(t,e,r,n,a,o){for(var s={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:r,y:n,z2:e,transformed:!1,min:[2,1],max:[-1,0]},l=0;l<t.length;l++){s.numFeatures++,i(s,t[l],a,o);var u=t[l].min,c=t[l].max;u[0]<s.min[0]&&(s.min[0]=u[0]),u[1]<s.min[1]&&(s.min[1]=u[1]),c[0]>s.max[0]&&(s.max[0]=c[0]),c[1]>s.max[1]&&(s.max[1]=c[1])}return s}function i(t,e,r,n){var i,o,s,l,u=e.geometry,c=e.type,h=[],f=r*r;if(1===c)for(i=0;i<u.length;i++)h.push(u[i]),t.numPoints++,t.numSimplified++;else for(i=0;i<u.length;i++)if(s=u[i],n||!(2===c&&s.dist<r||3===c&&s.area<f)){var d=[];for(o=0;o<s.length;o++)l=s[o],(n||l[2]>f)&&(d.push(l),t.numSimplified++),t.numPoints++;3===c&&a(d,s.outer),h.push(d)}else t.numPoints+=s.length;if(h.length){var p={geometry:h,type:c,tags:e.tags||null};null!==e.id&&(p.id=e.id),t.features.push(p)}}function a(t,e){o(t)<0===e&&t.reverse()}function o(t){for(var e,r,n=0,i=0,a=t.length,o=a-1;i<a;o=i++)e=t[i],r=t[o],n+=(r[0]-e[0])*(e[1]+r[1]);return n}e.exports=n},{}],141:[function(t,e,r){"use strict";function n(t,e){if(t.transformed)return t;var r,n,a,o=t.z2,s=t.x,l=t.y;for(r=0;r<t.features.length;r++){var u=t.features[r],c=u.geometry;if(1===u.type)for(n=0;n<c.length;n++)c[n]=i(c[n],e,o,s,l);else for(n=0;n<c.length;n++){var h=c[n];for(a=0;a<h.length;a++)h[a]=i(h[a],e,o,s,l)}}return t.transformed=!0,t}function i(t,e,r,n,i){return[Math.round(e*(t[0]*r-n)),Math.round(e*(t[1]*r-i))]}r.tile=n,r.point=i},{}],142:[function(t,e,r){"use strict";function n(t,e,r){var n=t,a=o(t,1,-1-e,e,0,r,-1,2),s=o(t,1,1-e,2+e,0,r,-1,2);return(a||s)&&(n=o(t,1,-e,1+e,0,r,-1,2)||[],a&&(n=i(a,1).concat(n)),s&&(n=n.concat(i(s,-1)))),n}function i(t,e){for(var r=[],n=0;n<t.length;n++){var i,o=t[n],l=o.type;if(1===l)i=a(o.geometry,e);else{i=[];for(var u=0;u<o.geometry.length;u++)i.push(a(o.geometry[u],e))}r.push(s(o.tags,l,i,o.id))}return r}function a(t,e){var r=[];r.area=t.area,r.dist=t.dist;for(var n=0;n<t.length;n++)r.push([t[n][0]+e,t[n][1],t[n][2]]);return r}var o=t("./clip"),s=t("./feature");e.exports=n},{"./clip":135,"./feature":137}],143:[function(t,e,r){function n(t,e){if("string"!=typeof t)throw new TypeError("must specify type string");if(e=e||{},"undefined"==typeof document&&!e.canvas)return null;var r=e.canvas||document.createElement("canvas");"number"==typeof e.width&&(r.width=e.width),"number"==typeof e.height&&(r.height=e.height);var n,i=e;try{var a=[t];0===t.indexOf("webgl")&&a.push("experimental-"+t);for(var o=0;o<a.length;o++)if(n=r.getContext(a[o],i))return n}catch(t){n=null}return n||null}e.exports=n},{}],144:[function(t,e,r){"use strict";function n(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function i(t){this.gl=t,this.pixelRatio=1,this.bounds=[[-10,-10,-10],[10,10,10]],this.ticks=[[],[],[]],this.autoTicks=!0,this.tickSpacing=[1,1,1],this.tickEnable=[!0,!0,!0],this.tickFont=["sans-serif","sans-serif","sans-serif"],this.tickSize=[12,12,12],this.tickAngle=[0,0,0],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickPad=[10,10,10],this.lastCubeProps={cubeEdges:[0,0,0],axis:[0,0,0]},this.labels=["x","y","z"],this.labelEnable=[!0,!0,!0],this.labelFont="sans-serif",this.labelSize=[20,20,20],this.labelAngle=[0,0,0],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labelPad=[10,10,10],this.lineEnable=[!0,!0,!0],this.lineMirror=[!1,!1,!1],this.lineWidth=[1,1,1],this.lineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.lineTickEnable=[!0,!0,!0],this.lineTickMirror=[!1,!1,!1],this.lineTickLength=[0,0,0],this.lineTickWidth=[1,1,1],this.lineTickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.gridEnable=[!0,!0,!0],this.gridWidth=[1,1,1],this.gridColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroEnable=[!0,!0,!0],this.zeroLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroLineWidth=[2,2,2],this.backgroundEnable=[!1,!1,!1],this.backgroundColor=[[.8,.8,.8,.5],[.8,.8,.8,.5],[.8,.8,.8,.5]],this._firstInit=!0,this._text=null,this._lines=null,this._background=c(t)}function a(){this.primalOffset=[0,0,0],this.primalMinor=[0,0,0],this.mirrorOffset=[0,0,0],this.mirrorMinor=[0,0,0]}function o(t,e,r,n,i){for(var a=t.primalOffset,o=t.primalMinor,s=t.mirrorOffset,l=t.mirrorMinor,u=n[e],c=0;c<3;++c)if(e!==c){var h=a,f=s,d=o,p=l;u&1<<c&&(h=s,f=a,d=l,p=o),h[c]=r[0][c],f[c]=r[1][c],i[c]>0?(d[c]=-1,p[c]=0):(d[c]=0,p[c]=1)}}function s(t,e){var r=new i(t);return r.update(e),r}e.exports=s;var l=t("./lib/text.js"),u=t("./lib/lines.js"),c=t("./lib/background.js"),h=t("./lib/cube.js"),f=t("./lib/ticks.js"),d=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),p=i.prototype;p.update=function(t){function e(e,r,n){if(n in t){var i,a=t[n],o=this[n];(e?Array.isArray(a)&&Array.isArray(a[0]):Array.isArray(a))?this[n]=i=[r(a[0]),r(a[1]),r(a[2])]:this[n]=i=[r(a),r(a),r(a)];for(var s=0;s<3;++s)if(i[s]!==o[s])return!0}return!1}t=t||{};var r,n=e.bind(this,!1,Number),i=e.bind(this,!1,Boolean),a=e.bind(this,!1,String),o=e.bind(this,!0,function(t){if(Array.isArray(t)){if(3===t.length)return[+t[0],+t[1],+t[2],1];if(4===t.length)return[+t[0],+t[1],+t[2],+t[3]]}return[0,0,0,1]}),s=!1,c=!1;if("bounds"in t)for(var h=t.bounds,d=0;d<2;++d)for(var p=0;p<3;++p)h[d][p]!==this.bounds[d][p]&&(c=!0),this.bounds[d][p]=h[d][p];if("ticks"in t){r=t.ticks,s=!0,this.autoTicks=!1;for(var d=0;d<3;++d)this.tickSpacing[d]=0}else n("tickSpacing")&&(this.autoTicks=!0,c=!0);if(this._firstInit&&("ticks"in t||"tickSpacing"in t||(this.autoTicks=!0),c=!0,s=!0,this._firstInit=!1),c&&this.autoTicks&&(r=f.create(this.bounds,this.tickSpacing),s=!0),s){for(var d=0;d<3;++d)r[d].sort(function(t,e){return t.x-e.x});f.equal(r,this.ticks)?s=!1:this.ticks=r}i("tickEnable"),a("tickFont")&&(s=!0),n("tickSize"),n("tickAngle"),n("tickPad"),o("tickColor");var m=a("labels");a("labelFont")&&(m=!0),i("labelEnable"),n("labelSize"),n("labelPad"),o("labelColor"),i("lineEnable"),i("lineMirror"),n("lineWidth"),o("lineColor"),i("lineTickEnable"),i("lineTickMirror"),n("lineTickLength"),n("lineTickWidth"),o("lineTickColor"),i("gridEnable"),n("gridWidth"),o("gridColor"),i("zeroEnable"),o("zeroLineColor"),
20 n("zeroLineWidth"),i("backgroundEnable"),o("backgroundColor"),this._text?this._text&&(m||s)&&this._text.update(this.bounds,this.labels,this.labelFont,this.ticks,this.tickFont):this._text=l(this.gl,this.bounds,this.labels,this.labelFont,this.ticks,this.tickFont),this._lines&&s&&(this._lines.dispose(),this._lines=null),this._lines||(this._lines=u(this.gl,this.bounds,this.ticks))};var m=[new a,new a,new a],v=[0,0,0],g={model:d,view:d,projection:d};p.isOpaque=function(){return!0},p.isTransparent=function(){return!1},p.drawTransparent=function(t){};var y=[0,0,0],b=[0,0,0],x=[0,0,0];p.draw=function(t){t=t||g;for(var e=this.gl,r=t.model||d,i=t.view||d,a=t.projection||d,s=this.bounds,l=h(r,i,a,s),u=l.cubeEdges,c=l.axis,f=i[12],p=i[13],_=i[14],w=i[15],M=this.pixelRatio*(a[3]*f+a[7]*p+a[11]*_+a[15]*w)/e.drawingBufferHeight,k=0;k<3;++k)this.lastCubeProps.cubeEdges[k]=u[k],this.lastCubeProps.axis[k]=c[k];for(var A=m,k=0;k<3;++k)o(m[k],k,this.bounds,u,c);for(var e=this.gl,T=v,k=0;k<3;++k)this.backgroundEnable[k]?T[k]=c[k]:T[k]=0;this._background.draw(r,i,a,s,T,this.backgroundColor),this._lines.bind(r,i,a,this);for(var k=0;k<3;++k){var S=[0,0,0];c[k]>0?S[k]=s[1][k]:S[k]=s[0][k];for(var E=0;E<2;++E){var L=(k+1+E)%3,C=(k+1+(1^E))%3;this.gridEnable[L]&&this._lines.drawGrid(L,C,this.bounds,S,this.gridColor[L],this.gridWidth[L]*this.pixelRatio)}for(var E=0;E<2;++E){var L=(k+1+E)%3,C=(k+1+(1^E))%3;this.zeroEnable[C]&&s[0][C]<=0&&s[1][C]>=0&&this._lines.drawZero(L,C,this.bounds,S,this.zeroLineColor[C],this.zeroLineWidth[C]*this.pixelRatio)}}for(var k=0;k<3;++k){this.lineEnable[k]&&this._lines.drawAxisLine(k,this.bounds,A[k].primalOffset,this.lineColor[k],this.lineWidth[k]*this.pixelRatio),this.lineMirror[k]&&this._lines.drawAxisLine(k,this.bounds,A[k].mirrorOffset,this.lineColor[k],this.lineWidth[k]*this.pixelRatio);for(var z=n(y,A[k].primalMinor),D=n(b,A[k].mirrorMinor),I=this.lineTickLength,E=0;E<3;++E){var P=M/r[5*E];z[E]*=I[E]*P,D[E]*=I[E]*P}this.lineTickEnable[k]&&this._lines.drawAxisTicks(k,A[k].primalOffset,z,this.lineTickColor[k],this.lineTickWidth[k]*this.pixelRatio),this.lineTickMirror[k]&&this._lines.drawAxisTicks(k,A[k].mirrorOffset,D,this.lineTickColor[k],this.lineTickWidth[k]*this.pixelRatio)}this._text.bind(r,i,a,this.pixelRatio);for(var k=0;k<3;++k){for(var O=A[k].primalMinor,j=n(x,A[k].primalOffset),E=0;E<3;++E)this.lineTickEnable[k]&&(j[E]+=M*O[E]*Math.max(this.lineTickLength[E],0)/r[5*E]);if(this.tickEnable[k]){for(var E=0;E<3;++E)j[E]+=M*O[E]*this.tickPad[E]/r[5*E];this._text.drawTicks(k,this.tickSize[k],this.tickAngle[k],j,this.tickColor[k])}if(this.labelEnable[k]){for(var E=0;E<3;++E)j[E]+=M*O[E]*this.labelPad[E]/r[5*E];j[k]+=.5*(s[0][k]+s[1][k]),this._text.drawLabel(k,this.labelSize[k],this.labelAngle[k],j,this.labelColor[k])}}},p.dispose=function(){this._text.dispose(),this._lines.dispose(),this._background.dispose(),this._lines=null,this._text=null,this._background=null,this.gl=null}},{"./lib/background.js":145,"./lib/cube.js":146,"./lib/lines.js":147,"./lib/text.js":149,"./lib/ticks.js":150}],145:[function(t,e,r){"use strict";function n(t,e,r,n){this.gl=t,this.buffer=e,this.vao=r,this.shader=n}function i(t){for(var e=[],r=[],i=0,l=0;l<3;++l)for(var u=(l+1)%3,c=(l+2)%3,h=[0,0,0],f=[0,0,0],d=-1;d<=1;d+=2){r.push(i,i+2,i+1,i+1,i+2,i+3),h[l]=d,f[l]=d;for(var p=-1;p<=1;p+=2){h[u]=p;for(var m=-1;m<=1;m+=2)h[c]=m,e.push(h[0],h[1],h[2],f[0],f[1],f[2]),i+=1}var v=u;u=c,c=v}var g=a(t,new Float32Array(e)),y=a(t,new Uint16Array(r),t.ELEMENT_ARRAY_BUFFER),b=o(t,[{buffer:g,type:t.FLOAT,size:3,offset:0,stride:24},{buffer:g,type:t.FLOAT,size:3,offset:12,stride:24}],y),x=s(t);return x.attributes.position.location=0,x.attributes.normal.location=1,new n(t,g,b,x)}e.exports=i;var a=t("gl-buffer"),o=t("gl-vao"),s=t("./shaders").bg,l=n.prototype;l.draw=function(t,e,r,n,i,a){for(var o=!1,s=0;s<3;++s)o=o||i[s];if(o){var l=this.gl;l.enable(l.POLYGON_OFFSET_FILL),l.polygonOffset(1,2),this.shader.bind(),this.shader.uniforms={model:t,view:e,projection:r,bounds:n,enable:i,colors:a},this.vao.bind(),this.vao.draw(this.gl.TRIANGLES,36),l.disable(l.POLYGON_OFFSET_FILL)}},l.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},{"./shaders":148,"gl-buffer":152,"gl-vao":266}],146:[function(t,e,r){"use strict";function n(t,e,r){for(var n=0;n<4;++n){t[n]=r[12+n];for(var i=0;i<3;++i)t[n]+=e[i]*r[4*i+n]}}function i(t){for(var e=0;e<m.length;++e)if(t=l.positive(t,m[e]),t.length<3)return 0;for(var r=t[0],n=r[0]/r[3],i=r[1]/r[3],a=0,e=1;e+1<t.length;++e){var o=t[e],s=t[e+1],u=o[0]/o[3],c=o[1]/o[3],h=s[0]/s[3],f=s[1]/s[3],d=u-n,p=c-i,v=h-n,g=f-i;a+=Math.abs(d*g-p*v)}return a}function a(t,e,r,a){s(c,e,t),s(c,r,c);for(var l=0,m=0;m<2;++m){d[2]=a[m][2];for(var b=0;b<2;++b){d[1]=a[b][1];for(var x=0;x<2;++x)d[0]=a[x][0],n(h[l],d,c),l+=1}}for(var _=-1,m=0;m<8;++m){for(var w=h[m][3],M=0;M<3;++M)f[m][M]=h[m][M]/w;w<0&&(_<0?_=m:f[m][2]<f[_][2]&&(_=m))}if(_<0){_=0;for(var k=0;k<3;++k){for(var A=(k+2)%3,T=(k+1)%3,S=-1,E=-1,L=0;L<2;++L){var C=L<<k,z=C+(L<<A)+(1-L<<T),D=C+(1-L<<A)+(L<<T);u(f[C],f[z],f[D],p)<0||(L?S=1:E=1)}if(S<0||E<0)E>S&&(_|=1<<k);else{for(var L=0;L<2;++L){var C=L<<k,z=C+(L<<A)+(1-L<<T),D=C+(1-L<<A)+(L<<T),I=i([h[C],h[z],h[D],h[C+(1<<A)+(1<<T)]]);L?S=I:E=I}E>S&&(_|=1<<k)}}}for(var P=7^_,O=-1,m=0;m<8;++m)m!==_&&m!==P&&(O<0?O=m:f[O][1]>f[m][1]&&(O=m));for(var j=-1,m=0;m<3;++m){var F=O^1<<m;if(F!==_&&F!==P){j<0&&(j=F);var T=f[F];T[0]<f[j][0]&&(j=F)}}for(var R=-1,m=0;m<3;++m){var F=O^1<<m;if(F!==_&&F!==P&&F!==j){R<0&&(R=F);var T=f[F];T[0]>f[R][0]&&(R=F)}}var N=v;N[0]=N[1]=N[2]=0,N[o.log2(j^O)]=O&j,N[o.log2(O^R)]=O&R;var B=7^R;B===_||B===P?(B=7^j,N[o.log2(R^B)]=B&R):N[o.log2(j^B)]=B&j;for(var U=g,V=_,k=0;k<3;++k)U[k]=V&1<<k?-1:1;return y}e.exports=a;var o=t("bit-twiddle"),s=t("gl-mat4/multiply"),l=(t("gl-mat4/invert"),t("split-polygon")),u=t("robust-orientation"),c=new Array(16),h=(new Array(16),new Array(8)),f=new Array(8),d=new Array(3),p=[0,0,0];!function(){for(var t=0;t<8;++t)h[t]=[1,1,1,1],f[t]=[1,1,1]}();var m=[[0,0,1,0,0],[0,0,-1,1,0],[0,-1,0,1,0],[0,1,0,1,0],[-1,0,0,1,0],[1,0,0,1,0]],v=[1,1,1],g=[0,0,0],y={cubeEdges:v,axis:g}},{"bit-twiddle":63,"gl-mat4/invert":176,"gl-mat4/multiply":178,"robust-orientation":500,"split-polygon":518}],147:[function(t,e,r){"use strict";function n(t){return t[0]=t[1]=t[2]=0,t}function i(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function a(t,e,r,n,i,a,o,s){this.gl=t,this.vertBuffer=e,this.vao=r,this.shader=n,this.tickCount=i,this.tickOffset=a,this.gridCount=o,this.gridOffset=s}function o(t,e,r){var n=[],i=[0,0,0],o=[0,0,0],c=[0,0,0],h=[0,0,0];n.push(0,0,1,0,1,1,0,0,-1,0,0,-1,0,1,1,0,1,-1);for(var f=0;f<3;++f){for(var d=n.length/3|0,p=0;p<r[f].length;++p){var m=+r[f][p].x;n.push(m,0,1,m,1,1,m,0,-1,m,0,-1,m,1,1,m,1,-1)}var v=n.length/3|0;i[f]=d,o[f]=v-d;for(var d=n.length/3|0,g=0;g<r[f].length;++g){var m=+r[f][g].x;n.push(m,0,1,m,1,1,m,0,-1,m,0,-1,m,1,1,m,1,-1)}var v=n.length/3|0;c[f]=d,h[f]=v-d}var y=s(t,new Float32Array(n)),b=l(t,[{buffer:y,type:t.FLOAT,size:3,stride:0,offset:0}]),x=u(t);return x.attributes.position.location=0,new a(t,y,b,x,o,i,h,c)}e.exports=o;var s=t("gl-buffer"),l=t("gl-vao"),u=t("./shaders").line,c=[0,0,0],h=[0,0,0],f=[0,0,0],d=[0,0,0],p=[1,1],m=a.prototype;m.bind=function(t,e,r){this.shader.bind(),this.shader.uniforms.model=t,this.shader.uniforms.view=e,this.shader.uniforms.projection=r,p[0]=this.gl.drawingBufferWidth,p[1]=this.gl.drawingBufferHeight,this.shader.uniforms.screenShape=p,this.vao.bind()},m.drawAxisLine=function(t,e,r,a,o){var s=n(h);this.shader.uniforms.majorAxis=h,s[t]=e[1][t]-e[0][t],this.shader.uniforms.minorAxis=s;var l=i(d,r);l[t]+=e[0][t],this.shader.uniforms.offset=l,this.shader.uniforms.lineWidth=o,this.shader.uniforms.color=a;var u=n(f);u[(t+2)%3]=1,this.shader.uniforms.screenAxis=u,this.vao.draw(this.gl.TRIANGLES,6);var u=n(f);u[(t+1)%3]=1,this.shader.uniforms.screenAxis=u,this.vao.draw(this.gl.TRIANGLES,6)},m.drawAxisTicks=function(t,e,r,i,a){if(this.tickCount[t]){var o=n(c);o[t]=1,this.shader.uniforms.majorAxis=o,this.shader.uniforms.offset=e,this.shader.uniforms.minorAxis=r,this.shader.uniforms.color=i,this.shader.uniforms.lineWidth=a;var s=n(f);s[t]=1,this.shader.uniforms.screenAxis=s,this.vao.draw(this.gl.TRIANGLES,this.tickCount[t],this.tickOffset[t])}},m.drawGrid=function(t,e,r,a,o,s){if(this.gridCount[t]){var l=n(h);l[e]=r[1][e]-r[0][e],this.shader.uniforms.minorAxis=l;var u=i(d,a);u[e]+=r[0][e],this.shader.uniforms.offset=u;var p=n(c);p[t]=1,this.shader.uniforms.majorAxis=p;var m=n(f);m[t]=1,this.shader.uniforms.screenAxis=m,this.shader.uniforms.lineWidth=s,this.shader.uniforms.color=o,this.vao.draw(this.gl.TRIANGLES,this.gridCount[t],this.gridOffset[t])}},m.drawZero=function(t,e,r,a,o,s){var l=n(h);this.shader.uniforms.majorAxis=l,l[t]=r[1][t]-r[0][t],this.shader.uniforms.minorAxis=l;var u=i(d,a);u[t]+=r[0][t],this.shader.uniforms.offset=u;var c=n(f);c[e]=1,this.shader.uniforms.screenAxis=c,this.shader.uniforms.lineWidth=s,this.shader.uniforms.color=o,this.vao.draw(this.gl.TRIANGLES,6)},m.dispose=function(){this.vao.dispose(),this.vertBuffer.dispose(),this.shader.dispose()}},{"./shaders":148,"gl-buffer":152,"gl-vao":266}],148:[function(t,e,r){"use strict";var n=t("gl-shader");r.line=function(t){return n(t,"#define GLSLIFY 1\nattribute vec3 position;\n\nuniform mat4 model, view, projection;\nuniform vec3 offset, majorAxis, minorAxis, screenAxis;\nuniform float lineWidth;\nuniform vec2 screenShape;\n\nvec3 project(vec3 p) {\n vec4 pp = projection * view * model * vec4(p, 1.0);\n return pp.xyz / max(pp.w, 0.0001);\n}\n\nvoid main() {\n vec3 major = position.x * majorAxis;\n vec3 minor = position.y * minorAxis;\n\n vec3 vPosition = major + minor + offset;\n vec3 pPosition = project(vPosition);\n vec3 offset = project(vPosition + screenAxis * position.z);\n\n vec2 screen = normalize((offset - pPosition).xy * screenShape) / screenShape;\n\n gl_Position = vec4(pPosition + vec3(0.5 * screen * lineWidth, 0), 1.0);\n}\n","precision mediump float;\n#define GLSLIFY 1\nuniform vec4 color;\nvoid main() {\n gl_FragColor = color;\n}",null,[{name:"position",type:"vec3"}])};r.text=function(t){return n(t,"#define GLSLIFY 1\nattribute vec3 position;\n\nuniform mat4 model, view, projection;\nuniform vec3 offset, axis;\nuniform float scale, angle, pixelScale;\nuniform vec2 resolution;\n\nvoid main() { \n //Compute plane offset\n vec2 planeCoord = position.xy * pixelScale;\n mat2 planeXform = scale * mat2(cos(angle), sin(angle),\n -sin(angle), cos(angle));\n vec2 viewOffset = 2.0 * planeXform * planeCoord / resolution;\n\n //Compute world offset\n float axisDistance = position.z;\n vec3 dataPosition = axisDistance * axis + offset;\n vec4 worldPosition = model * vec4(dataPosition, 1);\n \n //Compute clip position\n vec4 viewPosition = view * worldPosition;\n vec4 clipPosition = projection * viewPosition;\n clipPosition /= clipPosition.w;\n\n //Apply text offset in clip coordinates\n clipPosition += vec4(viewOffset, 0, 0);\n\n //Done\n gl_Position = clipPosition;\n}","precision mediump float;\n#define GLSLIFY 1\nuniform vec4 color;\nvoid main() {\n gl_FragColor = color;\n}",null,[{name:"position",type:"vec3"}])};r.bg=function(t){return n(t,"#define GLSLIFY 1\nattribute vec3 position;\nattribute vec3 normal;\n\nuniform mat4 model, view, projection;\nuniform vec3 enable;\nuniform vec3 bounds[2];\n\nvarying vec3 colorChannel;\n\nvoid main() {\n if(dot(normal, enable) > 0.0) {\n vec3 nPosition = mix(bounds[0], bounds[1], 0.5 * (position + 1.0));\n gl_Position = projection * view * model * vec4(nPosition, 1.0);\n } else {\n gl_Position = vec4(0,0,0,0);\n }\n colorChannel = abs(normal);\n}","precision mediump float;\n#define GLSLIFY 1\n\nuniform vec4 colors[3];\n\nvarying vec3 colorChannel;\n\nvoid main() {\n gl_FragColor = colorChannel.x * colors[0] + \n colorChannel.y * colors[1] +\n colorChannel.z * colors[2];\n}",null,[{name:"position",type:"vec3"},{name:"normal",type:"vec3"}])}},{"gl-shader":250}],149:[function(t,e,r){(function(r){"use strict";function n(t,e,r,n){this.gl=t,this.shader=e,this.buffer=r,this.vao=n,this.tickOffset=this.tickCount=this.labelOffset=this.labelCount=null}function i(t,e){try{return l(t,e)}catch(t){return console.warn("error vectorizing text:",t),{cells:[],positions:[]}}}function a(t,e,r,i,a,l){var c=o(t),h=s(t,[{buffer:c,size:3}]),f=u(t);f.attributes.position.location=0;var d=new n(t,f,c,h);return d.update(e,r,i,a,l),d}e.exports=a;var o=t("gl-buffer"),s=t("gl-vao"),l=t("vectorize-text"),u=t("./shaders").text,c=window||r.global||{},h=c.__TEXT_CACHE||{};c.__TEXT_CACHE={};var f=n.prototype,d=[0,0];f.bind=function(t,e,r,n){this.vao.bind(),this.shader.bind();var i=this.shader.uniforms;i.model=t,i.view=e,i.projection=r,i.pixelScale=n,d[0]=this.gl.drawingBufferWidth,d[1]=this.gl.drawingBufferHeight,this.shader.uniforms.resolution=d},f.update=function(t,e,r,n,a){function o(t,e,r,n){var a=h[r];a||(a=h[r]={});var o=a[e];o||(o=a[e]=i(e,{triangles:!0,font:r,textAlign:"center",textBaseline:"middle"}));for(var l=(n||12)/12,u=o.positions,c=o.cells,f=0,d=c.length;f<d;++f)for(var p=c[f],m=2;m>=0;--m){var v=u[p[m]];s.push(l*v[0],-l*v[1],t)}}for(var s=(this.gl,[]),l=[0,0,0],u=[0,0,0],c=[0,0,0],f=[0,0,0],d=0;d<3;++d){c[d]=s.length/3|0,o(.5*(t[0][d]+t[1][d]),e[d],r),f[d]=(s.length/3|0)-c[d],l[d]=s.length/3|0;for(var p=0;p<n[d].length;++p)n[d][p].text&&o(n[d][p].x,n[d][p].text,n[d][p].font||a,n[d][p].fontSize||12);u[d]=(s.length/3|0)-l[d]}this.buffer.update(s),this.tickOffset=l,this.tickCount=u,this.labelOffset=c,this.labelCount=f};var p=[0,0,0];f.drawTicks=function(t,e,r,n,i){if(this.tickCount[t]){var a=p;a[0]=a[1]=a[2]=0,a[t]=1,this.shader.uniforms.axis=a,this.shader.uniforms.color=i,this.shader.uniforms.angle=r,this.shader.uniforms.scale=e,this.shader.uniforms.offset=n,this.vao.draw(this.gl.TRIANGLES,this.tickCount[t],this.tickOffset[t])}};var m=[0,0,0];f.drawLabel=function(t,e,r,n,i){this.labelCount[t]&&(this.shader.uniforms.axis=m,this.shader.uniforms.color=i,this.shader.uniforms.angle=r,this.shader.uniforms.scale=e,this.shader.uniforms.offset=n,this.vao.draw(this.gl.TRIANGLES,this.labelCount[t],this.labelOffset[t]))},f.dispose=function(){this.shader.dispose(),this.vao.dispose(),this.buffer.dispose()}}).call(this,t("_process"))},{"./shaders":148,_process:479,"gl-buffer":152,"gl-vao":266,"vectorize-text":546}],150:[function(t,e,r){"use strict";function n(t,e){var r=t+"",n=r.indexOf("."),i=0;n>=0&&(i=r.length-n-1);var a=Math.pow(10,i),o=Math.round(t*e*a),s=o+"";if(s.indexOf("e")>=0)return s;var l=o/a,u=o%a;o<0?(l=0|-Math.ceil(l),u=0|-u):(l=0|Math.floor(l),u|=0);var c=""+l;if(o<0&&(c="-"+c),i){for(var h=""+u;h.length<i;)h="0"+h;return c+"."+h}return c}function i(t,e){for(var r=[],i=0;i<3;++i){for(var a=[],o=(t[0][i],t[1][i],0);o*e[i]<=t[1][i];++o)a.push({x:o*e[i],text:n(e[i],o)});for(var o=-1;o*e[i]>=t[0][i];--o)a.push({x:o*e[i],text:n(e[i],o)});r.push(a)}return r}function a(t,e){for(var r=0;r<3;++r){if(t[r].length!==e[r].length)return!1;for(var n=0;n<t[r].length;++n){var i=t[r][n],a=e[r][n];if(i.x!==a.x||i.text!==a.text||i.font!==a.font||i.fontColor!==a.fontColor||i.fontSize!==a.fontSize||i.dx!==a.dx||i.dy!==a.dy)return!1}}return!0}r.create=i,r.equal=a},{}],151:[function(t,e,r){"use strict";function n(t,e,r){this.lo=t,this.hi=e,this.pixelsPerDataUnit=r}function i(t,e,r,n,i){for(var a=0;a<3;++a){for(var o=p,s=m,l=0;l<3;++l)s[l]=o[l]=r[l];s[3]=o[3]=1,s[a]+=1,h(s,s,e),s[3]<0&&(t[a]=1/0),o[a]-=1,h(o,o,e),o[3]<0&&(t[a]=1/0);var u=(o[0]/o[3]-s[0]/s[3])*n,c=(o[1]/o[3]-s[1]/s[3])*i;t[a]=.25*Math.sqrt(u*u+c*c)}return t}function a(t,e,r,n,a){var h=e.model||f,p=e.view||f,m=e.projection||f,y=t.bounds,a=a||l(h,p,m,y),b=a.axis;a.edges;u(d,p,h),u(d,m,d);for(var x=v,_=0;_<3;++_)x[_].lo=1/0,x[_].hi=-1/0,x[_].pixelsPerDataUnit=1/0;var w=o(c(d,d));c(d,d);for(var M=0;M<3;++M){var k=(M+1)%3,A=(M+2)%3,T=g;t:for(var _=0;_<2;++_){var S=[];if(b[M]<0!=!!_){T[M]=y[_][M];for(var E=0;E<2;++E){T[k]=y[E^_][k];for(var L=0;L<2;++L)T[A]=y[L^E^_][A],S.push(T.slice())}for(var E=0;E<w.length;++E){if(0===S.length)continue t;S=s.positive(S,w[E])}for(var E=0;E<S.length;++E)for(var A=S[E],C=i(g,d,A,r,n),L=0;L<3;++L)x[L].lo=Math.min(x[L].lo,A[L]),x[L].hi=Math.max(x[L].hi,A[L]),L!==M&&(x[L].pixelsPerDataUnit=Math.min(x[L].pixelsPerDataUnit,Math.abs(C[L])))}}}return x}e.exports=a;var o=t("extract-frustum-planes"),s=t("split-polygon"),l=t("./lib/cube.js"),u=t("gl-mat4/multiply"),c=t("gl-mat4/transpose"),h=t("gl-vec4/transformMat4"),f=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),d=new Float32Array(16),p=[0,0,0,1],m=[0,0,0,1],v=[new n(1/0,-1/0,1/0),new n(1/0,-1/0,1/0),new n(1/0,-1/0,1/0)],g=[0,0,0]},{"./lib/cube.js":146,"extract-frustum-planes":126,"gl-mat4/multiply":178,"gl-mat4/transpose":186,"gl-vec4/transformMat4":272,"split-polygon":518}],152:[function(t,e,r){"use strict";function n(t,e,r,n,i){this.gl=t,this.type=e,this.handle=r,this.length=n,this.usage=i}function i(t,e,r,n,i,a){var o=i.length*i.BYTES_PER_ELEMENT;if(a<0)return t.bufferData(e,i,n),o;if(o+a>r)throw new Error("gl-buffer: If resizing buffer, must not specify offset");return t.bufferSubData(e,a,i),r}function a(t,e){for(var r=l.malloc(t.length,e),n=t.length,i=0;i<n;++i)r[i]=t[i];return r}function o(t,e){for(var r=1,n=e.length-1;n>=0;--n){if(e[n]!==r)return!1;r*=t[n]}return!0}function s(t,e,r,i){if(r=r||t.ARRAY_BUFFER,i=i||t.DYNAMIC_DRAW,r!==t.ARRAY_BUFFER&&r!==t.ELEMENT_ARRAY_BUFFER)throw new Error("gl-buffer: Invalid type for webgl buffer, must be either gl.ARRAY_BUFFER or gl.ELEMENT_ARRAY_BUFFER");if(i!==t.DYNAMIC_DRAW&&i!==t.STATIC_DRAW&&i!==t.STREAM_DRAW)throw new Error("gl-buffer: Invalid usage for buffer, must be either gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW");var a=t.createBuffer(),o=new n(t,r,a,0,i);return o.update(e),o}var l=t("typedarray-pool"),u=t("ndarray-ops"),c=t("ndarray"),h=["uint8","uint8_clamped","uint16","uint32","int8","int16","int32","float32"],f=n.prototype;f.bind=function(){this.gl.bindBuffer(this.type,this.handle)},f.unbind=function(){this.gl.bindBuffer(this.type,null)},f.dispose=function(){this.gl.deleteBuffer(this.handle)},f.update=function(t,e){if("number"!=typeof e&&(e=-1),this.bind(),"object"==typeof t&&void 0!==t.shape){var r=t.dtype;if(h.indexOf(r)<0&&(r="float32"),this.type===this.gl.ELEMENT_ARRAY_BUFFER){r=gl.getExtension("OES_element_index_uint")&&"uint16"!==r?"uint32":"uint16"}if(r===t.dtype&&o(t.shape,t.stride))0===t.offset&&t.data.length===t.shape[0]?this.length=i(this.gl,this.type,this.length,this.usage,t.data,e):this.length=i(this.gl,this.type,this.length,this.usage,t.data.subarray(t.offset,t.shape[0]),e);else{var n=l.malloc(t.size,r),s=c(n,t.shape);u.assign(s,t),this.length=e<0?i(this.gl,this.type,this.length,this.usage,n,e):i(this.gl,this.type,this.length,this.usage,n.subarray(0,t.size),e),l.free(n)}}else if(Array.isArray(t)){var f;f=this.type===this.gl.ELEMENT_ARRAY_BUFFER?a(t,"uint16"):a(t,"float32"),this.length=e<0?i(this.gl,this.type,this.length,this.usage,f,e):i(this.gl,this.type,this.length,this.usage,f.subarray(0,t.length),e),l.free(f)}else if("object"==typeof t&&"number"==typeof t.length)this.length=i(this.gl,this.type,this.length,this.usage,t,e);else{if("number"!=typeof t&&void 0!==t)throw new Error("gl-buffer: Invalid data type");if(e>=0)throw new Error("gl-buffer: Cannot specify offset when resizing buffer");t|=0,t<=0&&(t=1),this.gl.bufferData(this.type,0|t,this.usage),this.length=t}},e.exports=s},{ndarray:460,"ndarray-ops":454,"typedarray-pool":533}],153:[function(t,e,r){e.exports={0:"NONE",1:"ONE",2:"LINE_LOOP",3:"LINE_STRIP",4:"TRIANGLES",5:"TRIANGLE_STRIP",6:"TRIANGLE_FAN",256:"DEPTH_BUFFER_BIT",512:"NEVER",513:"LESS",514:"EQUAL",515:"LEQUAL",516:"GREATER",517:"NOTEQUAL",518:"GEQUAL",519:"ALWAYS",768:"SRC_COLOR",769:"ONE_MINUS_SRC_COLOR",770:"SRC_ALPHA",771:"ONE_MINUS_SRC_ALPHA",772:"DST_ALPHA",773:"ONE_MINUS_DST_ALPHA",774:"DST_COLOR",775:"ONE_MINUS_DST_COLOR",776:"SRC_ALPHA_SATURATE",1024:"STENCIL_BUFFER_BIT",1028:"FRONT",1029:"BACK",1032:"FRONT_AND_BACK",1280:"INVALID_ENUM",1281:"INVALID_VALUE",1282:"INVALID_OPERATION",1285:"OUT_OF_MEMORY",1286:"INVALID_FRAMEBUFFER_OPERATION",2304:"CW",2305:"CCW",2849:"LINE_WIDTH",2884:"CULL_FACE",2885:"CULL_FACE_MODE",2886:"FRONT_FACE",2928:"DEPTH_RANGE",2929:"DEPTH_TEST",2930:"DEPTH_WRITEMASK",2931:"DEPTH_CLEAR_VALUE",2932:"DEPTH_FUNC",2960:"STENCIL_TEST",2961:"STENCIL_CLEAR_VALUE",2962:"STENCIL_FUNC",2963:"STENCIL_VALUE_MASK",2964:"STENCIL_FAIL",2965:"STENCIL_PASS_DEPTH_FAIL",2966:"STENCIL_PASS_DEPTH_PASS",2967:"STENCIL_REF",2968:"STENCIL_WRITEMASK",2978:"VIEWPORT",3024:"DITHER",3042:"BLEND",3088:"SCISSOR_BOX",3089:"SCISSOR_TEST",3106:"COLOR_CLEAR_VALUE",3107:"COLOR_WRITEMASK",3317:"UNPACK_ALIGNMENT",3333:"PACK_ALIGNMENT",3379:"MAX_TEXTURE_SIZE",3386:"MAX_VIEWPORT_DIMS",3408:"SUBPIXEL_BITS",3410:"RED_BITS",3411:"GREEN_BITS",3412:"BLUE_BITS",3413:"ALPHA_BITS",3414:"DEPTH_BITS",3415:"STENCIL_BITS",3553:"TEXTURE_2D",4352:"DONT_CARE",4353:"FASTEST",4354:"NICEST",5120:"BYTE",5121:"UNSIGNED_BYTE",5122:"SHORT",5123:"UNSIGNED_SHORT",5124:"INT",5125:"UNSIGNED_INT",5126:"FLOAT",5386:"INVERT",5890:"TEXTURE",6401:"STENCIL_INDEX",6402:"DEPTH_COMPONENT",6406:"ALPHA",6407:"RGB",6408:"RGBA",6409:"LUMINANCE",6410:"LUMINANCE_ALPHA",7680:"KEEP",7681:"REPLACE",7682:"INCR",7683:"DECR",7936:"VENDOR",7937:"RENDERER",7938:"VERSION",9728:"NEAREST",9729:"LINEAR",9984:"NEAREST_MIPMAP_NEAREST",9985:"LINEAR_MIPMAP_NEAREST",9986:"NEAREST_MIPMAP_LINEAR",9987:"LINEAR_MIPMAP_LINEAR",10240:"TEXTURE_MAG_FILTER",10241:"TEXTURE_MIN_FILTER",10242:"TEXTURE_WRAP_S",10243:"TEXTURE_WRAP_T",10497:"REPEAT",10752:"POLYGON_OFFSET_UNITS",16384:"COLOR_BUFFER_BIT",32769:"CONSTANT_COLOR",32770:"ONE_MINUS_CONSTANT_COLOR",32771:"CONSTANT_ALPHA",32772:"ONE_MINUS_CONSTANT_ALPHA",32773:"BLEND_COLOR",32774:"FUNC_ADD",32777:"BLEND_EQUATION_RGB",32778:"FUNC_SUBTRACT",32779:"FUNC_REVERSE_SUBTRACT",32819:"UNSIGNED_SHORT_4_4_4_4",32820:"UNSIGNED_SHORT_5_5_5_1",32823:"POLYGON_OFFSET_FILL",32824:"POLYGON_OFFSET_FACTOR",32854:"RGBA4",32855:"RGB5_A1",32873:"TEXTURE_BINDING_2D",32926:"SAMPLE_ALPHA_TO_COVERAGE",32928:"SAMPLE_COVERAGE",32936:"SAMPLE_BUFFERS",32937:"SAMPLES",32938:"SAMPLE_COVERAGE_VALUE",32939:"SAMPLE_COVERAGE_INVERT",32968:"BLEND_DST_RGB",32969:"BLEND_SRC_RGB",32970:"BLEND_DST_ALPHA",32971:"BLEND_SRC_ALPHA",33071:"CLAMP_TO_EDGE",33170:"GENERATE_MIPMAP_HINT",33189:"DEPTH_COMPONENT16",33306:"DEPTH_STENCIL_ATTACHMENT",33635:"UNSIGNED_SHORT_5_6_5",33648:"MIRRORED_REPEAT",33901:"ALIASED_POINT_SIZE_RANGE",33902:"ALIASED_LINE_WIDTH_RANGE",33984:"TEXTURE0",33985:"TEXTURE1",33986:"TEXTURE2",33987:"TEXTURE3",33988:"TEXTURE4",33989:"TEXTURE5",33990:"TEXTURE6",33991:"TEXTURE7",33992:"TEXTURE8",33993:"TEXTURE9",33994:"TEXTURE10",33995:"TEXTURE11",33996:"TEXTURE12",33997:"TEXTURE13",33998:"TEXTURE14",33999:"TEXTURE15",34e3:"TEXTURE16",34001:"TEXTURE17",34002:"TEXTURE18",34003:"TEXTURE19",34004:"TEXTURE20",34005:"TEXTURE21",34006:"TEXTURE22",34007:"TEXTURE23",34008:"TEXTURE24",34009:"TEXTURE25",34010:"TEXTURE26",34011:"TEXTURE27",34012:"TEXTURE28",34013:"TEXTURE29",34014:"TEXTURE30",34015:"TEXTURE31",34016:"ACTIVE_TEXTURE",34024:"MAX_RENDERBUFFER_SIZE",34041:"DEPTH_STENCIL",34055:"INCR_WRAP",34056:"DECR_WRAP",34067:"TEXTURE_CUBE_MAP",34068:"TEXTURE_BINDING_CUBE_MAP",34069:"TEXTURE_CUBE_MAP_POSITIVE_X",34070:"TEXTURE_CUBE_MAP_NEGATIVE_X",34071:"TEXTURE_CUBE_MAP_POSITIVE_Y",34072:"TEXTURE_CUBE_MAP_NEGATIVE_Y",34073:"TEXTURE_CUBE_MAP_POSITIVE_Z",34074:"TEXTURE_CUBE_MAP_NEGATIVE_Z",34076:"MAX_CUBE_MAP_TEXTURE_SIZE",34338:"VERTEX_ATTRIB_ARRAY_ENABLED",34339:"VERTEX_ATTRIB_ARRAY_SIZE",34340:"VERTEX_ATTRIB_ARRAY_STRIDE",34341:"VERTEX_ATTRIB_ARRAY_TYPE",34342:"CURRENT_VERTEX_ATTRIB",34373:"VERTEX_ATTRIB_ARRAY_POINTER",34466:"NUM_COMPRESSED_TEXTURE_FORMATS",34467:"COMPRESSED_TEXTURE_FORMATS",34660:"BUFFER_SIZE",34661:"BUFFER_USAGE",34816:"STENCIL_BACK_FUNC",34817:"STENCIL_BACK_FAIL",34818:"STENCIL_BACK_PASS_DEPTH_FAIL",34819:"STENCIL_BACK_PASS_DEPTH_PASS",34877:"BLEND_EQUATION_ALPHA",34921:"MAX_VERTEX_ATTRIBS",34922:"VERTEX_ATTRIB_ARRAY_NORMALIZED",34930:"MAX_TEXTURE_IMAGE_UNITS",34962:"ARRAY_BUFFER",34963:"ELEMENT_ARRAY_BUFFER",34964:"ARRAY_BUFFER_BINDING",34965:"ELEMENT_ARRAY_BUFFER_BINDING",34975:"VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",35040:"STREAM_DRAW",35044:"STATIC_DRAW",35048:"DYNAMIC_DRAW",35632:"FRAGMENT_SHADER",35633:"VERTEX_SHADER",35660:"MAX_VERTEX_TEXTURE_IMAGE_UNITS",35661:"MAX_COMBINED_TEXTURE_IMAGE_UNITS",35663:"SHADER_TYPE",35664:"FLOAT_VEC2",35665:"FLOAT_VEC3",35666:"FLOAT_VEC4",35667:"INT_VEC2",35668:"INT_VEC3",35669:"INT_VEC4",35670:"BOOL",35671:"BOOL_VEC2",35672:"BOOL_VEC3",35673:"BOOL_VEC4",35674:"FLOAT_MAT2",35675:"FLOAT_MAT3",35676:"FLOAT_MAT4",35678:"SAMPLER_2D",35680:"SAMPLER_CUBE",35712:"DELETE_STATUS",35713:"COMPILE_STATUS",35714:"LINK_STATUS",35715:"VALIDATE_STATUS",35716:"INFO_LOG_LENGTH",35717:"ATTACHED_SHADERS",35718:"ACTIVE_UNIFORMS",35719:"ACTIVE_UNIFORM_MAX_LENGTH",35720:"SHADER_SOURCE_LENGTH",35721:"ACTIVE_ATTRIBUTES",35722:"ACTIVE_ATTRIBUTE_MAX_LENGTH",35724:"SHADING_LANGUAGE_VERSION",35725:"CURRENT_PROGRAM",36003:"STENCIL_BACK_REF",36004:"STENCIL_BACK_VALUE_MASK",36005:"STENCIL_BACK_WRITEMASK",36006:"FRAMEBUFFER_BINDING",36007:"RENDERBUFFER_BINDING",36048:"FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",36049:"FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",36050:"FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",36051:"FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",36053:"FRAMEBUFFER_COMPLETE",36054:"FRAMEBUFFER_INCOMPLETE_ATTACHMENT",36055:"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",36057:"FRAMEBUFFER_INCOMPLETE_DIMENSIONS",36061:"FRAMEBUFFER_UNSUPPORTED",36064:"COLOR_ATTACHMENT0",36096:"DEPTH_ATTACHMENT",36128:"STENCIL_ATTACHMENT",36160:"FRAMEBUFFER",36161:"RENDERBUFFER",36162:"RENDERBUFFER_WIDTH",36163:"RENDERBUFFER_HEIGHT",36164:"RENDERBUFFER_INTERNAL_FORMAT",36168:"STENCIL_INDEX8",36176:"RENDERBUFFER_RED_SIZE",36177:"RENDERBUFFER_GREEN_SIZE",36178:"RENDERBUFFER_BLUE_SIZE",36179:"RENDERBUFFER_ALPHA_SIZE",36180:"RENDERBUFFER_DEPTH_SIZE",36181:"RENDERBUFFER_STENCIL_SIZE",36194:"RGB565",36336:"LOW_FLOAT",36337:"MEDIUM_FLOAT",36338:"HIGH_FLOAT",36339:"LOW_INT",36340:"MEDIUM_INT",36341:"HIGH_INT",36346:"SHADER_COMPILER",36347:"MAX_VERTEX_UNIFORM_VECTORS",36348:"MAX_VARYING_VECTORS",36349:"MAX_FRAGMENT_UNIFORM_VECTORS",37440:"UNPACK_FLIP_Y_WEBGL",37441:"UNPACK_PREMULTIPLY_ALPHA_WEBGL",37442:"CONTEXT_LOST_WEBGL",37443:"UNPACK_COLORSPACE_CONVERSION_WEBGL",37444:"BROWSER_DEFAULT_WEBGL"}},{}],154:[function(t,e,r){var n=t("./1.0/numbers");e.exports=function(t){return n[t]}},{"./1.0/numbers":153}],155:[function(t,e,r){"use strict";function n(t,e,r,n){this.plot=t,this.shader=e,this.bufferHi=r,this.bufferLo=n,this.bounds=[1/0,1/0,-1/0,-1/0],this.numPoints=0,this.color=[0,0,0,1]}function i(t,e){var r=a(t.gl,l.vertex,l.fragment),i=o(t.gl),s=o(t.gl),u=new n(t,r,i,s);return u.update(e),t.addObject(u),u}var a=t("gl-shader"),o=t("gl-buffer"),s=t("typedarray-pool"),l=t("./lib/shaders");e.exports=i;var u=[[1,0,0,1,0,0],[1,0,0,-1,0,0],[-1,0,0,-1,0,0],[-1,0,0,-1,0,0],[-1,0,0,1,0,0],[1,0,0,1,0,0],[1,0,-1,0,0,1],[1,0,-1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,1],[1,0,-1,0,0,1],[-1,0,-1,0,0,1],[-1,0,-1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,1],[-1,0,-1,0,0,1],[0,1,1,0,0,0],[0,1,-1,0,0,0],[0,-1,-1,0,0,0],[0,-1,-1,0,0,0],[0,1,1,0,0,0],[0,-1,1,0,0,0],[0,1,0,-1,1,0],[0,1,0,-1,-1,0],[0,1,0,1,-1,0],[0,1,0,1,1,0],[0,1,0,-1,1,0],[0,1,0,1,-1,0],[0,-1,0,-1,1,0],[0,-1,0,-1,-1,0],[0,-1,0,1,-1,0],[0,-1,0,1,1,0],[0,-1,0,-1,1,0],[0,-1,0,1,-1,0]],c=n.prototype;c.draw=function(){var t=new Float32Array([0,0]),e=new Float32Array([0,0]),r=new Float32Array([0,0]),n=new Float32Array([0,0]),i=[1,1];return function(){var a=this.plot,o=this.shader,s=this.bounds,l=this.numPoints;if(l){var c=a.gl,h=a.dataBox,f=a.viewBox,d=a.pixelRatio,p=s[2]-s[0],m=s[3]-s[1],v=h[2]-h[0],g=h[3]-h[1],y=2*p/v,b=2*m/g,x=(s[0]-h[0]-.5*v)/p,_=(s[1]-h[1]-.5*g)/m;t[0]=y,t[1]=b,e[0]=y-t[0],e[1]=b-t[1],r[0]=x,r[1]=_,n[0]=x-r[0],n[1]=_-r[1];var w=f[2]-f[0],M=f[3]-f[1];i[0]=2*d/w,i[1]=2*d/M,o.bind(),o.uniforms.scaleHi=t,o.uniforms.scaleLo=e,o.uniforms.translateHi=r,o.uniforms.translateLo=n,o.uniforms.pixelScale=i,o.uniforms.color=this.color,this.bufferLo.bind(),o.attributes.positionLo.pointer(c.FLOAT,!1,16,0),this.bufferHi.bind(),o.attributes.positionHi.pointer(c.FLOAT,!1,16,0),o.attributes.pixelOffset.pointer(c.FLOAT,!1,16,8),c.drawArrays(c.TRIANGLES,0,l*u.length)}}}(),c.drawPick=function(t){return t},c.pick=function(){return null},c.update=function(t){t=t||{};var e,r,n,i=t.positions||[],a=t.errors||[],o=1;"lineWidth"in t&&(o=+t.lineWidth);var l=5;"capSize"in t&&(l=+t.capSize),this.color=(t.color||[0,0,0,1]).slice();var c=this.bounds=[1/0,1/0,-1/0,-1/0],h=this.numPoints=i.length>>1;for(e=0;e<h;++e)r=i[2*e],n=i[2*e+1],c[0]=Math.min(r,c[0]),c[1]=Math.min(n,c[1]),c[2]=Math.max(r,c[2]),c[3]=Math.max(n,c[3]);c[2]===c[0]&&(c[2]+=1),c[3]===c[1]&&(c[3]+=1);var f=1/(c[2]-c[0]),d=1/(c[3]-c[1]),p=c[0],m=c[1],v=s.mallocFloat64(h*u.length*4),g=s.mallocFloat32(h*u.length*4),y=s.mallocFloat32(h*u.length*4),b=0;for(e=0;e<h;++e){r=i[2*e],n=i[2*e+1];for(var x=a[4*e],_=a[4*e+1],w=a[4*e+2],M=a[4*e+3],k=0;k<u.length;++k){var A=u[k],T=A[0],S=A[1];T<0?T*=x:T>0&&(T*=_),S<0?S*=w:S>0&&(S*=M),v[b++]=f*(r-p+T),v[b++]=d*(n-m+S),v[b++]=o*A[2]+(l+o)*A[4],v[b++]=o*A[3]+(l+o)*A[5]}}for(e=0;e<v.length;e++)g[e]=v[e],y[e]=v[e]-g[e];this.bufferHi.update(g),this.bufferLo.update(y),s.free(v)},c.dispose=function(){this.plot.removeObject(this),this.shader.dispose(),this.bufferHi.dispose(),this.bufferLo.dispose()}},{"./lib/shaders":156,"gl-buffer":152,"gl-shader":250,"typedarray-pool":533}],156:[function(t,e,r){e.exports={vertex:"precision highp float;\n#define GLSLIFY 1\n\nattribute vec2 positionHi;\nattribute vec2 positionLo;\nattribute vec2 pixelOffset;\n\nuniform vec2 scaleHi, scaleLo, translateHi, translateLo, pixelScale;\n\nvec2 project(vec2 scHi, vec2 trHi, vec2 scLo, vec2 trLo, vec2 posHi, vec2 posLo) {\n return (posHi + trHi) * scHi\n + (posLo + trLo) * scHi\n + (posHi + trHi) * scLo\n + (posLo + trLo) * scLo;\n}\n\nvoid main() {\n vec3 scrPosition = vec3(\n project(scaleHi, translateHi, scaleLo, translateLo, positionHi, positionLo),\n 1);\n gl_Position = vec4(\n scrPosition.xy + scrPosition.z * pixelScale * pixelOffset,\n 0,\n scrPosition.z);\n}\n",fragment:"precision mediump float;\n#define GLSLIFY 1\n\nuniform vec4 color;\n\nvoid main() {\n gl_FragColor = vec4(color.rgb * color.a, color.a);\n}\n"}},{}],157:[function(t,e,r){"use strict";function n(t,e,r,n){this.gl=t,this.shader=n,this.buffer=e,this.vao=r,this.pixelRatio=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lineWidth=[1,1,1],this.capSize=[10,10,10],this.lineCount=[0,0,0],this.lineOffset=[0,0,0],this.opacity=1}function i(t,e){for(var r=0;r<3;++r)t[0][r]=Math.min(t[0][r],e[r]),t[1][r]=Math.max(t[1][r],e[r])}function a(t,e,r,n){for(var i=f[n],a=0;a<i.length;++a){var o=i[a];t.push(e[0],e[1],e[2],r[0],r[1],r[2],r[3],o[0],o[1],o[2])}return i.length}function o(t){var e=t.gl,r=s(e),i=l(e,[{buffer:r,type:e.FLOAT,size:3,offset:0,stride:40},{buffer:r,type:e.FLOAT,size:4,offset:12,stride:40},{buffer:r,type:e.FLOAT,size:3,offset:28,stride:40}]),a=u(e);a.attributes.position.location=0,a.attributes.color.location=1,a.attributes.offset.location=2;var o=new n(e,r,i,a);return o.update(t),o}e.exports=o;var s=t("gl-buffer"),l=t("gl-vao"),u=t("./shaders/index"),c=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],h=n.prototype;h.isOpaque=function(){return this.opacity>=1},h.isTransparent=function(){return this.opacity<1},h.drawTransparent=h.draw=function(t){var e=this.gl,r=this.shader.uniforms;this.shader.bind();var n=r.view=t.view||c,i=r.projection=t.projection||c;r.model=t.model||c,r.clipBounds=this.clipBounds,r.opacity=this.opacity
21 ;var a=n[12],o=n[13],s=n[14],l=n[15],u=this.pixelRatio*(i[3]*a+i[7]*o+i[11]*s+i[15]*l)/e.drawingBufferHeight;this.vao.bind();for(var h=0;h<3;++h)e.lineWidth(this.lineWidth[h]),r.capSize=this.capSize[h]*u,e.drawArrays(e.LINES,this.lineOffset[h],this.lineCount[h]);this.vao.unbind()};var f=function(){for(var t=new Array(3),e=0;e<3;++e){for(var r=[],n=1;n<=2;++n)for(var i=-1;i<=1;i+=2){var a=(n+e)%3,o=[0,0,0];o[a]=i,r.push(o)}t[e]=r}return t}();h.update=function(t){t=t||{},"lineWidth"in t&&(this.lineWidth=t.lineWidth,Array.isArray(this.lineWidth)||(this.lineWidth=[this.lineWidth,this.lineWidth,this.lineWidth])),"capSize"in t&&(this.capSize=t.capSize,Array.isArray(this.capSize)||(this.capSize=[this.capSize,this.capSize,this.capSize])),"opacity"in t&&(this.opacity=t.opacity);var e=t.color||[[0,0,0],[0,0,0],[0,0,0]],r=t.position,n=t.error;if(Array.isArray(e[0])||(e=[e,e,e]),r&&n){var o=[],s=r.length,l=0;this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.lineCount=[0,0,0];for(var u=0;u<3;++u){this.lineOffset[u]=l;t:for(var c=0;c<s;++c){for(var h=r[c],f=0;f<3;++f)if(isNaN(h[f])||!isFinite(h[f]))continue t;var d=n[c],p=e[u];if(Array.isArray(p[0])&&(p=e[c]),3===p.length&&(p=[p[0],p[1],p[2],1]),!isNaN(d[0][u])&&!isNaN(d[1][u])){if(d[0][u]<0){var m=h.slice();m[u]+=d[0][u],o.push(h[0],h[1],h[2],p[0],p[1],p[2],p[3],0,0,0,m[0],m[1],m[2],p[0],p[1],p[2],p[3],0,0,0),i(this.bounds,m),l+=2+a(o,m,p,u)}if(d[1][u]>0){var m=h.slice();m[u]+=d[1][u],o.push(h[0],h[1],h[2],p[0],p[1],p[2],p[3],0,0,0,m[0],m[1],m[2],p[0],p[1],p[2],p[3],0,0,0),i(this.bounds,m),l+=2+a(o,m,p,u)}}}this.lineCount[u]=l-this.lineOffset[u]}this.buffer.update(o)}},h.dispose=function(){this.shader.dispose(),this.buffer.dispose(),this.vao.dispose()}},{"./shaders/index":158,"gl-buffer":152,"gl-vao":266}],158:[function(t,e,r){"use strict";var n=t("gl-shader");e.exports=function(t){return n(t,"precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position, offset;\nattribute vec4 color;\nuniform mat4 model, view, projection;\nuniform float capSize;\nvarying vec4 fragColor;\nvarying vec3 fragPosition;\n\nvoid main() {\n vec4 worldPosition = model * vec4(position, 1.0);\n worldPosition = (worldPosition / worldPosition.w) + vec4(capSize * offset, 0.0);\n gl_Position = projection * view * worldPosition;\n fragColor = color;\n fragPosition = position;\n}","precision mediump float;\n#define GLSLIFY 1\nuniform vec3 clipBounds[2];\nuniform float opacity;\nvarying vec3 fragPosition;\nvarying vec4 fragColor;\n\nvoid main() {\n if(any(lessThan(fragPosition, clipBounds[0])) || any(greaterThan(fragPosition, clipBounds[1]))) {\n discard;\n }\n gl_FragColor = opacity * fragColor;\n}",null,[{name:"position",type:"vec3"},{name:"offset",type:"vec3"},{name:"color",type:"vec4"}])}},{"gl-shader":250}],159:[function(t,e,r){"use strict";function n(t){return[t.getParameter(t.FRAMEBUFFER_BINDING),t.getParameter(t.RENDERBUFFER_BINDING),t.getParameter(t.TEXTURE_BINDING_2D)]}function i(t,e){t.bindFramebuffer(t.FRAMEBUFFER,e[0]),t.bindRenderbuffer(t.RENDERBUFFER,e[1]),t.bindTexture(t.TEXTURE_2D,e[2])}function a(t,e){var r=t.getParameter(e.MAX_COLOR_ATTACHMENTS_WEBGL);y=new Array(r+1);for(var n=0;n<=r;++n){for(var i=new Array(r),a=0;a<n;++a)i[a]=t.COLOR_ATTACHMENT0+a;for(var a=n;a<r;++a)i[a]=t.NONE;y[n]=i}}function o(t){switch(t){case p:throw new Error("gl-fbo: Framebuffer unsupported");case m:throw new Error("gl-fbo: Framebuffer incomplete attachment");case v:throw new Error("gl-fbo: Framebuffer incomplete dimensions");case g:throw new Error("gl-fbo: Framebuffer incomplete missing attachment");default:throw new Error("gl-fbo: Framebuffer failed for unspecified reason")}}function s(t,e,r,n,i,a){if(!n)return null;var o=d(t,e,r,i,n);return o.magFilter=t.NEAREST,o.minFilter=t.NEAREST,o.mipSamples=1,o.bind(),t.framebufferTexture2D(t.FRAMEBUFFER,a,t.TEXTURE_2D,o.handle,0),o}function l(t,e,r,n,i){var a=t.createRenderbuffer();return t.bindRenderbuffer(t.RENDERBUFFER,a),t.renderbufferStorage(t.RENDERBUFFER,n,e,r),t.framebufferRenderbuffer(t.FRAMEBUFFER,i,t.RENDERBUFFER,a),a}function u(t){var e=n(t.gl),r=t.gl,a=t.handle=r.createFramebuffer(),u=t._shape[0],c=t._shape[1],h=t.color.length,f=t._ext,d=t._useStencil,p=t._useDepth,m=t._colorType;r.bindFramebuffer(r.FRAMEBUFFER,a);for(var v=0;v<h;++v)t.color[v]=s(r,u,c,m,r.RGBA,r.COLOR_ATTACHMENT0+v);0===h?(t._color_rb=l(r,u,c,r.RGBA4,r.COLOR_ATTACHMENT0),f&&f.drawBuffersWEBGL(y[0])):h>1&&f.drawBuffersWEBGL(y[h]);var g=r.getExtension("WEBGL_depth_texture");g?d?t.depth=s(r,u,c,g.UNSIGNED_INT_24_8_WEBGL,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):p&&(t.depth=s(r,u,c,r.UNSIGNED_SHORT,r.DEPTH_COMPONENT,r.DEPTH_ATTACHMENT)):p&&d?t._depth_rb=l(r,u,c,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):p?t._depth_rb=l(r,u,c,r.DEPTH_COMPONENT16,r.DEPTH_ATTACHMENT):d&&(t._depth_rb=l(r,u,c,r.STENCIL_INDEX,r.STENCIL_ATTACHMENT));var b=r.checkFramebufferStatus(r.FRAMEBUFFER);if(b!==r.FRAMEBUFFER_COMPLETE){t._destroyed=!0,r.bindFramebuffer(r.FRAMEBUFFER,null),r.deleteFramebuffer(t.handle),t.handle=null,t.depth&&(t.depth.dispose(),t.depth=null),t._depth_rb&&(r.deleteRenderbuffer(t._depth_rb),t._depth_rb=null);for(var v=0;v<t.color.length;++v)t.color[v].dispose(),t.color[v]=null;t._color_rb&&(r.deleteRenderbuffer(t._color_rb),t._color_rb=null),i(r,e),o(b)}i(r,e)}function c(t,e,r,n,i,a,o,s){this.gl=t,this._shape=[0|e,0|r],this._destroyed=!1,this._ext=s,this.color=new Array(i);for(var l=0;l<i;++l)this.color[l]=null;this._color_rb=null,this.depth=null,this._depth_rb=null,this._colorType=n,this._useDepth=a,this._useStencil=o;var c=this,h=[0|e,0|r];Object.defineProperties(h,{0:{get:function(){return c._shape[0]},set:function(t){return c.width=t}},1:{get:function(){return c._shape[1]},set:function(t){return c.height=t}}}),this._shapeVector=h,u(this)}function h(t,e,r){if(t._destroyed)throw new Error("gl-fbo: Can't resize destroyed FBO");if(t._shape[0]!==e||t._shape[1]!==r){var a=t.gl,s=a.getParameter(a.MAX_RENDERBUFFER_SIZE);if(e<0||e>s||r<0||r>s)throw new Error("gl-fbo: Can't resize FBO, invalid dimensions");t._shape[0]=e,t._shape[1]=r;for(var l=n(a),u=0;u<t.color.length;++u)t.color[u].shape=t._shape;t._color_rb&&(a.bindRenderbuffer(a.RENDERBUFFER,t._color_rb),a.renderbufferStorage(a.RENDERBUFFER,a.RGBA4,t._shape[0],t._shape[1])),t.depth&&(t.depth.shape=t._shape),t._depth_rb&&(a.bindRenderbuffer(a.RENDERBUFFER,t._depth_rb),t._useDepth&&t._useStencil?a.renderbufferStorage(a.RENDERBUFFER,a.DEPTH_STENCIL,t._shape[0],t._shape[1]):t._useDepth?a.renderbufferStorage(a.RENDERBUFFER,a.DEPTH_COMPONENT16,t._shape[0],t._shape[1]):t._useStencil&&a.renderbufferStorage(a.RENDERBUFFER,a.STENCIL_INDEX,t._shape[0],t._shape[1])),a.bindFramebuffer(a.FRAMEBUFFER,t.handle);var c=a.checkFramebufferStatus(a.FRAMEBUFFER);c!==a.FRAMEBUFFER_COMPLETE&&(t.dispose(),i(a,l),o(c)),i(a,l)}}function f(t,e,r,n){p||(p=t.FRAMEBUFFER_UNSUPPORTED,m=t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT,v=t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS,g=t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT);var i=t.getExtension("WEBGL_draw_buffers");if(!y&&i&&a(t,i),Array.isArray(e)&&(n=r,r=0|e[1],e=0|e[0]),"number"!=typeof e)throw new Error("gl-fbo: Missing shape parameter");var o=t.getParameter(t.MAX_RENDERBUFFER_SIZE);if(e<0||e>o||r<0||r>o)throw new Error("gl-fbo: Parameters are too large for FBO");n=n||{};var s=1;if("color"in n){if((s=Math.max(0|n.color,0))<0)throw new Error("gl-fbo: Must specify a nonnegative number of colors");if(s>1){if(!i)throw new Error("gl-fbo: Multiple draw buffer extension not supported");if(s>t.getParameter(i.MAX_COLOR_ATTACHMENTS_WEBGL))throw new Error("gl-fbo: Context does not support "+s+" draw buffers")}}var l=t.UNSIGNED_BYTE,u=t.getExtension("OES_texture_float");if(n.float&&s>0){if(!u)throw new Error("gl-fbo: Context does not support floating point textures");l=t.FLOAT}else n.preferFloat&&s>0&&u&&(l=t.FLOAT);var h=!0;"depth"in n&&(h=!!n.depth);var f=!1;return"stencil"in n&&(f=!!n.stencil),new c(t,e,r,l,s,h,f,i)}var d=t("gl-texture2d");e.exports=f;var p,m,v,g,y=null,b=c.prototype;Object.defineProperties(b,{shape:{get:function(){return this._destroyed?[0,0]:this._shapeVector},set:function(t){if(Array.isArray(t)||(t=[0|t,0|t]),2!==t.length)throw new Error("gl-fbo: Shape vector must be length 2");var e=0|t[0],r=0|t[1];return h(this,e,r),[e,r]},enumerable:!1},width:{get:function(){return this._destroyed?0:this._shape[0]},set:function(t){return t|=0,h(this,t,this._shape[1]),t},enumerable:!1},height:{get:function(){return this._destroyed?0:this._shape[1]},set:function(t){return t|=0,h(this,this._shape[0],t),t},enumerable:!1}}),b.bind=function(){if(!this._destroyed){var t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,this.handle),t.viewport(0,0,this._shape[0],this._shape[1])}},b.dispose=function(){if(!this._destroyed){this._destroyed=!0;var t=this.gl;t.deleteFramebuffer(this.handle),this.handle=null,this.depth&&(this.depth.dispose(),this.depth=null),this._depth_rb&&(t.deleteRenderbuffer(this._depth_rb),this._depth_rb=null);for(var e=0;e<this.color.length;++e)this.color[e].dispose(),this.color[e]=null;this._color_rb&&(t.deleteRenderbuffer(this._color_rb),this._color_rb=null)}}},{"gl-texture2d":262}],160:[function(t,e,r){function n(t,e,r){"use strict";var n=o(e)||"of unknown name (see npm glsl-shader-name)",l="unknown type";void 0!==r&&(l=r===a.FRAGMENT_SHADER?"fragment":"vertex");for(var u=i("Error compiling %s shader %s:\n",l,n),c=i("%s%s",u,t),h=t.split("\n"),f={},d=0;d<h.length;d++){var p=h[d];if(""!==p){var m=parseInt(p.split(":")[2]);if(isNaN(m))throw new Error(i("Could not parse error: %s",p));f[m]=p}}for(var v=s(e).split("\n"),d=0;d<v.length;d++)if(f[d+3]||f[d+2]||f[d+1]){var g=v[d];if(u+=g+"\n",f[d+1]){var y=f[d+1];y=y.substr(y.split(":",3).join(":").length+1).trim(),u+=i("^^^ %s\n\n",y)}}return{long:u.trim(),short:c.trim()}}var i=t("sprintf-js").sprintf,a=t("gl-constants/lookup"),o=t("glsl-shader-name"),s=t("add-line-numbers");e.exports=n},{"add-line-numbers":38,"gl-constants/lookup":154,"glsl-shader-name":274,"sprintf-js":519}],161:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o){this.plot=t,this.shader=e,this.pickShader=r,this.positionBuffer=n,this.weightBuffer=i,this.colorBuffer=a,this.idBuffer=o,this.xData=[],this.yData=[],this.shape=[0,0],this.bounds=[1/0,1/0,-1/0,-1/0],this.pickOffset=0}function i(t,e){var r=t.gl,i=l(r,c.vertex,c.fragment),a=l(r,c.pickVertex,c.pickFragment),o=u(r),s=u(r),h=u(r),f=u(r),d=new n(t,i,a,o,s,h,f);return d.update(e),t.addObject(d),d}e.exports=i;var a=t("binary-search-bounds"),o=t("iota-array"),s=t("typedarray-pool"),l=t("gl-shader"),u=t("gl-buffer"),c=t("./lib/shaders"),h=n.prototype,f=[0,0,1,0,0,1,1,0,1,1,0,1];h.draw=function(){var t=[1,0,0,0,1,0,0,0,1];return function(){var e=this.plot,r=this.shader,n=this.bounds,i=this.numVertices;if(!(i<=0)){var a=e.gl,o=e.dataBox,s=n[2]-n[0],l=n[3]-n[1],u=o[2]-o[0],c=o[3]-o[1];t[0]=2*s/u,t[4]=2*l/c,t[6]=2*(n[0]-o[0])/u-1,t[7]=2*(n[1]-o[1])/c-1,r.bind();var h=r.uniforms;h.viewTransform=t,h.shape=this.shape;var f=r.attributes;this.positionBuffer.bind(),f.position.pointer(),this.weightBuffer.bind(),f.weight.pointer(a.UNSIGNED_BYTE,!1),this.colorBuffer.bind(),f.color.pointer(a.UNSIGNED_BYTE,!0),a.drawArrays(a.TRIANGLES,0,i)}}}(),h.drawPick=function(){var t=[1,0,0,0,1,0,0,0,1],e=[0,0,0,0];return function(r){var n=this.plot,i=this.pickShader,a=this.bounds,o=this.numVertices;if(!(o<=0)){var s=n.gl,l=n.dataBox,u=a[2]-a[0],c=a[3]-a[1],h=l[2]-l[0],f=l[3]-l[1];t[0]=2*u/h,t[4]=2*c/f,t[6]=2*(a[0]-l[0])/h-1,t[7]=2*(a[1]-l[1])/f-1;for(var d=0;d<4;++d)e[d]=r>>8*d&255;this.pickOffset=r,i.bind();var p=i.uniforms;p.viewTransform=t,p.pickOffset=e,p.shape=this.shape;var m=i.attributes;return this.positionBuffer.bind(),m.position.pointer(),this.weightBuffer.bind(),m.weight.pointer(s.UNSIGNED_BYTE,!1),this.idBuffer.bind(),m.pickId.pointer(s.UNSIGNED_BYTE,!1),s.drawArrays(s.TRIANGLES,0,o),r+this.shape[0]*this.shape[1]}}}(),h.pick=function(t,e,r){var n=this.pickOffset,i=this.shape[0]*this.shape[1];if(r<n||r>=n+i)return null;var a=r-n,o=this.xData,s=this.yData;return{object:this,pointId:a,dataCoord:[o[a%this.shape[0]],s[a/this.shape[0]|0]]}},h.update=function(t){t=t||{};var e=t.shape||[0,0],r=t.x||o(e[0]),n=t.y||o(e[1]),i=t.z||new Float32Array(e[0]*e[1]);this.xData=r,this.yData=n;var l=t.colorLevels||[0],u=t.colorValues||[0,0,0,1],c=l.length,h=this.bounds,d=h[0]=r[0],p=h[1]=n[0],m=h[2]=r[r.length-1],v=h[3]=n[n.length-1],g=1/(m-d),y=1/(v-p),b=e[0],x=e[1];this.shape=[b,x];var _=(b-1)*(x-1)*(f.length>>>1);this.numVertices=_;for(var w=s.mallocUint8(4*_),M=s.mallocFloat32(2*_),k=s.mallocUint8(2*_),A=s.mallocUint32(_),T=0,S=0;S<x-1;++S)for(var E=y*(n[S]-p),L=y*(n[S+1]-p),C=0;C<b-1;++C)for(var z=g*(r[C]-d),D=g*(r[C+1]-d),I=0;I<f.length;I+=2){var P,O,j,F,R=f[I],N=f[I+1],B=(S+N)*b+(C+R),U=i[B],V=a.le(l,U);if(V<0)P=u[0],O=u[1],j=u[2],F=u[3];else if(V===c-1)P=u[4*c-4],O=u[4*c-3],j=u[4*c-2],F=u[4*c-1];else{var q=(U-l[V])/(l[V+1]-l[V]),H=1-q,G=4*V,Y=4*(V+1);P=H*u[G]+q*u[Y],O=H*u[G+1]+q*u[Y+1],j=H*u[G+2]+q*u[Y+2],F=H*u[G+3]+q*u[Y+3]}w[4*T]=255*P,w[4*T+1]=255*O,w[4*T+2]=255*j,w[4*T+3]=255*F,M[2*T]=.5*z+.5*D,M[2*T+1]=.5*E+.5*L,k[2*T]=R,k[2*T+1]=N,A[T]=S*b+C,T+=1}this.positionBuffer.update(M),this.weightBuffer.update(k),this.colorBuffer.update(w),this.idBuffer.update(A),s.free(M),s.free(w),s.free(k),s.free(A)},h.dispose=function(){this.shader.dispose(),this.pickShader.dispose(),this.positionBuffer.dispose(),this.weightBuffer.dispose(),this.colorBuffer.dispose(),this.idBuffer.dispose(),this.plot.removeObject(this)}},{"./lib/shaders":162,"binary-search-bounds":163,"gl-buffer":152,"gl-shader":250,"iota-array":287,"typedarray-pool":533}],162:[function(t,e,r){"use strict";e.exports={fragment:"precision lowp float;\n#define GLSLIFY 1\nvarying vec4 fragColor;\nvoid main() {\n gl_FragColor = vec4(fragColor.rgb * fragColor.a, fragColor.a);\n}\n",vertex:"precision mediump float;\n#define GLSLIFY 1\n\nattribute vec2 position;\nattribute vec4 color;\nattribute vec2 weight;\n\nuniform vec2 shape;\nuniform mat3 viewTransform;\n\nvarying vec4 fragColor;\n\nvoid main() {\n vec3 vPosition = viewTransform * vec3( position + (weight-.5)/(shape-1.) , 1.0);\n fragColor = color;\n gl_Position = vec4(vPosition.xy, 0, vPosition.z);\n}\n",pickFragment:"precision mediump float;\n#define GLSLIFY 1\n\nvarying vec4 fragId;\nvarying vec2 vWeight;\n\nuniform vec2 shape;\nuniform vec4 pickOffset;\n\nvoid main() {\n vec2 d = step(.5, vWeight);\n vec4 id = fragId + pickOffset;\n id.x += d.x + d.y*shape.x;\n\n id.y += floor(id.x / 256.0);\n id.x -= floor(id.x / 256.0) * 256.0;\n\n id.z += floor(id.y / 256.0);\n id.y -= floor(id.y / 256.0) * 256.0;\n\n id.w += floor(id.z / 256.0);\n id.z -= floor(id.z / 256.0) * 256.0;\n\n gl_FragColor = id/255.;\n}\n",pickVertex:"precision mediump float;\n#define GLSLIFY 1\n\nattribute vec2 position;\nattribute vec4 pickId;\nattribute vec2 weight;\n\nuniform vec2 shape;\nuniform mat3 viewTransform;\n\nvarying vec4 fragId;\nvarying vec2 vWeight;\n\nvoid main() {\n vWeight = weight;\n\n fragId = pickId;\n\n vec3 vPosition = viewTransform * vec3( position + (weight-.5)/(shape-1.) , 1.0);\n gl_Position = vec4(vPosition.xy, 0, vPosition.z);\n}\n"}},{}],163:[function(t,e,r){arguments[4][80][0].apply(r,arguments)},{dup:80}],164:[function(t,e,r){r.lineVertex="precision highp float;\n#define GLSLIFY 1\n\nattribute vec2 aHi, aLo, dHi, dLo;\n\nuniform vec2 scaleHi, translateHi, scaleLo, translateLo, screenShape;\nuniform float width;\n\nvarying vec2 direction;\n\n\nvec2 project_1_0(vec2 scHi, vec2 trHi, vec2 scLo, vec2 trLo, vec2 posHi, vec2 posLo) {\n return (posHi + trHi) * scHi\n + (posLo + trLo) * scHi\n + (posHi + trHi) * scLo\n + (posLo + trLo) * scLo;\n}\n\n\nvec2 project_2_1(vec2 scHi, vec2 scLo, vec2 posHi, vec2 posLo) {\n return scHi * posHi\n + scLo * posHi\n + scHi * posLo\n + scLo * posLo;\n}\n\nvoid main() {\n vec2 p = project_1_0(scaleHi, translateHi, scaleLo, translateLo, aHi, aLo);\n vec2 dir = project_2_1(scaleHi, scaleLo, dHi, dLo);\n vec2 n = 0.5 * width * normalize(screenShape.yx * vec2(dir.y, -dir.x)) / screenShape.xy;\n vec2 tangent = normalize(screenShape.xy * dir);\n if(dir.x < 0.0 || (dir.x == 0.0 && dir.y < 0.0)) {\n direction = -tangent;\n } else {\n direction = tangent;\n }\n gl_Position = vec4(p + n, 0.0, 1.0);\n}",r.lineFragment="precision highp float;\n#define GLSLIFY 1\n\nuniform vec4 color;\nuniform vec2 screenShape;\nuniform sampler2D dashPattern;\nuniform float dashLength;\n\nvarying vec2 direction;\n\nvoid main() {\n float t = fract(dot(direction, gl_FragCoord.xy) / dashLength);\n vec4 pcolor = color * texture2D(dashPattern, vec2(t, 0.0)).r;\n gl_FragColor = vec4(pcolor.rgb * pcolor.a, pcolor.a);\n}",r.mitreVertex="precision highp float;\n#define GLSLIFY 1\n\nattribute vec2 aHi, aLo;\n\nuniform vec2 scaleHi, translateHi, scaleLo, translateLo;\nuniform float radius;\n\n\nvec2 project_1_0(vec2 scHi, vec2 trHi, vec2 scLo, vec2 trLo, vec2 posHi, vec2 posLo) {\n return (posHi + trHi) * scHi\n + (posLo + trLo) * scHi\n + (posHi + trHi) * scLo\n + (posLo + trLo) * scLo;\n}\n\n\nvoid main() {\n vec2 p = project_1_0(scaleHi, translateHi, scaleLo, translateLo, aHi, aLo);\n gl_Position = vec4(p, 0.0, 1.0);\n gl_PointSize = radius;\n}",r.mitreFragment="precision mediump float;\n#define GLSLIFY 1\n\nuniform vec4 color;\n\nvoid main() {\n if(length(gl_PointCoord.xy - 0.5) > 0.25) {\n discard;\n }\n gl_FragColor = vec4(color.rgb, color.a);\n}",r.pickVertex="precision highp float;\n#define GLSLIFY 1\n\nattribute vec2 aHi, aLo, dHi;\nattribute vec4 pick0, pick1;\n\nuniform vec2 scaleHi, translateHi, scaleLo, translateLo, screenShape;\nuniform float width;\n\nvarying vec4 pickA, pickB;\n\n\nvec2 project_1_0(vec2 scHi, vec2 trHi, vec2 scLo, vec2 trLo, vec2 posHi, vec2 posLo) {\n return (posHi + trHi) * scHi\n + (posLo + trLo) * scHi\n + (posHi + trHi) * scLo\n + (posLo + trLo) * scLo;\n}\n\n\nvoid main() {\n vec2 p = project_1_0(scaleHi, translateHi, scaleLo, translateLo, aHi, aLo);\n vec2 n = width * normalize(screenShape.yx * vec2(dHi.y, -dHi.x)) / screenShape.xy;\n gl_Position = vec4(p + n, 0, 1);\n pickA = pick0;\n pickB = pick1;\n}",r.pickFragment="precision mediump float;\n#define GLSLIFY 1\n\nuniform vec4 pickOffset;\n\nvarying vec4 pickA, pickB;\n\nvoid main() {\n vec4 fragId = vec4(pickA.xyz, 0.0);\n if(pickB.w > pickA.w) {\n fragId.xyz = pickB.xyz;\n }\n\n fragId += pickOffset;\n\n fragId.y += floor(fragId.x / 256.0);\n fragId.x -= floor(fragId.x / 256.0) * 256.0;\n\n fragId.z += floor(fragId.y / 256.0);\n fragId.y -= floor(fragId.y / 256.0) * 256.0;\n\n fragId.w += floor(fragId.z / 256.0);\n fragId.z -= floor(fragId.z / 256.0) * 256.0;\n\n gl_FragColor = fragId / 255.0;\n}",r.fillVertex="precision highp float;\n#define GLSLIFY 1\n\nattribute vec2 aHi, aLo, dHi;\n\nuniform vec2 scaleHi, translateHi, scaleLo, translateLo, projectAxis;\nuniform float projectValue, depth;\n\n\nvec2 project_1_0(vec2 scHi, vec2 trHi, vec2 scLo, vec2 trLo, vec2 posHi, vec2 posLo) {\n return (posHi + trHi) * scHi\n + (posLo + trLo) * scHi\n + (posHi + trHi) * scLo\n + (posLo + trLo) * scLo;\n}\n\n\nvoid main() {\n vec2 p = project_1_0(scaleHi, translateHi, scaleLo, translateLo, aHi, aLo);\n if(dHi.y < 0.0 || (dHi.y == 0.0 && dHi.x < 0.0)) {\n if(dot(p, projectAxis) < projectValue) {\n p = p * (1.0 - abs(projectAxis)) + projectAxis * projectValue;\n }\n }\n gl_Position = vec4(p, depth, 1);\n}",r.fillFragment="precision mediump float;\n#define GLSLIFY 1\n\nuniform vec4 color;\n\nvoid main() {\n gl_FragColor = vec4(color.rgb * color.a, color.a);\n}"},{}],165:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o,s,l){this.plot=t,this.dashPattern=e,this.lineBufferHi=r,this.lineBufferLo=n,this.pickBuffer=i,this.lineShader=a,this.mitreShader=o,this.fillShader=s,this.pickShader=l,this.usingDashes=!1,this.bounds=[1/0,1/0,-1/0,-1/0],this.width=1,this.color=[0,0,1,1],this.fill=[!1,!1,!1,!1],this.fillColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.data=null,this.numPoints=0,this.vertCount=0,this.pickOffset=0}function i(t){return t.map(function(t){return t.slice()})}function a(t,e){var r=t.gl,i=s(r),a=s(r),u=s(r),c=l(r,[1,1]),f=o(r,h.lineVertex,h.lineFragment),d=o(r,h.mitreVertex,h.mitreFragment),p=o(r,h.fillVertex,h.fillFragment),m=o(r,h.pickVertex,h.pickFragment),v=new n(t,c,i,a,u,f,d,p,m);return t.addObject(v),v.update(e),v}e.exports=a;var o=t("gl-shader"),s=t("gl-buffer"),l=t("gl-texture2d"),u=t("ndarray"),c=t("typedarray-pool"),h=t("./lib/shaders"),f=n.prototype;f.setProjectionModel=function(){var t={scaleHi:new Float32Array([0,0]),scaleLo:new Float32Array([0,0]),translateHi:new Float32Array([0,0]),translateLo:new Float32Array([0,0]),screenShape:[0,0]};return function(){var e=this.bounds,r=this.plot.viewBox,n=this.plot.dataBox,i=e[2]-e[0],a=e[3]-e[1],o=n[2]-n[0],s=n[3]-n[1],l=r[2]-r[0],u=r[3]-r[1],c=2*i/o,h=2*a/s,f=(e[0]-n[0]-.5*o)/i,d=(e[1]-n[1]-.5*s)/a;return t.scaleHi[0]=c,t.scaleHi[1]=h,t.scaleLo[0]=c-t.scaleHi[0],t.scaleLo[1]=h-t.scaleHi[1],t.translateHi[0]=f,t.translateHi[1]=d,t.translateLo[0]=f-t.translateHi[0],t.translateLo[1]=d-t.translateHi[1],t.screenShape[0]=l,t.screenShape[1]=u,t}}(),f.setProjectionUniforms=function(t,e){t.scaleHi=e.scaleHi,t.scaleLo=e.scaleLo,t.translateHi=e.translateHi,t.translateLo=e.translateLo,t.screenShape=e.screenShape},f.draw=function(){var t=[1,0],e=[-1,0],r=[0,1],n=[0,-1];return function(){var i=this.vertCount;if(i){var a=this.setProjectionModel(),o=this.plot,s=this.width,l=o.gl,u=o.pixelRatio,c=this.color,h=this.fillShader.attributes;this.lineBufferLo.bind(),h.aLo.pointer(l.FLOAT,!1,16,0),this.lineBufferHi.bind();var f=this.fill;if(f[0]||f[1]||f[2]||f[3]){var d=this.fillShader;d.bind();var p=d.uniforms;this.setProjectionUniforms(p,a),p.depth=o.nextDepthValue(),h.aHi.pointer(l.FLOAT,!1,16,0),h.dHi.pointer(l.FLOAT,!1,16,8),l.depthMask(!0),l.enable(l.DEPTH_TEST);var m=this.fillColor;f[0]&&(p.color=m[0],p.projectAxis=e,p.projectValue=1,l.drawArrays(l.TRIANGLES,0,i)),f[1]&&(p.color=m[1],p.projectAxis=n,p.projectValue=1,l.drawArrays(l.TRIANGLES,0,i)),f[2]&&(p.color=m[2],p.projectAxis=t,p.projectValue=1,l.drawArrays(l.TRIANGLES,0,i)),f[3]&&(p.color=m[3],p.projectAxis=r,p.projectValue=1,l.drawArrays(l.TRIANGLES,0,i)),l.depthMask(!1),l.disable(l.DEPTH_TEST)}var v=this.lineShader;v.bind(),this.lineBufferLo.bind(),v.attributes.aLo.pointer(l.FLOAT,!1,16,0),v.attributes.dLo.pointer(l.FLOAT,!1,16,8),this.lineBufferHi.bind();var g=v.uniforms;this.setProjectionUniforms(g,a),g.color=c,g.width=s*u,g.dashPattern=this.dashPattern.bind(),g.dashLength=this.dashLength*u;var y=v.attributes;if(y.aHi.pointer(l.FLOAT,!1,16,0),y.dHi.pointer(l.FLOAT,!1,16,8),l.drawArrays(l.TRIANGLES,0,i),s>2&&!this.usingDashes){var b=this.mitreShader;this.lineBufferLo.bind(),b.attributes.aLo.pointer(l.FLOAT,!1,48,0),this.lineBufferHi.bind(),b.bind();var x=b.uniforms;this.setProjectionUniforms(x,a),x.color=c,x.radius=s*u,b.attributes.aHi.pointer(l.FLOAT,!1,48,0),l.drawArrays(l.POINTS,0,i/3|0)}}}}(),f.drawPick=function(){var t=[0,0,0,0];return function(e){var r=this.vertCount,n=this.numPoints;if(this.pickOffset=e,!r)return e+n;var i=this.setProjectionModel(),a=this.plot,o=this.width,s=a.gl,l=a.pickPixelRatio,u=this.pickShader,c=this.pickBuffer;t[0]=255&e,t[1]=e>>>8&255,t[2]=e>>>16&255,t[3]=e>>>24,u.bind();var h=u.uniforms;this.setProjectionUniforms(h,i),h.width=o*l,h.pickOffset=t;var f=u.attributes;return this.lineBufferHi.bind(),f.aHi.pointer(s.FLOAT,!1,16,0),f.dHi.pointer(s.FLOAT,!1,16,8),this.lineBufferLo.bind(),f.aLo.pointer(s.FLOAT,!1,16,0),c.bind(),f.pick0.pointer(s.UNSIGNED_BYTE,!1,8,0),f.pick1.pointer(s.UNSIGNED_BYTE,!1,8,4),s.drawArrays(s.TRIANGLES,0,r),e+n}}(),f.pick=function(t,e,r){var n=this.pickOffset,i=this.numPoints;if(r<n||r>=n+i)return null;var a=r-n,o=this.data;return{object:this,pointId:a,dataCoord:[o[2*a],o[2*a+1]]}},f.update=function(t){t=t||{};var e,r,n,a,o,s=this.plot.gl;this.color=(t.color||[0,0,1,1]).slice(),this.width=+(t.width||1),this.fill=(t.fill||[!1,!1,!1,!1]).slice(),this.fillColor=i(t.fillColor||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]);var h=t.dashes||[1],f=0;for(e=0;e<h.length;++e)f+=h[e];var d=c.mallocUint8(f);n=0;var p=255;for(e=0;e<h.length;++e){for(r=0;r<h[e];++r)d[n++]=p;p^=255}this.dashPattern.dispose(),this.usingDashes=h.length>1,this.dashPattern=l(s,u(d,[f,1,4],[1,0,0])),this.dashPattern.minFilter=s.NEAREST,this.dashPattern.magFilter=s.NEAREST,this.dashLength=f,c.free(d);var m=t.positions;this.data=m;var v=this.bounds;v[0]=v[1]=1/0,v[2]=v[3]=-1/0;var g=this.numPoints=m.length>>>1;if(0!==g){for(e=0;e<g;++e)a=m[2*e],o=m[2*e+1],isNaN(a)||isNaN(o)||(v[0]=Math.min(v[0],a),v[1]=Math.min(v[1],o),v[2]=Math.max(v[2],a),v[3]=Math.max(v[3],o));v[0]===v[2]&&(v[2]+=1),v[3]===v[1]&&(v[3]+=1);var y=c.mallocFloat64(24*(g-1)),b=c.mallocFloat32(24*(g-1)),x=c.mallocFloat32(24*(g-1)),_=c.mallocUint32(12*(g-1)),w=b.length,M=_.length;n=g;for(var k=0;n>1;){var A=--n;a=m[2*n],o=m[2*n+1];var T=A-1,S=m[2*T],E=m[2*T+1];if(!(isNaN(a)||isNaN(o)||isNaN(S)||isNaN(E))){k+=1,a=(a-v[0])/(v[2]-v[0]),o=(o-v[1])/(v[3]-v[1]),S=(S-v[0])/(v[2]-v[0]),E=(E-v[1])/(v[3]-v[1]);var L=S-a,C=E-o,z=A|1<<24,D=A-1,I=A,P=A-1|1<<24;y[--w]=-C,y[--w]=-L,y[--w]=o,y[--w]=a,_[--M]=z,_[--M]=D,y[--w]=C,y[--w]=L,y[--w]=E,y[--w]=S,_[--M]=I,_[--M]=P,y[--w]=-C,y[--w]=-L,y[--w]=E,y[--w]=S,_[--M]=I,_[--M]=P,y[--w]=C,y[--w]=L,y[--w]=E,y[--w]=S,_[--M]=I,_[--M]=P,y[--w]=-C,y[--w]=-L,y[--w]=o,y[--w]=a,_[--M]=z,_[--M]=D,y[--w]=C,y[--w]=L,y[--w]=o,y[--w]=a,_[--M]=z,_[--M]=D}}for(e=0;e<y.length;e++)b[e]=y[e],x[e]=y[e]-b[e];this.vertCount=6*k,this.lineBufferHi.update(b.subarray(w)),this.lineBufferLo.update(x.subarray(w)),this.pickBuffer.update(_.subarray(M)),c.free(y),c.free(b),c.free(x),c.free(_)}},f.dispose=function(){this.plot.removeObject(this),this.lineBufferLo.dispose(),this.lineBufferHi.dispose(),this.pickBuffer.dispose(),this.lineShader.dispose(),this.mitreShader.dispose(),this.fillShader.dispose(),this.pickShader.dispose(),this.dashPattern.dispose()}},{"./lib/shaders":164,"gl-buffer":152,"gl-shader":250,"gl-texture2d":262,ndarray:460,"typedarray-pool":533}],166:[function(t,e,r){var n=t("gl-shader"),i="precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position, nextPosition;\nattribute float arcLength, lineWidth;\nattribute vec4 color;\n\nuniform vec2 screenShape;\nuniform float pixelRatio;\nuniform mat4 model, view, projection;\n\nvarying vec4 fragColor;\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\n\nvoid main() {\n vec4 projected = projection * view * model * vec4(position, 1.0);\n vec4 tangentClip = projection * view * model * vec4(nextPosition - position, 0.0);\n vec2 tangent = normalize(screenShape * tangentClip.xy);\n vec2 offset = 0.5 * pixelRatio * lineWidth * vec2(tangent.y, -tangent.x) / screenShape;\n\n gl_Position = vec4(projected.xy + projected.w * offset, projected.zw);\n\n worldPosition = position;\n pixelArcLength = arcLength;\n fragColor = color;\n}\n",a=[{name:"position",type:"vec3"},{name:"nextPosition",type:"vec3"},{name:"arcLength",type:"float"},{name:"lineWidth",type:"float"},{name:"color",type:"vec4"}];r.createShader=function(t){return n(t,i,"precision mediump float;\n#define GLSLIFY 1\n\nuniform vec3 clipBounds[2];\nuniform sampler2D dashTexture;\nuniform float dashScale;\nuniform float opacity;\n\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\nvarying vec4 fragColor;\n\nvoid main() {\n if(any(lessThan(worldPosition, clipBounds[0])) || any(greaterThan(worldPosition, clipBounds[1]))) {\n discard;\n }\n float dashWeight = texture2D(dashTexture, vec2(dashScale * pixelArcLength, 0)).r;\n if(dashWeight < 0.5) {\n discard;\n }\n gl_FragColor = fragColor * opacity;\n}\n",null,a)},r.createPickShader=function(t){return n(t,i,"precision mediump float;\n#define GLSLIFY 1\n\n#define FLOAT_MAX 1.70141184e38\n#define FLOAT_MIN 1.17549435e-38\n\nlowp vec4 encode_float_1_0(highp float v) {\n highp float av = abs(v);\n\n //Handle special cases\n if(av < FLOAT_MIN) {\n return vec4(0.0, 0.0, 0.0, 0.0);\n } else if(v > FLOAT_MAX) {\n return vec4(127.0, 128.0, 0.0, 0.0) / 255.0;\n } else if(v < -FLOAT_MAX) {\n return vec4(255.0, 128.0, 0.0, 0.0) / 255.0;\n }\n\n highp vec4 c = vec4(0,0,0,0);\n\n //Compute exponent and mantissa\n highp float e = floor(log2(av));\n highp float m = av * pow(2.0, -e) - 1.0;\n \n //Unpack mantissa\n c[1] = floor(128.0 * m);\n m -= c[1] / 128.0;\n c[2] = floor(32768.0 * m);\n m -= c[2] / 32768.0;\n c[3] = floor(8388608.0 * m);\n \n //Unpack exponent\n highp float ebias = e + 127.0;\n c[0] = floor(ebias / 2.0);\n ebias -= c[0] * 2.0;\n c[1] += floor(ebias) * 128.0; \n\n //Unpack sign bit\n c[0] += 128.0 * step(0.0, -v);\n\n //Scale back to range\n return c / 255.0;\n}\n\n\n\nuniform float pickId;\nuniform vec3 clipBounds[2];\n\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\nvarying vec4 fragColor;\n\nvoid main() {\n if(any(lessThan(worldPosition, clipBounds[0])) || any(greaterThan(worldPosition, clipBounds[1]))) {\n discard;\n }\n gl_FragColor = vec4(pickId/255.0, encode_float_1_0(pixelArcLength).xyz);\n}",null,a)}},{"gl-shader":250}],167:[function(t,e,r){"use strict";function n(t,e){for(var r=0,n=0;n<3;++n){var i=t[n]-e[n];r+=i*i}return Math.sqrt(r)}function i(t){for(var e=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],r=0;r<3;++r)e[0][r]=Math.max(t[0][r],e[0][r]),e[1][r]=Math.min(t[1][r],e[1][r]);return e}function a(t,e,r,n){this.arcLength=t,this.position=e,this.index=r,this.dataCoordinate=n}function o(t,e,r,n,i,a){this.gl=t,this.shader=e,this.pickShader=r,this.buffer=n,this.vao=i,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.points=[],this.arcLength=[],this.vertexCount=0,this.bounds=[[0,0,0],[0,0,0]],this.pickId=0,this.lineWidth=1,this.texture=a,this.dashScale=1,this.opacity=1,this.dirty=!0,this.pixelRatio=1}function s(t){var e=t.gl||t.scene&&t.scene.gl,r=m(e);r.attributes.position.location=0,r.attributes.nextPosition.location=1,r.attributes.arcLength.location=2,r.attributes.lineWidth.location=3,r.attributes.color.location=4;var n=v(e);n.attributes.position.location=0,n.attributes.nextPosition.location=1,n.attributes.arcLength.location=2,n.attributes.lineWidth.location=3,n.attributes.color.location=4;for(var i=l(e),a=u(e,[{buffer:i,size:3,offset:0,stride:48},{buffer:i,size:3,offset:12,stride:48},{buffer:i,size:1,offset:24,stride:48},{buffer:i,size:1,offset:28,stride:48},{buffer:i,size:4,offset:32,stride:48}]),s=d(new Array(1024),[256,1,4]),h=0;h<1024;++h)s.data[h]=255;var f=c(e,s);f.wrap=e.REPEAT;var p=new o(e,r,n,i,a,f);return p.update(t),p}e.exports=s;var l=t("gl-buffer"),u=t("gl-vao"),c=t("gl-texture2d"),h=t("glsl-read-float"),f=t("binary-search-bounds"),d=t("ndarray"),p=t("./lib/shaders"),m=p.createShader,v=p.createPickShader,g=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],y=o.prototype;y.isTransparent=function(){return this.opacity<1},y.isOpaque=function(){return this.opacity>=1},y.pickSlots=1,y.setPickBase=function(t){this.pickId=t},y.drawTransparent=y.draw=function(t){var e=this.gl,r=this.shader,n=this.vao;r.bind(),r.uniforms={model:t.model||g,view:t.view||g,projection:t.projection||g,clipBounds:i(this.clipBounds),dashTexture:this.texture.bind(),dashScale:this.dashScale/this.arcLength[this.arcLength.length-1],opacity:this.opacity,screenShape:[e.drawingBufferWidth,e.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(e.TRIANGLE_STRIP,this.vertexCount)},y.drawPick=function(t){var e=this.gl,r=this.pickShader,n=this.vao;r.bind(),r.uniforms={model:t.model||g,view:t.view||g,projection:t.projection||g,pickId:this.pickId,clipBounds:i(this.clipBounds),screenShape:[e.drawingBufferWidth,e.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(e.TRIANGLE_STRIP,this.vertexCount)},y.update=function(t){var e,r;this.dirty=!0
22 ;var i=!!t.connectGaps;"dashScale"in t&&(this.dashScale=t.dashScale),"opacity"in t&&(this.opacity=+t.opacity);var a=t.position||t.positions;if(a){var o=t.color||t.colors||[0,0,0,1],s=t.lineWidth||1,l=[],u=[],c=[],h=0,p=0,m=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],v=!1;t:for(e=1;e<a.length;++e){var g=a[e-1],y=a[e];for(u.push(h),c.push(g.slice()),r=0;r<3;++r){if(isNaN(g[r])||isNaN(y[r])||!isFinite(g[r])||!isFinite(y[r])){if(!i&&l.length>0){for(var b=0;b<24;++b)l.push(l[l.length-12]);p+=2,v=!0}continue t}m[0][r]=Math.min(m[0][r],g[r],y[r]),m[1][r]=Math.max(m[1][r],g[r],y[r])}var x,_;Array.isArray(o[0])?(x=o[e-1],_=o[e]):x=_=o,3===x.length&&(x=[x[0],x[1],x[2],1]),3===_.length&&(_=[_[0],_[1],_[2],1]);var w;w=Array.isArray(s)?s[e-1]:s;var M=h;if(h+=n(g,y),v){for(r=0;r<2;++r)l.push(g[0],g[1],g[2],y[0],y[1],y[2],M,w,x[0],x[1],x[2],x[3]);p+=2,v=!1}l.push(g[0],g[1],g[2],y[0],y[1],y[2],M,w,x[0],x[1],x[2],x[3],g[0],g[1],g[2],y[0],y[1],y[2],M,-w,x[0],x[1],x[2],x[3],y[0],y[1],y[2],g[0],g[1],g[2],h,-w,_[0],_[1],_[2],_[3],y[0],y[1],y[2],g[0],g[1],g[2],h,w,_[0],_[1],_[2],_[3]),p+=4}if(this.buffer.update(l),u.push(h),c.push(a[a.length-1].slice()),this.bounds=m,this.vertexCount=p,this.points=c,this.arcLength=u,"dashes"in t){var k=t.dashes,A=k.slice();for(A.unshift(0),e=1;e<A.length;++e)A[e]=A[e-1]+A[e];var T=d(new Array(1024),[256,1,4]);for(e=0;e<256;++e){for(r=0;r<4;++r)T.set(e,0,r,0);1&f.le(A,A[A.length-1]*e/255)?T.set(e,0,0,0):T.set(e,0,0,255)}this.texture.setPixels(T)}}},y.dispose=function(){this.shader.dispose(),this.vao.dispose(),this.buffer.dispose()},y.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;var e=h(t.value[0],t.value[1],t.value[2],0),r=f.le(this.arcLength,e);if(r<0)return null;if(r===this.arcLength.length-1)return new a(this.arcLength[this.arcLength.length-1],this.points[this.points.length-1].slice(),r);for(var n=this.points[r],i=this.points[Math.min(r+1,this.points.length-1)],o=(e-this.arcLength[r])/(this.arcLength[r+1]-this.arcLength[r]),s=1-o,l=[0,0,0],u=0;u<3;++u)l[u]=s*n[u]+o*i[u];var c=Math.min(o<.5?r:r+1,this.points.length-1);return new a(e,l,c,this.points[c])}},{"./lib/shaders":166,"binary-search-bounds":62,"gl-buffer":152,"gl-texture2d":262,"gl-vao":266,"glsl-read-float":273,ndarray:460}],168:[function(t,e,r){function n(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r*a-i*n;return o?(o=1/o,t[0]=a*o,t[1]=-n*o,t[2]=-i*o,t[3]=r*o,t):null}e.exports=n},{}],169:[function(t,e,r){function n(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],h=c*o-s*u,f=-c*a+s*l,d=u*a-o*l,p=r*h+n*f+i*d;return p?(p=1/p,t[0]=h*p,t[1]=(-c*n+i*u)*p,t[2]=(s*n-i*o)*p,t[3]=f*p,t[4]=(c*r-i*l)*p,t[5]=(-s*r+i*a)*p,t[6]=d*p,t[7]=(-u*r+n*l)*p,t[8]=(o*r-n*a)*p,t):null}e.exports=n},{}],170:[function(t,e,r){function n(t){var e=new Float32Array(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}e.exports=n},{}],171:[function(t,e,r){function n(){var t=new Float32Array(16);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}e.exports=n},{}],172:[function(t,e,r){function n(t){var e=t[0],r=t[1],n=t[2],i=t[3],a=t[4],o=t[5],s=t[6],l=t[7],u=t[8],c=t[9],h=t[10],f=t[11],d=t[12],p=t[13],m=t[14],v=t[15];return(e*o-r*a)*(h*v-f*m)-(e*s-n*a)*(c*v-f*p)+(e*l-i*a)*(c*m-h*p)+(r*s-n*o)*(u*v-f*d)-(r*l-i*o)*(u*m-h*d)+(n*l-i*s)*(u*p-c*d)}e.exports=n},{}],173:[function(t,e,r){function n(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,h=n*s,f=i*o,d=i*s,p=i*l,m=a*o,v=a*s,g=a*l;return t[0]=1-h-p,t[1]=c+g,t[2]=f-v,t[3]=0,t[4]=c-g,t[5]=1-u-p,t[6]=d+m,t[7]=0,t[8]=f+v,t[9]=d-m,t[10]=1-u-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}e.exports=n},{}],174:[function(t,e,r){function n(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=n+n,l=i+i,u=a+a,c=n*s,h=n*l,f=n*u,d=i*l,p=i*u,m=a*u,v=o*s,g=o*l,y=o*u;return t[0]=1-(d+m),t[1]=h+y,t[2]=f-g,t[3]=0,t[4]=h-y,t[5]=1-(c+m),t[6]=p+v,t[7]=0,t[8]=f+g,t[9]=p-v,t[10]=1-(c+d),t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}e.exports=n},{}],175:[function(t,e,r){function n(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}e.exports=n},{}],176:[function(t,e,r){function n(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],h=e[9],f=e[10],d=e[11],p=e[12],m=e[13],v=e[14],g=e[15],y=r*s-n*o,b=r*l-i*o,x=r*u-a*o,_=n*l-i*s,w=n*u-a*s,M=i*u-a*l,k=c*m-h*p,A=c*v-f*p,T=c*g-d*p,S=h*v-f*m,E=h*g-d*m,L=f*g-d*v,C=y*L-b*E+x*S+_*T-w*A+M*k;return C?(C=1/C,t[0]=(s*L-l*E+u*S)*C,t[1]=(i*E-n*L-a*S)*C,t[2]=(m*M-v*w+g*_)*C,t[3]=(f*w-h*M-d*_)*C,t[4]=(l*T-o*L-u*A)*C,t[5]=(r*L-i*T+a*A)*C,t[6]=(v*x-p*M-g*b)*C,t[7]=(c*M-f*x+d*b)*C,t[8]=(o*E-s*T+u*k)*C,t[9]=(n*T-r*E-a*k)*C,t[10]=(p*w-m*x+g*y)*C,t[11]=(h*x-c*w-d*y)*C,t[12]=(s*A-o*S-l*k)*C,t[13]=(r*S-n*A+i*k)*C,t[14]=(m*b-p*_-v*y)*C,t[15]=(c*_-h*b+f*y)*C,t):null}e.exports=n},{}],177:[function(t,e,r){function n(t,e,r,n){var a,o,s,l,u,c,h,f,d,p,m=e[0],v=e[1],g=e[2],y=n[0],b=n[1],x=n[2],_=r[0],w=r[1],M=r[2];return Math.abs(m-_)<1e-6&&Math.abs(v-w)<1e-6&&Math.abs(g-M)<1e-6?i(t):(h=m-_,f=v-w,d=g-M,p=1/Math.sqrt(h*h+f*f+d*d),h*=p,f*=p,d*=p,a=b*d-x*f,o=x*h-y*d,s=y*f-b*h,p=Math.sqrt(a*a+o*o+s*s),p?(p=1/p,a*=p,o*=p,s*=p):(a=0,o=0,s=0),l=f*s-d*o,u=d*a-h*s,c=h*o-f*a,p=Math.sqrt(l*l+u*u+c*c),p?(p=1/p,l*=p,u*=p,c*=p):(l=0,u=0,c=0),t[0]=a,t[1]=l,t[2]=h,t[3]=0,t[4]=o,t[5]=u,t[6]=f,t[7]=0,t[8]=s,t[9]=c,t[10]=d,t[11]=0,t[12]=-(a*m+o*v+s*g),t[13]=-(l*m+u*v+c*g),t[14]=-(h*m+f*v+d*g),t[15]=1,t)}var i=t("./identity");e.exports=n},{"./identity":175}],178:[function(t,e,r){function n(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],h=e[8],f=e[9],d=e[10],p=e[11],m=e[12],v=e[13],g=e[14],y=e[15],b=r[0],x=r[1],_=r[2],w=r[3];return t[0]=b*n+x*s+_*h+w*m,t[1]=b*i+x*l+_*f+w*v,t[2]=b*a+x*u+_*d+w*g,t[3]=b*o+x*c+_*p+w*y,b=r[4],x=r[5],_=r[6],w=r[7],t[4]=b*n+x*s+_*h+w*m,t[5]=b*i+x*l+_*f+w*v,t[6]=b*a+x*u+_*d+w*g,t[7]=b*o+x*c+_*p+w*y,b=r[8],x=r[9],_=r[10],w=r[11],t[8]=b*n+x*s+_*h+w*m,t[9]=b*i+x*l+_*f+w*v,t[10]=b*a+x*u+_*d+w*g,t[11]=b*o+x*c+_*p+w*y,b=r[12],x=r[13],_=r[14],w=r[15],t[12]=b*n+x*s+_*h+w*m,t[13]=b*i+x*l+_*f+w*v,t[14]=b*a+x*u+_*d+w*g,t[15]=b*o+x*c+_*p+w*y,t}e.exports=n},{}],179:[function(t,e,r){function n(t,e,r,n,i){var a=1/Math.tan(e/2),o=1/(n-i);return t[0]=a/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=(i+n)*o,t[11]=-1,t[12]=0,t[13]=0,t[14]=2*i*n*o,t[15]=0,t}e.exports=n},{}],180:[function(t,e,r){function n(t,e,r,n){var i,a,o,s,l,u,c,h,f,d,p,m,v,g,y,b,x,_,w,M,k,A,T,S,E=n[0],L=n[1],C=n[2],z=Math.sqrt(E*E+L*L+C*C);return Math.abs(z)<1e-6?null:(z=1/z,E*=z,L*=z,C*=z,i=Math.sin(r),a=Math.cos(r),o=1-a,s=e[0],l=e[1],u=e[2],c=e[3],h=e[4],f=e[5],d=e[6],p=e[7],m=e[8],v=e[9],g=e[10],y=e[11],b=E*E*o+a,x=L*E*o+C*i,_=C*E*o-L*i,w=E*L*o-C*i,M=L*L*o+a,k=C*L*o+E*i,A=E*C*o+L*i,T=L*C*o-E*i,S=C*C*o+a,t[0]=s*b+h*x+m*_,t[1]=l*b+f*x+v*_,t[2]=u*b+d*x+g*_,t[3]=c*b+p*x+y*_,t[4]=s*w+h*M+m*k,t[5]=l*w+f*M+v*k,t[6]=u*w+d*M+g*k,t[7]=c*w+p*M+y*k,t[8]=s*A+h*T+m*S,t[9]=l*A+f*T+v*S,t[10]=u*A+d*T+g*S,t[11]=c*A+p*T+y*S,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)}e.exports=n},{}],181:[function(t,e,r){function n(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],h=e[10],f=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+h*n,t[7]=l*i+f*n,t[8]=u*i-a*n,t[9]=c*i-o*n,t[10]=h*i-s*n,t[11]=f*i-l*n,t}e.exports=n},{}],182:[function(t,e,r){function n(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[8],c=e[9],h=e[10],f=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],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-h*n,t[3]=l*i-f*n,t[8]=a*n+u*i,t[9]=o*n+c*i,t[10]=s*n+h*i,t[11]=l*n+f*i,t}e.exports=n},{}],183:[function(t,e,r){function n(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],h=e[6],f=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+h*n,t[3]=l*i+f*n,t[4]=u*i-a*n,t[5]=c*i-o*n,t[6]=h*i-s*n,t[7]=f*i-l*n,t}e.exports=n},{}],184:[function(t,e,r){function n(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}e.exports=n},{}],185:[function(t,e,r){function n(t,e,r){var n,i,a,o,s,l,u,c,h,f,d,p,m=r[0],v=r[1],g=r[2];return e===t?(t[12]=e[0]*m+e[4]*v+e[8]*g+e[12],t[13]=e[1]*m+e[5]*v+e[9]*g+e[13],t[14]=e[2]*m+e[6]*v+e[10]*g+e[14],t[15]=e[3]*m+e[7]*v+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],h=e[8],f=e[9],d=e[10],p=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]=h,t[9]=f,t[10]=d,t[11]=p,t[12]=n*m+s*v+h*g+e[12],t[13]=i*m+l*v+f*g+e[13],t[14]=a*m+u*v+d*g+e[14],t[15]=o*m+c*v+p*g+e[15]),t}e.exports=n},{}],186:[function(t,e,r){function n(t,e){if(t===e){var r=e[1],n=e[2],i=e[3],a=e[6],o=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=a,t[11]=e[14],t[12]=i,t[13]=o,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}e.exports=n},{}],187:[function(t,e,r){"use strict";function n(t,e){switch(e.length){case 0:break;case 1:t[0]=1/e[0];break;case 4:i(t,e);break;case 9:a(t,e);break;case 16:o(t,e);break;default:throw new Error("currently supports matrices up to 4x4")}return t}e.exports=n;var i=t("gl-mat2/invert"),a=t("gl-mat3/invert"),o=t("gl-mat4/invert")},{"gl-mat2/invert":168,"gl-mat3/invert":169,"gl-mat4/invert":176}],188:[function(t,e,r){r.glMatrix=t("./gl-matrix/common.js"),r.mat2=t("./gl-matrix/mat2.js"),r.mat2d=t("./gl-matrix/mat2d.js"),r.mat3=t("./gl-matrix/mat3.js"),r.mat4=t("./gl-matrix/mat4.js"),r.quat=t("./gl-matrix/quat.js"),r.vec2=t("./gl-matrix/vec2.js"),r.vec3=t("./gl-matrix/vec3.js"),r.vec4=t("./gl-matrix/vec4.js")},{"./gl-matrix/common.js":189,"./gl-matrix/mat2.js":190,"./gl-matrix/mat2d.js":191,"./gl-matrix/mat3.js":192,"./gl-matrix/mat4.js":193,"./gl-matrix/quat.js":194,"./gl-matrix/vec2.js":195,"./gl-matrix/vec3.js":196,"./gl-matrix/vec4.js":197}],189:[function(t,e,r){var n={};n.EPSILON=1e-6,n.ARRAY_TYPE="undefined"!=typeof Float32Array?Float32Array:Array,n.RANDOM=Math.random,n.ENABLE_SIMD=!1,n.SIMD_AVAILABLE=n.ARRAY_TYPE===Float32Array&&"SIMD"in this,n.USE_SIMD=n.ENABLE_SIMD&&n.SIMD_AVAILABLE,n.setMatrixArrayType=function(t){n.ARRAY_TYPE=t};var i=Math.PI/180;n.toRadian=function(t){return t*i},n.equals=function(t,e){return Math.abs(t-e)<=n.EPSILON*Math.max(1,Math.abs(t),Math.abs(e))},e.exports=n},{}],190:[function(t,e,r){var n=t("./common.js"),i={};i.create=function(){var t=new n.ARRAY_TYPE(4);return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t},i.clone=function(t){var e=new n.ARRAY_TYPE(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},i.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},i.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t},i.fromValues=function(t,e,r,i){var a=new n.ARRAY_TYPE(4);return a[0]=t,a[1]=e,a[2]=r,a[3]=i,a},i.set=function(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t},i.transpose=function(t,e){if(t===e){var r=e[1];t[1]=e[2],t[2]=r}else t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3];return t},i.invert=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r*a-i*n;return o?(o=1/o,t[0]=a*o,t[1]=-n*o,t[2]=-i*o,t[3]=r*o,t):null},i.adjoint=function(t,e){var r=e[0];return t[0]=e[3],t[1]=-e[1],t[2]=-e[2],t[3]=r,t},i.determinant=function(t){return t[0]*t[3]-t[2]*t[1]},i.multiply=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=r[0],l=r[1],u=r[2],c=r[3];return t[0]=n*s+a*l,t[1]=i*s+o*l,t[2]=n*u+a*c,t[3]=i*u+o*c,t},i.mul=i.multiply,i.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},i.scale=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=r[0],l=r[1];return t[0]=n*s,t[1]=i*s,t[2]=a*l,t[3]=o*l,t},i.fromRotation=function(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=-r,t[3]=n,t},i.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t},i.str=function(t){return"mat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},i.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2))},i.LDU=function(t,e,r,n){return t[2]=n[2]/n[0],r[0]=n[0],r[1]=n[1],r[3]=n[3]-t[2]*r[1],[t,e,r]},i.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t},i.subtract=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t},i.sub=i.subtract,i.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]},i.equals=function(t,e){var r=t[0],i=t[1],a=t[2],o=t[3],s=e[0],l=e[1],u=e[2],c=e[3];return Math.abs(r-s)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(i-l)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(l))&&Math.abs(a-u)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(u))&&Math.abs(o-c)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(c))},i.multiplyScalar=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t},i.multiplyScalarAndAdd=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t},e.exports=i},{"./common.js":189}],191:[function(t,e,r){var n=t("./common.js"),i={};i.create=function(){var t=new n.ARRAY_TYPE(6);return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t},i.clone=function(t){var e=new n.ARRAY_TYPE(6);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},i.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t},i.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t},i.fromValues=function(t,e,r,i,a,o){var s=new n.ARRAY_TYPE(6);return s[0]=t,s[1]=e,s[2]=r,s[3]=i,s[4]=a,s[5]=o,s},i.set=function(t,e,r,n,i,a,o){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=a,t[5]=o,t},i.invert=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=r*a-n*i;return l?(l=1/l,t[0]=a*l,t[1]=-n*l,t[2]=-i*l,t[3]=r*l,t[4]=(i*s-a*o)*l,t[5]=(n*o-r*s)*l,t):null},i.determinant=function(t){return t[0]*t[3]-t[1]*t[2]},i.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=r[0],c=r[1],h=r[2],f=r[3],d=r[4],p=r[5];return t[0]=n*u+a*c,t[1]=i*u+o*c,t[2]=n*h+a*f,t[3]=i*h+o*f,t[4]=n*d+a*p+s,t[5]=i*d+o*p+l,t},i.mul=i.multiply,i.rotate=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=Math.sin(r),c=Math.cos(r);return t[0]=n*c+a*u,t[1]=i*c+o*u,t[2]=n*-u+a*c,t[3]=i*-u+o*c,t[4]=s,t[5]=l,t},i.scale=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=r[0],c=r[1];return t[0]=n*u,t[1]=i*u,t[2]=a*c,t[3]=o*c,t[4]=s,t[5]=l,t},i.translate=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=r[0],c=r[1];return t[0]=n,t[1]=i,t[2]=a,t[3]=o,t[4]=n*u+a*c+s,t[5]=i*u+o*c+l,t},i.fromRotation=function(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=-r,t[3]=n,t[4]=0,t[5]=0,t},i.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t[4]=0,t[5]=0,t},i.fromTranslation=function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=e[0],t[5]=e[1],t},i.str=function(t){return"mat2d("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+")"},i.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+1)},i.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t},i.subtract=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t},i.sub=i.subtract,i.multiplyScalar=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t},i.multiplyScalarAndAdd=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t},i.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]},i.equals=function(t,e){var r=t[0],i=t[1],a=t[2],o=t[3],s=t[4],l=t[5],u=e[0],c=e[1],h=e[2],f=e[3],d=e[4],p=e[5];return Math.abs(r-u)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(i-c)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(c))&&Math.abs(a-h)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(h))&&Math.abs(o-f)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(f))&&Math.abs(s-d)<=n.EPSILON*Math.max(1,Math.abs(s),Math.abs(d))&&Math.abs(l-p)<=n.EPSILON*Math.max(1,Math.abs(l),Math.abs(p))},e.exports=i},{"./common.js":189}],192:[function(t,e,r){var n=t("./common.js"),i={};i.create=function(){var t=new n.ARRAY_TYPE(9);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},i.fromMat4=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t},i.clone=function(t){var e=new n.ARRAY_TYPE(9);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},i.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},i.fromValues=function(t,e,r,i,a,o,s,l,u){var c=new n.ARRAY_TYPE(9);return c[0]=t,c[1]=e,c[2]=r,c[3]=i,c[4]=a,c[5]=o,c[6]=s,c[7]=l,c[8]=u,c},i.set=function(t,e,r,n,i,a,o,s,l,u){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=l,t[8]=u,t},i.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},i.transpose=function(t,e){if(t===e){var r=e[1],n=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=r,t[5]=e[7],t[6]=n,t[7]=i}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t},i.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],h=c*o-s*u,f=-c*a+s*l,d=u*a-o*l,p=r*h+n*f+i*d;return p?(p=1/p,t[0]=h*p,t[1]=(-c*n+i*u)*p,t[2]=(s*n-i*o)*p,t[3]=f*p,t[4]=(c*r-i*l)*p,t[5]=(-s*r+i*a)*p,t[6]=d*p,t[7]=(-u*r+n*l)*p,t[8]=(o*r-n*a)*p,t):null},i.adjoint=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];return t[0]=o*c-s*u,t[1]=i*u-n*c,t[2]=n*s-i*o,t[3]=s*l-a*c,t[4]=r*c-i*l,t[5]=i*a-r*s,t[6]=a*u-o*l,t[7]=n*l-r*u,t[8]=r*o-n*a,t},i.determinant=function(t){var e=t[0],r=t[1],n=t[2],i=t[3],a=t[4],o=t[5],s=t[6],l=t[7],u=t[8];return e*(u*a-o*l)+r*(-u*i+o*s)+n*(l*i-a*s)},i.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],h=e[8],f=r[0],d=r[1],p=r[2],m=r[3],v=r[4],g=r[5],y=r[6],b=r[7],x=r[8];return t[0]=f*n+d*o+p*u,t[1]=f*i+d*s+p*c,t[2]=f*a+d*l+p*h,t[3]=m*n+v*o+g*u,t[4]=m*i+v*s+g*c,t[5]=m*a+v*l+g*h,t[6]=y*n+b*o+x*u,t[7]=y*i+b*s+x*c,t[8]=y*a+b*l+x*h,t},i.mul=i.multiply,i.translate=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],h=e[8],f=r[0],d=r[1];return t[0]=n,t[1]=i,t[2]=a,t[3]=o,t[4]=s,t[5]=l,t[6]=f*n+d*o+u,t[7]=f*i+d*s+c,t[8]=f*a+d*l+h,t},i.rotate=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],h=e[8],f=Math.sin(r),d=Math.cos(r);return t[0]=d*n+f*o,t[1]=d*i+f*s,t[2]=d*a+f*l,t[3]=d*o-f*n,t[4]=d*s-f*i,t[5]=d*l-f*a,t[6]=u,t[7]=c,t[8]=h,t},i.scale=function(t,e,r){var n=r[0],i=r[1];return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},i.fromTranslation=function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t},i.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},i.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},i.fromMat2d=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t},i.fromQuat=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,h=n*s,f=i*o,d=i*s,p=i*l,m=a*o,v=a*s,g=a*l;return t[0]=1-h-p,t[3]=c-g,t[6]=f+v,t[1]=c+g,t[4]=1-u-p,t[7]=d-m,t[2]=f-v,t[5]=d+m,t[8]=1-u-h,t},i.normalFromMat4=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],h=e[9],f=e[10],d=e[11],p=e[12],m=e[13],v=e[14],g=e[15],y=r*s-n*o,b=r*l-i*o,x=r*u-a*o,_=n*l-i*s,w=n*u-a*s,M=i*u-a*l,k=c*m-h*p,A=c*v-f*p,T=c*g-d*p,S=h*v-f*m,E=h*g-d*m,L=f*g-d*v,C=y*L-b*E+x*S+_*T-w*A+M*k;return C?(C=1/C,t[0]=(s*L-l*E+u*S)*C,t[1]=(l*T-o*L-u*A)*C,t[2]=(o*E-s*T+u*k)*C,t[3]=(i*E-n*L-a*S)*C,t[4]=(r*L-i*T+a*A)*C,t[5]=(n*T-r*E-a*k)*C,t[6]=(m*M-v*w+g*_)*C,t[7]=(v*x-p*M-g*b)*C,t[8]=(p*w-m*x+g*y)*C,t):null},i.str=function(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"},i.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+Math.pow(t[6],2)+Math.pow(t[7],2)+Math.pow(t[8],2))},i.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t},i.subtract=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t},i.sub=i.subtract,i.multiplyScalar=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t},i.multiplyScalarAndAdd=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t},i.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]},i.equals=function(t,e){var r=t[0],i=t[1],a=t[2],o=t[3],s=t[4],l=t[5],u=t[6],c=t[7],h=t[8],f=e[0],d=e[1],p=e[2],m=e[3],v=e[4],g=e[5],y=t[6],b=e[7],x=e[8];return Math.abs(r-f)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(f))&&Math.abs(i-d)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(a-p)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(p))&&Math.abs(o-m)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(m))&&Math.abs(s-v)<=n.EPSILON*Math.max(1,Math.abs(s),Math.abs(v))&&Math.abs(l-g)<=n.EPSILON*Math.max(1,Math.abs(l),Math.abs(g))&&Math.abs(u-y)<=n.EPSILON*Math.max(1,Math.abs(u),Math.abs(y))&&Math.abs(c-b)<=n.EPSILON*Math.max(1,Math.abs(c),Math.abs(b))&&Math.abs(h-x)<=n.EPSILON*Math.max(1,Math.abs(h),Math.abs(x))},e.exports=i},{"./common.js":189}],193:[function(t,e,r){var n=t("./common.js"),i={scalar:{},SIMD:{}};i.create=function(){var t=new n.ARRAY_TYPE(16);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},i.clone=function(t){var e=new n.ARRAY_TYPE(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},i.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],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},i.fromValues=function(t,e,r,i,a,o,s,l,u,c,h,f,d,p,m,v){var g=new n.ARRAY_TYPE(16);return g[0]=t,g[1]=e,g[2]=r,g[3]=i,g[4]=a,g[5]=o,g[6]=s,g[7]=l,g[8]=u,g[9]=c,g[10]=h,g[11]=f,g[12]=d,g[13]=p,g[14]=m,g[15]=v,g},i.set=function(t,e,r,n,i,a,o,s,l,u,c,h,f,d,p,m,v){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=l,t[8]=u,t[9]=c,t[10]=h,t[11]=f,t[12]=d,t[13]=p,t[14]=m,t[15]=v,t},i.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},i.scalar.transpose=function(t,e){if(t===e){var r=e[1],n=e[2],i=e[3],a=e[6],o=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=a,t[11]=e[14],t[12]=i,t[13]=o,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t},i.SIMD.transpose=function(t,e){var r,n,i,a,o,s,l,u,c,h;return r=SIMD.Float32x4.load(e,0),n=SIMD.Float32x4.load(e,4),i=SIMD.Float32x4.load(e,8),a=SIMD.Float32x4.load(e,12),o=SIMD.Float32x4.shuffle(r,n,0,1,4,5),s=SIMD.Float32x4.shuffle(i,a,0,1,4,5),l=SIMD.Float32x4.shuffle(o,s,0,2,4,6),u=SIMD.Float32x4.shuffle(o,s,1,3,5,7),SIMD.Float32x4.store(t,0,l),SIMD.Float32x4.store(t,4,u),o=SIMD.Float32x4.shuffle(r,n,2,3,6,7),s=SIMD.Float32x4.shuffle(i,a,2,3,6,7),c=SIMD.Float32x4.shuffle(o,s,0,2,4,6),h=SIMD.Float32x4.shuffle(o,s,1,3,5,7),SIMD.Float32x4.store(t,8,c),SIMD.Float32x4.store(t,12,h),t},i.transpose=n.USE_SIMD?i.SIMD.transpose:i.scalar.transpose,i.scalar.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],h=e[9],f=e[10],d=e[11],p=e[12],m=e[13],v=e[14],g=e[15],y=r*s-n*o,b=r*l-i*o,x=r*u-a*o,_=n*l-i*s,w=n*u-a*s,M=i*u-a*l,k=c*m-h*p,A=c*v-f*p,T=c*g-d*p,S=h*v-f*m,E=h*g-d*m,L=f*g-d*v,C=y*L-b*E+x*S+_*T-w*A+M*k;return C?(C=1/C,t[0]=(s*L-l*E+u*S)*C,t[1]=(i*E-n*L-a*S)*C,t[2]=(m*M-v*w+g*_)*C,t[3]=(f*w-h*M-d*_)*C,t[4]=(l*T-o*L-u*A)*C,t[5]=(r*L-i*T+a*A)*C,t[6]=(v*x-p*M-g*b)*C,t[7]=(c*M-f*x+d*b)*C,t[8]=(o*E-s*T+u*k)*C,t[9]=(n*T-r*E-a*k)*C,t[10]=(p*w-m*x+g*y)*C,t[11]=(h*x-c*w-d*y)*C,t[12]=(s*A-o*S-l*k)*C,t[13]=(r*S-n*A+i*k)*C,t[14]=(m*b-p*_-v*y)*C,t[15]=(c*_-h*b+f*y)*C,t):null},i.SIMD.invert=function(t,e){var r,n,i,a,o,s,l,u,c,h,f=SIMD.Float32x4.load(e,0),d=SIMD.Float32x4.load(e,4),p=SIMD.Float32x4.load(e,8),m=SIMD.Float32x4.load(e,12);return o=SIMD.Float32x4.shuffle(f,d,0,1,4,5),n=SIMD.Float32x4.shuffle(p,m,0,1,4,5),r=SIMD.Float32x4.shuffle(o,n,0,2,4,6),n=SIMD.Float32x4.shuffle(n,o,1,3,5,7),o=SIMD.Float32x4.shuffle(f,d,2,3,6,7),a=SIMD.Float32x4.shuffle(p,m,2,3,6,7),i=SIMD.Float32x4.shuffle(o,a,0,2,4,6),a=SIMD.Float32x4.shuffle(a,o,1,3,5,7),o=SIMD.Float32x4.mul(i,a),o=SIMD.Float32x4.swizzle(o,1,0,3,2),s=SIMD.Float32x4.mul(n,o),l=SIMD.Float32x4.mul(r,o),o=SIMD.Float32x4.swizzle(o,2,3,0,1),s=SIMD.Float32x4.sub(SIMD.Float32x4.mul(n,o),s),l=SIMD.Float32x4.sub(SIMD.Float32x4.mul(r,o),l),l=SIMD.Float32x4.swizzle(l,2,3,0,1),o=SIMD.Float32x4.mul(n,i),o=SIMD.Float32x4.swizzle(o,1,0,3,2),s=SIMD.Float32x4.add(SIMD.Float32x4.mul(a,o),s),c=SIMD.Float32x4.mul(r,o),o=SIMD.Float32x4.swizzle(o,2,3,0,1),s=SIMD.Float32x4.sub(s,SIMD.Float32x4.mul(a,o)),c=SIMD.Float32x4.sub(SIMD.Float32x4.mul(r,o),c),c=SIMD.Float32x4.swizzle(c,2,3,0,1),o=SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(n,2,3,0,1),a),o=SIMD.Float32x4.swizzle(o,1,0,3,2),i=SIMD.Float32x4.swizzle(i,2,3,0,1),s=SIMD.Float32x4.add(SIMD.Float32x4.mul(i,o),s),u=SIMD.Float32x4.mul(r,o),o=SIMD.Float32x4.swizzle(o,2,3,0,1),s=SIMD.Float32x4.sub(s,SIMD.Float32x4.mul(i,o)),u=SIMD.Float32x4.sub(SIMD.Float32x4.mul(r,o),u),u=SIMD.Float32x4.swizzle(u,2,3,0,1),o=SIMD.Float32x4.mul(r,n),o=SIMD.Float32x4.swizzle(o,1,0,3,2),u=SIMD.Float32x4.add(SIMD.Float32x4.mul(a,o),u),c=SIMD.Float32x4.sub(SIMD.Float32x4.mul(i,o),c),o=SIMD.Float32x4.swizzle(o,2,3,0,1),u=SIMD.Float32x4.sub(SIMD.Float32x4.mul(a,o),u),c=SIMD.Float32x4.sub(c,SIMD.Float32x4.mul(i,o)),o=SIMD.Float32x4.mul(r,a),o=SIMD.Float32x4.swizzle(o,1,0,3,2),l=SIMD.Float32x4.sub(l,SIMD.Float32x4.mul(i,o)),u=SIMD.Float32x4.add(SIMD.Float32x4.mul(n,o),u),o=SIMD.Float32x4.swizzle(o,2,3,0,1),l=SIMD.Float32x4.add(SIMD.Float32x4.mul(i,o),l),u=SIMD.Float32x4.sub(u,SIMD.Float32x4.mul(n,o)),o=SIMD.Float32x4.mul(r,i),o=SIMD.Float32x4.swizzle(o,1,0,3,2),l=SIMD.Float32x4.add(SIMD.Float32x4.mul(a,o),l),c=SIMD.Float32x4.sub(c,SIMD.Float32x4.mul(n,o)),o=SIMD.Float32x4.swizzle(o,2,3,0,1),l=SIMD.Float32x4.sub(l,SIMD.Float32x4.mul(a,o)),c=SIMD.Float32x4.add(SIMD.Float32x4.mul(n,o),c),h=SIMD.Float32x4.mul(r,s),h=SIMD.Float32x4.add(SIMD.Float32x4.swizzle(h,2,3,0,1),h),h=SIMD.Float32x4.add(SIMD.Float32x4.swizzle(h,1,0,3,2),h),o=SIMD.Float32x4.reciprocalApproximation(h),h=SIMD.Float32x4.sub(SIMD.Float32x4.add(o,o),SIMD.Float32x4.mul(h,SIMD.Float32x4.mul(o,o))),(h=SIMD.Float32x4.swizzle(h,0,0,0,0))?(SIMD.Float32x4.store(t,0,SIMD.Float32x4.mul(h,s)),SIMD.Float32x4.store(t,4,SIMD.Float32x4.mul(h,l)),SIMD.Float32x4.store(t,8,SIMD.Float32x4.mul(h,u)),SIMD.Float32x4.store(t,12,SIMD.Float32x4.mul(h,c)),t):null},i.invert=n.USE_SIMD?i.SIMD.invert:i.scalar.invert,i.scalar.adjoint=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],h=e[9],f=e[10],d=e[11],p=e[12],m=e[13],v=e[14],g=e[15];return t[0]=s*(f*g-d*v)-h*(l*g-u*v)+m*(l*d-u*f),t[1]=-(n*(f*g-d*v)-h*(i*g-a*v)+m*(i*d-a*f)),t[2]=n*(l*g-u*v)-s*(i*g-a*v)+m*(i*u-a*l),t[3]=-(n*(l*d-u*f)-s*(i*d-a*f)+h*(i*u-a*l)),t[4]=-(o*(f*g-d*v)-c*(l*g-u*v)+p*(l*d-u*f)),t[5]=r*(f*g-d*v)-c*(i*g-a*v)+p*(i*d-a*f),t[6]=-(r*(l*g-u*v)-o*(i*g-a*v)+p*(i*u-a*l)),t[7]=r*(l*d-u*f)-o*(i*d-a*f)+c*(i*u-a*l),t[8]=o*(h*g-d*m)-c*(s*g-u*m)+p*(s*d-u*h),t[9]=-(r*(h*g-d*m)-c*(n*g-a*m)+p*(n*d-a*h)),t[10]=r*(s*g-u*m)-o*(n*g-a*m)+p*(n*u-a*s),t[11]=-(r*(s*d-u*h)-o*(n*d-a*h)+c*(n*u-a*s)),t[12]=-(o*(h*v-f*m)-c*(s*v-l*m)+p*(s*f-l*h)),t[13]=r*(h*v-f*m)-c*(n*v-i*m)+p*(n*f-i*h),t[14]=-(r*(s*v-l*m)-o*(n*v-i*m)+p*(n*l-i*s)),t[15]=r*(s*f-l*h)-o*(n*f-i*h)+c*(n*l-i*s),t},i.SIMD.adjoint=function(t,e){var r,n,i,a,o,s,l,u,c,h,f,d,p,r=SIMD.Float32x4.load(e,0),n=SIMD.Float32x4.load(e,4),i=SIMD.Float32x4.load(e,8),a=SIMD.Float32x4.load(e,12);return c=SIMD.Float32x4.shuffle(r,n,0,1,4,5),s=SIMD.Float32x4.shuffle(i,a,0,1,4,5),o=SIMD.Float32x4.shuffle(c,s,0,2,4,6),s=SIMD.Float32x4.shuffle(s,c,1,3,5,7),c=SIMD.Float32x4.shuffle(r,n,2,3,6,7),u=SIMD.Float32x4.shuffle(i,a,2,3,6,7),l=SIMD.Float32x4.shuffle(c,u,0,2,4,6),u=SIMD.Float32x4.shuffle(u,c,1,3,5,7),c=SIMD.Float32x4.mul(l,u),c=SIMD.Float32x4.swizzle(c,1,0,3,2),h=SIMD.Float32x4.mul(s,c),f=SIMD.Float32x4.mul(o,c),c=SIMD.Float32x4.swizzle(c,2,3,0,1),h=SIMD.Float32x4.sub(SIMD.Float32x4.mul(s,c),h),f=SIMD.Float32x4.sub(SIMD.Float32x4.mul(o,c),f),f=SIMD.Float32x4.swizzle(f,2,3,0,1),c=SIMD.Float32x4.mul(s,l),c=SIMD.Float32x4.swizzle(c,1,0,3,2),h=SIMD.Float32x4.add(SIMD.Float32x4.mul(u,c),h),p=SIMD.Float32x4.mul(o,c),c=SIMD.Float32x4.swizzle(c,2,3,0,1),h=SIMD.Float32x4.sub(h,SIMD.Float32x4.mul(u,c)),p=SIMD.Float32x4.sub(SIMD.Float32x4.mul(o,c),p),p=SIMD.Float32x4.swizzle(p,2,3,0,1),c=SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(s,2,3,0,1),u),c=SIMD.Float32x4.swizzle(c,1,0,3,2),l=SIMD.Float32x4.swizzle(l,2,3,0,1),h=SIMD.Float32x4.add(SIMD.Float32x4.mul(l,c),h),d=SIMD.Float32x4.mul(o,c),c=SIMD.Float32x4.swizzle(c,2,3,0,1),h=SIMD.Float32x4.sub(h,SIMD.Float32x4.mul(l,c)),d=SIMD.Float32x4.sub(SIMD.Float32x4.mul(o,c),d),d=SIMD.Float32x4.swizzle(d,2,3,0,1),c=SIMD.Float32x4.mul(o,s),c=SIMD.Float32x4.swizzle(c,1,0,3,2),d=SIMD.Float32x4.add(SIMD.Float32x4.mul(u,c),d),p=SIMD.Float32x4.sub(SIMD.Float32x4.mul(l,c),p),c=SIMD.Float32x4.swizzle(c,2,3,0,1),d=SIMD.Float32x4.sub(SIMD.Float32x4.mul(u,c),d),p=SIMD.Float32x4.sub(p,SIMD.Float32x4.mul(l,c)),c=SIMD.Float32x4.mul(o,u),c=SIMD.Float32x4.swizzle(c,1,0,3,2),f=SIMD.Float32x4.sub(f,SIMD.Float32x4.mul(l,c)),d=SIMD.Float32x4.add(SIMD.Float32x4.mul(s,c),d),c=SIMD.Float32x4.swizzle(c,2,3,0,1),f=SIMD.Float32x4.add(SIMD.Float32x4.mul(l,c),f),d=SIMD.Float32x4.sub(d,SIMD.Float32x4.mul(s,c)),c=SIMD.Float32x4.mul(o,l),c=SIMD.Float32x4.swizzle(c,1,0,3,2),f=SIMD.Float32x4.add(SIMD.Float32x4.mul(u,c),f),p=SIMD.Float32x4.sub(p,SIMD.Float32x4.mul(s,c)),c=SIMD.Float32x4.swizzle(c,2,3,0,1),f=SIMD.Float32x4.sub(f,SIMD.Float32x4.mul(u,c)),p=SIMD.Float32x4.add(SIMD.Float32x4.mul(s,c),p),SIMD.Float32x4.store(t,0,h),SIMD.Float32x4.store(t,4,f),SIMD.Float32x4.store(t,8,d),SIMD.Float32x4.store(t,12,p),t},i.adjoint=n.USE_SIMD?i.SIMD.adjoint:i.scalar.adjoint,i.determinant=function(t){var e=t[0],r=t[1],n=t[2],i=t[3],a=t[4],o=t[5],s=t[6],l=t[7],u=t[8],c=t[9],h=t[10],f=t[11],d=t[12],p=t[13],m=t[14],v=t[15]
23 ;return(e*o-r*a)*(h*v-f*m)-(e*s-n*a)*(c*v-f*p)+(e*l-i*a)*(c*m-h*p)+(r*s-n*o)*(u*v-f*d)-(r*l-i*o)*(u*m-h*d)+(n*l-i*s)*(u*p-c*d)},i.SIMD.multiply=function(t,e,r){var n=SIMD.Float32x4.load(e,0),i=SIMD.Float32x4.load(e,4),a=SIMD.Float32x4.load(e,8),o=SIMD.Float32x4.load(e,12),s=SIMD.Float32x4.load(r,0),l=SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(s,0,0,0,0),n),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(s,1,1,1,1),i),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(s,2,2,2,2),a),SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(s,3,3,3,3),o))));SIMD.Float32x4.store(t,0,l);var u=SIMD.Float32x4.load(r,4),c=SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(u,0,0,0,0),n),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(u,1,1,1,1),i),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(u,2,2,2,2),a),SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(u,3,3,3,3),o))));SIMD.Float32x4.store(t,4,c);var h=SIMD.Float32x4.load(r,8),f=SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(h,0,0,0,0),n),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(h,1,1,1,1),i),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(h,2,2,2,2),a),SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(h,3,3,3,3),o))));SIMD.Float32x4.store(t,8,f);var d=SIMD.Float32x4.load(r,12),p=SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(d,0,0,0,0),n),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(d,1,1,1,1),i),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(d,2,2,2,2),a),SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(d,3,3,3,3),o))));return SIMD.Float32x4.store(t,12,p),t},i.scalar.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],h=e[8],f=e[9],d=e[10],p=e[11],m=e[12],v=e[13],g=e[14],y=e[15],b=r[0],x=r[1],_=r[2],w=r[3];return t[0]=b*n+x*s+_*h+w*m,t[1]=b*i+x*l+_*f+w*v,t[2]=b*a+x*u+_*d+w*g,t[3]=b*o+x*c+_*p+w*y,b=r[4],x=r[5],_=r[6],w=r[7],t[4]=b*n+x*s+_*h+w*m,t[5]=b*i+x*l+_*f+w*v,t[6]=b*a+x*u+_*d+w*g,t[7]=b*o+x*c+_*p+w*y,b=r[8],x=r[9],_=r[10],w=r[11],t[8]=b*n+x*s+_*h+w*m,t[9]=b*i+x*l+_*f+w*v,t[10]=b*a+x*u+_*d+w*g,t[11]=b*o+x*c+_*p+w*y,b=r[12],x=r[13],_=r[14],w=r[15],t[12]=b*n+x*s+_*h+w*m,t[13]=b*i+x*l+_*f+w*v,t[14]=b*a+x*u+_*d+w*g,t[15]=b*o+x*c+_*p+w*y,t},i.multiply=n.USE_SIMD?i.SIMD.multiply:i.scalar.multiply,i.mul=i.multiply,i.scalar.translate=function(t,e,r){var n,i,a,o,s,l,u,c,h,f,d,p,m=r[0],v=r[1],g=r[2];return e===t?(t[12]=e[0]*m+e[4]*v+e[8]*g+e[12],t[13]=e[1]*m+e[5]*v+e[9]*g+e[13],t[14]=e[2]*m+e[6]*v+e[10]*g+e[14],t[15]=e[3]*m+e[7]*v+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],h=e[8],f=e[9],d=e[10],p=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]=h,t[9]=f,t[10]=d,t[11]=p,t[12]=n*m+s*v+h*g+e[12],t[13]=i*m+l*v+f*g+e[13],t[14]=a*m+u*v+d*g+e[14],t[15]=o*m+c*v+p*g+e[15]),t},i.SIMD.translate=function(t,e,r){var n=SIMD.Float32x4.load(e,0),i=SIMD.Float32x4.load(e,4),a=SIMD.Float32x4.load(e,8),o=SIMD.Float32x4.load(e,12),s=SIMD.Float32x4(r[0],r[1],r[2],0);e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11]),n=SIMD.Float32x4.mul(n,SIMD.Float32x4.swizzle(s,0,0,0,0)),i=SIMD.Float32x4.mul(i,SIMD.Float32x4.swizzle(s,1,1,1,1)),a=SIMD.Float32x4.mul(a,SIMD.Float32x4.swizzle(s,2,2,2,2));var l=SIMD.Float32x4.add(n,SIMD.Float32x4.add(i,SIMD.Float32x4.add(a,o)));return SIMD.Float32x4.store(t,12,l),t},i.translate=n.USE_SIMD?i.SIMD.translate:i.scalar.translate,i.scalar.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},i.SIMD.scale=function(t,e,r){var n,i,a,o=SIMD.Float32x4(r[0],r[1],r[2],0);return n=SIMD.Float32x4.load(e,0),SIMD.Float32x4.store(t,0,SIMD.Float32x4.mul(n,SIMD.Float32x4.swizzle(o,0,0,0,0))),i=SIMD.Float32x4.load(e,4),SIMD.Float32x4.store(t,4,SIMD.Float32x4.mul(i,SIMD.Float32x4.swizzle(o,1,1,1,1))),a=SIMD.Float32x4.load(e,8),SIMD.Float32x4.store(t,8,SIMD.Float32x4.mul(a,SIMD.Float32x4.swizzle(o,2,2,2,2))),t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},i.scale=n.USE_SIMD?i.SIMD.scale:i.scalar.scale,i.rotate=function(t,e,r,i){var a,o,s,l,u,c,h,f,d,p,m,v,g,y,b,x,_,w,M,k,A,T,S,E,L=i[0],C=i[1],z=i[2],D=Math.sqrt(L*L+C*C+z*z);return Math.abs(D)<n.EPSILON?null:(D=1/D,L*=D,C*=D,z*=D,a=Math.sin(r),o=Math.cos(r),s=1-o,l=e[0],u=e[1],c=e[2],h=e[3],f=e[4],d=e[5],p=e[6],m=e[7],v=e[8],g=e[9],y=e[10],b=e[11],x=L*L*s+o,_=C*L*s+z*a,w=z*L*s-C*a,M=L*C*s-z*a,k=C*C*s+o,A=z*C*s+L*a,T=L*z*s+C*a,S=C*z*s-L*a,E=z*z*s+o,t[0]=l*x+f*_+v*w,t[1]=u*x+d*_+g*w,t[2]=c*x+p*_+y*w,t[3]=h*x+m*_+b*w,t[4]=l*M+f*k+v*A,t[5]=u*M+d*k+g*A,t[6]=c*M+p*k+y*A,t[7]=h*M+m*k+b*A,t[8]=l*T+f*S+v*E,t[9]=u*T+d*S+g*E,t[10]=c*T+p*S+y*E,t[11]=h*T+m*S+b*E,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)},i.scalar.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],h=e[10],f=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+h*n,t[7]=l*i+f*n,t[8]=u*i-a*n,t[9]=c*i-o*n,t[10]=h*i-s*n,t[11]=f*i-l*n,t},i.SIMD.rotateX=function(t,e,r){var n=SIMD.Float32x4.splat(Math.sin(r)),i=SIMD.Float32x4.splat(Math.cos(r));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]);var a=SIMD.Float32x4.load(e,4),o=SIMD.Float32x4.load(e,8);return SIMD.Float32x4.store(t,4,SIMD.Float32x4.add(SIMD.Float32x4.mul(a,i),SIMD.Float32x4.mul(o,n))),SIMD.Float32x4.store(t,8,SIMD.Float32x4.sub(SIMD.Float32x4.mul(o,i),SIMD.Float32x4.mul(a,n))),t},i.rotateX=n.USE_SIMD?i.SIMD.rotateX:i.scalar.rotateX,i.scalar.rotateY=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[8],c=e[9],h=e[10],f=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],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-h*n,t[3]=l*i-f*n,t[8]=a*n+u*i,t[9]=o*n+c*i,t[10]=s*n+h*i,t[11]=l*n+f*i,t},i.SIMD.rotateY=function(t,e,r){var n=SIMD.Float32x4.splat(Math.sin(r)),i=SIMD.Float32x4.splat(Math.cos(r));e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]);var a=SIMD.Float32x4.load(e,0),o=SIMD.Float32x4.load(e,8);return SIMD.Float32x4.store(t,0,SIMD.Float32x4.sub(SIMD.Float32x4.mul(a,i),SIMD.Float32x4.mul(o,n))),SIMD.Float32x4.store(t,8,SIMD.Float32x4.add(SIMD.Float32x4.mul(a,n),SIMD.Float32x4.mul(o,i))),t},i.rotateY=n.USE_SIMD?i.SIMD.rotateY:i.scalar.rotateY,i.scalar.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],h=e[6],f=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+h*n,t[3]=l*i+f*n,t[4]=u*i-a*n,t[5]=c*i-o*n,t[6]=h*i-s*n,t[7]=f*i-l*n,t},i.SIMD.rotateZ=function(t,e,r){var n=SIMD.Float32x4.splat(Math.sin(r)),i=SIMD.Float32x4.splat(Math.cos(r));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]);var a=SIMD.Float32x4.load(e,0),o=SIMD.Float32x4.load(e,4);return SIMD.Float32x4.store(t,0,SIMD.Float32x4.add(SIMD.Float32x4.mul(a,i),SIMD.Float32x4.mul(o,n))),SIMD.Float32x4.store(t,4,SIMD.Float32x4.sub(SIMD.Float32x4.mul(o,i),SIMD.Float32x4.mul(a,n))),t},i.rotateZ=n.USE_SIMD?i.SIMD.rotateZ:i.scalar.rotateZ,i.fromTranslation=function(t,e){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]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t},i.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},i.fromRotation=function(t,e,r){var i,a,o,s=r[0],l=r[1],u=r[2],c=Math.sqrt(s*s+l*l+u*u);return Math.abs(c)<n.EPSILON?null:(c=1/c,s*=c,l*=c,u*=c,i=Math.sin(e),a=Math.cos(e),o=1-a,t[0]=s*s*o+a,t[1]=l*s*o+u*i,t[2]=u*s*o-l*i,t[3]=0,t[4]=s*l*o-u*i,t[5]=l*l*o+a,t[6]=u*l*o+s*i,t[7]=0,t[8]=s*u*o+l*i,t[9]=l*u*o-s*i,t[10]=u*u*o+a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)},i.fromXRotation=function(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=n,t[6]=r,t[7]=0,t[8]=0,t[9]=-r,t[10]=n,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},i.fromYRotation=function(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=0,t[2]=-r,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=r,t[9]=0,t[10]=n,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},i.fromZRotation=function(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=0,t[3]=0,t[4]=-r,t[5]=n,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},i.fromRotationTranslation=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=n+n,l=i+i,u=a+a,c=n*s,h=n*l,f=n*u,d=i*l,p=i*u,m=a*u,v=o*s,g=o*l,y=o*u;return t[0]=1-(d+m),t[1]=h+y,t[2]=f-g,t[3]=0,t[4]=h-y,t[5]=1-(c+m),t[6]=p+v,t[7]=0,t[8]=f+g,t[9]=p-v,t[10]=1-(c+d),t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t},i.getTranslation=function(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t},i.getRotation=function(t,e){var r=e[0]+e[5]+e[10],n=0;return r>0?(n=2*Math.sqrt(r+1),t[3]=.25*n,t[0]=(e[6]-e[9])/n,t[1]=(e[8]-e[2])/n,t[2]=(e[1]-e[4])/n):e[0]>e[5]&e[0]>e[10]?(n=2*Math.sqrt(1+e[0]-e[5]-e[10]),t[3]=(e[6]-e[9])/n,t[0]=.25*n,t[1]=(e[1]+e[4])/n,t[2]=(e[8]+e[2])/n):e[5]>e[10]?(n=2*Math.sqrt(1+e[5]-e[0]-e[10]),t[3]=(e[8]-e[2])/n,t[0]=(e[1]+e[4])/n,t[1]=.25*n,t[2]=(e[6]+e[9])/n):(n=2*Math.sqrt(1+e[10]-e[0]-e[5]),t[3]=(e[1]-e[4])/n,t[0]=(e[8]+e[2])/n,t[1]=(e[6]+e[9])/n,t[2]=.25*n),t},i.fromRotationTranslationScale=function(t,e,r,n){var i=e[0],a=e[1],o=e[2],s=e[3],l=i+i,u=a+a,c=o+o,h=i*l,f=i*u,d=i*c,p=a*u,m=a*c,v=o*c,g=s*l,y=s*u,b=s*c,x=n[0],_=n[1],w=n[2];return t[0]=(1-(p+v))*x,t[1]=(f+b)*x,t[2]=(d-y)*x,t[3]=0,t[4]=(f-b)*_,t[5]=(1-(h+v))*_,t[6]=(m+g)*_,t[7]=0,t[8]=(d+y)*w,t[9]=(m-g)*w,t[10]=(1-(h+p))*w,t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t},i.fromRotationTranslationScaleOrigin=function(t,e,r,n,i){var a=e[0],o=e[1],s=e[2],l=e[3],u=a+a,c=o+o,h=s+s,f=a*u,d=a*c,p=a*h,m=o*c,v=o*h,g=s*h,y=l*u,b=l*c,x=l*h,_=n[0],w=n[1],M=n[2],k=i[0],A=i[1],T=i[2];return t[0]=(1-(m+g))*_,t[1]=(d+x)*_,t[2]=(p-b)*_,t[3]=0,t[4]=(d-x)*w,t[5]=(1-(f+g))*w,t[6]=(v+y)*w,t[7]=0,t[8]=(p+b)*M,t[9]=(v-y)*M,t[10]=(1-(f+m))*M,t[11]=0,t[12]=r[0]+k-(t[0]*k+t[4]*A+t[8]*T),t[13]=r[1]+A-(t[1]*k+t[5]*A+t[9]*T),t[14]=r[2]+T-(t[2]*k+t[6]*A+t[10]*T),t[15]=1,t},i.fromQuat=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,h=n*s,f=i*o,d=i*s,p=i*l,m=a*o,v=a*s,g=a*l;return t[0]=1-h-p,t[1]=c+g,t[2]=f-v,t[3]=0,t[4]=c-g,t[5]=1-u-p,t[6]=d+m,t[7]=0,t[8]=f+v,t[9]=d-m,t[10]=1-u-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},i.frustum=function(t,e,r,n,i,a,o){var s=1/(r-e),l=1/(i-n),u=1/(a-o);return t[0]=2*a*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*a*l,t[6]=0,t[7]=0,t[8]=(r+e)*s,t[9]=(i+n)*l,t[10]=(o+a)*u,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*a*2*u,t[15]=0,t},i.perspective=function(t,e,r,n,i){var a=1/Math.tan(e/2),o=1/(n-i);return t[0]=a/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=(i+n)*o,t[11]=-1,t[12]=0,t[13]=0,t[14]=2*i*n*o,t[15]=0,t},i.perspectiveFromFieldOfView=function(t,e,r,n){var i=Math.tan(e.upDegrees*Math.PI/180),a=Math.tan(e.downDegrees*Math.PI/180),o=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),l=2/(o+s),u=2/(i+a);return t[0]=l,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=u,t[6]=0,t[7]=0,t[8]=-((o-s)*l)*.5,t[9]=(i-a)*u*.5,t[10]=n/(r-n),t[11]=-1,t[12]=0,t[13]=0,t[14]=n*r/(r-n),t[15]=0,t},i.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},i.lookAt=function(t,e,r,a){var o,s,l,u,c,h,f,d,p,m,v=e[0],g=e[1],y=e[2],b=a[0],x=a[1],_=a[2],w=r[0],M=r[1],k=r[2];return Math.abs(v-w)<n.EPSILON&&Math.abs(g-M)<n.EPSILON&&Math.abs(y-k)<n.EPSILON?i.identity(t):(f=v-w,d=g-M,p=y-k,m=1/Math.sqrt(f*f+d*d+p*p),f*=m,d*=m,p*=m,o=x*p-_*d,s=_*f-b*p,l=b*d-x*f,m=Math.sqrt(o*o+s*s+l*l),m?(m=1/m,o*=m,s*=m,l*=m):(o=0,s=0,l=0),u=d*l-p*s,c=p*o-f*l,h=f*s-d*o,m=Math.sqrt(u*u+c*c+h*h),m?(m=1/m,u*=m,c*=m,h*=m):(u=0,c=0,h=0),t[0]=o,t[1]=u,t[2]=f,t[3]=0,t[4]=s,t[5]=c,t[6]=d,t[7]=0,t[8]=l,t[9]=h,t[10]=p,t[11]=0,t[12]=-(o*v+s*g+l*y),t[13]=-(u*v+c*g+h*y),t[14]=-(f*v+d*g+p*y),t[15]=1,t)},i.str=function(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"},i.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+Math.pow(t[6],2)+Math.pow(t[7],2)+Math.pow(t[8],2)+Math.pow(t[9],2)+Math.pow(t[10],2)+Math.pow(t[11],2)+Math.pow(t[12],2)+Math.pow(t[13],2)+Math.pow(t[14],2)+Math.pow(t[15],2))},i.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t[9]=e[9]+r[9],t[10]=e[10]+r[10],t[11]=e[11]+r[11],t[12]=e[12]+r[12],t[13]=e[13]+r[13],t[14]=e[14]+r[14],t[15]=e[15]+r[15],t},i.subtract=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t[9]=e[9]-r[9],t[10]=e[10]-r[10],t[11]=e[11]-r[11],t[12]=e[12]-r[12],t[13]=e[13]-r[13],t[14]=e[14]-r[14],t[15]=e[15]-r[15],t},i.sub=i.subtract,i.multiplyScalar=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t[9]=e[9]*r,t[10]=e[10]*r,t[11]=e[11]*r,t[12]=e[12]*r,t[13]=e[13]*r,t[14]=e[14]*r,t[15]=e[15]*r,t},i.multiplyScalarAndAdd=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t[9]=e[9]+r[9]*n,t[10]=e[10]+r[10]*n,t[11]=e[11]+r[11]*n,t[12]=e[12]+r[12]*n,t[13]=e[13]+r[13]*n,t[14]=e[14]+r[14]*n,t[15]=e[15]+r[15]*n,t},i.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&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]},i.equals=function(t,e){var r=t[0],i=t[1],a=t[2],o=t[3],s=t[4],l=t[5],u=t[6],c=t[7],h=t[8],f=t[9],d=t[10],p=t[11],m=t[12],v=t[13],g=t[14],y=t[15],b=e[0],x=e[1],_=e[2],w=e[3],M=e[4],k=e[5],A=e[6],T=e[7],S=e[8],E=e[9],L=e[10],C=e[11],z=e[12],D=e[13],I=e[14],P=e[15];return Math.abs(r-b)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(b))&&Math.abs(i-x)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(x))&&Math.abs(a-_)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(_))&&Math.abs(o-w)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(w))&&Math.abs(s-M)<=n.EPSILON*Math.max(1,Math.abs(s),Math.abs(M))&&Math.abs(l-k)<=n.EPSILON*Math.max(1,Math.abs(l),Math.abs(k))&&Math.abs(u-A)<=n.EPSILON*Math.max(1,Math.abs(u),Math.abs(A))&&Math.abs(c-T)<=n.EPSILON*Math.max(1,Math.abs(c),Math.abs(T))&&Math.abs(h-S)<=n.EPSILON*Math.max(1,Math.abs(h),Math.abs(S))&&Math.abs(f-E)<=n.EPSILON*Math.max(1,Math.abs(f),Math.abs(E))&&Math.abs(d-L)<=n.EPSILON*Math.max(1,Math.abs(d),Math.abs(L))&&Math.abs(p-C)<=n.EPSILON*Math.max(1,Math.abs(p),Math.abs(C))&&Math.abs(m-z)<=n.EPSILON*Math.max(1,Math.abs(m),Math.abs(z))&&Math.abs(v-D)<=n.EPSILON*Math.max(1,Math.abs(v),Math.abs(D))&&Math.abs(g-I)<=n.EPSILON*Math.max(1,Math.abs(g),Math.abs(I))&&Math.abs(y-P)<=n.EPSILON*Math.max(1,Math.abs(y),Math.abs(P))},e.exports=i},{"./common.js":189}],194:[function(t,e,r){var n=t("./common.js"),i=t("./mat3.js"),a=t("./vec3.js"),o=t("./vec4.js"),s={};s.create=function(){var t=new n.ARRAY_TYPE(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t},s.rotationTo=function(){var t=a.create(),e=a.fromValues(1,0,0),r=a.fromValues(0,1,0);return function(n,i,o){var l=a.dot(i,o);return l<-.999999?(a.cross(t,e,i),a.length(t)<1e-6&&a.cross(t,r,i),a.normalize(t,t),s.setAxisAngle(n,t,Math.PI),n):l>.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(a.cross(t,i,o),n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=1+l,s.normalize(n,n))}}(),s.setAxes=function(){var t=i.create();return function(e,r,n,i){return t[0]=n[0],t[3]=n[1],t[6]=n[2],t[1]=i[0],t[4]=i[1],t[7]=i[2],t[2]=-r[0],t[5]=-r[1],t[8]=-r[2],s.normalize(e,s.fromMat3(e,t))}}(),s.clone=o.clone,s.fromValues=o.fromValues,s.copy=o.copy,s.set=o.set,s.identity=function(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t},s.setAxisAngle=function(t,e,r){r*=.5;var n=Math.sin(r);return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=Math.cos(r),t},s.getAxisAngle=function(t,e){var r=2*Math.acos(e[3]),n=Math.sin(r/2);return 0!=n?(t[0]=e[0]/n,t[1]=e[1]/n,t[2]=e[2]/n):(t[0]=1,t[1]=0,t[2]=0),r},s.add=o.add,s.multiply=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=r[0],l=r[1],u=r[2],c=r[3];return t[0]=n*c+o*s+i*u-a*l,t[1]=i*c+o*l+a*s-n*u,t[2]=a*c+o*u+n*l-i*s,t[3]=o*c-n*s-i*l-a*u,t},s.mul=s.multiply,s.scale=o.scale,s.rotateX=function(t,e,r){r*=.5;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+o*s,t[1]=i*l+a*s,t[2]=a*l-i*s,t[3]=o*l-n*s,t},s.rotateY=function(t,e,r){r*=.5;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]=a*l+n*s,t[3]=o*l-i*s,t},s.rotateZ=function(t,e,r){r*=.5;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+i*s,t[1]=i*l-n*s,t[2]=a*l+o*s,t[3]=o*l-a*s,t},s.calculateW=function(t,e){var r=e[0],n=e[1],i=e[2];return t[0]=r,t[1]=n,t[2]=i,t[3]=Math.sqrt(Math.abs(1-r*r-n*n-i*i)),t},s.dot=o.dot,s.lerp=o.lerp,s.slerp=function(t,e,r,n){var i,a,o,s,l,u=e[0],c=e[1],h=e[2],f=e[3],d=r[0],p=r[1],m=r[2],v=r[3];return a=u*d+c*p+h*m+f*v,a<0&&(a=-a,d=-d,p=-p,m=-m,v=-v),1-a>1e-6?(i=Math.acos(a),o=Math.sin(i),s=Math.sin((1-n)*i)/o,l=Math.sin(n*i)/o):(s=1-n,l=n),t[0]=s*u+l*d,t[1]=s*c+l*p,t[2]=s*h+l*m,t[3]=s*f+l*v,t},s.sqlerp=function(){var t=s.create(),e=s.create();return function(r,n,i,a,o,l){return s.slerp(t,n,o,l),s.slerp(e,i,a,l),s.slerp(r,t,e,2*l*(1-l)),r}}(),s.invert=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r*r+n*n+i*i+a*a,s=o?1/o:0;return t[0]=-r*s,t[1]=-n*s,t[2]=-i*s,t[3]=a*s,t},s.conjugate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t},s.length=o.length,s.len=s.length,s.squaredLength=o.squaredLength,s.sqrLen=s.squaredLength,s.normalize=o.normalize,s.fromMat3=function(t,e){var r,n=e[0]+e[4]+e[8];if(n>0)r=Math.sqrt(n+1),t[3]=.5*r,r=.5/r,t[0]=(e[5]-e[7])*r,t[1]=(e[6]-e[2])*r,t[2]=(e[1]-e[3])*r;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);var a=(i+1)%3,o=(i+2)%3;r=Math.sqrt(e[3*i+i]-e[3*a+a]-e[3*o+o]+1),t[i]=.5*r,r=.5/r,t[3]=(e[3*a+o]-e[3*o+a])*r,t[a]=(e[3*a+i]+e[3*i+a])*r,t[o]=(e[3*o+i]+e[3*i+o])*r}return t},s.str=function(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},s.exactEquals=o.exactEquals,s.equals=o.equals,e.exports=s},{"./common.js":189,"./mat3.js":192,"./vec3.js":196,"./vec4.js":197}],195:[function(t,e,r){var n=t("./common.js"),i={};i.create=function(){var t=new n.ARRAY_TYPE(2);return t[0]=0,t[1]=0,t},i.clone=function(t){var e=new n.ARRAY_TYPE(2);return e[0]=t[0],e[1]=t[1],e},i.fromValues=function(t,e){var r=new n.ARRAY_TYPE(2);return r[0]=t,r[1]=e,r},i.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t},i.set=function(t,e,r){return t[0]=e,t[1]=r,t},i.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t},i.subtract=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t},i.sub=i.subtract,i.multiply=function(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t},i.mul=i.multiply,i.divide=function(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t},i.div=i.divide,i.ceil=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t},i.floor=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t},i.min=function(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t},i.max=function(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t},i.round=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t},i.scale=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t},i.scaleAndAdd=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t},i.distance=function(t,e){var r=e[0]-t[0],n=e[1]-t[1];return Math.sqrt(r*r+n*n)},i.dist=i.distance,i.squaredDistance=function(t,e){var r=e[0]-t[0],n=e[1]-t[1];return r*r+n*n},i.sqrDist=i.squaredDistance,i.length=function(t){var e=t[0],r=t[1];return Math.sqrt(e*e+r*r)},i.len=i.length,i.squaredLength=function(t){var e=t[0],r=t[1];return e*e+r*r},i.sqrLen=i.squaredLength,i.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t},i.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t},i.normalize=function(t,e){var r=e[0],n=e[1],i=r*r+n*n;return i>0&&(i=1/Math.sqrt(i),t[0]=e[0]*i,t[1]=e[1]*i),t},i.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]},i.cross=function(t,e,r){var n=e[0]*r[1]-e[1]*r[0];return t[0]=t[1]=0,t[2]=n,t},i.lerp=function(t,e,r,n){var i=e[0],a=e[1];return t[0]=i+n*(r[0]-i),t[1]=a+n*(r[1]-a),t},i.random=function(t,e){e=e||1;var r=2*n.RANDOM()*Math.PI;return t[0]=Math.cos(r)*e,t[1]=Math.sin(r)*e,t},i.transformMat2=function(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i,t[1]=r[1]*n+r[3]*i,t},i.transformMat2d=function(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i+r[4],t[1]=r[1]*n+r[3]*i+r[5],t},i.transformMat3=function(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[3]*i+r[6],t[1]=r[1]*n+r[4]*i+r[7],t},i.transformMat4=function(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},i.forEach=function(){var t=i.create();return function(e,r,n,i,a,o){var s,l;for(r||(r=2),n||(n=0),l=i?Math.min(i*r+n,e.length):e.length,s=n;s<l;s+=r)t[0]=e[s],t[1]=e[s+1],a(t,t,o),e[s]=t[0],e[s+1]=t[1];return e}}(),i.str=function(t){return"vec2("+t[0]+", "+t[1]+")"},i.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]},i.equals=function(t,e){var r=t[0],i=t[1],a=e[0],o=e[1];return Math.abs(r-a)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(i-o)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(o))},e.exports=i},{"./common.js":189}],196:[function(t,e,r){var n=t("./common.js"),i={};i.create=function(){var t=new n.ARRAY_TYPE(3);return t[0]=0,t[1]=0,t[2]=0,t},i.clone=function(t){var e=new n.ARRAY_TYPE(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},i.fromValues=function(t,e,r){var i=new n.ARRAY_TYPE(3);return i[0]=t,i[1]=e,i[2]=r,i},i.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},i.set=function(t,e,r,n){return t[0]=e,t[1]=r,t[2]=n,t},i.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t},i.subtract=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t},i.sub=i.subtract,i.multiply=function(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t},i.mul=i.multiply,i.divide=function(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t},i.div=i.divide,i.ceil=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t},i.floor=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t},i.min=function(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t},i.max=function(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t},i.round=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t},i.scale=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t},i.scaleAndAdd=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t},i.distance=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return Math.sqrt(r*r+n*n+i*i)},i.dist=i.distance,i.squaredDistance=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return r*r+n*n+i*i},i.sqrDist=i.squaredDistance,i.length=function(t){var e=t[0],r=t[1],n=t[2];return Math.sqrt(e*e+r*r+n*n)},i.len=i.length,i.squaredLength=function(t){var e=t[0],r=t[1],n=t[2];return e*e+r*r+n*n},i.sqrLen=i.squaredLength,i.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t},i.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t},i.normalize=function(t,e){var r=e[0],n=e[1],i=e[2],a=r*r+n*n+i*i;return a>0&&(a=1/Math.sqrt(a),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a),t},i.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]},i.cross=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2];return t[0]=i*l-a*s,t[1]=a*o-n*l,t[2]=n*s-i*o,t},i.lerp=function(t,e,r,n){var i=e[0],a=e[1],o=e[2];return t[0]=i+n*(r[0]-i),t[1]=a+n*(r[1]-a),t[2]=o+n*(r[2]-o),t},i.hermite=function(t,e,r,n,i,a){var o=a*a,s=o*(2*a-3)+1,l=o*(a-2)+a,u=o*(a-1),c=o*(3-2*a);return t[0]=e[0]*s+r[0]*l+n[0]*u+i[0]*c,t[1]=e[1]*s+r[1]*l+n[1]*u+i[1]*c,t[2]=e[2]*s+r[2]*l+n[2]*u+i[2]*c,t},i.bezier=function(t,e,r,n,i,a){var o=1-a,s=o*o,l=a*a,u=s*o,c=3*a*s,h=3*l*o,f=l*a;return t[0]=e[0]*u+r[0]*c+n[0]*h+i[0]*f,t[1]=e[1]*u+r[1]*c+n[1]*h+i[1]*f,t[2]=e[2]*u+r[2]*c+n[2]*h+i[2]*f,t},i.random=function(t,e){e=e||1;var r=2*n.RANDOM()*Math.PI,i=2*n.RANDOM()-1,a=Math.sqrt(1-i*i)*e;return t[0]=Math.cos(r)*a,t[1]=Math.sin(r)*a,t[2]=i*e,t},i.transformMat4=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[3]*n+r[7]*i+r[11]*a+r[15];return o=o||1,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},i.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},i.transformQuat=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2],u=r[3],c=u*n+s*a-l*i,h=u*i+l*n-o*a,f=u*a+o*i-s*n,d=-o*n-s*i-l*a;return t[0]=c*u+d*-o+h*-l-f*-s,t[1]=h*u+d*-s+f*-o-c*-l,t[2]=f*u+d*-l+c*-s-h*-o,t},i.rotateX=function(t,e,r,n){var i=[],a=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],a[0]=i[0],a[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),a[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),t[0]=a[0]+r[0],t[1]=a[1]+r[1],t[2]=a[2]+r[2],t},i.rotateY=function(t,e,r,n){var i=[],a=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],a[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),a[1]=i[1],a[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),t[0]=a[0]+r[0],t[1]=a[1]+r[1],t[2]=a[2]+r[2],t},i.rotateZ=function(t,e,r,n){var i=[],a=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],a[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),a[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),a[2]=i[2],t[0]=a[0]+r[0],t[1]=a[1]+r[1],t[2]=a[2]+r[2],t},i.forEach=function(){var t=i.create();return function(e,r,n,i,a,o){var s,l;for(r||(r=3),n||(n=0),l=i?Math.min(i*r+n,e.length):e.length,s=n;s<l;s+=r)t[0]=e[s],t[1]=e[s+1],t[2]=e[s+2],a(t,t,o),e[s]=t[0],e[s+1]=t[1],e[s+2]=t[2];return e}}(),i.angle=function(t,e){var r=i.fromValues(t[0],t[1],t[2]),n=i.fromValues(e[0],e[1],e[2]);i.normalize(r,r),i.normalize(n,n);var a=i.dot(r,n);return a>1?0:Math.acos(a)},i.str=function(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"},i.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]},i.equals=function(t,e){var r=t[0],i=t[1],a=t[2],o=e[0],s=e[1],l=e[2];return Math.abs(r-o)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(i-s)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(a-l)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(l))},e.exports=i},{"./common.js":189}],197:[function(t,e,r){var n=t("./common.js"),i={};i.create=function(){var t=new n.ARRAY_TYPE(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t},i.clone=function(t){var e=new n.ARRAY_TYPE(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},i.fromValues=function(t,e,r,i){var a=new n.ARRAY_TYPE(4);return a[0]=t,a[1]=e,a[2]=r,a[3]=i,a},i.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},i.set=function(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t},i.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t},i.subtract=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t},i.sub=i.subtract,i.multiply=function(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t[3]=e[3]*r[3],t},i.mul=i.multiply,i.divide=function(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t[3]=e[3]/r[3],t},i.div=i.divide,i.ceil=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t[3]=Math.ceil(e[3]),t},i.floor=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t[3]=Math.floor(e[3]),t},i.min=function(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t[3]=Math.min(e[3],r[3]),t},i.max=function(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t[3]=Math.max(e[3],r[3]),t},i.round=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t[3]=Math.round(e[3]),t},i.scale=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t},i.scaleAndAdd=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t},i.distance=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],a=e[3]-t[3];return Math.sqrt(r*r+n*n+i*i+a*a)},i.dist=i.distance,i.squaredDistance=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],a=e[3]-t[3];return r*r+n*n+i*i+a*a},i.sqrDist=i.squaredDistance,i.length=function(t){var e=t[0],r=t[1],n=t[2],i=t[3];return Math.sqrt(e*e+r*r+n*n+i*i)},i.len=i.length,i.squaredLength=function(t){var e=t[0],r=t[1],n=t[2],i=t[3];return e*e+r*r+n*n+i*i},i.sqrLen=i.squaredLength,i.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t},i.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t[3]=1/e[3],t},i.normalize=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r*r+n*n+i*i+a*a;return o>0&&(o=1/Math.sqrt(o),t[0]=r*o,t[1]=n*o,t[2]=i*o,t[3]=a*o),t},i.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]},i.lerp=function(t,e,r,n){var i=e[0],a=e[1],o=e[2],s=e[3];return t[0]=i+n*(r[0]-i),t[1]=a+n*(r[1]-a),t[2]=o+n*(r[2]-o),t[3]=s+n*(r[3]-s),t},i.random=function(t,e){return e=e||1,t[0]=n.RANDOM(),t[1]=n.RANDOM(),t[2]=n.RANDOM(),t[3]=n.RANDOM(),i.normalize(t,t),i.scale(t,t,e),t},i.transformMat4=function(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},i.transformQuat=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2],u=r[3],c=u*n+s*a-l*i,h=u*i+l*n-o*a,f=u*a+o*i-s*n,d=-o*n-s*i-l*a;return t[0]=c*u+d*-o+h*-l-f*-s,t[1]=h*u+d*-s+f*-o-c*-l,t[2]=f*u+d*-l+c*-s-h*-o,t[3]=e[3],t},i.forEach=function(){var t=i.create();return function(e,r,n,i,a,o){var s,l;for(r||(r=4),n||(n=0),l=i?Math.min(i*r+n,e.length):e.length,s=n;s<l;s+=r)t[0]=e[s],t[1]=e[s+1],t[2]=e[s+2],t[3]=e[s+3],a(t,t,o),e[s]=t[0],e[s+1]=t[1],e[s+2]=t[2],e[s+3]=t[3];return e}}(),i.str=function(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},i.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]},i.equals=function(t,e){var r=t[0],i=t[1],a=t[2],o=t[3],s=e[0],l=e[1],u=e[2],c=e[3];return Math.abs(r-s)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(i-l)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(l))&&Math.abs(a-u)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(u))&&Math.abs(o-c)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(c))},e.exports=i},{"./common.js":189}],198:[function(t,e,r){"use strict";function n(t,e){for(var r=[0,0,0,0],n=0;n<4;++n)for(var i=0;i<4;++i)r[i]+=t[4*n+i]*e[n];return r}function i(t,e,r,i,a){for(var o=n(i,n(r,n(e,[t[0],t[1],t[2],1]))),s=0;s<3;++s)o[s]/=o[3];return[.5*a[0]*(1+o[0]),.5*a[1]*(1-o[1])]}function a(t,e){if(2===t.length){for(var r=0,n=0,i=0;i<2;++i)r+=Math.pow(e[i]-t[0][i],2),n+=Math.pow(e[i]-t[1][i],2);return r=Math.sqrt(r),n=Math.sqrt(n),r+n<1e-6?[1,0]:[n/(r+n),r/(n+r)]}if(3===t.length){var a=[0,0];return u(t[0],t[1],t[2],e,a),l(t,a)}return[]}function o(t,e){for(var r=[0,0,0],n=0;n<t.length;++n)for(var i=t[n],a=e[n],o=0;o<3;++o)r[o]+=a*i[o];return r}function s(t,e,r,n,s,l){if(1===t.length)return[0,t[0].slice()]
24 ;for(var u=new Array(t.length),c=0;c<t.length;++c)u[c]=i(t[c],r,n,s,l);for(var h=0,f=1/0,c=0;c<u.length;++c){for(var d=0,p=0;p<2;++p)d+=Math.pow(u[c][p]-e[p],2);d<f&&(f=d,h=c)}for(var m=a(u,e),v=0,c=0;c<3;++c){if(m[c]<-.001||m[c]>1.0001)return null;v+=m[c]}return Math.abs(v-1)>.001?null:[h,o(t,m),m]}var l=t("barycentric"),u=t("polytope-closest-point/lib/closest_point_2d.js");e.exports=s},{barycentric:45,"polytope-closest-point/lib/closest_point_2d.js":478}],199:[function(t,e,r){var n="precision mediump float;\n#define GLSLIFY 1\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if(any(lessThan(f_position, clipBounds[0])) || \n any(greaterThan(f_position, clipBounds[1]))) {\n discard;\n }\n gl_FragColor = vec4(pickId, f_id.xyz);\n}";r.meshShader={vertex:"precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position, normal;\nattribute vec4 color;\nattribute vec2 uv;\n\nuniform mat4 model\n , view\n , projection;\nuniform vec3 eyePosition\n , lightPosition;\n\nvarying vec3 f_normal\n , f_lightDirection\n , f_eyeDirection\n , f_data;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n vec4 m_position = model * vec4(position, 1.0);\n vec4 t_position = view * m_position;\n gl_Position = projection * t_position;\n f_color = color;\n f_normal = normal;\n f_data = position;\n f_eyeDirection = eyePosition - position;\n f_lightDirection = lightPosition - position;\n f_uv = uv;\n}",fragment:"precision mediump float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution_2_0(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\n\n\nfloat cookTorranceSpecular_1_1(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness,\n float fresnel) {\n\n float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);\n float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);\n\n //Half angle vector\n vec3 H = normalize(lightDirection + viewDirection);\n\n //Geometric term\n float NdotH = max(dot(surfaceNormal, H), 0.0);\n float VdotH = max(dot(viewDirection, H), 0.000001);\n float LdotH = max(dot(lightDirection, H), 0.000001);\n float G1 = (2.0 * NdotH * VdotN) / VdotH;\n float G2 = (2.0 * NdotH * LdotN) / LdotH;\n float G = min(1.0, min(G1, G2));\n \n //Distribution term\n float D = beckmannDistribution_2_0(NdotH, roughness);\n\n //Fresnel term\n float F = pow(1.0 - VdotN, fresnel);\n\n //Multiply terms and done\n return G * F * D / max(3.14159265 * VdotN, 0.000001);\n}\n\n\n\nuniform vec3 clipBounds[2];\nuniform float roughness\n , fresnel\n , kambient\n , kdiffuse\n , kspecular\n , opacity;\nuniform sampler2D texture;\n\nvarying vec3 f_normal\n , f_lightDirection\n , f_eyeDirection\n , f_data;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if(any(lessThan(f_data, clipBounds[0])) || \n any(greaterThan(f_data, clipBounds[1]))) {\n discard;\n }\n\n vec3 N = normalize(f_normal);\n vec3 L = normalize(f_lightDirection);\n vec3 V = normalize(f_eyeDirection);\n \n if(!gl_FrontFacing) {\n N = -N;\n }\n\n float specular = cookTorranceSpecular_1_1(L, V, N, roughness, fresnel);\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n vec4 surfaceColor = f_color * texture2D(texture, f_uv);\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = litColor * opacity;\n}",attributes:[{name:"position",type:"vec3"},{name:"normal",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},r.wireShader={vertex:"precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 uv;\n\nuniform mat4 model, view, projection;\n\nvarying vec4 f_color;\nvarying vec3 f_data;\nvarying vec2 f_uv;\n\nvoid main() {\n gl_Position = projection * view * model * vec4(position, 1.0);\n f_color = color;\n f_data = position;\n f_uv = uv;\n}",fragment:"precision mediump float;\n#define GLSLIFY 1\n\nuniform vec3 clipBounds[2];\nuniform sampler2D texture;\nuniform float opacity;\n\nvarying vec4 f_color;\nvarying vec3 f_data;\nvarying vec2 f_uv;\n\nvoid main() {\n if(any(lessThan(f_data, clipBounds[0])) || \n any(greaterThan(f_data, clipBounds[1]))) {\n discard;\n }\n\n gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\n}",attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},r.pointShader={vertex:"precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 uv;\nattribute float pointSize;\n\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if(any(lessThan(position, clipBounds[0])) || \n any(greaterThan(position, clipBounds[1]))) {\n gl_Position = vec4(0,0,0,0);\n } else {\n gl_Position = projection * view * model * vec4(position, 1.0);\n }\n gl_PointSize = pointSize;\n f_color = color;\n f_uv = uv;\n}",fragment:"precision mediump float;\n#define GLSLIFY 1\n\nuniform sampler2D texture;\nuniform float opacity;\n\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n vec2 pointR = gl_PointCoord.xy - vec2(0.5,0.5);\n if(dot(pointR, pointR) > 0.25) {\n discard;\n }\n gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\n}",attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"pointSize",type:"float"}]},r.pickShader={vertex:"precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n gl_Position = projection * view * model * vec4(position, 1.0);\n f_id = id;\n f_position = position;\n}",fragment:n,attributes:[{name:"position",type:"vec3"},{name:"id",type:"vec4"}]},r.pointPickShader={vertex:"precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute float pointSize;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if(any(lessThan(position, clipBounds[0])) || \n any(greaterThan(position, clipBounds[1]))) {\n gl_Position = vec4(0,0,0,0);\n } else {\n gl_Position = projection * view * model * vec4(position, 1.0);\n gl_PointSize = pointSize;\n }\n f_id = id;\n f_position = position;\n}",fragment:n,attributes:[{name:"position",type:"vec3"},{name:"pointSize",type:"float"},{name:"id",type:"vec4"}]},r.contourShader={vertex:"precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position;\n\nuniform mat4 model, view, projection;\n\nvoid main() {\n gl_Position = projection * view * model * vec4(position, 1.0);\n}",fragment:"precision mediump float;\n#define GLSLIFY 1\n\nuniform vec3 contourColor;\n\nvoid main() {\n gl_FragColor = vec4(contourColor,1);\n}\n",attributes:[{name:"position",type:"vec3"}]}},{}],200:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o,s,l,u,c,h,f,d,p,m,v,g,y,b,x,_,w,M,k,A,T){this.gl=t,this.cells=[],this.positions=[],this.intensity=[],this.texture=e,this.dirty=!0,this.triShader=r,this.lineShader=n,this.pointShader=i,this.pickShader=a,this.pointPickShader=o,this.contourShader=s,this.trianglePositions=l,this.triangleColors=c,this.triangleNormals=f,this.triangleUVs=h,this.triangleIds=u,this.triangleVAO=d,this.triangleCount=0,this.lineWidth=1,this.edgePositions=p,this.edgeColors=v,this.edgeUVs=g,this.edgeIds=m,this.edgeVAO=y,this.edgeCount=0,this.pointPositions=b,this.pointColors=_,this.pointUVs=w,this.pointSizes=M,this.pointIds=x,this.pointVAO=k,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=A,this.contourVAO=T,this.contourCount=0,this.contourColor=[0,0,0],this.contourEnable=!0,this.pickId=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lightPosition=[1e5,1e5,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.opacity=1,this._model=I,this._view=I,this._projection=I,this._resolution=[1,1]}function i(t){for(var e=w({colormap:t,nshades:256,format:"rgba"}),r=new Uint8Array(1024),n=0;n<256;++n){for(var i=e[n],a=0;a<3;++a)r[4*n+a]=i[a];r[4*n+3]=255*i[3]}return _(r,[256,256,4],[4,0,1])}function a(t,e,r){for(var n=new Array(e),i=0;i<e;++i)n[i]=0;for(var a=t.length,i=0;i<a;++i)for(var o=t[i],s=0;s<o.length;++s)n[o[s]]=r[i];return n}function o(t){for(var e=t.length,r=new Array(e),n=0;n<e;++n)r[n]=t[n][2];return r}function s(t){var e=p(t,S);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e.attributes.normal.location=4,e}function l(t){var e=p(t,E);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e}function u(t){var e=p(t,L);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e.attributes.pointSize.location=4,e}function c(t){var e=p(t,C);return e.attributes.position.location=0,e.attributes.id.location=1,e}function h(t){var e=p(t,z);return e.attributes.position.location=0,e.attributes.id.location=1,e.attributes.pointSize.location=4,e}function f(t){var e=p(t,D);return e.attributes.position.location=0,e}function d(t){var e=t.gl,r=s(e),i=l(e),a=u(e),o=c(e),d=h(e),p=f(e),y=g(e,_(new Uint8Array([255,255,255,255]),[1,1,4]));y.generateMipmap(),y.minFilter=e.LINEAR_MIPMAP_LINEAR,y.magFilter=e.LINEAR;var b=m(e),x=m(e),w=m(e),M=m(e),k=m(e),A=v(e,[{buffer:b,type:e.FLOAT,size:3},{buffer:k,type:e.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:x,type:e.FLOAT,size:4},{buffer:w,type:e.FLOAT,size:2},{buffer:M,type:e.FLOAT,size:3}]),T=m(e),S=m(e),E=m(e),L=m(e),C=v(e,[{buffer:T,type:e.FLOAT,size:3},{buffer:L,type:e.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:S,type:e.FLOAT,size:4},{buffer:E,type:e.FLOAT,size:2}]),z=m(e),D=m(e),I=m(e),P=m(e),O=m(e),j=v(e,[{buffer:z,type:e.FLOAT,size:3},{buffer:O,type:e.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:D,type:e.FLOAT,size:4},{buffer:I,type:e.FLOAT,size:2},{buffer:P,type:e.FLOAT,size:1}]),F=m(e),R=v(e,[{buffer:F,type:e.FLOAT,size:3}]),N=new n(e,y,r,i,a,o,d,p,b,k,x,w,M,A,T,L,S,E,C,z,O,D,I,P,j,F,R);return N.update(t),N}var p=t("gl-shader"),m=t("gl-buffer"),v=t("gl-vao"),g=t("gl-texture2d"),y=t("normals"),b=t("gl-mat4/multiply"),x=t("gl-mat4/invert"),_=t("ndarray"),w=t("colormap"),M=t("simplicial-complex-contour"),k=t("typedarray-pool"),A=t("./lib/shaders"),T=t("./lib/closest-point"),S=A.meshShader,E=A.wireShader,L=A.pointShader,C=A.pickShader,z=A.pointPickShader,D=A.contourShader,I=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],P=n.prototype;P.isOpaque=function(){return this.opacity>=1},P.isTransparent=function(){return this.opacity<1},P.pickSlots=1,P.setPickBase=function(t){this.pickId=t},P.highlight=function(t){if(!t||!this.contourEnable)return void(this.contourCount=0);for(var e=M(this.cells,this.intensity,t.intensity),r=e.cells,n=e.vertexIds,i=e.vertexWeights,a=r.length,o=k.mallocFloat32(6*a),s=0,l=0;l<a;++l)for(var u=r[l],c=0;c<2;++c){var h=u[0];2===u.length&&(h=u[c]);for(var f=n[h][0],d=n[h][1],p=i[h],m=1-p,v=this.positions[f],g=this.positions[d],y=0;y<3;++y)o[s++]=p*v[y]+m*g[y]}this.contourCount=s/3|0,this.contourPositions.update(o.subarray(0,s)),k.free(o)},P.update=function(t){t=t||{};var e=this.gl;this.dirty=!0,"contourEnable"in t&&(this.contourEnable=t.contourEnable),"contourColor"in t&&(this.contourColor=t.contourColor),"lineWidth"in t&&(this.lineWidth=t.lineWidth),"lightPosition"in t&&(this.lightPosition=t.lightPosition),"opacity"in t&&(this.opacity=t.opacity),"ambient"in t&&(this.ambientLight=t.ambient),"diffuse"in t&&(this.diffuseLight=t.diffuse),"specular"in t&&(this.specularLight=t.specular),"roughness"in t&&(this.roughness=t.roughness),"fresnel"in t&&(this.fresnel=t.fresnel),t.texture?(this.texture.dispose(),this.texture=g(e,t.texture)):t.colormap&&(this.texture.shape=[256,256],this.texture.minFilter=e.LINEAR_MIPMAP_LINEAR,this.texture.magFilter=e.LINEAR,this.texture.setPixels(i(t.colormap)),this.texture.generateMipmap());var r=t.cells,n=t.positions;if(n&&r){var s=[],l=[],u=[],c=[],h=[],f=[],d=[],p=[],m=[],v=[],b=[],x=[],_=[],w=[];this.cells=r,this.positions=n;var M=t.vertexNormals,k=t.cellNormals,A=void 0===t.vertexNormalsEpsilon?1e-6:t.vertexNormalsEpsilon,T=void 0===t.faceNormalsEpsilon?1e-6:t.faceNormalsEpsilon;t.useFacetNormals&&!k&&(k=y.faceNormals(r,n,T)),k||M||(M=y.vertexNormals(r,n,A));var S=t.vertexColors,E=t.cellColors,L=t.meshColor||[1,1,1,1],C=t.vertexUVs,z=t.vertexIntensity,D=t.cellUVs,I=t.cellIntensity,P=1/0,O=-1/0;if(!C&&!D)if(z)for(var j=0;j<z.length;++j){var F=z[j];P=Math.min(P,F),O=Math.max(O,F)}else if(I)for(var j=0;j<I.length;++j){var F=I[j];P=Math.min(P,F),O=Math.max(O,F)}else for(var j=0;j<n.length;++j){var F=n[j][2];P=Math.min(P,F),O=Math.max(O,F)}this.intensity=z||(I?a(r,n.length,I):o(n));var R=t.pointSizes,N=t.pointSize||1;this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]];for(var j=0;j<n.length;++j)for(var B=n[j],U=0;U<3;++U)!isNaN(B[U])&&isFinite(B[U])&&(this.bounds[0][U]=Math.min(this.bounds[0][U],B[U]),this.bounds[1][U]=Math.max(this.bounds[1][U],B[U]));var V=0,q=0,H=0;t:for(var j=0;j<r.length;++j){var G=r[j];switch(G.length){case 1:for(var Y=G[0],B=n[Y],U=0;U<3;++U)if(isNaN(B[U])||!isFinite(B[U]))continue t;v.push(B[0],B[1],B[2]);var X;X=S?S[Y]:E?E[j]:L,3===X.length?b.push(X[0],X[1],X[2],1):b.push(X[0],X[1],X[2],X[3]);var W;W=C?C[Y]:z?[(z[Y]-P)/(O-P),0]:D?D[j]:I?[(I[j]-P)/(O-P),0]:[(B[2]-P)/(O-P),0],x.push(W[0],W[1]),R?_.push(R[Y]):_.push(N),w.push(j),H+=1;break;case 2:for(var U=0;U<2;++U)for(var Y=G[U],B=n[Y],Z=0;Z<3;++Z)if(isNaN(B[Z])||!isFinite(B[Z]))continue t;for(var U=0;U<2;++U){var Y=G[U],B=n[Y];f.push(B[0],B[1],B[2]);var X;X=S?S[Y]:E?E[j]:L,3===X.length?d.push(X[0],X[1],X[2],1):d.push(X[0],X[1],X[2],X[3]);var W;W=C?C[Y]:z?[(z[Y]-P)/(O-P),0]:D?D[j]:I?[(I[j]-P)/(O-P),0]:[(B[2]-P)/(O-P),0],p.push(W[0],W[1]),m.push(j)}q+=1;break;case 3:for(var U=0;U<3;++U)for(var Y=G[U],B=n[Y],Z=0;Z<3;++Z)if(isNaN(B[Z])||!isFinite(B[Z]))continue t;for(var U=0;U<3;++U){var Y=G[U],B=n[Y];s.push(B[0],B[1],B[2]);var X;X=S?S[Y]:E?E[j]:L,3===X.length?l.push(X[0],X[1],X[2],1):l.push(X[0],X[1],X[2],X[3]);var W;W=C?C[Y]:z?[(z[Y]-P)/(O-P),0]:D?D[j]:I?[(I[j]-P)/(O-P),0]:[(B[2]-P)/(O-P),0],c.push(W[0],W[1]);var J;J=M?M[Y]:k[j],u.push(J[0],J[1],J[2]),h.push(j)}V+=1}}this.pointCount=H,this.edgeCount=q,this.triangleCount=V,this.pointPositions.update(v),this.pointColors.update(b),this.pointUVs.update(x),this.pointSizes.update(_),this.pointIds.update(new Uint32Array(w)),this.edgePositions.update(f),this.edgeColors.update(d),this.edgeUVs.update(p),this.edgeIds.update(new Uint32Array(m)),this.trianglePositions.update(s),this.triangleColors.update(l),this.triangleUVs.update(c),this.triangleNormals.update(u),this.triangleIds.update(new Uint32Array(h))}},P.drawTransparent=P.draw=function(t){t=t||{};for(var e=this.gl,r=t.model||I,n=t.view||I,i=t.projection||I,a=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)a[0][o]=Math.max(a[0][o],this.clipBounds[0][o]),a[1][o]=Math.min(a[1][o],this.clipBounds[1][o]);var s={model:r,view:n,projection:i,clipBounds:a,kambient:this.ambientLight,kdiffuse:this.diffuseLight,kspecular:this.specularLight,roughness:this.roughness,fresnel:this.fresnel,eyePosition:[0,0,0],lightPosition:[0,0,0],opacity:this.opacity,contourColor:this.contourColor,texture:0};this.texture.bind(0);var l=new Array(16);b(l,s.view,s.model),b(l,s.projection,l),x(l,l);for(var o=0;o<3;++o)s.eyePosition[o]=l[12+o]/l[15];for(var u=l[15],o=0;o<3;++o)u+=this.lightPosition[o]*l[4*o+3];for(var o=0;o<3;++o){for(var c=l[12+o],h=0;h<3;++h)c+=l[4*h+o]*this.lightPosition[h];s.lightPosition[o]=c/u}if(this.triangleCount>0){var f=this.triShader;f.bind(),f.uniforms=s,this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()}if(this.edgeCount>0&&this.lineWidth>0){var f=this.lineShader;f.bind(),f.uniforms=s,this.edgeVAO.bind(),e.lineWidth(this.lineWidth),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()}if(this.pointCount>0){var f=this.pointShader;f.bind(),f.uniforms=s,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind()}if(this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0){var f=this.contourShader;f.bind(),f.uniforms=s,this.contourVAO.bind(),e.drawArrays(e.LINES,0,this.contourCount),this.contourVAO.unbind()}},P.drawPick=function(t){t=t||{};for(var e=this.gl,r=t.model||I,n=t.view||I,i=t.projection||I,a=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)a[0][o]=Math.max(a[0][o],this.clipBounds[0][o]),a[1][o]=Math.min(a[1][o],this.clipBounds[1][o]);this._model=[].slice.call(r),this._view=[].slice.call(n),this._projection=[].slice.call(i),this._resolution=[e.drawingBufferWidth,e.drawingBufferHeight];var s={model:r,view:n,projection:i,clipBounds:a,pickId:this.pickId/255},l=this.pickShader;if(l.bind(),l.uniforms=s,this.triangleCount>0&&(this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()),this.edgeCount>0&&(this.edgeVAO.bind(),e.lineWidth(this.lineWidth),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0){var l=this.pointPickShader;l.bind(),l.uniforms=s,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind()}},P.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;for(var e=t.value[0]+256*t.value[1]+65536*t.value[2],r=this.cells[e],n=this.positions,i=new Array(r.length),a=0;a<r.length;++a)i[a]=n[r[a]];var o=T(i,[t.coord[0],this._resolution[1]-t.coord[1]],this._model,this._view,this._projection,this._resolution);if(!o)return null;for(var s=o[2],l=0,a=0;a<r.length;++a)l+=s[a]*this.intensity[r[a]];return{position:o[1],index:r[o[0]],cell:r,cellId:e,intensity:l,dataCoordinate:this.positions[r[o[0]]]}},P.dispose=function(){this.texture.dispose(),this.triShader.dispose(),this.lineShader.dispose(),this.pointShader.dispose(),this.pickShader.dispose(),this.pointPickShader.dispose(),this.triangleVAO.dispose(),this.trianglePositions.dispose(),this.triangleColors.dispose(),this.triangleUVs.dispose(),this.triangleNormals.dispose(),this.triangleIds.dispose(),this.edgeVAO.dispose(),this.edgePositions.dispose(),this.edgeColors.dispose(),this.edgeUVs.dispose(),this.edgeIds.dispose(),this.pointVAO.dispose(),this.pointPositions.dispose(),this.pointColors.dispose(),this.pointUVs.dispose(),this.pointSizes.dispose(),this.pointIds.dispose(),this.contourVAO.dispose(),this.contourPositions.dispose(),this.contourShader.dispose()},e.exports=d},{"./lib/closest-point":198,"./lib/shaders":199,colormap:95,"gl-buffer":152,"gl-mat4/invert":176,"gl-mat4/multiply":178,"gl-shader":250,"gl-texture2d":262,"gl-vao":266,ndarray:460,normals:462,"simplicial-complex-contour":509,"typedarray-pool":533}],201:[function(t,e,r){"use strict";function n(t,e,r){this.plot=t,this.vbo=e,this.shader=r}function i(t){var e=t.gl;return new n(t,a(e,[0,0,0,1,1,0,1,1]),o(e,s.boxVert,s.lineFrag))}e.exports=i;var a=t("gl-buffer"),o=t("gl-shader"),s=t("./shaders"),l=n.prototype;l.bind=function(){var t=this.shader;this.vbo.bind(),this.shader.bind(),t.attributes.coord.pointer(),t.uniforms.screenBox=this.plot.screenBox},l.drawBox=function(){var t=[0,0],e=[0,0];return function(r,n,i,a,o){var s=this.plot,l=this.shader,u=s.gl;t[0]=r,t[1]=n,e[0]=i,e[1]=a,l.uniforms.lo=t,l.uniforms.hi=e,l.uniforms.color=o,u.drawArrays(u.TRIANGLE_STRIP,0,4)}}(),l.dispose=function(){this.vbo.dispose(),this.shader.dispose()}},{"./shaders":204,"gl-buffer":152,"gl-shader":207}],202:[function(t,e,r){"use strict";function n(t,e,r,n){this.plot=t,this.vbo=e,this.shader=r,this.tickShader=n,this.ticks=[[],[]]}function i(t,e){return t-e}function a(t){var e=t.gl;return new n(t,o(e),s(e,u.gridVert,u.gridFrag),s(e,u.tickVert,u.gridFrag))}e.exports=a;var o=t("gl-buffer"),s=t("gl-shader"),l=t("binary-search-bounds"),u=t("./shaders"),c=n.prototype;c.draw=function(){var t=[0,0],e=[0,0],r=[0,0];return function(){for(var n=this.plot,i=this.vbo,a=this.shader,o=this.ticks,s=n.gl,l=n._tickBounds,u=n.dataBox,c=n.viewBox,h=n.gridLineWidth,f=n.gridLineColor,d=n.gridLineEnable,p=n.pixelRatio,m=0;m<2;++m){var v=l[m],g=l[m+2],y=g-v,b=.5*(u[m+2]+u[m]),x=u[m+2]-u[m];e[m]=2*y/x,t[m]=2*(v-b)/x}a.bind(),i.bind(),a.attributes.dataCoord.pointer(),a.uniforms.dataShift=t,a.uniforms.dataScale=e;for(var _=0,m=0;m<2;++m){r[0]=r[1]=0,r[m]=1,a.uniforms.dataAxis=r,a.uniforms.lineWidth=h[m]/(c[m+2]-c[m])*p,a.uniforms.color=f[m];var w=6*o[m].length;d[m]&&w&&s.drawArrays(s.TRIANGLES,_,w),_+=w}}}(),c.drawTickMarks=function(){var t=[0,0],e=[0,0],r=[1,0],n=[0,1],a=[0,0],o=[0,0];return function(){for(var s=this.plot,u=this.vbo,c=this.tickShader,h=this.ticks,f=s.gl,d=s._tickBounds,p=s.dataBox,m=s.viewBox,v=s.pixelRatio,g=s.screenBox,y=g[2]-g[0],b=g[3]-g[1],x=m[2]-m[0],_=m[3]-m[1],w=0;w<2;++w){var M=d[w],k=d[w+2],A=k-M,T=.5*(p[w+2]+p[w]),S=p[w+2]-p[w];e[w]=2*A/S,t[w]=2*(M-T)/S}e[0]*=x/y,t[0]*=x/y,e[1]*=_/b,t[1]*=_/b,c.bind(),u.bind(),c.attributes.dataCoord.pointer();var E=c.uniforms;E.dataShift=t,E.dataScale=e;var L=s.tickMarkLength,C=s.tickMarkWidth,z=s.tickMarkColor,D=6*h[0].length,I=Math.min(l.ge(h[0],(p[0]-d[0])/(d[2]-d[0]),i),h[0].length),P=Math.min(l.gt(h[0],(p[2]-d[0])/(d[2]-d[0]),i),h[0].length),O=0+6*I,j=6*Math.max(0,P-I),F=Math.min(l.ge(h[1],(p[1]-d[1])/(d[3]-d[1]),i),h[1].length),R=Math.min(l.gt(h[1],(p[3]-d[1])/(d[3]-d[1]),i),h[1].length),N=D+6*F,B=6*Math.max(0,R-F);a[0]=2*(m[0]-L[1])/y-1,a[1]=(m[3]+m[1])/b-1,o[0]=L[1]*v/y,o[1]=C[1]*v/b,B&&(E.color=z[1],E.tickScale=o,E.dataAxis=n,E.screenOffset=a,f.drawArrays(f.TRIANGLES,N,B)),a[0]=(m[2]+m[0])/y-1,a[1]=2*(m[1]-L[0])/b-1,o[0]=C[0]*v/y,o[1]=L[0]*v/b,j&&(E.color=z[0],E.tickScale=o,E.dataAxis=r,E.screenOffset=a,f.drawArrays(f.TRIANGLES,O,j)),a[0]=2*(m[2]+L[3])/y-1,a[1]=(m[3]+m[1])/b-1,o[0]=L[3]*v/y,o[1]=C[3]*v/b,B&&(E.color=z[3],E.tickScale=o,E.dataAxis=n,E.screenOffset=a,f.drawArrays(f.TRIANGLES,N,B)),a[0]=(m[2]+m[0])/y-1,a[1]=2*(m[3]+L[2])/b-1,o[0]=C[2]*v/y,o[1]=L[2]*v/b,j&&(E.color=z[2],E.tickScale=o,E.dataAxis=r,E.screenOffset=a,f.drawArrays(f.TRIANGLES,O,j))}}(),c.update=function(){var t=[1,1,-1,-1,1,-1],e=[1,-1,1,1,-1,-1];return function(r){for(var n=r.ticks,i=r.bounds,a=new Float32Array(18*(n[0].length+n[1].length)),o=(this.plot.zeroLineEnable,0),s=[[],[]],l=0;l<2;++l)for(var u=s[l],c=n[l],h=i[l],f=i[l+2],d=0;d<c.length;++d){var p=(c[d].x-h)/(f-h);u.push(p);for(var m=0;m<6;++m)a[o++]=p,a[o++]=t[m],a[o++]=e[m]}this.ticks=s,this.vbo.update(a)}}(),c.dispose=function(){this.vbo.dispose(),this.shader.dispose(),this.tickShader.dispose()}},{"./shaders":204,"binary-search-bounds":206,"gl-buffer":152,"gl-shader":207}],203:[function(t,e,r){"use strict";function n(t,e,r){this.plot=t,this.vbo=e,this.shader=r}function i(t){var e=t.gl;return new n(t,a(e,[-1,-1,-1,1,1,-1,1,1]),o(e,s.lineVert,s.lineFrag))}e.exports=i;var a=t("gl-buffer"),o=t("gl-shader"),s=t("./shaders"),l=n.prototype;l.bind=function(){var t=this.shader;this.vbo.bind(),this.shader.bind(),t.attributes.coord.pointer(),t.uniforms.screenBox=this.plot.screenBox},l.drawLine=function(){var t=[0,0],e=[0,0];return function(r,n,i,a,o,s){var l=this.plot,u=this.shader,c=l.gl;t[0]=r,t[1]=n,e[0]=i,e[1]=a,u.uniforms.start=t,u.uniforms.end=e,u.uniforms.width=o*l.pixelRatio,u.uniforms.color=s,c.drawArrays(c.TRIANGLE_STRIP,0,4)}}(),l.dispose=function(){this.vbo.dispose(),this.shader.dispose()}},{"./shaders":204,"gl-buffer":152,"gl-shader":207}],204:[function(t,e,r){"use strict";var n="precision lowp float;\n#define GLSLIFY 1\nuniform vec4 color;\nvoid main() {\n gl_FragColor = vec4(color.xyz * color.w, color.w);\n}\n";e.exports={lineVert:"precision mediump float;\n#define GLSLIFY 1\n\nattribute vec2 coord;\n\nuniform vec4 screenBox;\nuniform vec2 start, end;\nuniform float width;\n\nvec2 perp(vec2 v) {\n return vec2(v.y, -v.x);\n}\n\nvec2 screen(vec2 v) {\n return 2.0 * (v - screenBox.xy) / (screenBox.zw - screenBox.xy) - 1.0;\n}\n\nvoid main() {\n vec2 delta = normalize(perp(start - end));\n vec2 offset = mix(start, end, 0.5 * (coord.y+1.0));\n gl_Position = vec4(screen(offset + 0.5 * width * delta * coord.x), 0, 1);\n}\n",lineFrag:n,textVert:"#define GLSLIFY 1\nattribute vec3 textCoordinate;\n\nuniform vec2 dataScale, dataShift, dataAxis, screenOffset, textScale;\nuniform float angle;\n\nvoid main() {\n float dataOffset = textCoordinate.z;\n vec2 glyphOffset = textCoordinate.xy;\n mat2 glyphMatrix = mat2(cos(angle), sin(angle), -sin(angle), cos(angle));\n vec2 screenCoordinate = dataAxis * (dataScale * dataOffset + dataShift) +\n glyphMatrix * glyphOffset * textScale + screenOffset;\n gl_Position = vec4(screenCoordinate, 0, 1);\n}\n",textFrag:n,gridVert:"precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 dataCoord;\n\nuniform vec2 dataAxis, dataShift, dataScale;\nuniform float lineWidth;\n\nvoid main() {\n vec2 pos = dataAxis * (dataScale * dataCoord.x + dataShift);\n pos += 10.0 * dataCoord.y * vec2(dataAxis.y, -dataAxis.x) + dataCoord.z * lineWidth;\n gl_Position = vec4(pos, 0, 1);\n}\n",gridFrag:n,boxVert:"precision mediump float;\n#define GLSLIFY 1\n\nattribute vec2 coord;\n\nuniform vec4 screenBox;\nuniform vec2 lo, hi;\n\nvec2 screen(vec2 v) {\n return 2.0 * (v - screenBox.xy) / (screenBox.zw - screenBox.xy) - 1.0;\n}\n\nvoid main() {\n gl_Position = vec4(screen(mix(lo, hi, coord)), 0, 1);\n}\n",tickVert:"precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 dataCoord;\n\nuniform vec2 dataAxis, dataShift, dataScale, screenOffset, tickScale;\n\nvoid main() {\n vec2 pos = dataAxis * (dataScale * dataCoord.x + dataShift);\n gl_Position = vec4(pos + tickScale*dataCoord.yz + screenOffset, 0, 1);\n}\n"}},{}],205:[function(t,e,r){"use strict";function n(t,e,r){this.plot=t,this.vbo=e,this.shader=r,this.tickOffset=[[],[]],this.tickX=[[],[]],this.labelOffset=[0,0],this.labelCount=[0,0]}function i(t){var e=t.gl;return new n(t,a(e),o(e,u.textVert,u.textFrag))}e.exports=i;var a=t("gl-buffer"),o=t("gl-shader"),s=t("text-cache"),l=t("binary-search-bounds"),u=t("./shaders"),c=n.prototype;c.drawTicks=function(){var t=[0,0],e=[0,0],r=[0,0];return function(n){var i=this.plot,a=this.shader,o=this.tickX[n],s=this.tickOffset[n],u=i.gl,c=i.viewBox,h=i.dataBox,f=i.screenBox,d=i.pixelRatio,p=i.tickEnable,m=i.tickPad,v=i.tickColor,g=i.tickAngle,y=i.labelEnable,b=i.labelPad,x=i.labelColor,_=i.labelAngle,w=this.labelOffset[n],M=this.labelCount[n],k=l.lt(o,h[n]),A=l.le(o,h[n+2]);t[0]=t[1]=0,t[n]=1,e[n]=(c[2+n]+c[n])/(f[2+n]-f[n])-1;var T=2/f[2+(1^n)]-f[1^n];e[1^n]=T*c[1^n]-1,p[n]&&(e[1^n]-=T*d*m[n],k<A&&s[A]>s[k]&&(a.uniforms.dataAxis=t,a.uniforms.screenOffset=e,a.uniforms.color=v[n],a.uniforms.angle=g[n],u.drawArrays(u.TRIANGLES,s[k],s[A]-s[k]))),y[n]&&M&&(e[1^n]-=T*d*b[n],a.uniforms.dataAxis=r,a.uniforms.screenOffset=e,a.uniforms.color=x[n],a.uniforms.angle=_[n],u.drawArrays(u.TRIANGLES,w,M)),e[1^n]=T*c[2+(1^n)]-1,p[n+2]&&(e[1^n]+=T*d*m[n+2],k<A&&s[A]>s[k]&&(a.uniforms.dataAxis=t,a.uniforms.screenOffset=e,a.uniforms.color=v[n+2],a.uniforms.angle=g[n+2],u.drawArrays(u.TRIANGLES,s[k],s[A]-s[k]))),y[n+2]&&M&&(e[1^n]+=T*d*b[n+2],a.uniforms.dataAxis=r,a.uniforms.screenOffset=e,a.uniforms.color=x[n+2],a.uniforms.angle=_[n+2],u.drawArrays(u.TRIANGLES,w,M))}}(),c.drawTitle=function(){var t=[0,0],e=[0,0];return function(){var r=this.plot,n=this.shader,i=r.gl,a=r.screenBox,o=r.titleCenter,s=r.titleAngle,l=r.titleColor,u=r.pixelRatio;if(this.titleCount){for(var c=0;c<2;++c)e[c]=2*(o[c]*u-a[c])/(a[2+c]-a[c])-1;n.bind(),n.uniforms.dataAxis=t,n.uniforms.screenOffset=e,n.uniforms.angle=s,n.uniforms.color=l,i.drawArrays(i.TRIANGLES,this.titleOffset,this.titleCount)}}}(),c.bind=function(){var t=[0,0],e=[0,0],r=[0,0];return function(){var n=this.plot,i=this.shader,a=n._tickBounds,o=n.dataBox,s=n.screenBox,l=n.viewBox;i.bind();for(var u=0;u<2;++u){var c=a[u],h=a[u+2],f=h-c,d=.5*(o[u+2]+o[u]),p=o[u+2]-o[u],m=l[u],v=l[u+2],g=v-m,y=s[u],b=s[u+2],x=b-y;e[u]=2*f/p*g/x,t[u]=2*(c-d)/p*g/x}r[1]=2*n.pixelRatio/(s[3]-s[1]),r[0]=r[1]*(s[3]-s[1])/(s[2]-s[0]),i.uniforms.dataScale=e,i.uniforms.dataShift=t,i.uniforms.textScale=r,this.vbo.bind(),i.attributes.textCoordinate.pointer()}}(),c.update=function(t){var e,r,n,i,a,o=[],l=t.ticks,u=t.bounds;for(a=0;a<2;++a){var c=[Math.floor(o.length/3)],h=[-1/0],f=l[a];for(e=0;e<f.length;++e){var d=f[e],p=d.x,m=d.text,v=d.font||"sans-serif";i=d.fontSize||12;for(var g=1/(u[a+2]-u[a]),y=u[a],b=m.split("\n"),x=0;x<b.length;x++)for(n=s(v,b[x]).data,r=0;r<n.length;r+=2)o.push(n[r]*i,-n[r+1]*i-x*i*1.2,(p-y)*g);c.push(Math.floor(o.length/3)),h.push(p)}this.tickOffset[a]=c,this.tickX[a]=h}for(a=0;a<2;++a){for(this.labelOffset[a]=Math.floor(o.length/3),n=s(t.labelFont[a],t.labels[a],{textAlign:"center"}).data,i=t.labelSize[a],e=0;e<n.length;e+=2)o.push(n[e]*i,-n[e+1]*i,0);this.labelCount[a]=Math.floor(o.length/3)-this.labelOffset[a]}for(this.titleOffset=Math.floor(o.length/3),n=s(t.titleFont,t.title).data,i=t.titleSize,e=0;e<n.length;e+=2)o.push(n[e]*i,-n[e+1]*i,0);this.titleCount=Math.floor(o.length/3)-this.titleOffset,this.vbo.update(o)},c.dispose=function(){this.vbo.dispose(),this.shader.dispose()}},{"./shaders":204,"binary-search-bounds":206,"gl-buffer":152,"gl-shader":207,"text-cache":524}],206:[function(t,e,r){arguments[4][80][0].apply(r,arguments)},{dup:80}],207:[function(t,e,r){"use strict";function n(t){this.gl=t,this.gl.lastAttribCount=0,this._vref=this._fref=this._relink=this.vertShader=this.fragShader=this.program=this.attributes=this.uniforms=this.types=null}function i(t,e){return t.name<e.name?-1:1}function a(t,e,r,i,a){var o=new n(t);return o.update(e,r,i,a),o}var o=t("./lib/create-uniforms"),s=t("./lib/create-attributes"),l=t("./lib/reflect"),u=t("./lib/shader-cache"),c=t("./lib/runtime-reflect"),h=t("./lib/GLError"),f=n.prototype;f.bind=function(){this.program||this._relink();var t,e=this.gl.getProgramParameter(this.program,this.gl.ACTIVE_ATTRIBUTES),r=this.gl.lastAttribCount;if(e>r)for(t=r;t<e;t++)this.gl.enableVertexAttribArray(t);else if(r>e)for(t=e;t<r;t++)this.gl.disableVertexAttribArray(t);this.gl.lastAttribCount=e,this.gl.useProgram(this.program)},f.dispose=function(){for(var t=this.gl.lastAttribCount,e=0;e<t;e++)this.gl.disableVertexAttribArray(e);this.gl.lastAttribCount=0,this._fref&&this._fref.dispose(),this._vref&&this._vref.dispose(),this.attributes=this.types=this.vertShader=this.fragShader=this.program=this._relink=this._fref=this._vref=null},f.update=function(t,e,r,n){function a(){d.program=u.program(p,d._vref,d._fref,_,w);for(var t=0;t<r.length;++t)E[t]=p.getUniformLocation(d.program,r[t].name)}if(!e||1===arguments.length){var f=t;t=f.vertex,e=f.fragment,r=f.uniforms,n=f.attributes}var d=this,p=d.gl,m=d._vref;d._vref=u.shader(p,p.VERTEX_SHADER,t),m&&m.dispose(),d.vertShader=d._vref.shader;var v=this._fref;if(d._fref=u.shader(p,p.FRAGMENT_SHADER,e),v&&v.dispose(),d.fragShader=d._fref.shader,!r||!n){var g=p.createProgram();if(p.attachShader(g,d.fragShader),p.attachShader(g,d.vertShader),p.linkProgram(g),!p.getProgramParameter(g,p.LINK_STATUS)){var y=p.getProgramInfoLog(g);throw new h(y,"Error linking program:"+y)}r=r||c.uniforms(p,g),n=n||c.attributes(p,g),p.deleteProgram(g)}n=n.slice(),n.sort(i);var b,x=[],_=[],w=[];for(b=0;b<n.length;++b){var M=n[b];if(M.type.indexOf("mat")>=0){for(var k=0|M.type.charAt(M.type.length-1),A=new Array(k),T=0;T<k;++T)A[T]=w.length,_.push(M.name+"["+T+"]"),
25 "number"==typeof M.location?w.push(M.location+T):Array.isArray(M.location)&&M.location.length===k&&"number"==typeof M.location[T]?w.push(0|M.location[T]):w.push(-1);x.push({name:M.name,type:M.type,locations:A})}else x.push({name:M.name,type:M.type,locations:[w.length]}),_.push(M.name),"number"==typeof M.location?w.push(0|M.location):w.push(-1)}var S=0;for(b=0;b<w.length;++b)if(w[b]<0){for(;w.indexOf(S)>=0;)S+=1;w[b]=S}var E=new Array(r.length);a(),d._relink=a,d.types={uniforms:l(r),attributes:l(n)},d.attributes=s(p,d,x,w),Object.defineProperty(d,"uniforms",o(p,d,r,E))},e.exports=a},{"./lib/GLError":208,"./lib/create-attributes":209,"./lib/create-uniforms":210,"./lib/reflect":211,"./lib/runtime-reflect":212,"./lib/shader-cache":213}],208:[function(t,e,r){function n(t,e,r){this.shortMessage=e||"",this.longMessage=r||"",this.rawError=t||"",this.message="gl-shader: "+(e||t||"")+(r?"\n"+r:""),this.stack=(new Error).stack}n.prototype=new Error,n.prototype.name="GLError",n.prototype.constructor=n,e.exports=n},{}],209:[function(t,e,r){"use strict";function n(t,e,r,n,i,a){this._gl=t,this._wrapper=e,this._index=r,this._locations=n,this._dimension=i,this._constFunc=a}function i(t,e,r,i,a,o,s){for(var l=["gl","v"],u=[],c=0;c<a;++c)l.push("x"+c),u.push("x"+c);l.push("if(x0.length===void 0){return gl.vertexAttrib"+a+"f(v,"+u.join()+")}else{return gl.vertexAttrib"+a+"fv(v,x0)}");var h=Function.apply(null,l),f=new n(t,e,r,i,a,h);Object.defineProperty(o,s,{set:function(e){return t.disableVertexAttribArray(i[r]),h(t,i[r],e),e},get:function(){return f},enumerable:!0})}function a(t,e,r,n,a,o,s){for(var l=new Array(a),u=new Array(a),c=0;c<a;++c)i(t,e,r[c],n,a,l,c),u[c]=l[c];Object.defineProperty(l,"location",{set:function(t){if(Array.isArray(t))for(var e=0;e<a;++e)u[e].location=t[e];else for(var e=0;e<a;++e)u[e].location=t+e;return t},get:function(){for(var t=new Array(a),e=0;e<a;++e)t[e]=n[r[e]];return t},enumerable:!0}),l.pointer=function(e,i,o,s){e=e||t.FLOAT,i=!!i,o=o||a*a,s=s||0;for(var l=0;l<a;++l){var u=n[r[l]];t.vertexAttribPointer(u,a,e,i,o,s+l*a),t.enableVertexAttribArray(u)}};var h=new Array(a),f=t["vertexAttrib"+a+"fv"];Object.defineProperty(o,s,{set:function(e){for(var i=0;i<a;++i){var o=n[r[i]];if(t.disableVertexAttribArray(o),Array.isArray(e[0]))f.call(t,o,e[i]);else{for(var s=0;s<a;++s)h[s]=e[a*i+s];f.call(t,o,h)}}return e},get:function(){return l},enumerable:!0})}function o(t,e,r,n){for(var o={},l=0,u=r.length;l<u;++l){var c=r[l],h=c.name,f=c.type,d=c.locations;switch(f){case"bool":case"int":case"float":i(t,e,d[0],n,1,o,h);break;default:if(f.indexOf("vec")>=0){var p=f.charCodeAt(f.length-1)-48;if(p<2||p>4)throw new s("","Invalid data type for attribute "+h+": "+f);i(t,e,d[0],n,p,o,h)}else{if(!(f.indexOf("mat")>=0))throw new s("","Unknown data type for attribute "+h+": "+f);var p=f.charCodeAt(f.length-1)-48;if(p<2||p>4)throw new s("","Invalid data type for attribute "+h+": "+f);a(t,e,d,n,p,o,h)}}}return o}e.exports=o;var s=t("./GLError"),l=n.prototype;l.pointer=function(t,e,r,n){var i=this,a=i._gl,o=i._locations[i._index];a.vertexAttribPointer(o,i._dimension,t||a.FLOAT,!!e,r||0,n||0),a.enableVertexAttribArray(o)},l.set=function(t,e,r,n){return this._constFunc(this._locations[this._index],t,e,r,n)},Object.defineProperty(l,"location",{get:function(){return this._locations[this._index]},set:function(t){return t!==this._locations[this._index]&&(this._locations[this._index]=0|t,this._wrapper.program=null),0|t}})},{"./GLError":208}],210:[function(t,e,r){"use strict";function n(t){return new Function("y","return function(){return y}")(t)}function i(t,e){for(var r=new Array(t),n=0;n<t;++n)r[n]=e;return r}function a(t,e,r,a){function l(r){return new Function("gl","wrapper","locations","return function(){return gl.getUniform(wrapper.program,locations["+r+"])}")(t,e,a)}function u(t,e,r){switch(r){case"bool":case"int":case"sampler2D":case"samplerCube":return"gl.uniform1i(locations["+e+"],obj"+t+")";case"float":return"gl.uniform1f(locations["+e+"],obj"+t+")";default:var n=r.indexOf("vec");if(!(0<=n&&n<=1&&r.length===4+n)){if(0===r.indexOf("mat")&&4===r.length){var i=r.charCodeAt(r.length-1)-48;if(i<2||i>4)throw new s("","Invalid uniform dimension type for matrix "+name+": "+r);return"gl.uniformMatrix"+i+"fv(locations["+e+"],false,obj"+t+")"}throw new s("","Unknown uniform data type for "+name+": "+r)}var i=r.charCodeAt(r.length-1)-48;if(i<2||i>4)throw new s("","Invalid data type");switch(r.charAt(0)){case"b":case"i":return"gl.uniform"+i+"iv(locations["+e+"],obj"+t+")";case"v":return"gl.uniform"+i+"fv(locations["+e+"],obj"+t+")";default:throw new s("","Unrecognized data type for vector "+name+": "+r)}}}function c(t,e){if("object"!=typeof e)return[[t,e]];var r=[];for(var n in e){var i=e[n],a=t;parseInt(n)+""===n?a+="["+n+"]":a+="."+n,"object"==typeof i?r.push.apply(r,c(a,i)):r.push([a,i])}return r}function h(e){for(var n=["return function updateProperty(obj){"],i=c("",e),o=0;o<i.length;++o){var s=i[o],l=s[0],h=s[1];a[h]&&n.push(u(l,h,r[h].type))}return n.push("return obj}"),new Function("gl","locations",n.join("\n"))(t,a)}function f(t){switch(t){case"bool":return!1;case"int":case"sampler2D":case"samplerCube":case"float":return 0;default:var e=t.indexOf("vec");if(0<=e&&e<=1&&t.length===4+e){var r=t.charCodeAt(t.length-1)-48;if(r<2||r>4)throw new s("","Invalid data type");return"b"===t.charAt(0)?i(r,!1):i(r,0)}if(0===t.indexOf("mat")&&4===t.length){var r=t.charCodeAt(t.length-1)-48;if(r<2||r>4)throw new s("","Invalid uniform dimension type for matrix "+name+": "+t);return i(r*r,0)}throw new s("","Unknown uniform data type for "+name+": "+t)}}function d(t,e,i){if("object"==typeof i){var o=p(i);Object.defineProperty(t,e,{get:n(o),set:h(i),enumerable:!0,configurable:!1})}else a[i]?Object.defineProperty(t,e,{get:l(i),set:h(i),enumerable:!0,configurable:!1}):t[e]=f(r[i].type)}function p(t){var e;if(Array.isArray(t)){e=new Array(t.length);for(var r=0;r<t.length;++r)d(e,r,t[r])}else{e={};for(var n in t)d(e,n,t[n])}return e}var m=o(r,!0);return{get:n(p(m)),set:h(m),enumerable:!0,configurable:!0}}var o=t("./reflect"),s=t("./GLError");e.exports=a},{"./GLError":208,"./reflect":211}],211:[function(t,e,r){"use strict";function n(t,e){for(var r={},n=0;n<t.length;++n)for(var i=t[n].name,a=i.split("."),o=r,s=0;s<a.length;++s){var l=a[s].split("[");if(l.length>1){l[0]in o||(o[l[0]]=[]),o=o[l[0]];for(var u=1;u<l.length;++u){var c=parseInt(l[u]);u<l.length-1||s<a.length-1?(c in o||(u<l.length-1?o[c]=[]:o[c]={}),o=o[c]):o[c]=e?n:t[n].type}}else s<a.length-1?(l[0]in o||(o[l[0]]={}),o=o[l[0]]):o[l[0]]=e?n:t[n].type}return r}e.exports=n},{}],212:[function(t,e,r){"use strict";function n(t,e){if(!s){var r=Object.keys(o);s={};for(var n=0;n<r.length;++n){var i=r[n];s[t[i]]=o[i]}}return s[e]}function i(t,e){for(var r=t.getProgramParameter(e,t.ACTIVE_UNIFORMS),i=[],a=0;a<r;++a){var o=t.getActiveUniform(e,a);if(o){var s=n(t,o.type);if(o.size>1)for(var l=0;l<o.size;++l)i.push({name:o.name.replace("[0]","["+l+"]"),type:s});else i.push({name:o.name,type:s})}}return i}function a(t,e){for(var r=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES),i=[],a=0;a<r;++a){var o=t.getActiveAttrib(e,a);o&&i.push({name:o.name,type:n(t,o.type)})}return i}r.uniforms=i,r.attributes=a;var o={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube"},s=null},{}],213:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o){this.id=t,this.src=e,this.type=r,this.shader=n,this.count=a,this.programs=[],this.cache=o}function i(t){this.gl=t,this.shaders=[{},{}],this.programs={}}function a(t,e,r){var n=t.createShader(e);if(t.shaderSource(n,r),t.compileShader(n),!t.getShaderParameter(n,t.COMPILE_STATUS)){var i=t.getShaderInfoLog(n);try{var a=h(i,r,e)}catch(t){throw console.warn("Failed to format compiler error: "+t),new c(i,"Error compiling shader:\n"+i)}throw new c(i,a.short,a.long)}return n}function o(t,e,r,n,i){var a=t.createProgram();t.attachShader(a,e),t.attachShader(a,r);for(var o=0;o<n.length;++o)t.bindAttribLocation(a,i[o],n[o]);if(t.linkProgram(a),!t.getProgramParameter(a,t.LINK_STATUS)){var s=t.getProgramInfoLog(a);throw new c(s,"Error linking program: "+s)}return a}function s(t){var e=d.get(t);return e||(e=new i(t),d.set(t,e)),e}function l(t,e,r){return s(t).getShaderReference(e,r)}function u(t,e,r,n,i){return s(t).getProgram(e,r,n,i)}r.shader=l,r.program=u;var c=t("./GLError"),h=t("gl-format-compiler-error"),f="undefined"==typeof WeakMap?t("weakmap-shim"):WeakMap,d=new f,p=0;n.prototype.dispose=function(){if(0==--this.count){for(var t=this.cache,e=t.gl,r=this.programs,n=0,i=r.length;n<i;++n){var a=t.programs[r[n]];a&&(delete t.programs[n],e.deleteProgram(a))}e.deleteShader(this.shader),delete t.shaders[this.type===e.FRAGMENT_SHADER|0][this.src]}};var m=i.prototype;m.getShaderReference=function(t,e){var r=this.gl,i=this.shaders[t===r.FRAGMENT_SHADER|0],o=i[e];if(o&&r.isShader(o.shader))o.count+=1;else{var s=a(r,t,e);o=i[e]=new n(p++,e,t,s,[],1,this)}return o},m.getProgram=function(t,e,r,n){var i=[t.id,e.id,r.join(":"),n.join(":")].join("@"),a=this.programs[i];return a&&this.gl.isProgram(a)||(this.programs[i]=a=o(this.gl,t.shader,e.shader,r,n),t.programs.push(i),e.programs.push(i)),a}},{"./GLError":208,"gl-format-compiler-error":160,"weakmap-shim":554}],214:[function(t,e,r){"use strict";function n(t,e){this.gl=t,this.pickBuffer=e,this.screenBox=[0,0,t.drawingBufferWidth,t.drawingBufferHeight],this.viewBox=[0,0,0,0],this.dataBox=[-10,-10,10,10],this.gridLineEnable=[!0,!0],this.gridLineWidth=[1,1],this.gridLineColor=[[0,0,0,1],[0,0,0,1]],this.pixelRatio=1,this.tickMarkLength=[0,0,0,0],this.tickMarkWidth=[0,0,0,0],this.tickMarkColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickPad=[15,15,15,15],this.tickAngle=[0,0,0,0],this.tickEnable=[!0,!0,!0,!0],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labelPad=[15,15,15,15],this.labelAngle=[0,Math.PI/2,0,3*Math.PI/2],this.labelEnable=[!0,!0,!0,!0],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.titleCenter=[0,0],this.titleEnable=!0,this.titleAngle=0,this.titleColor=[0,0,0,1],this.borderColor=[0,0,0,0],this.backgroundColor=[0,0,0,0],this.zeroLineEnable=[!0,!0],this.zeroLineWidth=[4,4],this.zeroLineColor=[[0,0,0,1],[0,0,0,1]],this.borderLineEnable=[!0,!0,!0,!0],this.borderLineWidth=[2,2,2,2],this.borderLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.grid=null,this.text=null,this.line=null,this.box=null,this.objects=[],this.overlays=[],this._tickBounds=[1/0,1/0,-1/0,-1/0],this.static=!1,this.dirty=!1,this.pickDirty=!1,this.pickDelay=120,this.pickRadius=10,this._pickTimeout=null,this._drawPick=this.drawPick.bind(this),this._depthCounter=0}function i(t){for(var e=t.slice(),r=0;r<e.length;++r)e[r]=e[r].slice();return e}function a(t,e){return t.x-e.x}function o(t){var e=t.gl,r=s(e,[e.drawingBufferWidth,e.drawingBufferHeight]),i=new n(e,r);return i.grid=l(i),i.text=u(i),i.line=c(i),i.box=h(i),i.update(t),i}e.exports=o;var s=t("gl-select-static"),l=t("./lib/grid"),u=t("./lib/text"),c=t("./lib/line"),h=t("./lib/box"),f=n.prototype;f.setDirty=function(){this.dirty=this.pickDirty=!0},f.setOverlayDirty=function(){this.dirty=!0},f.nextDepthValue=function(){return this._depthCounter++/65536},f.draw=function(){return function(){var t=this.gl,e=this.screenBox,r=this.viewBox,n=this.dataBox,i=this.pixelRatio,a=this.grid,o=this.line,s=this.text,l=this.objects;if(this._depthCounter=0,this.pickDirty&&(this._pickTimeout&&clearTimeout(this._pickTimeout),this.pickDirty=!1,this._pickTimeout=setTimeout(this._drawPick,this.pickDelay)),this.dirty){this.dirty=!1,t.bindFramebuffer(t.FRAMEBUFFER,null),t.enable(t.SCISSOR_TEST),t.disable(t.DEPTH_TEST),t.depthFunc(t.LESS),t.depthMask(!1),t.enable(t.BLEND),t.blendEquation(t.FUNC_ADD,t.FUNC_ADD),t.blendFunc(t.ONE,t.ONE_MINUS_SRC_ALPHA),t.scissor(e[0],e[1],e[2]-e[0],e[3]-e[1]);var u=this.borderColor;t.clearColor(u[0]*u[3],u[1]*u[3],u[2]*u[3],u[3]),t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT),t.scissor(r[0],r[1],r[2]-r[0],r[3]-r[1]),t.viewport(r[0],r[1],r[2]-r[0],r[3]-r[1]);var c=this.backgroundColor;t.clearColor(c[0]*c[3],c[1]*c[3],c[2]*c[3],c[3]),t.clear(t.COLOR_BUFFER_BIT),a.draw();var h=this.zeroLineEnable,f=this.zeroLineColor,d=this.zeroLineWidth;if(h[0]||h[1]){o.bind();for(var p=0;p<2;++p)if(h[p]&&n[p]<=0&&n[p+2]>=0){var m=e[p]-n[p]*(e[p+2]-e[p])/(n[p+2]-n[p]);0===p?o.drawLine(m,e[1],m,e[3],d[p],f[p]):o.drawLine(e[0],m,e[2],m,d[p],f[p])}}for(var p=0;p<l.length;++p)l[p].draw();t.viewport(e[0],e[1],e[2]-e[0],e[3]-e[1]),t.scissor(e[0],e[1],e[2]-e[0],e[3]-e[1]),this.grid.drawTickMarks(),o.bind();var v=this.borderLineEnable,g=this.borderLineWidth,y=this.borderLineColor;v[1]&&o.drawLine(r[0],r[1]-.5*g[1]*i,r[0],r[3]+.5*g[3]*i,g[1],y[1]),v[0]&&o.drawLine(r[0]-.5*g[0]*i,r[1],r[2]+.5*g[2]*i,r[1],g[0],y[0]),v[3]&&o.drawLine(r[2],r[1]-.5*g[1]*i,r[2],r[3]+.5*g[3]*i,g[3],y[3]),v[2]&&o.drawLine(r[0]-.5*g[0]*i,r[3],r[2]+.5*g[2]*i,r[3],g[2],y[2]),s.bind();for(var p=0;p<2;++p)s.drawTicks(p);this.titleEnable&&s.drawTitle();for(var b=this.overlays,p=0;p<b.length;++p)b[p].draw();t.disable(t.SCISSOR_TEST),t.disable(t.BLEND),t.depthMask(!0)}}}(),f.drawPick=function(){return function(){if(!this.static){var t=this.pickBuffer;this.gl;this._pickTimeout=null,t.begin();for(var e=1,r=this.objects,n=0;n<r.length;++n)e=r[n].drawPick(e);t.end()}}}(),f.pick=function(){return function(t,e){if(!this.static){var r=this.pixelRatio,n=this.pickPixelRatio,i=this.viewBox,a=0|Math.round((t-i[0]/r)*n),o=0|Math.round((e-i[1]/r)*n),s=this.pickBuffer.query(a,o,this.pickRadius);if(!s)return null;for(var l=s.id+(s.value[0]<<8)+(s.value[1]<<16)+(s.value[2]<<24),u=this.objects,c=0;c<u.length;++c){var h=u[c].pick(a,o,l);if(h)return h}return null}}}(),f.setScreenBox=function(t){var e=this.screenBox,r=this.pixelRatio;e[0]=0|Math.round(t[0]*r),e[1]=0|Math.round(t[1]*r),e[2]=0|Math.round(t[2]*r),e[3]=0|Math.round(t[3]*r),this.setDirty()},f.setDataBox=function(t){var e=this.dataBox;(e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||e[3]!==t[3])&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],this.setDirty())},f.setViewBox=function(t){var e=this.pixelRatio,r=this.viewBox;r[0]=0|Math.round(t[0]*e),r[1]=0|Math.round(t[1]*e),r[2]=0|Math.round(t[2]*e),r[3]=0|Math.round(t[3]*e);var n=this.pickPixelRatio;this.pickBuffer.shape=[0|Math.round((t[2]-t[0])*n),0|Math.round((t[3]-t[1])*n)],this.setDirty()},f.update=function(t){t=t||{};var e=this.gl;this.pixelRatio=t.pixelRatio||1;var r=this.pixelRatio;this.pickPixelRatio=Math.max(r,1),this.setScreenBox(t.screenBox||[0,0,e.drawingBufferWidth/r,e.drawingBufferHeight/r]);this.screenBox;this.setViewBox(t.viewBox||[.125*(this.screenBox[2]-this.screenBox[0])/r,.125*(this.screenBox[3]-this.screenBox[1])/r,.875*(this.screenBox[2]-this.screenBox[0])/r,.875*(this.screenBox[3]-this.screenBox[1])/r]);var n=this.viewBox,o=(n[2]-n[0])/(n[3]-n[1]);this.setDataBox(t.dataBox||[-10,-10/o,10,10/o]),this.borderColor=(t.borderColor||[0,0,0,0]).slice(),this.backgroundColor=(t.backgroundColor||[0,0,0,0]).slice(),this.gridLineEnable=(t.gridLineEnable||[!0,!0]).slice(),this.gridLineWidth=(t.gridLineWidth||[1,1]).slice(),this.gridLineColor=i(t.gridLineColor||[[.5,.5,.5,1],[.5,.5,.5,1]]),this.zeroLineEnable=(t.zeroLineEnable||[!0,!0]).slice(),this.zeroLineWidth=(t.zeroLineWidth||[4,4]).slice(),this.zeroLineColor=i(t.zeroLineColor||[[0,0,0,1],[0,0,0,1]]),this.tickMarkLength=(t.tickMarkLength||[0,0,0,0]).slice(),this.tickMarkWidth=(t.tickMarkWidth||[0,0,0,0]).slice(),this.tickMarkColor=i(t.tickMarkColor||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]),this.titleCenter=(t.titleCenter||[.5*(n[0]+n[2])/r,(n[3]+120)/r]).slice(),this.titleEnable=!("titleEnable"in t&&!t.titleEnable),this.titleAngle=t.titleAngle||0,this.titleColor=(t.titleColor||[0,0,0,1]).slice(),this.labelPad=(t.labelPad||[15,15,15,15]).slice(),this.labelAngle=(t.labelAngle||[0,Math.PI/2,0,3*Math.PI/2]).slice(),this.labelEnable=(t.labelEnable||[!0,!0,!0,!0]).slice(),this.labelColor=i(t.labelColor||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]),this.tickPad=(t.tickPad||[15,15,15,15]).slice(),this.tickAngle=(t.tickAngle||[0,0,0,0]).slice(),this.tickEnable=(t.tickEnable||[!0,!0,!0,!0]).slice(),this.tickColor=i(t.tickColor||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]),this.borderLineEnable=(t.borderLineEnable||[!0,!0,!0,!0]).slice(),this.borderLineWidth=(t.borderLineWidth||[2,2,2,2]).slice(),this.borderLineColor=i(t.borderLineColor||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]);var s=t.ticks||[[],[]],l=this._tickBounds;l[0]=l[1]=1/0,l[2]=l[3]=-1/0;for(var u=0;u<2;++u){var c=s[u].slice(0);0!==c.length&&(c.sort(a),l[u]=Math.min(l[u],c[0].x),l[u+2]=Math.max(l[u+2],c[c.length-1].x))}this.grid.update({bounds:l,ticks:s}),this.text.update({bounds:l,ticks:s,labels:t.labels||["x","y"],labelSize:t.labelSize||[12,12],labelFont:t.labelFont||["sans-serif","sans-serif"],title:t.title||"",titleSize:t.titleSize||18,titleFont:t.titleFont||"sans-serif"}),this.static=!!t.static,this.setDirty()},f.dispose=function(){this.box.dispose(),this.grid.dispose(),this.text.dispose(),this.line.dispose();for(var t=this.objects.length-1;t>=0;--t)this.objects[t].dispose();this.objects.length=0;for(var t=this.overlays.length-1;t>=0;--t)this.overlays[t].dispose();this.overlays.length=0,this.gl=null},f.addObject=function(t){this.objects.indexOf(t)<0&&(this.objects.push(t),this.setDirty())},f.removeObject=function(t){for(var e=this.objects,r=0;r<e.length;++r)if(e[r]===t){e.splice(r,1),this.setDirty();break}},f.addOverlay=function(t){this.overlays.indexOf(t)<0&&(this.overlays.push(t),this.setOverlayDirty())},f.removeOverlay=function(t){for(var e=this.overlays,r=0;r<e.length;++r)if(e[r]===t){e.splice(r,1),this.setOverlayDirty();break}}},{"./lib/box":201,"./lib/grid":202,"./lib/line":203,"./lib/text":205,"gl-select-static":249}],215:[function(t,e,r){var n=t("gl-shader");e.exports=function(t){return n(t,"precision mediump float;\n#define GLSLIFY 1\nattribute vec2 position;\nvarying vec2 uv;\nvoid main() {\n uv = position;\n gl_Position = vec4(position, 0, 1);\n}","precision mediump float;\n#define GLSLIFY 1\n\nuniform sampler2D accumBuffer;\nvarying vec2 uv;\n\nvoid main() {\n vec4 accum = texture2D(accumBuffer, 0.5 * (uv + 1.0));\n gl_FragColor = min(vec4(1,1,1,1), accum);\n}",null,[{name:"position",type:"vec2"}])}},{"gl-shader":250}],216:[function(t,e,r){"use strict";function n(){this.mouse=[-1,-1],this.screen=null,this.distance=1/0,this.index=null,this.dataCoordinate=null,this.dataPosition=null,this.object=null,this.data=null}function i(t,e){var r=null;try{r=t.getContext("webgl",e),r||(r=t.getContext("experimental-webgl",e))}catch(t){return null}return r}function a(t){var e=Math.round(Math.log(Math.abs(t))/Math.log(10));if(e<0){var r=Math.round(Math.pow(10,-e));return Math.ceil(t*r)/r}if(e>0){var r=Math.round(Math.pow(10,e));return Math.ceil(t/r)*r}return Math.ceil(t)}function o(t){return"boolean"!=typeof t||t}function s(t){function e(){if(!w&&G.autoResize){var t=M.parentNode,e=1,r=1;t&&t!==document.body?(e=t.clientWidth,r=t.clientHeight):(e=window.innerWidth,r=window.innerHeight);var n=0|Math.ceil(e*G.pixelRatio),i=0|Math.ceil(r*G.pixelRatio);if(n!==M.width||i!==M.height){M.width=n,M.height=i;var a=M.style;a.position=a.position||"absolute",a.left="0px",a.top="0px",a.width=e+"px",a.height=r+"px",N=!0}}}function r(){for(var t=O.length,e=R.length,r=0;r<e;++r)F[r]=0;t:for(var r=0;r<t;++r){var n=O[r],i=n.pickSlots;if(i){for(var a=0;a<e;++a)if(F[a]+i<255){j[r]=a,n.setPickBase(F[a]+1),F[a]+=i;continue t}var o=f(A,H);j[r]=e,R.push(o),F.push(i),n.setPickBase(1),e+=1}else j[r]=-1}for(;e>0&&0===F[e-1];)F.pop(),R.pop().dispose()}function s(){if(G.contextLost)return!0;A.isContextLost()&&(G.contextLost=!0,G.mouseListener.enabled=!1,G.selection.object=null,G.oncontextloss&&G.oncontextloss())}function b(){if(!s()){A.colorMask(!0,!0,!0,!0),A.depthMask(!0),A.disable(A.BLEND),A.enable(A.DEPTH_TEST);for(var t=O.length,e=R.length,r=0;r<e;++r){var n=R[r];n.shape=Y,n.begin();for(var i=0;i<t;++i)if(j[i]===r){var a=O[i];a.drawPick&&(a.pixelRatio=1,a.drawPick(q))}n.end()}}}function x(){if(!s()){e();var t=G.camera.tick();q.view=G.camera.matrix,N=N||t,B=B||t,D.pixelRatio=G.pixelRatio,P.pixelRatio=G.pixelRatio;var r=O.length,n=Z[0],i=Z[1];n[0]=n[1]=n[2]=1/0,i[0]=i[1]=i[2]=-1/0;for(var o=0;o<r;++o){var l=O[o];l.pixelRatio=G.pixelRatio,l.axes=G.axes,N=N||!!l.dirty,B=B||!!l.dirty;var u=l.bounds;if(u)for(var h=u[0],f=u[1],d=0;d<3;++d)n[d]=Math.min(n[d],h[d]),i[d]=Math.max(i[d],f[d])}var m=G.bounds;if(G.autoBounds)for(var d=0;d<3;++d){if(i[d]<n[d])n[d]=-1,i[d]=1;else{n[d]===i[d]&&(n[d]-=1,i[d]+=1);var g=.05*(i[d]-n[d]);n[d]=n[d]-g,i[d]=i[d]+g}m[0][d]=n[d],m[1][d]=i[d]}for(var y=!1,d=0;d<3;++d)y=y||J[0][d]!==m[0][d]||J[1][d]!==m[1][d],J[0][d]=m[0][d],J[1][d]=m[1][d];if(B=B||y,N=N||y){if(y){for(var x=[0,0,0],o=0;o<3;++o)x[o]=a((m[1][o]-m[0][o])/10);D.autoTicks?D.update({bounds:m,tickSpacing:x}):D.update({bounds:m})}var _=A.drawingBufferWidth,w=A.drawingBufferHeight;H[0]=_,H[1]=w,Y[0]=0|Math.max(_/G.pixelRatio,1),Y[1]=0|Math.max(w/G.pixelRatio,1),v(U,G.fovy,_/w,G.zNear,G.zFar);for(var o=0;o<16;++o)V[o]=0;V[15]=1;for(var M=0,o=0;o<3;++o)M=Math.max(M,m[1][o]-m[0][o]);for(var o=0;o<3;++o)G.autoScale?V[5*o]=G.aspect[o]/(m[1][o]-m[0][o]):V[5*o]=1/M,G.autoCenter&&(V[12+o]=.5*-V[5*o]*(m[0][o]+m[1][o]));for(var o=0;o<r;++o){var l=O[o];l.axesBounds=m,G.clipToBounds&&(l.clipBounds=m)}S.object&&(G.snapToData?P.position=S.dataCoordinate:P.position=S.dataPosition,P.bounds=m),B&&(B=!1,b()),G.axesPixels=c(G.axes,q,_,w),G.onrender&&G.onrender(),A.bindFramebuffer(A.FRAMEBUFFER,null),A.viewport(0,0,_,w);var k=G.clearColor;A.clearColor(k[0],k[1],k[2],k[3]),A.clear(A.COLOR_BUFFER_BIT|A.DEPTH_BUFFER_BIT),A.depthMask(!0),A.colorMask(!0,!0,!0,!0),A.enable(A.DEPTH_TEST),A.depthFunc(A.LEQUAL),A.disable(A.BLEND),A.disable(A.CULL_FACE);var T=!1;D.enable&&(T=T||D.isTransparent(),D.draw(q)),P.axes=D,S.object&&P.draw(q),A.disable(A.CULL_FACE);for(var o=0;o<r;++o){var l=O[o];l.axes=D,l.pixelRatio=G.pixelRatio,l.isOpaque&&l.isOpaque()&&l.draw(q),l.isTransparent&&l.isTransparent()&&(T=!0)}if(T){E.shape=H,E.bind(),A.clear(A.DEPTH_BUFFER_BIT),A.colorMask(!1,!1,!1,!1),A.depthMask(!0),A.depthFunc(A.LESS),D.enable&&D.isTransparent()&&D.drawTransparent(q);for(var o=0;o<r;++o){var l=O[o];l.isOpaque&&l.isOpaque()&&l.draw(q)}A.enable(A.BLEND),A.blendEquation(A.FUNC_ADD),A.blendFunc(A.ONE,A.ONE_MINUS_SRC_ALPHA),A.colorMask(!0,!0,!0,!0),A.depthMask(!1),A.clearColor(0,0,0,0),A.clear(A.COLOR_BUFFER_BIT),D.isTransparent()&&D.drawTransparent(q);for(var o=0;o<r;++o){var l=O[o];l.isTransparent&&l.isTransparent()&&l.drawTransparent(q)}A.bindFramebuffer(A.FRAMEBUFFER,null),A.blendFunc(A.ONE,A.ONE_MINUS_SRC_ALPHA),A.disable(A.DEPTH_TEST),L.bind(),E.color[0].bind(0),L.uniforms.accumBuffer=0,p(A),A.disable(A.BLEND)}N=!1;for(var o=0;o<r;++o)O[o].dirty=!1}}}function _(){w||G.contextLost||(requestAnimationFrame(_),x())}t=t||{};var w=!1,M=(t.pixelRatio||parseFloat(window.devicePixelRatio),t.canvas);if(!M)if(M=document.createElement("canvas"),t.container){var k=t.container;k.appendChild(M)}else document.body.appendChild(M);var A=t.gl;if(A||(A=i(M,t.glOptions||{premultipliedAlpha:!0,antialias:!0})),!A)throw new Error("webgl not supported");var T=t.bounds||[[-10,-10,-10],[10,10,10]],S=new n,E=d(A,[A.drawingBufferWidth,A.drawingBufferHeight],{preferFloat:!y}),L=g(A),C=t.camera||{eye:[2,0,0],center:[0,0,0],up:[0,1,0],zoomMin:.1,zoomMax:100,mode:"turntable"},z=t.axes||{},D=u(A,z);D.enable=!z.disable;var I=t.spikes||{},P=h(A,I),O=[],j=[],F=[],R=[],N=!0,B=!0,U=new Array(16),V=new Array(16),q={view:null,projection:U,model:V},B=!0,H=[A.drawingBufferWidth,A.drawingBufferHeight],G={gl:A,contextLost:!1,pixelRatio:t.pixelRatio||parseFloat(window.devicePixelRatio),canvas:M,selection:S,camera:l(M,C),axes:D,axesPixels:null,spikes:P,bounds:T,objects:O,shape:H,aspect:t.aspectRatio||[1,1,1],pickRadius:t.pickRadius||10,zNear:t.zNear||.01,zFar:t.zFar||1e3,fovy:t.fovy||Math.PI/4,clearColor:t.clearColor||[0,0,0,0],autoResize:o(t.autoResize),autoBounds:o(t.autoBounds),autoScale:!!t.autoScale,autoCenter:o(t.autoCenter),clipToBounds:o(t.clipToBounds),snapToData:!!t.snapToData,onselect:t.onselect||null,onrender:t.onrender||null,onclick:t.onclick||null,cameraParams:q,oncontextloss:null,mouseListener:null},Y=[A.drawingBufferWidth/G.pixelRatio|0,A.drawingBufferHeight/G.pixelRatio|0];G.autoResize&&e(),window.addEventListener("resize",e),G.update=function(t){w||(t=t||{},N=!0,B=!0)},G.add=function(t){w||(t.axes=D,O.push(t),j.push(-1),N=!0,B=!0,r())},G.remove=function(t){if(!w){var e=O.indexOf(t);e<0||(O.splice(e,1),j.pop(),N=!0,B=!0,r())}},G.dispose=function(){if(!w&&(w=!0,window.removeEventListener("resize",e),M.removeEventListener("webglcontextlost",s),G.mouseListener.enabled=!1,!G.contextLost)){D.dispose(),P.dispose();for(var t=0;t<O.length;++t)O[t].dispose();E.dispose();for(var t=0;t<R.length;++t)R[t].dispose();L.dispose(),A=null,D=null,P=null,O=[]}};var X=!1,W=0;G.mouseListener=m(M,function(t,e,r){if(!w){var n=R.length,i=O.length,a=S.object;S.distance=1/0,S.mouse[0]=e,S.mouse[1]=r,S.object=null,S.screen=null,S.dataCoordinate=S.dataPosition=null;var o=!1;if(t&&W)X=!0;else{X&&(B=!0),X=!1;for(var s=0;s<n;++s){var l=R[s].query(e,Y[1]-r-1,G.pickRadius);if(l){if(l.distance>S.distance)continue;for(var u=0;u<i;++u){var c=O[u];if(j[u]===s){var h=c.pick(l);h&&(S.buttons=t,S.screen=l.coord,S.distance=l.distance,S.object=c,S.index=h.distance,S.dataPosition=h.position,S.dataCoordinate=h.dataCoordinate,S.data=h,o=!0)}}}}}a&&a!==S.object&&(a.highlight&&a.highlight(null),N=!0),S.object&&(S.object.highlight&&S.object.highlight(S.data),N=!0),o=o||S.object!==a,o&&G.onselect&&G.onselect(S),1&t&&!(1&W)&&G.onclick&&G.onclick(S),W=t}}),M.addEventListener("webglcontextlost",s);var Z=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],J=[Z[0].slice(),Z[1].slice()];return _(),G.redraw=function(){w||(N=!0,x())},G}e.exports=s;var l=t("3d-view-controls"),u=t("gl-axes3d"),c=t("gl-axes3d/properties"),h=t("gl-spikes3d"),f=t("gl-select-static"),d=t("gl-fbo"),p=t("a-big-triangle"),m=t("mouse-change"),v=t("gl-mat4/perspective"),g=t("./lib/shader"),y=t("is-mobile")()},{"./lib/shader":215,"3d-view-controls":34,"a-big-triangle":37,"gl-axes3d":144,"gl-axes3d/properties":151,"gl-fbo":159,"gl-mat4/perspective":179,"gl-select-static":249,"gl-spikes3d":259,"is-mobile":289,"mouse-change":445}],217:[function(t,e,r){r.pointVertex="precision mediump float;\n#define GLSLIFY 1\n\nattribute vec2 position;\n\nuniform mat3 matrix;\nuniform float pointSize;\nuniform float pointCloud;\n\nhighp float rand(vec2 co) {\n highp float a = 12.9898;\n highp float b = 78.233;\n highp float c = 43758.5453;\n highp float d = dot(co.xy, vec2(a, b));\n highp float e = mod(d, 3.14);\n return fract(sin(e) * c);\n}\n\nvoid main() {\n vec3 hgPosition = matrix * vec3(position, 1);\n gl_Position = vec4(hgPosition.xy, 0, hgPosition.z);\n // if we don't jitter the point size a bit, overall point cloud\n // saturation 'jumps' on zooming, which is disturbing and confusing\n gl_PointSize = pointSize * ((19.5 + rand(position)) / 20.0);\n if(pointCloud != 0.0) { // pointCloud is truthy\n // get the same square surface as circle would be\n gl_PointSize *= 0.886;\n }\n}",r.pointFragment="precision mediump float;\n#define GLSLIFY 1\n\nuniform vec4 color, borderColor;\nuniform float centerFraction;\nuniform float pointCloud;\n\nvoid main() {\n float radius;\n vec4 baseColor;\n if(pointCloud != 0.0) { // pointCloud is truthy\n if(centerFraction == 1.0) {\n gl_FragColor = color;\n } else {\n gl_FragColor = mix(borderColor, color, centerFraction);\n }\n } else {\n radius = length(2.0 * gl_PointCoord.xy - 1.0);\n if(radius > 1.0) {\n discard;\n }\n baseColor = mix(borderColor, color, step(radius, centerFraction));\n gl_FragColor = vec4(baseColor.rgb * baseColor.a, baseColor.a);\n }\n}\n",r.pickVertex="precision mediump float;\n#define GLSLIFY 1\n\nattribute vec2 position;\nattribute vec4 pickId;\n\nuniform mat3 matrix;\nuniform float pointSize;\nuniform vec4 pickOffset;\n\nvarying vec4 fragId;\n\nvoid main() {\n vec3 hgPosition = matrix * vec3(position, 1);\n gl_Position = vec4(hgPosition.xy, 0, hgPosition.z);\n gl_PointSize = pointSize;\n\n vec4 id = pickId + pickOffset;\n id.y += floor(id.x / 256.0);\n id.x -= floor(id.x / 256.0) * 256.0;\n\n id.z += floor(id.y / 256.0);\n id.y -= floor(id.y / 256.0) * 256.0;\n\n id.w += floor(id.z / 256.0);\n id.z -= floor(id.z / 256.0) * 256.0;\n\n fragId = id;\n}\n",r.pickFragment="precision mediump float;\n#define GLSLIFY 1\n\nvarying vec4 fragId;\n\nvoid main() {\n float radius = length(2.0 * gl_PointCoord.xy - 1.0);\n if(radius > 1.0) {\n discard;\n }\n gl_FragColor = fragId / 255.0;\n}\n"},{}],218:[function(t,e,r){arguments[4][207][0].apply(r,arguments)},{"./lib/GLError":219,"./lib/create-attributes":220,"./lib/create-uniforms":221,"./lib/reflect":222,"./lib/runtime-reflect":223,"./lib/shader-cache":224,dup:207}],219:[function(t,e,r){arguments[4][208][0].apply(r,arguments)},{dup:208}],220:[function(t,e,r){arguments[4][209][0].apply(r,arguments)},{"./GLError":219,dup:209}],221:[function(t,e,r){arguments[4][210][0].apply(r,arguments)},{"./GLError":219,"./reflect":222,dup:210}],222:[function(t,e,r){arguments[4][211][0].apply(r,arguments)},{dup:211}],223:[function(t,e,r){arguments[4][212][0].apply(r,arguments)},{dup:212}],224:[function(t,e,r){arguments[4][213][0].apply(r,arguments)},{"./GLError":219,dup:213,"gl-format-compiler-error":160,"weakmap-shim":554}],225:[function(t,e,r){"use strict";function n(t,e,r,n,i){this.plot=t,this.offsetBuffer=e,this.pickBuffer=r,this.shader=n,this.pickShader=i,this.sizeMin=.5,this.sizeMinCap=2,this.sizeMax=20,this.areaRatio=1,this.pointCount=0,this.color=[1,0,0,1],this.borderColor=[0,0,0,1],this.blend=!1,this.pickOffset=0,this.points=null}function i(t,e){var r,n=0,i=t.length>>>1;for(r=0;r<i;r++){var a=t[2*r],o=t[2*r+1];a>=e[0]&&a<=e[2]&&o>=e[1]&&o<=e[3]&&n++}return n}function a(t,e){var r=t.gl,i=s(r),a=s(r),l=o(r,u.pointVertex,u.pointFragment),c=o(r,u.pickVertex,u.pickFragment),h=new n(t,i,a,l,c);return h.update(e),t.addObject(h),h}var o=t("gl-shader"),s=t("gl-buffer"),l=t("typedarray-pool"),u=t("./lib/shader");e.exports=a;var c=n.prototype;c.dispose=function(){this.shader.dispose(),this.pickShader.dispose(),this.offsetBuffer.dispose(),this.pickBuffer.dispose(),this.plot.removeObject(this)},c.update=function(t){function e(e,r){return e in t?t[e]:r}var r;t=t||{},this.sizeMin=e("sizeMin",.5),this.sizeMax=e("sizeMax",20),this.color=e("color",[1,0,0,1]).slice(),this.areaRatio=e("areaRatio",1),this.borderColor=e("borderColor",[0,0,0,1]).slice(),this.blend=e("blend",!1);var n=t.positions.length>>>1,i=t.positions instanceof Float32Array,a=t.idToIndex instanceof Int32Array&&t.idToIndex.length>=n,o=t.positions,s=i?o:l.mallocFloat32(o.length),u=a?t.idToIndex:l.mallocInt32(n);if(i||s.set(o),!a)for(s.set(o),r=0;r<n;r++)u[r]=r;this.points=o,this.offsetBuffer.update(s),this.pickBuffer.update(u),i||l.free(s),a||l.free(u),this.pointCount=n,this.pickOffset=0},c.unifiedDraw=function(){var t=[1,0,0,0,1,0,0,0,1],e=[0,0,0,0];return function(r){var n=void 0!==r,a=n?this.pickShader:this.shader,o=this.plot.gl,s=this.plot.dataBox;if(0===this.pointCount)return r;var l=s[2]-s[0],u=s[3]-s[1],c=i(this.points,s),h=this.plot.pickPixelRatio*Math.max(Math.min(this.sizeMinCap,this.sizeMin),Math.min(this.sizeMax,this.sizeMax/Math.pow(c,.33333)));t[0]=2/l,t[4]=2/u,t[6]=-2*s[0]/l-1,t[7]=-2*s[1]/u-1,this.offsetBuffer.bind(),a.bind(),a.attributes.position.pointer(),a.uniforms.matrix=t,a.uniforms.color=this.color,a.uniforms.borderColor=this.borderColor,a.uniforms.pointCloud=h<5,a.uniforms.pointSize=h,a.uniforms.centerFraction=Math.min(1,Math.max(0,Math.sqrt(1-this.areaRatio))),
26 n&&(e[0]=255&r,e[1]=r>>8&255,e[2]=r>>16&255,e[3]=r>>24&255,this.pickBuffer.bind(),a.attributes.pickId.pointer(o.UNSIGNED_BYTE),a.uniforms.pickOffset=e,this.pickOffset=r);var f=o.getParameter(o.BLEND),d=o.getParameter(o.DITHER);return f&&!this.blend&&o.disable(o.BLEND),d&&o.disable(o.DITHER),o.drawArrays(o.POINTS,0,this.pointCount),f&&!this.blend&&o.enable(o.BLEND),d&&o.enable(o.DITHER),r+this.pointCount}}(),c.draw=c.unifiedDraw,c.drawPick=c.unifiedDraw,c.pick=function(t,e,r){var n=this.pickOffset,i=this.pointCount;if(r<n||r>=n+i)return null;var a=r-n,o=this.points;return{object:this,pointId:a,dataCoord:[o[2*a],o[2*a+1]]}}},{"./lib/shader":217,"gl-buffer":152,"gl-shader":218,"typedarray-pool":533}],226:[function(t,e,r){function n(t,e,r,n){var i,a,o,s,l,u=e[0],c=e[1],h=e[2],f=e[3],d=r[0],p=r[1],m=r[2],v=r[3];return a=u*d+c*p+h*m+f*v,a<0&&(a=-a,d=-d,p=-p,m=-m,v=-v),1-a>1e-6?(i=Math.acos(a),o=Math.sin(i),s=Math.sin((1-n)*i)/o,l=Math.sin(n*i)/o):(s=1-n,l=n),t[0]=s*u+l*d,t[1]=s*c+l*p,t[2]=s*h+l*m,t[3]=s*f+l*v,t}e.exports=n},{}],227:[function(t,e,r){"use strict";e.exports={vertex:"precision highp float;\n#define GLSLIFY 1\n\n\nvec4 computePosition_1_0(vec2 posHi, vec2 posLo, vec2 scHi, vec2 scLo, vec2 trHi, vec2 trLo) {\n return vec4((posHi + trHi) * scHi\n \t\t\t//FIXME: this thingy does not give noticeable precision gain, need test\n + (posLo + trLo) * scHi\n + (posHi + trHi) * scLo\n + (posLo + trLo) * scLo\n , 0, 1);\n}\n\n\nattribute vec2 positionHi, positionLo;\nattribute float size, border;\nattribute vec2 char, color;\n\n//this is 64-bit form of scale and translate\nuniform vec2 scaleHi, scaleLo, translateHi, translateLo;\nuniform float pixelRatio;\nuniform vec4 viewBox;\nuniform sampler2D palette;\n\nvarying vec4 charColor, borderColor;\nvarying vec2 charId;\nvarying vec2 pointCoord;\nvarying float pointSize;\nvarying float borderWidth;\n\n\nvoid main() {\n charColor = texture2D(palette, vec2(color.x / 255., 0));\n borderColor = texture2D(palette, vec2(color.y / 255., 0));\n\n gl_PointSize = size * pixelRatio;\n pointSize = size * pixelRatio;\n\n charId = char;\n borderWidth = border;\n\n gl_Position = computePosition_1_0(\n positionHi, positionLo,\n scaleHi, scaleLo,\n translateHi, translateLo);\n\n pointCoord = viewBox.xy + (viewBox.zw - viewBox.xy) * (gl_Position.xy * .5 + .5);\n}\n",fragment:"precision highp float;\n#define GLSLIFY 1\n\nuniform sampler2D chars;\nuniform vec2 charsShape;\nuniform float charsStep, pixelRatio, charOffset;\n\nvarying vec4 borderColor;\nvarying vec4 charColor;\nvarying vec2 charId;\nvarying vec2 pointCoord;\nvarying float pointSize;\nvarying float borderWidth;\n\nvoid main() {\n\tvec2 pointUV = (pointCoord - gl_FragCoord.xy + pointSize * .5) / pointSize;\n\tpointUV.x = 1. - pointUV.x;\n\tvec2 texCoord = ((charId + pointUV) * charsStep) / charsShape;\n\tfloat dist = texture2D(chars, texCoord).r;\n\n\t//max-distance alpha\n\tif (dist < 1e-2)\n\t\tdiscard;\n\n\tfloat gamma = .0045 * charsStep / pointSize;\n\n //null-border case\n \tif (borderWidth * borderColor.a == 0.) {\n\t\tfloat charAmt = smoothstep(.748 - gamma, .748 + gamma, dist);\n\t\tgl_FragColor = vec4(charColor.rgb, charAmt*charColor.a);\n\t\treturn;\n\t}\n\n\tfloat dif = 5. * pixelRatio * borderWidth / pointSize;\n\tfloat borderLevel = .748 - dif * .5;\n\tfloat charLevel = .748 + dif * .5;\n\n\tfloat borderAmt = smoothstep(borderLevel - gamma, borderLevel + gamma, dist);\n\tfloat charAmt = smoothstep(charLevel - gamma, charLevel + gamma, dist);\n\n\tvec4 color = borderColor;\n\tcolor.a *= borderAmt;\n\n\tgl_FragColor = mix(color, charColor, charAmt);\n}\n",pickVertex:"precision highp float;\n#define GLSLIFY 1\n\nattribute vec2 positionHi, positionLo;\nattribute vec4 id;\nattribute float size;\n\nuniform vec2 scaleHi, scaleLo, translateHi, translateLo;\nuniform vec4 pickOffset;\nuniform float pixelRatio;\n\nvarying vec4 fragColor;\n\n\nvec4 computePosition_1_0(vec2 posHi, vec2 posLo, vec2 scHi, vec2 scLo, vec2 trHi, vec2 trLo) {\n return vec4((posHi + trHi) * scHi\n \t\t\t//FIXME: this thingy does not give noticeable precision gain, need test\n + (posLo + trLo) * scHi\n + (posHi + trHi) * scLo\n + (posLo + trLo) * scLo\n , 0, 1);\n}\n\n\nvoid main() {\n vec4 fragId = id + pickOffset;\n\n fragId.y += floor(fragId.x / 256.0);\n fragId.x -= floor(fragId.x / 256.0) * 256.0;\n\n fragId.z += floor(fragId.y / 256.0);\n fragId.y -= floor(fragId.y / 256.0) * 256.0;\n\n fragId.w += floor(fragId.z / 256.0);\n fragId.z -= floor(fragId.z / 256.0) * 256.0;\n\n fragColor = fragId / 255.0;\n\n gl_PointSize = size * .25 * pixelRatio;\n\n gl_Position = computePosition_1_0(\n positionHi, positionLo,\n scaleHi, scaleLo,\n translateHi, translateLo);\n}\n",pickFragment:"precision lowp float;\n#define GLSLIFY 1\nvarying vec4 fragColor;\nvoid main() {\n gl_FragColor = fragColor;\n}\n"}},{}],228:[function(t,e,r){arguments[4][80][0].apply(r,arguments)},{dup:80}],229:[function(t,e,r){arguments[4][207][0].apply(r,arguments)},{"./lib/GLError":230,"./lib/create-attributes":231,"./lib/create-uniforms":232,"./lib/reflect":233,"./lib/runtime-reflect":234,"./lib/shader-cache":235,dup:207}],230:[function(t,e,r){arguments[4][208][0].apply(r,arguments)},{dup:208}],231:[function(t,e,r){arguments[4][209][0].apply(r,arguments)},{"./GLError":230,dup:209}],232:[function(t,e,r){arguments[4][210][0].apply(r,arguments)},{"./GLError":230,"./reflect":233,dup:210}],233:[function(t,e,r){arguments[4][211][0].apply(r,arguments)},{dup:211}],234:[function(t,e,r){arguments[4][212][0].apply(r,arguments)},{dup:212}],235:[function(t,e,r){arguments[4][213][0].apply(r,arguments)},{"./GLError":230,dup:213,"gl-format-compiler-error":160,"weakmap-shim":554}],236:[function(t,e,r){"use strict";function n(t,e,r,n,a){a<=4*f?i(0,a-1,t,e,r,n):h(0,a-1,t,e,r,n)}function i(t,e,r,n,i,a){for(var o=t+1;o<=e;++o){for(var s=r[o],l=n[2*o],u=n[2*o+1],c=i[o],h=a[o],f=o;f>t;){var d=r[f-1],p=n[2*(f-1)];if((d-s||l-p)>=0)break;r[f]=d,n[2*f]=p,n[2*f+1]=n[2*f-1],i[f]=i[f-1],a[f]=a[f-1],f-=1}r[f]=s,n[2*f]=l,n[2*f+1]=u,i[f]=c,a[f]=h}}function a(t,e,r,n,i,a){var o=r[t],s=n[2*t],l=n[2*t+1],u=i[t],c=a[t];r[t]=r[e],n[2*t]=n[2*e],n[2*t+1]=n[2*e+1],i[t]=i[e],a[t]=a[e],r[e]=o,n[2*e]=s,n[2*e+1]=l,i[e]=u,a[e]=c}function o(t,e,r,n,i,a){r[t]=r[e],n[2*t]=n[2*e],n[2*t+1]=n[2*e+1],i[t]=i[e],a[t]=a[e]}function s(t,e,r,n,i,a,o){var s=n[t],l=i[2*t],u=i[2*t+1],c=a[t],h=o[t];n[t]=n[e],i[2*t]=i[2*e],i[2*t+1]=i[2*e+1],a[t]=a[e],o[t]=o[e],n[e]=n[r],i[2*e]=i[2*r],i[2*e+1]=i[2*r+1],a[e]=a[r],o[e]=o[r],n[r]=s,i[2*r]=l,i[2*r+1]=u,a[r]=c,o[r]=h}function l(t,e,r,n,i,a,o,s,l,u,c){s[t]=s[e],l[2*t]=l[2*e],l[2*t+1]=l[2*e+1],u[t]=u[e],c[t]=c[e],s[e]=r,l[2*e]=n,l[2*e+1]=i,u[e]=a,c[e]=o}function u(t,e,r,n,i){return(r[t]-r[e]||n[2*e]-n[2*t]||i[t]-i[e])<0}function c(t,e,r,n,i,a,o,s){return(e-a[t]||o[2*t]-r||i-s[t])<0}function h(t,e,r,n,d,p){var m=(e-t+1)/6|0,v=t+m,g=e-m,y=t+e>>1,b=y-m,x=y+m,_=v,w=b,M=y,k=x,A=g,T=t+1,S=e-1,E=0;u(_,w,r,n,d,p)&&(E=_,_=w,w=E),u(k,A,r,n,d,p)&&(E=k,k=A,A=E),u(_,M,r,n,d,p)&&(E=_,_=M,M=E),u(w,M,r,n,d,p)&&(E=w,w=M,M=E),u(_,k,r,n,d,p)&&(E=_,_=k,k=E),u(M,k,r,n,d,p)&&(E=M,M=k,k=E),u(w,A,r,n,d,p)&&(E=w,w=A,A=E),u(w,M,r,n,d,p)&&(E=w,w=M,M=E),u(k,A,r,n,d,p)&&(E=k,k=A,A=E);var L=r[w],C=n[2*w],z=n[2*w+1],D=d[w],I=p[w],P=r[k],O=n[2*k],j=n[2*k+1],F=d[k],R=p[k],N=_,B=M,U=A,V=v,q=y,H=g,G=r[N],Y=r[B],X=r[U];r[V]=G,r[q]=Y,r[H]=X;for(var W=0;W<2;++W){var Z=n[2*N+W],J=n[2*B+W],K=n[2*U+W];n[2*V+W]=Z,n[2*q+W]=J,n[2*H+W]=K}var Q=d[N],$=d[B],tt=d[U];d[V]=Q,d[q]=$,d[H]=tt;var et=p[N],rt=p[B],nt=p[U];p[V]=et,p[q]=rt,p[H]=nt,o(b,t,r,n,d,p),o(x,e,r,n,d,p);for(var it=T;it<=S;++it)if(c(it,L,C,z,D,r,n,d))it!==T&&a(it,T,r,n,d,p),++T;else if(!c(it,P,O,j,F,r,n,d))for(;;){if(c(S,P,O,j,F,r,n,d)){c(S,L,C,z,D,r,n,d)?(s(it,T,S,r,n,d,p),++T,--S):(a(it,S,r,n,d,p),--S);break}if(--S<it)break}l(t,T-1,L,C,z,D,I,r,n,d,p),l(e,S+1,P,O,j,F,R,r,n,d,p),T-2-t<=f?i(t,T-2,r,n,d,p):h(t,T-2,r,n,d,p),e-(S+2)<=f?i(S+2,e,r,n,d,p):h(S+2,e,r,n,d,p),S-T<=f?i(T,S,r,n,d,p):h(T,S,r,n,d,p)}e.exports=n;var f=32},{}],237:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o,s){for(var l=r,u=r;u<n;++u){var c=t[2*u],h=t[2*u+1],f=e[u];i<=c&&c<=o&&a<=h&&h<=s&&(u===l?l+=1:(t[2*u]=t[2*l],t[2*u+1]=t[2*l+1],e[u]=e[l],t[2*l]=c,t[2*l+1]=h,e[l]=f,l+=1))}return l}function i(t,e,r){this.pixelSize=t,this.offset=e,this.count=r}function a(t,e,r,a){function l(i,a,o,s,u,c){var h=.5*o,f=s+1,d=u-s;r[_]=d,x[_++]=c;for(var p=0;p<2;++p)for(var m=0;m<2;++m){var v=i+p*h,g=a+m*h,y=n(t,e,f,u,v,g,v+h,g+h);if(y!==f){if(y-f>=Math.max(.9*d,32)){var b=u+s>>>1;l(v,g,h,f,b,c+1),f=b}l(v,g,h,f,y,c+1),f=y}}}var u=t.length>>>1;if(u<1)return[];for(var c=1/0,h=1/0,f=-1/0,d=-1/0,p=0;p<u;++p){var m=t[2*p],v=t[2*p+1];c=Math.min(c,m),f=Math.max(f,m),h=Math.min(h,v),d=Math.max(d,v),e[p]=p}c===f&&(f+=1+Math.abs(f)),h===d&&(d+=1+Math.abs(f));var g=1/(f-c),y=1/(d-h),b=Math.max(f-c,d-h);a=a||[0,0,0,0],a[0]=c,a[1]=h,a[2]=f,a[3]=d;var x=o.mallocInt32(u),_=0;l(c,h,b,0,u,0),s(x,t,e,r,u);for(var w=[],M=0,k=u,_=u-1;_>=0;--_){t[2*_]=(t[2*_]-c)*g,t[2*_+1]=(t[2*_+1]-h)*y;var A=x[_];A!==M&&(w.push(new i(b*Math.pow(.5,A),_+1,k-(_+1))),k=_+1,M=A)}return w.push(new i(b*Math.pow(.5,A+1),0,k)),o.free(x),w}var o=t("typedarray-pool"),s=t("./lib/sort");e.exports=a},{"./lib/sort":236,"typedarray-pool":533}],238:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o,s){this.plot=t,this.shader=e,this.pickShader=r,this.positionBuffer=n,this.sizeBuffer=i,this.colorBuffer=a,this.idBuffer=o,this.charBuffer=s,this.pointCount=0,this.pickOffset=0,this.points=null,this.scales=[],this.xCoords=[],this.charCanvas=document.createElement("canvas"),this.charTexture=h(this.plot.gl,this.charCanvas),this.charStep=400,this.snapThreshold=1e4,this.paletteTexture=h(this.plot.gl,[256,1])}function i(t,e){var r=t.gl,i=a(r,l.vertex,l.fragment),s=a(r,l.pickVertex,l.pickFragment),u=o(r),c=o(r),h=o(r),f=o(r),d=o(r),p=new n(t,i,s,u,c,h,f,d);return p.update(e),t.addObject(p),p}e.exports=i;var a=t("gl-shader"),o=t("gl-buffer"),s=t("typedarray-pool"),l=t("./lib/shaders"),u=t("snap-points-2d"),c=t("font-atlas-sdf"),h=t("gl-texture2d"),f=t("color-id"),d=t("ndarray"),p=t("clamp"),m=t("binary-search-bounds"),v=n.prototype;!function(){function t(){var t=this.plot,u=t.viewBox,c=t.dataBox,h=t.pixelRatio,f=c[2]-c[0],d=c[3]-c[1],p=2/f,m=2/d,v=-c[0]-.5*f,g=-c[1]-.5*d;i[0]=p,a[0]=p-i[0],i[1]=m,a[1]=m-i[1],o[0]=v,s[0]=v-o[0],o[1]=g,s[1]=g-o[1];var y=u[2]-u[0],b=u[3]-u[1];e=Math.min(f/y,d/b),l[0]=2*h/y,l[1]=2*h/b,r=c[0],n=c[2]}var e,r,n,i=new Float32Array([0,0]),a=new Float32Array([0,0]),o=new Float32Array([0,0]),s=new Float32Array([0,0]),l=[0,0],u=[0,0,0,0];v.drawPick=function(l){var c=void 0!==l,h=this.plot,f=this.pointCount,d=f>this.snapThreshold;if(!f)return l;t.call(this);var p=h.gl,v=c?this.pickShader:this.shader,g=p.isEnabled(p.BLEND);if(v.bind(),c){this.pickOffset=l;for(var y=0;y<4;++y)u[y]=l>>8*y&255;v.uniforms.pickOffset=u,this.idBuffer.bind(),v.attributes.id.pointer(p.UNSIGNED_BYTE,!1)}else p.blendFuncSeparate(p.SRC_ALPHA,p.ONE_MINUS_SRC_ALPHA,p.ONE,p.ONE_MINUS_SRC_ALPHA),p.blendColor(0,0,0,1),g||p.enable(p.BLEND),this.colorBuffer.bind(),v.attributes.color.pointer(p.UNSIGNED_BYTE,!1),this.charBuffer.bind(),v.attributes.char.pointer(p.UNSIGNED_BYTE,!1),v.uniforms.chars=this.charTexture.bind(0),v.uniforms.charsShape=[this.charCanvas.width,this.charCanvas.height],v.uniforms.charsStep=this.charStep,v.uniforms.palette=this.paletteTexture.bind(1);this.sizeBuffer.bind(),v.attributes.size.pointer(p.FLOAT,!1,8,0),c||v.attributes.border.pointer(p.FLOAT,!1,8,4),this.positionBuffer.bind(),v.attributes.positionHi.pointer(p.FLOAT,!1,16,0),v.attributes.positionLo.pointer(p.FLOAT,!1,16,8),v.uniforms.pixelRatio=h.pixelRatio,v.uniforms.scaleHi=i,v.uniforms.scaleLo=a,v.uniforms.translateHi=o,v.uniforms.translateLo=s,v.uniforms.viewBox=h.viewBox;var b=this.scales;if(d)for(var x=b.length-1;x>=0;x--){var _=b[x];if(!(_.pixelSize&&_.pixelSize<1.25*e&&x>1)){var w=_.offset,M=_.count+w,k=m.ge(this.xCoords,r,w,M-1),A=m.lt(this.xCoords,n,k,M-1)+1;A>k&&p.drawArrays(p.POINTS,k,A-k)}}else p.drawArrays(p.POINTS,0,f);if(c)return l+f;g?p.blendFunc(p.ONE,p.ONE_MINUS_SRC_ALPHA):p.disable(p.BLEND)}}(),v.draw=v.drawPick,v.pick=function(t,e,r){var n=this.pickOffset,i=this.pointCount;if(r<n||r>=n+i)return null;var a=r-n,o=this.points;return{object:this,pointId:a,dataCoord:[o[2*a],o[2*a+1]]}},v.update=function(t){t=t||{};var e=t.positions||[],r=t.colors||[],n=t.glyphs||[],i=t.sizes||[],a=t.borderWidths||[],o=t.borderColors||[],l=this.plot.gl;this.points=e;var h=this.points.length/2,m=s.mallocInt32(h),v=s.mallocFloat32(2*h),g=s.mallocFloat64(2*h);g.set(this.points),this.pointCount=h;var y=h>this.snapThreshold;y&&(this.scales=u(g,m,v));for(var b=s.mallocFloat32(4*h),x=s.mallocFloat32(2*h),_=s.mallocUint8(2*h),w=s.mallocUint32(h),M=s.mallocUint8(2*h),k={},A=[],T=[],S=[],E=0,L=h,C=0;E<L;++E){var z=[255*r[4*E],255*r[4*E+1],255*r[4*E+2],255*r[4*E+3]],D=f(z,!1);null==k[D]&&(k[D]=C++,T.push(z[0]),T.push(z[1]),T.push(z[2]),T.push(z[3])),A.push(D),o&&o.length&&(z=[255*o[4*E],255*o[4*E+1],255*o[4*E+2],255*o[4*E+3]],D=f(z,!1),null==k[D]&&(k[D]=C++,T.push(z[0]),T.push(z[1]),T.push(z[2]),T.push(z[3])),S.push(D))}for(var I={},E=0,L=h,C=0;E<L;E++){var P=n[E];null==I[P]&&(I[P]=C++)}for(var O=0,E=0,L=i.length;E<L;++E)i[E]>O&&(O=i[E]);var j=this.charStep;this.charStep=p(Math.ceil(4*O),128,768);var F=Object.keys(I),R=this.charStep,N=Math.floor(R/2),B=l.getParameter(l.MAX_TEXTURE_SIZE),U=B/R*(B/R),V=Math.min(B,R*F.length),q=Math.min(B,R*Math.ceil(R*F.length/B)),H=Math.floor(V/R);F.length>U&&console.warn("gl-scatter2d-fancy: number of characters is more than maximum texture size. Try reducing it."),this.chars&&this.chars+""==F+""&&this.charStep==j||(this.charCanvas=c({canvas:this.charCanvas,family:"sans-serif",size:N,shape:[V,q],step:[R,R],chars:F,align:!0}),this.chars=F);for(var E=0;E<h;++E){var G=y?m[E]:E,Y=e[2*G],X=e[2*G+1],W=i[G],Z=a[G];b[4*E]=Y,b[4*E+1]=X,b[4*E+2]=Y-b[4*E],b[4*E+3]=X-b[4*E+1],this.xCoords[E]=Y,x[2*E]=2*W,x[2*E+1]=Z,w[E]=G;var D=A[G],J=k[D];_[2*E]=J;var K=S[G],Q=k[K];_[2*E+1]=Q;var P=n[G],$=I[P];M[2*E+1]=Math.floor($/H),M[2*E]=$%H}this.positionBuffer.update(b),this.sizeBuffer.update(x),this.colorBuffer.update(_),this.idBuffer.update(w),this.charBuffer.update(M),this.charTexture.shape=[this.charCanvas.width,this.charCanvas.height],this.charCanvas&&this.charCanvas.width&&this.charTexture.setPixels(this.charCanvas),this.paletteTexture.setPixels(d(T.slice(0,1024),[256,1,4])),s.free(b),s.free(x),s.free(_),s.free(w),s.free(M),s.free(g),s.free(m),s.free(v)},v.dispose=function(){this.shader.dispose(),this.pickShader.dispose(),this.positionBuffer.dispose(),this.sizeBuffer.dispose(),this.colorBuffer.dispose(),this.idBuffer.dispose(),this.charBuffer.dispose(),this.plot.removeObject(this)}},{"./lib/shaders":227,"binary-search-bounds":228,clamp:84,"color-id":88,"font-atlas-sdf":130,"gl-buffer":152,"gl-shader":229,"gl-texture2d":262,ndarray:460,"snap-points-2d":237,"typedarray-pool":533}],239:[function(t,e,r){r.pointVertex="precision highp float;\n#define GLSLIFY 1\n\nattribute vec2 positionHi, positionLo;\nattribute float weight;\n\nuniform vec2 scaleHi, scaleLo, translateHi, translateLo;\nuniform float pointSize, useWeight;\n\nvarying float fragWeight;\n\n\nvec4 pfx_1_0(vec2 scaleHi, vec2 scaleLo, vec2 translateHi, vec2 translateLo, vec2 positionHi, vec2 positionLo) {\n return vec4((positionHi + translateHi) * scaleHi\n + (positionLo + translateLo) * scaleHi\n + (positionHi + translateHi) * scaleLo\n + (positionLo + translateLo) * scaleLo, 0.0, 1.0);\n}\n\nvoid main() {\n gl_Position = pfx_1_0(scaleHi, scaleLo, translateHi, translateLo, positionHi, positionLo);\n gl_PointSize = pointSize;\n fragWeight = mix(1.0, weight, useWeight);\n}",r.pointFragment="precision mediump float;\n#define GLSLIFY 1\n\nuniform vec4 color, borderColor;\nuniform float centerFraction;\n\nvarying float fragWeight;\n\nfloat smoothStep(float x, float y) {\n return 1.0 / (1.0 + exp(50.0*(x - y)));\n}\n\nvoid main() {\n float radius = length(2.0*gl_PointCoord.xy-1.0);\n if(radius > 1.0) {\n discard;\n }\n vec4 baseColor = mix(borderColor, color, smoothStep(radius, centerFraction));\n float alpha = 1.0 - pow(1.0 - baseColor.a, fragWeight);\n gl_FragColor = vec4(baseColor.rgb * alpha, alpha);\n}",r.pickVertex="precision highp float;\n#define GLSLIFY 1\n\nvec4 pfx_1_0(vec2 scaleHi, vec2 scaleLo, vec2 translateHi, vec2 translateLo, vec2 positionHi, vec2 positionLo) {\n return vec4((positionHi + translateHi) * scaleHi\n + (positionLo + translateLo) * scaleHi\n + (positionHi + translateHi) * scaleLo\n + (positionLo + translateLo) * scaleLo, 0.0, 1.0);\n}\n\nattribute vec2 positionHi, positionLo;\nattribute vec4 pickId;\n\nuniform vec2 scaleHi, scaleLo, translateHi, translateLo;\nuniform float pointSize;\nuniform vec4 pickOffset;\n\nvarying vec4 fragId;\n\nvoid main() {\n\n vec4 id = pickId + pickOffset;\n id.y += floor(id.x / 256.0);\n id.x -= floor(id.x / 256.0) * 256.0;\n\n id.z += floor(id.y / 256.0);\n id.y -= floor(id.y / 256.0) * 256.0;\n\n id.w += floor(id.z / 256.0);\n id.z -= floor(id.z / 256.0) * 256.0;\n\n gl_Position = pfx_1_0(scaleHi, scaleLo, translateHi, translateLo, positionHi, positionLo);\n gl_PointSize = pointSize;\n fragId = id;\n}",r.pickFragment="precision mediump float;\n#define GLSLIFY 1\n\nvarying vec4 fragId;\n\nvoid main() {\n float radius = length(2.0 * gl_PointCoord.xy - 1.0);\n if(radius > 1.0) {\n discard;\n }\n gl_FragColor = fragId / 255.0;\n}"},{}],240:[function(t,e,r){arguments[4][80][0].apply(r,arguments)},{dup:80}],241:[function(t,e,r){arguments[4][236][0].apply(r,arguments)},{dup:236}],242:[function(t,e,r){arguments[4][237][0].apply(r,arguments)},{"./lib/sort":241,dup:237,"typedarray-pool":533}],243:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o){this.plot=t,this.positionBufferHi=e,this.positionBufferLo=r,this.pickBuffer=n,this.weightBuffer=i,this.shader=a,this.pickShader=o,this.scales=[],this.size=12,this.borderSize=1,this.pointCount=0,this.color=[1,0,0,1],this.borderColor=[0,0,0,1],this.bounds=[1/0,1/0,-1/0,-1/0],this.pickOffset=0,this.points=null,this.xCoords=null}function i(t,e){var r=t.gl,i=o(r),s=o(r),l=o(r),u=o(r),h=a(r,c.pointVertex,c.pointFragment),f=a(r,c.pickVertex,c.pickFragment),d=new n(t,i,s,l,u,h,f);return d.update(e),t.addObject(d),d}var a=t("gl-shader"),o=t("gl-buffer"),s=t("binary-search-bounds"),l=t("snap-points-2d"),u=t("typedarray-pool"),c=t("./lib/shader");e.exports=i;var h=n.prototype,f=new Float32Array(2),d=new Float32Array(2),p=new Float32Array(2),m=new Float32Array(2),v=[0,0,0,0];h.dispose=function(){this.shader.dispose(),this.pickShader.dispose(),this.positionBufferHi.dispose(),this.positionBufferLo.dispose(),this.pickBuffer.dispose(),this.xCoords&&u.free(this.xCoords),this.plot.removeObject(this)},h.update=function(t){function e(e,r){return e in t?t[e]:r}t=t||{},this.size=e("size",12),this.color=e("color",[1,0,0,1]).slice(),this.borderSize=e("borderSize",1),this.borderColor=e("borderColor",[0,0,0,1]).slice(),this.xCoords&&u.free(this.xCoords),this.points=t.positions;var r=this.points.length>>>1,n=u.mallocInt32(r),i=u.mallocFloat32(2*r),a=u.mallocFloat64(2*r);a.set(this.points),this.scales=l(a,n,i,this.bounds);var o=u.mallocFloat64(r),s=u.mallocFloat32(2*r),c=u.mallocFloat32(2*r);s.set(a);for(var h=0,f=0;h<r;h++,f+=2)c[f]=a[f]-s[f],c[f+1]=a[f+1]-s[f+1],o[h]=a[f];this.positionBufferHi.update(s),this.positionBufferLo.update(c),this.pickBuffer.update(n),this.weightBuffer.update(i),u.free(n),u.free(a),u.free(s),u.free(c),u.free(i),this.xCoords=o,this.pointCount=r,this.pickOffset=0},h.draw=function(t){var e=void 0!==t,r=this.plot,n=e?this.pickShader:this.shader,i=this.scales,a=this.positionBufferHi,o=this.positionBufferLo,l=this.pickBuffer,u=this.bounds,c=this.size,h=this.borderSize,g=r.gl,y=e?r.pickPixelRatio:r.pixelRatio,b=r.viewBox,x=r.dataBox;if(0===this.pointCount)return t;var _=u[2]-u[0],w=u[3]-u[1],M=x[2]-x[0],k=x[3]-x[1],A=(b[2]-b[0])*y/r.pixelRatio,T=(b[3]-b[1])*y/r.pixelRatio,S=Math.min(M/A,k/T),E=2*_/M,L=2*w/k;f[0]=E,f[1]=L,d[0]=E-f[0],d[1]=L-f[1];var C=(u[0]-x[0]-.5*M)/_,z=(u[1]-x[1]-.5*k)/w;p[0]=C,p[1]=z,m[0]=C-p[0],m[1]=z-p[1],n.bind(),n.uniforms.scaleHi=f,n.uniforms.scaleLo=d,n.uniforms.translateHi=p,n.uniforms.translateLo=m,n.uniforms.color=this.color,n.uniforms.borderColor=this.borderColor,n.uniforms.pointSize=y*(c+h),n.uniforms.centerFraction=0===this.borderSize?2:c/(c+h+1.25),a.bind(),n.attributes.positionHi.pointer(),o.bind(),n.attributes.positionLo.pointer(),e?(this.pickOffset=t,v[0]=255&t,v[1]=t>>8&255,v[2]=t>>16&255,v[3]=t>>24&255,n.uniforms.pickOffset=v,l.bind(),n.attributes.pickId.pointer(g.UNSIGNED_BYTE)):(n.uniforms.useWeight=1,this.weightBuffer.bind(),n.attributes.weight.pointer());for(var D=this.xCoords,I=(x[0]-u[0]-S*c*y)/_,P=(x[2]-u[0]+S*c*y)/_,O=!0,j=i.length-1;j>=0;j--){var F=i[j];if(!(F.pixelSize<S&&j>1)){var R=F.offset,N=F.count+R,B=s.ge(D,I,R,N-1),U=s.lt(D,P,B,N-1)+1;U>B&&g.drawArrays(g.POINTS,B,U-B),!e&&O&&(O=!1,n.uniforms.useWeight=0)}}return t+this.pointCount},h.drawPick=h.draw,h.pick=function(t,e,r){var n=r-this.pickOffset;return n<0||n>=this.pointCount?null:{object:this,pointId:n,dataCoord:[this.points[2*n],this.points[2*n+1]]}}},{"./lib/shader":239,"binary-search-bounds":240,"gl-buffer":152,"gl-shader":250,"snap-points-2d":242,"typedarray-pool":533}],244:[function(t,e,r){"use strict";function n(t,e){var r=a[e];if(r||(r=a[e]={}),t in r)return r[t];for(var n=i(t,{textAlign:"center",textBaseline:"middle",lineHeight:1,font:e}),o=i(t,{triangles:!0,textAlign:"center",textBaseline:"middle",lineHeight:1,font:e}),s=[[1/0,1/0],[-1/0,-1/0]],l=0;l<n.positions.length;++l)for(var u=n.positions[l],c=0;c<2;++c)s[0][c]=Math.min(s[0][c],u[c]),s[1][c]=Math.max(s[1][c],u[c]);return r[t]=[o,n,s]}var i=t("vectorize-text");e.exports=n;var a={}},{"vectorize-text":546}],245:[function(t,e,r){function n(t,e){var r=i(t,e),n=r.attributes;return n.position.location=0,n.color.location=1,n.glyph.location=2,n.id.location=3,r}var i=t("gl-shader"),a="precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\n\n\nuniform vec4 highlightId;\nuniform float highlightScale;\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if(any(lessThan(position, clipBounds[0])) || \n any(greaterThan(position, clipBounds[1])) ) {\n gl_Position = vec4(0,0,0,0);\n } else {\n float scale = 1.0;\n if(distance(highlightId, id) < 0.0001) {\n scale = highlightScale;\n }\n\n vec4 worldPosition = model * vec4(position, 1);\n vec4 viewPosition = view * worldPosition;\n viewPosition = viewPosition / viewPosition.w;\n vec4 clipPosition = projection * (viewPosition + scale * vec4(glyph.x, -glyph.y, 0, 0));\n \n gl_Position = clipPosition;\n interpColor = color;\n pickId = id;\n dataCoordinate = position;\n }\n}",o="precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform vec2 screenSize;\nuniform vec3 clipBounds[2];\nuniform float highlightScale, pixelRatio;\nuniform vec4 highlightId;\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if(any(lessThan(position, clipBounds[0])) || any(greaterThan(position, clipBounds[1]))) {\n gl_Position = vec4(0,0,0,0);\n } else {\n float scale = pixelRatio;\n if(distance(highlightId.bgr, id.bgr) < 0.001) {\n scale *= highlightScale;\n }\n\n vec4 worldPosition = model * vec4(position, 1.0);\n vec4 viewPosition = view * worldPosition;\n vec4 clipPosition = projection * viewPosition;\n clipPosition /= clipPosition.w;\n \n gl_Position = clipPosition + vec4(screenSize * scale * vec2(glyph.x, -glyph.y), 0.0, 0.0);\n interpColor = color;\n pickId = id;\n dataCoordinate = position;\n }\n}",s="precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\n\nuniform float highlightScale;\nuniform vec4 highlightId;\nuniform vec3 axes[2];\nuniform mat4 model, view, projection;\nuniform vec2 screenSize;\nuniform vec3 clipBounds[2];\nuniform float scale, pixelRatio;\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if(any(lessThan(position, clipBounds[0])) ||\n any(greaterThan(position, clipBounds[1])) ) {\n gl_Position = vec4(0,0,0,0);\n } else {\n float lscale = pixelRatio * scale;\n if(distance(highlightId, id) < 0.0001) {\n lscale *= highlightScale;\n }\n\n vec4 clipCenter = projection * view * model * vec4(position, 1);\n vec3 dataPosition = position + 0.5*lscale*(axes[0] * glyph.x + axes[1] * glyph.y) * clipCenter.w * screenSize.y;\n vec4 clipPosition = projection * view * model * vec4(dataPosition, 1);\n\n gl_Position = clipPosition;\n interpColor = color;\n pickId = id;\n dataCoordinate = dataPosition;\n }\n}\n",l="precision mediump float;\n#define GLSLIFY 1\n\nuniform vec3 fragClipBounds[2];\nuniform float opacity;\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if(any(lessThan(dataCoordinate, fragClipBounds[0])) ||\n any(greaterThan(dataCoordinate, fragClipBounds[1])) ) {\n discard;\n } else {\n gl_FragColor = interpColor * opacity;\n }\n}\n",u="precision mediump float;\n#define GLSLIFY 1\n\nuniform vec3 fragClipBounds[2];\nuniform float pickGroup;\n\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if(any(lessThan(dataCoordinate, fragClipBounds[0])) || \n any(greaterThan(dataCoordinate, fragClipBounds[1])) ) {\n discard;\n } else {\n gl_FragColor = vec4(pickGroup, pickId.bgr);\n }\n}",c=[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"glyph",type:"vec2"},{name:"id",type:"vec4"}],h={vertex:a,fragment:l,attributes:c},f={vertex:o,fragment:l,attributes:c},d={vertex:s,fragment:l,attributes:c},p={vertex:a,fragment:u,attributes:c},m={vertex:o,fragment:u,attributes:c},v={vertex:s,fragment:u,attributes:c};r.createPerspective=function(t){return n(t,h)},r.createOrtho=function(t){return n(t,f)},r.createProject=function(t){return n(t,d)},r.createPickPerspective=function(t){return n(t,p)},r.createPickOrtho=function(t){return n(t,m)},r.createPickProject=function(t){return n(t,v)}},{"gl-shader":250}],246:[function(t,e,r){"use strict";function n(t,e){var r=t[0],n=t[1],i=t[2],a=t[3];return t[0]=e[0]*r+e[4]*n+e[8]*i+e[12]*a,t[1]=e[1]*r+e[5]*n+e[9]*i+e[13]*a,t[2]=e[2]*r+e[6]*n+e[10]*i+e[14]*a,t[3]=e[3]*r+e[7]*n+e[11]*i+e[15]*a,t}function i(t,e,r,i){return n(i,i,r),n(i,i,e),n(i,i,t)}function a(t,e){this.index=t,this.dataCoordinate=this.position=e}function o(t,e,r,n,i,o,s,l,u,c,h,f){this.gl=t,this.pixelRatio=1,this.shader=e,this.orthoShader=r,this.projectShader=n,this.pointBuffer=i,this.colorBuffer=o,this.glyphBuffer=s,this.idBuffer=l,this.vao=u,this.vertexCount=0,this.lineVertexCount=0,this.opacity=1,this.lineWidth=0,this.projectScale=[2/3,2/3,2/3],this.projectOpacity=[1,1,1],this.pickId=0,this.pickPerspectiveShader=c,this.pickOrthoShader=h,this.pickProjectShader=f,this.points=[],this._selectResult=new a(0,[0,0,0]),this.useOrtho=!0,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.axesProject=[!0,!0,!0],this.axesBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.highlightId=[1,1,1,1],this.highlightScale=2,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.dirty=!0}function s(t){return t[0]=t[1]=t[2]=0,t}function l(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=1,t}function u(t,e,r,n){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[r]=n,t}function c(t){for(var e=L,r=0;r<2;++r)for(var n=0;n<3;++n)e[r][n]=Math.max(Math.min(t[r][n],1e8),-1e8);return e}function h(t,e,r,n,a){var o,h=e.axesProject,f=e.gl,d=t.uniforms,p=r.model||x,m=r.view||x,v=r.projection||x,y=e.axesBounds,b=c(e.clipBounds);o=e.axes?e.axes.lastCubeProps.axis:[1,1,1],w[0]=2/f.drawingBufferWidth,w[1]=2/f.drawingBufferHeight,t.bind(),d.view=m,d.projection=v,d.screenSize=w,d.highlightId=e.highlightId,d.highlightScale=e.highlightScale,d.clipBounds=b,d.pickGroup=e.pickId/255,d.pixelRatio=e.pixelRatio;for(var _=0;_<3;++_)if(h[_]&&e.projectOpacity[_]<1===n){d.scale=e.projectScale[_],d.opacity=e.projectOpacity[_];for(var L=S,C=0;C<16;++C)L[C]=0;for(var C=0;C<4;++C)L[5*C]=1;L[5*_]=0,o[_]<0?L[12+_]=y[0][_]:L[12+_]=y[1][_],g(L,p,L),d.model=L;var z=(_+1)%3,D=(_+2)%3,I=s(M),P=s(k);I[z]=1,P[D]=1;var O=i(v,m,p,l(A,I)),j=i(v,m,p,l(T,P));if(Math.abs(O[1])>Math.abs(j[1])){var F=O;O=j,j=F,F=I,I=P,P=F;var R=z;z=D,D=R}O[0]<0&&(I[z]=-1),j[1]>0&&(P[D]=-1);for(var N=0,B=0,C=0;C<4;++C)N+=Math.pow(p[4*z+C],2),B+=Math.pow(p[4*D+C],2);I[z]/=Math.sqrt(N),P[D]/=Math.sqrt(B),d.axes[0]=I,d.axes[1]=P,d.fragClipBounds[0]=u(E,b[0],_,-1e8),d.fragClipBounds[1]=u(E,b[1],_,1e8),e.vao.draw(f.TRIANGLES,e.vertexCount),e.lineWidth>0&&(f.lineWidth(e.lineWidth),e.vao.draw(f.LINES,e.lineVertexCount,e.vertexCount))}}function f(t,e,r,n,i,a){var o=r.gl;if(r.vao.bind(),i===r.opacity<1||a){t.bind();var s=t.uniforms;s.model=n.model||x,s.view=n.view||x,s.projection=n.projection||x,w[0]=2/o.drawingBufferWidth,w[1]=2/o.drawingBufferHeight,s.screenSize=w,s.highlightId=r.highlightId,s.highlightScale=r.highlightScale,s.fragClipBounds=D,s.clipBounds=r.axes.bounds,s.opacity=r.opacity,s.pickGroup=r.pickId/255,s.pixelRatio=r.pixelRatio,r.vao.draw(o.TRIANGLES,r.vertexCount),r.lineWidth>0&&(o.lineWidth(r.lineWidth),r.vao.draw(o.LINES,r.lineVertexCount,r.vertexCount))}h(e,r,n,i,a),r.vao.unbind()}function d(t){var e=t.gl,r=y.createPerspective(e),n=y.createOrtho(e),i=y.createProject(e),a=y.createPickPerspective(e),s=y.createPickOrtho(e),l=y.createPickProject(e),u=p(e),c=p(e),h=p(e),f=p(e),d=m(e,[{buffer:u,size:3,type:e.FLOAT},{buffer:c,size:4,type:e.FLOAT},{buffer:h,size:2,type:e.FLOAT},{buffer:f,size:4,type:e.UNSIGNED_BYTE,normalized:!0}]),v=new o(e,r,n,i,u,c,h,f,d,a,s,l);return v.update(t),v}var p=t("gl-buffer"),m=t("gl-vao"),v=t("typedarray-pool"),g=t("gl-mat4/multiply"),y=t("./lib/shaders"),b=t("./lib/glyphs"),x=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];e.exports=d;var _=o.prototype;_.pickSlots=1,_.setPickBase=function(t){this.pickId=t},_.isTransparent=function(){if(this.opacity<1)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&this.projectOpacity[t]<1)return!0;return!1},_.isOpaque=function(){if(this.opacity>=1)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&this.projectOpacity[t]>=1)return!0;return!1};var w=[0,0],M=[0,0,0],k=[0,0,0],A=[0,0,0,1],T=[0,0,0,1],S=x.slice(),E=[0,0,0],L=[[0,0,0],[0,0,0]],C=[-1e8,-1e8,-1e8],z=[1e8,1e8,1e8],D=[C,z];_.draw=function(t){f(this.useOrtho?this.orthoShader:this.shader,this.projectShader,this,t,!1,!1)},_.drawTransparent=function(t){f(this.useOrtho?this.orthoShader:this.shader,this.projectShader,this,t,!0,!1)},_.drawPick=function(t){f(this.useOrtho?this.pickOrthoShader:this.pickPerspectiveShader,this.pickProjectShader,this,t,!1,!0)},_.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;var e=t.value[2]+(t.value[1]<<8)+(t.value[0]<<16);if(e>=this.pointCount||e<0)return null;var r=this.points[e],n=this._selectResult;n.index=e;for(var i=0;i<3;++i)n.position[i]=n.dataCoordinate[i]=r[i];return n},_.highlight=function(t){if(t){var e=t.index,r=255&e,n=e>>8&255,i=e>>16&255;this.highlightId=[r/255,n/255,i/255,0]}else this.highlightId=[1,1,1,1]},_.update=function(t){if(t=t||{},"perspective"in t&&(this.useOrtho=!t.perspective),"orthographic"in t&&(this.useOrtho=!!t.orthographic),"lineWidth"in t&&(this.lineWidth=t.lineWidth),
27 "project"in t)if(Array.isArray(t.project))this.axesProject=t.project;else{var e=!!t.project;this.axesProject=[e,e,e]}if("projectScale"in t)if(Array.isArray(t.projectScale))this.projectScale=t.projectScale.slice();else{var r=+t.projectScale;this.projectScale=[r,r,r]}if("projectOpacity"in t)if(Array.isArray(t.projectOpacity))this.projectOpacity=t.projectOpacity.slice();else{var r=+t.projectOpacity;this.projectOpacity=[r,r,r]}"opacity"in t&&(this.opacity=t.opacity),this.dirty=!0;var n=t.position;if(n){var i=t.font||"normal",a=t.alignment||[0,0],o=[1/0,1/0,1/0],s=[-1/0,-1/0,-1/0],l=t.glyph,u=t.color,c=t.size,h=t.angle,f=t.lineColor,d=0,p=0,m=0,g=n.length;t:for(var y=0;y<g;++y){for(var x=n[y],_=0;_<3;++_)if(isNaN(x[_])||!isFinite(x[_]))continue t;var w;w=Array.isArray(l)?b(l[y],i):l?b(l,i):b("\u25cf",i);var M=w[0],k=w[1],A=w[2];p+=3*M.cells.length,m+=2*k.edges.length}var T=p+m,S=v.mallocFloat(3*T),E=v.mallocFloat(4*T),L=v.mallocFloat(2*T),C=v.mallocUint32(T),z=[0,a[1]],D=0,I=p,P=[0,0,0,1],O=[0,0,0,1],j=Array.isArray(u)&&Array.isArray(u[0]),F=Array.isArray(f)&&Array.isArray(f[0]);t:for(var y=0;y<g;++y){for(var x=n[y],_=0;_<3;++_){if(isNaN(x[_])||!isFinite(x[_])){d+=1;continue t}s[_]=Math.max(s[_],x[_]),o[_]=Math.min(o[_],x[_])}var w;w=Array.isArray(l)?b(l[y],i):l?b(l,i):b("\u25cf",i);var M=w[0],k=w[1],A=w[2];if(Array.isArray(u)){var R;if(R=j?u[y]:u,3===R.length){for(var _=0;_<3;++_)P[_]=R[_];P[3]=1}else if(4===R.length)for(var _=0;_<4;++_)P[_]=R[_]}else P[0]=P[1]=P[2]=0,P[3]=1;if(Array.isArray(f)){var R;if(R=F?f[y]:f,3===R.length){for(var _=0;_<3;++_)O[_]=R[_];O[_]=1}else if(4===R.length)for(var _=0;_<4;++_)O[_]=R[_]}else O[0]=O[1]=O[2]=0,O[3]=1;var N=.5;Array.isArray(c)?N=+c[y]:c?N=+c:this.useOrtho&&(N=12);var B=0;Array.isArray(h)?B=+h[y]:h&&(B=+h);for(var U=Math.cos(B),V=Math.sin(B),x=n[y],_=0;_<3;++_)s[_]=Math.max(s[_],x[_]),o[_]=Math.min(o[_],x[_]);a[0]<0?z[0]=a[0]*(1+A[1][0]):a[0]>0&&(z[0]=-a[0]*(1+A[0][0]));for(var q=M.cells,H=M.positions,_=0;_<q.length;++_)for(var G=q[_],Y=0;Y<3;++Y){for(var X=0;X<3;++X)S[3*D+X]=x[X];for(var X=0;X<4;++X)E[4*D+X]=P[X];C[D]=d;var W=H[G[Y]];L[2*D]=N*(U*W[0]-V*W[1]+z[0]),L[2*D+1]=N*(V*W[0]+U*W[1]+z[1]),D+=1}for(var q=k.edges,H=k.positions,_=0;_<q.length;++_)for(var G=q[_],Y=0;Y<2;++Y){for(var X=0;X<3;++X)S[3*I+X]=x[X];for(var X=0;X<4;++X)E[4*I+X]=O[X];C[I]=d;var W=H[G[Y]];L[2*I]=N*(U*W[0]-V*W[1]+z[0]),L[2*I+1]=N*(V*W[0]+U*W[1]+z[1]),I+=1}d+=1}this.vertexCount=p,this.lineVertexCount=m,this.pointBuffer.update(S),this.colorBuffer.update(E),this.glyphBuffer.update(L),this.idBuffer.update(new Uint32Array(C)),v.free(S),v.free(E),v.free(L),v.free(C),this.bounds=[o,s],this.points=n,this.pointCount=n.length}},_.dispose=function(){this.shader.dispose(),this.orthoShader.dispose(),this.pickPerspectiveShader.dispose(),this.pickOrthoShader.dispose(),this.vao.dispose(),this.pointBuffer.dispose(),this.colorBuffer.dispose(),this.glyphBuffer.dispose(),this.idBuffer.dispose()}},{"./lib/glyphs":244,"./lib/shaders":245,"gl-buffer":152,"gl-mat4/multiply":178,"gl-vao":266,"typedarray-pool":533}],247:[function(t,e,r){"use strict";r.boxVertex="precision mediump float;\n#define GLSLIFY 1\n\nattribute vec2 vertex;\n\nuniform vec2 cornerA, cornerB;\n\nvoid main() {\n gl_Position = vec4(mix(cornerA, cornerB, vertex), 0, 1);\n}\n",r.boxFragment="precision mediump float;\n#define GLSLIFY 1\n\nuniform vec4 color;\n\nvoid main() {\n gl_FragColor = color;\n}\n"},{}],248:[function(t,e,r){"use strict";function n(t,e,r){this.plot=t,this.boxBuffer=e,this.boxShader=r,this.enabled=!0,this.selectBox=[1/0,1/0,-1/0,-1/0],this.borderColor=[0,0,0,1],this.innerFill=!1,this.innerColor=[0,0,0,.25],this.outerFill=!0,this.outerColor=[0,0,0,.5],this.borderWidth=10}function i(t,e){var r=t.gl,i=o(r,[0,0,0,1,1,0,1,1]),l=a(r,s.boxVertex,s.boxFragment),u=new n(t,i,l);return u.update(e),t.addOverlay(u),u}var a=t("gl-shader"),o=t("gl-buffer"),s=t("./lib/shaders");e.exports=i;var l=n.prototype;l.draw=function(){if(this.enabled){var t=this.plot,e=this.selectBox,r=this.borderWidth,n=(this.innerFill,this.innerColor),i=(this.outerFill,this.outerColor),a=this.borderColor,o=t.box,s=t.screenBox,l=t.dataBox,u=t.viewBox,c=t.pixelRatio,h=(e[0]-l[0])*(u[2]-u[0])/(l[2]-l[0])+u[0],f=(e[1]-l[1])*(u[3]-u[1])/(l[3]-l[1])+u[1],d=(e[2]-l[0])*(u[2]-u[0])/(l[2]-l[0])+u[0],p=(e[3]-l[1])*(u[3]-u[1])/(l[3]-l[1])+u[1];if(h=Math.max(h,u[0]),f=Math.max(f,u[1]),d=Math.min(d,u[2]),p=Math.min(p,u[3]),!(d<h||p<f)){o.bind();var m=s[2]-s[0],v=s[3]-s[1];if(this.outerFill&&(o.drawBox(0,0,m,f,i),o.drawBox(0,f,h,p,i),o.drawBox(0,p,m,v,i),o.drawBox(d,f,m,p,i)),this.innerFill&&o.drawBox(h,f,d,p,n),r>0){var g=r*c;o.drawBox(h-g,f-g,d+g,f+g,a),o.drawBox(h-g,p-g,d+g,p+g,a),o.drawBox(h-g,f-g,h+g,p+g,a),o.drawBox(d-g,f-g,d+g,p+g,a)}}}},l.update=function(t){t=t||{},this.innerFill=!!t.innerFill,this.outerFill=!!t.outerFill,this.innerColor=(t.innerColor||[0,0,0,.5]).slice(),this.outerColor=(t.outerColor||[0,0,0,.5]).slice(),this.borderColor=(t.borderColor||[0,0,0,1]).slice(),this.borderWidth=t.borderWidth||0,this.selectBox=(t.selectBox||this.selectBox).slice()},l.dispose=function(){this.boxBuffer.dispose(),this.boxShader.dispose(),this.plot.removeOverlay(this)}},{"./lib/shaders":247,"gl-buffer":152,"gl-shader":250}],249:[function(t,e,r){"use strict";function n(t,e,r,n,i){this.coord=[t,e],this.id=r,this.value=n,this.distance=i}function i(t,e,r){this.gl=t,this.fbo=e,this.buffer=r,this._readTimeout=null;var n=this;this._readCallback=function(){n.gl&&(e.bind(),t.readPixels(0,0,e.shape[0],e.shape[1],t.RGBA,t.UNSIGNED_BYTE,n.buffer),n._readTimeout=null)}}function a(t,e){return new i(t,o(t,e),s.mallocUint8(e[0]*e[1]*4))}e.exports=a;var o=t("gl-fbo"),s=t("typedarray-pool"),l=t("ndarray"),u=t("bit-twiddle").nextPow2,c=t("cwise/lib/wrapper")({args:["array",{offset:[0,0,1],array:0},{offset:[0,0,2],array:0},{offset:[0,0,3],array:0},"scalar","scalar","index"],pre:{body:"{this_closestD2=1e8,this_closestX=-1,this_closestY=-1}",args:[],thisVars:["this_closestD2","this_closestX","this_closestY"],localVars:[]},body:{body:"{if(_inline_46_arg0_<255||_inline_46_arg1_<255||_inline_46_arg2_<255||_inline_46_arg3_<255){var _inline_46_l=_inline_46_arg4_-_inline_46_arg6_[0],_inline_46_a=_inline_46_arg5_-_inline_46_arg6_[1],_inline_46_f=_inline_46_l*_inline_46_l+_inline_46_a*_inline_46_a;_inline_46_f<this_closestD2&&(this_closestD2=_inline_46_f,this_closestX=_inline_46_arg6_[0],this_closestY=_inline_46_arg6_[1])}}",args:[{name:"_inline_46_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_46_arg1_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_46_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_46_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_46_arg4_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_46_arg5_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_46_arg6_",lvalue:!1,rvalue:!0,count:4}],thisVars:["this_closestD2","this_closestX","this_closestY"],localVars:["_inline_46_a","_inline_46_f","_inline_46_l"]},post:{body:"{return[this_closestX,this_closestY,this_closestD2]}",args:[],thisVars:["this_closestD2","this_closestX","this_closestY"],localVars:[]},debug:!1,funcName:"cwise",blockSize:64}),h=i.prototype;Object.defineProperty(h,"shape",{get:function(){return this.gl?this.fbo.shape.slice():[0,0]},set:function(t){if(this.gl){this.fbo.shape=t;var e=this.fbo.shape[0],r=this.fbo.shape[1];if(r*e*4>this.buffer.length){s.free(this.buffer);for(var n=this.buffer=s.mallocUint8(u(r*e*4)),i=0;i<r*e*4;++i)n[i]=255}return t}}}),h.begin=function(){var t=this.gl;this.shape;t&&(this.fbo.bind(),t.clearColor(1,1,1,1),t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT))},h.end=function(){var t=this.gl;t&&(t.bindFramebuffer(t.FRAMEBUFFER,null),this._readTimeout||clearTimeout(this._readTimeout),this._readTimeout=setTimeout(this._readCallback,1))},h.query=function(t,e,r){if(!this.gl)return null;var i=this.fbo.shape.slice();t|=0,e|=0,"number"!=typeof r&&(r=1);var a=0|Math.min(Math.max(t-r,0),i[0]),o=0|Math.min(Math.max(t+r,0),i[0]),s=0|Math.min(Math.max(e-r,0),i[1]),u=0|Math.min(Math.max(e+r,0),i[1]);if(o<=a||u<=s)return null;var h=[o-a,u-s],f=l(this.buffer,[h[0],h[1],4],[4,4*i[0],1],4*(a+i[0]*s)),d=c(f.hi(h[0],h[1],1),r,r),p=d[0],m=d[1];return p<0||Math.pow(this.radius,2)<d[2]?null:new n(p+a|0,m+s|0,f.get(p,m,0),[f.get(p,m,1),f.get(p,m,2),f.get(p,m,3)],Math.sqrt(d[2]))},h.dispose=function(){this.gl&&(this.fbo.dispose(),s.free(this.buffer),this.gl=null,this._readTimeout&&clearTimeout(this._readTimeout))}},{"bit-twiddle":63,"cwise/lib/wrapper":109,"gl-fbo":159,ndarray:460,"typedarray-pool":533}],250:[function(t,e,r){"use strict";function n(t){this.gl=t,this._vref=this._fref=this._relink=this.vertShader=this.fragShader=this.program=this.attributes=this.uniforms=this.types=null}function i(t,e){return t.name<e.name?-1:1}function a(t,e,r,i,a){var o=new n(t);return o.update(e,r,i,a),o}var o=t("./lib/create-uniforms"),s=t("./lib/create-attributes"),l=t("./lib/reflect"),u=t("./lib/shader-cache"),c=t("./lib/runtime-reflect"),h=t("./lib/GLError"),f=n.prototype;f.bind=function(){this.program||this._relink(),this.gl.useProgram(this.program)},f.dispose=function(){this._fref&&this._fref.dispose(),this._vref&&this._vref.dispose(),this.attributes=this.types=this.vertShader=this.fragShader=this.program=this._relink=this._fref=this._vref=null},f.update=function(t,e,r,n){function a(){d.program=u.program(p,d._vref,d._fref,x,_);for(var t=0;t<r.length;++t)E[t]=p.getUniformLocation(d.program,r[t].name)}if(!e||1===arguments.length){var f=t;t=f.vertex,e=f.fragment,r=f.uniforms,n=f.attributes}var d=this,p=d.gl,m=d._vref;d._vref=u.shader(p,p.VERTEX_SHADER,t),m&&m.dispose(),d.vertShader=d._vref.shader;var v=this._fref;if(d._fref=u.shader(p,p.FRAGMENT_SHADER,e),v&&v.dispose(),d.fragShader=d._fref.shader,!r||!n){var g=p.createProgram();if(p.attachShader(g,d.fragShader),p.attachShader(g,d.vertShader),p.linkProgram(g),!p.getProgramParameter(g,p.LINK_STATUS)){var y=p.getProgramInfoLog(g);throw new h(y,"Error linking program:"+y)}r=r||c.uniforms(p,g),n=n||c.attributes(p,g),p.deleteProgram(g)}n=n.slice(),n.sort(i);for(var b=[],x=[],_=[],w=0;w<n.length;++w){var M=n[w];if(M.type.indexOf("mat")>=0){for(var k=0|M.type.charAt(M.type.length-1),A=new Array(k),T=0;T<k;++T)A[T]=_.length,x.push(M.name+"["+T+"]"),"number"==typeof M.location?_.push(M.location+T):Array.isArray(M.location)&&M.location.length===k&&"number"==typeof M.location[T]?_.push(0|M.location[T]):_.push(-1);b.push({name:M.name,type:M.type,locations:A})}else b.push({name:M.name,type:M.type,locations:[_.length]}),x.push(M.name),"number"==typeof M.location?_.push(0|M.location):_.push(-1)}for(var S=0,w=0;w<_.length;++w)if(_[w]<0){for(;_.indexOf(S)>=0;)S+=1;_[w]=S}var E=new Array(r.length);a(),d._relink=a,d.types={uniforms:l(r),attributes:l(n)},d.attributes=s(p,d,b,_),Object.defineProperty(d,"uniforms",o(p,d,r,E))},e.exports=a},{"./lib/GLError":251,"./lib/create-attributes":252,"./lib/create-uniforms":253,"./lib/reflect":254,"./lib/runtime-reflect":255,"./lib/shader-cache":256}],251:[function(t,e,r){arguments[4][208][0].apply(r,arguments)},{dup:208}],252:[function(t,e,r){arguments[4][209][0].apply(r,arguments)},{"./GLError":251,dup:209}],253:[function(t,e,r){arguments[4][210][0].apply(r,arguments)},{"./GLError":251,"./reflect":254,dup:210}],254:[function(t,e,r){arguments[4][211][0].apply(r,arguments)},{dup:211}],255:[function(t,e,r){arguments[4][212][0].apply(r,arguments)},{dup:212}],256:[function(t,e,r){arguments[4][213][0].apply(r,arguments)},{"./GLError":251,dup:213,"gl-format-compiler-error":160,"weakmap-shim":554}],257:[function(t,e,r){"use strict";function n(t){this.plot=t,this.enable=[!0,!0,!1,!1],this.width=[1,1,1,1],this.color=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.center=[1/0,1/0]}function i(t,e){var r=new n(t);return r.update(e),t.addOverlay(r),r}e.exports=i;var a=n.prototype;a.update=function(t){t=t||{},this.enable=(t.enable||[!0,!0,!1,!1]).slice(),this.width=(t.width||[1,1,1,1]).slice(),this.color=(t.color||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]).map(function(t){return t.slice()}),this.center=(t.center||[1/0,1/0]).slice(),this.plot.setOverlayDirty()},a.draw=function(){var t=this.enable,e=this.width,r=this.color,n=this.center,i=this.plot,a=i.line,o=i.dataBox,s=i.viewBox;if(a.bind(),o[0]<=n[0]&&n[0]<=o[2]&&o[1]<=n[1]&&n[1]<=o[3]){var l=s[0]+(n[0]-o[0])/(o[2]-o[0])*(s[2]-s[0]),u=s[1]+(n[1]-o[1])/(o[3]-o[1])*(s[3]-s[1]);t[0]&&a.drawLine(l,u,s[0],u,e[0],r[0]),t[1]&&a.drawLine(l,u,l,s[1],e[1],r[1]),t[2]&&a.drawLine(l,u,s[2],u,e[2],r[2]),t[3]&&a.drawLine(l,u,l,s[3],e[3],r[3])}},a.dispose=function(){this.plot.removeOverlay(this)}},{}],258:[function(t,e,r){"use strict";var n=t("gl-shader");e.exports=function(t){return n(t,"precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position, color;\nattribute float weight;\n\nuniform mat4 model, view, projection;\nuniform vec3 coordinates[3];\nuniform vec4 colors[3];\nuniform vec2 screenShape;\nuniform float lineWidth;\n\nvarying vec4 fragColor;\n\nvoid main() {\n vec3 vertexPosition = mix(coordinates[0],\n mix(coordinates[2], coordinates[1], 0.5 * (position + 1.0)), abs(position));\n\n vec4 clipPos = projection * view * model * vec4(vertexPosition, 1.0);\n vec2 clipOffset = (projection * view * model * vec4(color, 0.0)).xy;\n vec2 delta = weight * clipOffset * screenShape;\n vec2 lineOffset = normalize(vec2(delta.y, -delta.x)) / screenShape;\n\n gl_Position = vec4(clipPos.xy + clipPos.w * 0.5 * lineWidth * lineOffset, clipPos.z, clipPos.w);\n fragColor = color.x * colors[0] + color.y * colors[1] + color.z * colors[2];\n}\n","precision mediump float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nvoid main() {\n gl_FragColor = fragColor;\n}",null,[{name:"position",type:"vec3"},{name:"color",type:"vec3"},{name:"weight",type:"float"}])}},{"gl-shader":250}],259:[function(t,e,r){"use strict";function n(t,e,r,n){this.gl=t,this.buffer=e,this.vao=r,this.shader=n,this.pixelRatio=1,this.bounds=[[-1e3,-1e3,-1e3],[1e3,1e3,1e3]],this.position=[0,0,0],this.lineWidth=[2,2,2],this.colors=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.enabled=[!0,!0,!0],this.drawSides=[!0,!0,!0],this.axes=null}function i(t,e){function r(t,e,r,n,a,o){var s=[t,e,r,0,0,0,1];s[n+3]=1,s[n]=a,i.push.apply(i,s),s[6]=-1,i.push.apply(i,s),s[n]=o,i.push.apply(i,s),i.push.apply(i,s),s[6]=1,i.push.apply(i,s),s[n]=a,i.push.apply(i,s)}var i=[];r(0,0,0,0,0,1),r(0,0,0,1,0,1),r(0,0,0,2,0,1),r(1,0,0,1,-1,1),r(1,0,0,2,-1,1),r(0,1,0,0,-1,1),r(0,1,0,2,-1,1),r(0,0,1,0,-1,1),r(0,0,1,1,-1,1);var l=a(t,i),u=o(t,[{type:t.FLOAT,buffer:l,size:3,offset:0,stride:28},{type:t.FLOAT,buffer:l,size:3,offset:12,stride:28},{type:t.FLOAT,buffer:l,size:1,offset:24,stride:28}]),c=s(t);c.attributes.position.location=0,c.attributes.color.location=1,c.attributes.weight.location=2;var h=new n(t,l,u,c);return h.update(e),h}var a=t("gl-buffer"),o=t("gl-vao"),s=t("./shaders/index");e.exports=i;var l=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],u=n.prototype,c=[0,0,0],h=[0,0,0],f=[0,0];u.isTransparent=function(){return!1},u.drawTransparent=function(t){},u.draw=function(t){var e=this.gl,r=this.vao,n=this.shader;r.bind(),n.bind();var i,a=t.model||l,o=t.view||l,s=t.projection||l;this.axes&&(i=this.axes.lastCubeProps.axis);for(var u=c,d=h,p=0;p<3;++p)i&&i[p]<0?(u[p]=this.bounds[0][p],d[p]=this.bounds[1][p]):(u[p]=this.bounds[1][p],d[p]=this.bounds[0][p]);f[0]=e.drawingBufferWidth,f[1]=e.drawingBufferHeight,n.uniforms.model=a,n.uniforms.view=o,n.uniforms.projection=s,n.uniforms.coordinates=[this.position,u,d],n.uniforms.colors=this.colors,n.uniforms.screenShape=f;for(var p=0;p<3;++p)n.uniforms.lineWidth=this.lineWidth[p]*this.pixelRatio,this.enabled[p]&&(r.draw(e.TRIANGLES,6,6*p),this.drawSides[p]&&r.draw(e.TRIANGLES,12,18+12*p));r.unbind()},u.update=function(t){t&&("bounds"in t&&(this.bounds=t.bounds),"position"in t&&(this.position=t.position),"lineWidth"in t&&(this.lineWidth=t.lineWidth),"colors"in t&&(this.colors=t.colors),"enabled"in t&&(this.enabled=t.enabled),"drawSides"in t&&(this.drawSides=t.drawSides))},u.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},{"./shaders/index":258,"gl-buffer":152,"gl-vao":266}],260:[function(t,e,r){var n=t("gl-shader"),i="precision mediump float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute vec3 f;\nattribute vec3 normal;\n\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 lightPosition, eyePosition;\nuniform sampler2D colormap;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n worldCoordinate = vec3(uv.zw, f.x);\n vec4 worldPosition = model * vec4(worldCoordinate, 1.0);\n vec4 clipPosition = projection * view * worldPosition;\n gl_Position = clipPosition;\n kill = f.y;\n value = f.z;\n planeCoordinate = uv.xy;\n\n vColor = texture2D(colormap, vec2(value, value));\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * worldPosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n lightDirection = lightPosition - cameraCoordinate.xyz;\n eyeDirection = eyePosition - cameraCoordinate.xyz;\n surfaceNormal = normalize((vec4(normal,0) * inverseModel).xyz);\n}\n",a="precision mediump float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution_2_0(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\n\n\nfloat beckmannSpecular_1_1(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness) {\n return beckmannDistribution_2_0(dot(surfaceNormal, normalize(lightDirection + viewDirection)), roughness);\n}\n\n\n\nuniform vec3 lowerBound, upperBound;\nuniform float contourTint;\nuniform vec4 contourColor;\nuniform sampler2D colormap;\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\nuniform float vertexColor;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n if (kill > 0.0 ||\n any(lessThan(worldCoordinate, clipBounds[0])) || any(greaterThan(worldCoordinate, clipBounds[1]))) {\n discard;\n }\n\n vec3 N = normalize(surfaceNormal);\n vec3 V = normalize(eyeDirection);\n vec3 L = normalize(lightDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = beckmannSpecular_1_1(L, V, N, roughness);\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n //decide how to interpolate color \u2014 in vertex or in fragment\n vec4 surfaceColor = step(vertexColor, .5) * texture2D(colormap, vec2(value, value)) + step(.5, vertexColor) * vColor;\n\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = mix(litColor, contourColor, contourTint) * opacity;\n}\n",o="precision mediump float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute float f;\n\nuniform mat3 permutation;\nuniform mat4 model, view, projection;\nuniform float height, zOffset;\nuniform sampler2D colormap;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n vec3 dataCoordinate = permutation * vec3(uv.xy, height);\n vec4 worldPosition = model * vec4(dataCoordinate, 1.0);\n\n vec4 clipPosition = projection * view * worldPosition;\n clipPosition.z = clipPosition.z + zOffset;\n\n gl_Position = clipPosition;\n value = f;\n kill = -1.0;\n worldCoordinate = dataCoordinate;\n planeCoordinate = uv.zw;\n\n vColor = texture2D(colormap, vec2(value, value));\n\n //Don't do lighting for contours\n surfaceNormal = vec3(1,0,0);\n eyeDirection = vec3(0,1,0);\n lightDirection = vec3(0,0,1);\n}\n",s="precision mediump float;\n#define GLSLIFY 1\n\nuniform vec2 shape;\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 surfaceNormal;\n\nvec2 splitFloat(float v) {\n float vh = 255.0 * v;\n float upper = floor(vh);\n float lower = fract(vh);\n return vec2(upper / 255.0, floor(lower * 16.0) / 16.0);\n}\n\nvoid main() {\n if(kill > 0.0 ||\n any(lessThan(worldCoordinate, clipBounds[0])) || any(greaterThan(worldCoordinate, clipBounds[1]))) {\n discard;\n }\n vec2 ux = splitFloat(planeCoordinate.x / shape.x);\n vec2 uy = splitFloat(planeCoordinate.y / shape.y);\n gl_FragColor = vec4(pickId, ux.x, uy.x, ux.y + (uy.y/16.0));\n}\n";r.createShader=function(t){var e=n(t,i,a,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e.attributes.normal.location=2,e},r.createPickShader=function(t){var e=n(t,i,s,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e.attributes.normal.location=2,e},r.createContourShader=function(t){var e=n(t,o,a,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e},r.createPickContourShader=function(t){var e=n(t,o,s,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e}},{"gl-shader":250}],261:[function(t,e,r){"use strict";function n(t,e,r,n,i){this.position=t,this.index=e,this.uv=r,this.level=n,this.dataCoordinate=i}function i(t){var e=x([y({colormap:t,nshades:j,format:"rgba"}).map(function(t){return[t[0],t[1],t[2],255*t[3]]})]);return b.divseq(e,255),e}function a(t,e,r,i,a,o,s,l,u,c,h,f,d,p){this.gl=t,this.shape=e,this.bounds=r,this.intensityBounds=[],this._shader=i,this._pickShader=a,this._coordinateBuffer=o,this._vao=s,this._colorMap=l,this._contourShader=u,this._contourPickShader=c,this._contourBuffer=h,this._contourVAO=f,this._contourOffsets=[[],[],[]],this._contourCounts=[[],[],[]],this._vertexCount=0,this._pickResult=new n([0,0,0],[0,0],[0,0],[0,0,0],[0,0,0]),this._dynamicBuffer=d,this._dynamicVAO=p,this._dynamicOffsets=[0,0,0],this._dynamicCounts=[0,0,0],this.contourWidth=[1,1,1],this.contourLevels=[[1],[1],[1]],this.contourTint=[0,0,0],this.contourColor=[[.5,.5,.5,1],[.5,.5,.5,1],[.5,.5,.5,1]],this.showContour=!0,this.showSurface=!0,this.enableHighlight=[!0,!0,!0],this.highlightColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.highlightTint=[1,1,1],this.highlightLevel=[-1,-1,-1],this.enableDynamic=[!0,!0,!0],this.dynamicLevel=[0/0,0/0,0/0],this.dynamicColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.dynamicTint=[1,1,1],this.dynamicWidth=[1,1,1],this.axesBounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.surfaceProject=[!1,!1,!1],this.contourProject=[[!1,!1,!1],[!1,!1,!1],[!1,!1,!1]],this.colorBounds=[!1,!1],this._field=[_(g.mallocFloat(1024),[0,0]),_(g.mallocFloat(1024),[0,0]),_(g.mallocFloat(1024),[0,0])],this.pickId=1,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.snapToData=!1,this.opacity=1,this.lightPosition=[10,1e4,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.vertexColor=0,this.dirty=!0}function o(t,e){var r,n,i,a=e.axes&&e.axes.lastCubeProps.axis||R,o=e.showSurface,s=e.showContour;for(r=0;r<3;++r)for(o=o||e.surfaceProject[r],n=0;n<3;++n)s=s||e.contourProject[r][n];for(r=0;r<3;++r){var l=N.projections[r];for(n=0;n<16;++n)l[n]=0;for(n=0;n<4;++n)l[5*n]=1;l[5*r]=0,l[12+r]=e.axesBounds[+(a[r]>0)][r],M(l,t.model,l);var u=N.clipBounds[r];for(i=0;i<2;++i)for(n=0;n<3;++n)u[i][n]=t.clipBounds[i][n];u[0][r]=-1e8,u[1][r]=1e8}return N.showSurface=o,N.showContour=s,N}function s(t,e){t=t||{};var r=this.gl;r.disable(r.CULL_FACE),this._colorMap.bind(0);var n=B;n.model=t.model||I,n.view=t.view||I,n.projection=t.projection||I,n.lowerBound=[this.bounds[0][0],this.bounds[0][1],this.colorBounds[0]||this.bounds[0][2]],n.upperBound=[this.bounds[1][0],this.bounds[1][1],this.colorBounds[1]||this.bounds[1][2]],n.contourColor=this.contourColor[0],n.inverseModel=k(n.inverseModel,n.model);for(var i=0;i<2;++i)for(var a=n.clipBounds[i],s=0;s<3;++s)a[s]=Math.min(Math.max(this.clipBounds[i][s],-1e8),1e8);n.kambient=this.ambientLight,n.kdiffuse=this.diffuseLight,n.kspecular=this.specularLight,n.roughness=this.roughness,n.fresnel=this.fresnel,n.opacity=this.opacity,n.height=0,n.permutation=V,n.vertexColor=this.vertexColor;var l=U;for(M(l,n.view,n.model),M(l,n.projection,l),k(l,l),i=0;i<3;++i)n.eyePosition[i]=l[12+i]/l[15];var u=l[15];for(i=0;i<3;++i)u+=this.lightPosition[i]*l[4*i+3];for(i=0;i<3;++i){var c=l[12+i];for(s=0;s<3;++s)c+=l[4*s+i]*this.lightPosition[s];n.lightPosition[i]=c/u}var h=o(n,this);if(h.showSurface&&e===this.opacity<1){for(this._shader.bind(),this._shader.uniforms=n,this._vao.bind(),this.showSurface&&this._vertexCount&&this._vao.draw(r.TRIANGLES,this._vertexCount),i=0;i<3;++i)this.surfaceProject[i]&&this.vertexCount&&(this._shader.uniforms.model=h.projections[i],this._shader.uniforms.clipBounds=h.clipBounds[i],this._vao.draw(r.TRIANGLES,this._vertexCount));this._vao.unbind()}if(h.showContour&&!e){var f=this._contourShader;n.kambient=1,n.kdiffuse=0,n.kspecular=0,n.opacity=1,f.bind(),f.uniforms=n;var d=this._contourVAO;for(d.bind(),i=0;i<3;++i)for(f.uniforms.permutation=O[i],r.lineWidth(this.contourWidth[i]),s=0;s<this.contourLevels[i].length;++s)this._contourCounts[i][s]&&(s===this.highlightLevel[i]?(f.uniforms.contourColor=this.highlightColor[i],f.uniforms.contourTint=this.highlightTint[i]):0!==s&&s-1!==this.highlightLevel[i]||(f.uniforms.contourColor=this.contourColor[i],f.uniforms.contourTint=this.contourTint[i]),f.uniforms.height=this.contourLevels[i][s],d.draw(r.LINES,this._contourCounts[i][s],this._contourOffsets[i][s]));for(i=0;i<3;++i)for(f.uniforms.model=h.projections[i],f.uniforms.clipBounds=h.clipBounds[i],s=0;s<3;++s)if(this.contourProject[i][s]){f.uniforms.permutation=O[s],r.lineWidth(this.contourWidth[s]);for(var p=0;p<this.contourLevels[s].length;++p)p===this.highlightLevel[s]?(f.uniforms.contourColor=this.highlightColor[s],f.uniforms.contourTint=this.highlightTint[s]):0!==p&&p-1!==this.highlightLevel[s]||(f.uniforms.contourColor=this.contourColor[s],f.uniforms.contourTint=this.contourTint[s]),f.uniforms.height=this.contourLevels[s][p],d.draw(r.LINES,this._contourCounts[s][p],this._contourOffsets[s][p])}for(d=this._dynamicVAO,d.bind(),i=0;i<3;++i)if(0!==this._dynamicCounts[i])for(f.uniforms.model=n.model,f.uniforms.clipBounds=n.clipBounds,f.uniforms.permutation=O[i],r.lineWidth(this.dynamicWidth[i]),f.uniforms.contourColor=this.dynamicColor[i],f.uniforms.contourTint=this.dynamicTint[i],f.uniforms.height=this.dynamicLevel[i],d.draw(r.LINES,this._dynamicCounts[i],this._dynamicOffsets[i]),s=0;s<3;++s)this.contourProject[s][i]&&(f.uniforms.model=h.projections[s],f.uniforms.clipBounds=h.clipBounds[s],d.draw(r.LINES,this._dynamicCounts[i],this._dynamicOffsets[i]));d.unbind()}}function l(t,e){var r=e.shape.slice(),n=t.shape.slice();b.assign(t.lo(1,1).hi(r[0],r[1]),e),b.assign(t.lo(1).hi(r[0],1),e.hi(r[0],1)),b.assign(t.lo(1,n[1]-1).hi(r[0],1),e.lo(0,r[1]-1).hi(r[0],1)),b.assign(t.lo(0,1).hi(1,r[1]),e.hi(1)),b.assign(t.lo(n[0]-1,1).hi(1,r[1]),e.lo(r[0]-1)),t.set(0,0,e.get(0,0)),t.set(0,n[1]-1,e.get(0,r[1]-1)),t.set(n[0]-1,0,e.get(r[0]-1,0)),t.set(n[0]-1,n[1]-1,e.get(r[0]-1,r[1]-1))}function u(t,e){return Array.isArray(t)?[e(t[0]),e(t[1]),e(t[2])]:[e(t),e(t),e(t)]}function c(t){return Array.isArray(t)?3===t.length?[t[0],t[1],t[2],1]:[t[0],t[1],t[2],t[3]]:[0,0,0,1]}function h(t){if(Array.isArray(t)){if(Array.isArray(t))return[c(t[0]),c(t[1]),c(t[2])];var e=c(t);return[e.slice(),e.slice(),e.slice()]}}function f(t){var e=t.gl,r=E(e),n=C(e),i=L(e),o=z(e),s=p(e),l=m(e,[{buffer:s,size:4,stride:D,offset:0},{buffer:s,size:3,stride:D,offset:16},{buffer:s,size:3,stride:D,offset:28}]),u=p(e),c=m(e,[{buffer:u,size:4,stride:20,offset:0},{buffer:u,size:1,stride:20,offset:16}]),h=p(e),f=m(e,[{buffer:h,size:2,type:e.FLOAT}]),d=v(e,1,j,e.RGBA,e.UNSIGNED_BYTE);d.minFilter=e.LINEAR,d.magFilter=e.LINEAR;var g=new a(e,[0,0],[[0,0,0],[0,0,0]],r,n,s,l,d,i,o,u,c,h,f),y={levels:[[],[],[]]};for(var b in t)y[b]=t[b];return y.colormap=y.colormap||"jet",g.update(y),g}e.exports=f;var d=t("bit-twiddle"),p=t("gl-buffer"),m=t("gl-vao"),v=t("gl-texture2d"),g=t("typedarray-pool"),y=t("colormap"),b=t("ndarray-ops"),x=t("ndarray-pack"),_=t("ndarray"),w=t("surface-nets"),M=t("gl-mat4/multiply"),k=t("gl-mat4/invert"),A=t("binary-search-bounds"),T=t("ndarray-gradient"),S=t("./lib/shaders"),E=S.createShader,L=S.createContourShader,C=S.createPickShader,z=S.createPickContourShader,D=40,I=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],P=[[0,0],[0,1],[1,0],[1,1],[1,0],[0,1]],O=[[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0]];!function(){for(var t=0;t<3;++t){var e=O[t],r=(t+1)%3,n=(t+2)%3;e[r+0]=1,e[n+3]=1,e[t+6]=1}}();var j=256,F=a.prototype;F.isTransparent=function(){return this.opacity<1},F.isOpaque=function(){if(this.opacity>=1)return!0;for(var t=0;t<3;++t)if(this._contourCounts[t].length>0||this._dynamicCounts[t]>0)return!0;return!1},F.pickSlots=1,F.setPickBase=function(t){this.pickId=t};var R=[0,0,0],N={showSurface:!1,showContour:!1,projections:[I.slice(),I.slice(),I.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]},B={model:I,view:I,projection:I,inverseModel:I.slice(),lowerBound:[0,0,0],upperBound:[0,0,0],colorMap:0,clipBounds:[[0,0,0],[0,0,0]],height:0,contourTint:0,contourColor:[0,0,0,1],permutation:[1,0,0,0,1,0,0,0,1],zOffset:-1e-4,kambient:1,kdiffuse:1,kspecular:1,lightPosition:[1e3,1e3,1e3],eyePosition:[0,0,0],roughness:1,fresnel:1,opacity:1,vertexColor:0},U=I.slice(),V=[1,0,0,0,1,0,0,0,1];F.draw=function(t){return s.call(this,t,!1)},F.drawTransparent=function(t){return s.call(this,t,!0)};var q={model:I,view:I,projection:I,inverseModel:I,clipBounds:[[0,0,0],[0,0,0]],height:0,shape:[0,0],pickId:0,lowerBound:[0,0,0],upperBound:[0,0,0],zOffset:0,permutation:[1,0,0,0,1,0,0,0,1],lightPosition:[0,0,0],eyePosition:[0,0,0]};F.drawPick=function(t){t=t||{};var e=this.gl;e.disable(e.CULL_FACE);var r=q;r.model=t.model||I,r.view=t.view||I,r.projection=t.projection||I,r.shape=this._field[2].shape,r.pickId=this.pickId/255,r.lowerBound=this.bounds[0],r.upperBound=this.bounds[1],r.permutation=V;for(var n=0;n<2;++n)for(var i=r.clipBounds[n],a=0;a<3;++a)i[a]=Math.min(Math.max(this.clipBounds[n][a],-1e8),1e8);var s=o(r,this);if(s.showSurface){for(this._pickShader.bind(),this._pickShader.uniforms=r,this._vao.bind(),this._vao.draw(e.TRIANGLES,this._vertexCount),n=0;n<3;++n)this.surfaceProject[n]&&(this._pickShader.uniforms.model=s.projections[n],this._pickShader.uniforms.clipBounds=s.clipBounds[n],this._vao.draw(e.TRIANGLES,this._vertexCount));this._vao.unbind()}if(s.showContour){var l=this._contourPickShader;l.bind(),l.uniforms=r;var u=this._contourVAO;for(u.bind(),a=0;a<3;++a)for(e.lineWidth(this.contourWidth[a]),l.uniforms.permutation=O[a],n=0;n<this.contourLevels[a].length;++n)this._contourCounts[a][n]&&(l.uniforms.height=this.contourLevels[a][n],u.draw(e.LINES,this._contourCounts[a][n],this._contourOffsets[a][n]));for(n=0;n<3;++n)for(l.uniforms.model=s.projections[n],l.uniforms.clipBounds=s.clipBounds[n],a=0;a<3;++a)if(this.contourProject[n][a]){l.uniforms.permutation=O[a],e.lineWidth(this.contourWidth[a]);for(var c=0;c<this.contourLevels[a].length;++c)this._contourCounts[a][c]&&(l.uniforms.height=this.contourLevels[a][c],u.draw(e.LINES,this._contourCounts[a][c],this._contourOffsets[a][c]))}u.unbind()}},F.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null
28 ;var e=this._field[2].shape,r=this._pickResult,n=e[0]*(t.value[0]+(t.value[2]>>4)/16)/255,i=Math.floor(n),a=n-i,o=e[1]*(t.value[1]+(15&t.value[2])/16)/255,s=Math.floor(o),l=o-s;i+=1,s+=1;var u=r.position;u[0]=u[1]=u[2]=0;for(var c=0;c<2;++c)for(var h=c?a:1-a,f=0;f<2;++f)for(var d=f?l:1-l,p=i+c,m=s+f,v=h*d,g=0;g<3;++g)u[g]+=this._field[g].get(p,m)*v;for(var y=this._pickResult.level,b=0;b<3;++b)if(y[b]=A.le(this.contourLevels[b],u[b]),y[b]<0)this.contourLevels[b].length>0&&(y[b]=0);else if(y[b]<this.contourLevels[b].length-1){var x=this.contourLevels[b][y[b]],_=this.contourLevels[b][y[b]+1];Math.abs(x-u[b])>Math.abs(_-u[b])&&(y[b]+=1)}for(r.index[0]=a<.5?i:i+1,r.index[1]=l<.5?s:s+1,r.uv[0]=n/e[0],r.uv[1]=o/e[1],g=0;g<3;++g)r.dataCoordinate[g]=this._field[g].get(r.index[0],r.index[1]);return r},F.update=function(t){t=t||{},this.dirty=!0,"contourWidth"in t&&(this.contourWidth=u(t.contourWidth,Number)),"showContour"in t&&(this.showContour=u(t.showContour,Boolean)),"showSurface"in t&&(this.showSurface=!!t.showSurface),"contourTint"in t&&(this.contourTint=u(t.contourTint,Boolean)),"contourColor"in t&&(this.contourColor=h(t.contourColor)),"contourProject"in t&&(this.contourProject=u(t.contourProject,function(t){return u(t,Boolean)})),"surfaceProject"in t&&(this.surfaceProject=t.surfaceProject),"dynamicColor"in t&&(this.dynamicColor=h(t.dynamicColor)),"dynamicTint"in t&&(this.dynamicTint=u(t.dynamicTint,Number)),"dynamicWidth"in t&&(this.dynamicWidth=u(t.dynamicWidth,Number)),"opacity"in t&&(this.opacity=t.opacity),"colorBounds"in t&&(this.colorBounds=t.colorBounds),"vertexColor"in t&&(this.vertexColor=t.vertexColor?1:0);var e=t.field||t.coords&&t.coords[2]||null,r=!1;if(e||(e=this._field[2].shape[0]||this._field[2].shape[2]?this._field[2].lo(1,1).hi(this._field[2].shape[0]-2,this._field[2].shape[1]-2):this._field[2].hi(0,0)),"field"in t||"coords"in t){var n=(e.shape[0]+2)*(e.shape[1]+2);n>this._field[2].data.length&&(g.freeFloat(this._field[2].data),this._field[2].data=g.mallocFloat(d.nextPow2(n))),this._field[2]=_(this._field[2].data,[e.shape[0]+2,e.shape[1]+2]),l(this._field[2],e),this.shape=e.shape.slice();for(var a=this.shape,o=0;o<2;++o)this._field[2].size>this._field[o].data.length&&(g.freeFloat(this._field[o].data),this._field[o].data=g.mallocFloat(this._field[2].size)),this._field[o]=_(this._field[o].data,[a[0]+2,a[1]+2]);if(t.coords){var s=t.coords;if(!Array.isArray(s)||3!==s.length)throw new Error("gl-surface: invalid coordinates for x/y");for(o=0;o<2;++o){var c=s[o];for(y=0;y<2;++y)if(c.shape[y]!==a[y])throw new Error("gl-surface: coords have incorrect shape");l(this._field[o],c)}}else if(t.ticks){var f=t.ticks;if(!Array.isArray(f)||2!==f.length)throw new Error("gl-surface: invalid ticks");for(o=0;o<2;++o){var p=f[o];if((Array.isArray(p)||p.length)&&(p=_(p)),p.shape[0]!==a[o])throw new Error("gl-surface: invalid tick length");var m=_(p.data,a);m.stride[o]=p.stride[0],m.stride[1^o]=0,l(this._field[o],m)}}else{for(o=0;o<2;++o){var v=[0,0];v[o]=1,this._field[o]=_(this._field[o].data,[a[0]+2,a[1]+2],v,0)}this._field[0].set(0,0,0);for(var y=0;y<a[0];++y)this._field[0].set(y+1,0,y);for(this._field[0].set(a[0]+1,0,a[0]-1),this._field[1].set(0,0,0),y=0;y<a[1];++y)this._field[1].set(0,y+1,y);this._field[1].set(0,a[1]+1,a[1]-1)}var b=this._field,x=_(g.mallocFloat(3*b[2].size*2),[3,a[0]+2,a[1]+2,2]);for(o=0;o<3;++o)T(x.pick(o),b[o],"mirror");var M=_(g.mallocFloat(3*b[2].size),[a[0]+2,a[1]+2,3]);for(o=0;o<a[0]+2;++o)for(y=0;y<a[1]+2;++y){var k=x.get(0,o,y,0),A=x.get(0,o,y,1),S=x.get(1,o,y,0),E=x.get(1,o,y,1),L=x.get(2,o,y,0),C=x.get(2,o,y,1),z=S*C-E*L,D=L*A-C*k,I=k*E-A*S,O=Math.sqrt(z*z+D*D+I*I);O<1e-8?(O=Math.max(Math.abs(z),Math.abs(D),Math.abs(I)),O<1e-8?(I=1,D=z=0,O=1):O=1/O):O=1/Math.sqrt(O),M.set(o,y,0,z*O),M.set(o,y,1,D*O),M.set(o,y,2,I*O)}g.free(x.data);var j=[1/0,1/0,1/0],F=[-1/0,-1/0,-1/0],R=1/0,N=-1/0,B=(a[0]-1)*(a[1]-1)*6,U=g.mallocFloat(d.nextPow2(10*B)),V=0,q=0;for(o=0;o<a[0]-1;++o)t:for(y=0;y<a[1]-1;++y){for(var H=0;H<2;++H)for(var G=0;G<2;++G)for(var Y=0;Y<3;++Y){var X=this._field[Y].get(1+o+H,1+y+G);if(isNaN(X)||!isFinite(X))continue t}for(Y=0;Y<6;++Y){var W=o+P[Y][0],Z=y+P[Y][1],J=this._field[0].get(W+1,Z+1),K=this._field[1].get(W+1,Z+1);X=this._field[2].get(W+1,Z+1);var Q=X;z=M.get(W+1,Z+1,0),D=M.get(W+1,Z+1,1),I=M.get(W+1,Z+1,2),t.intensity&&(Q=t.intensity.get(W,Z)),U[V++]=W,U[V++]=Z,U[V++]=J,U[V++]=K,U[V++]=X,U[V++]=0,U[V++]=Q,U[V++]=z,U[V++]=D,U[V++]=I,j[0]=Math.min(j[0],J),j[1]=Math.min(j[1],K),j[2]=Math.min(j[2],X),R=Math.min(R,Q),F[0]=Math.max(F[0],J),F[1]=Math.max(F[1],K),F[2]=Math.max(F[2],X),N=Math.max(N,Q),q+=1}}for(t.intensityBounds&&(R=+t.intensityBounds[0],N=+t.intensityBounds[1]),o=6;o<V;o+=10)U[o]=(U[o]-R)/(N-R);this._vertexCount=q,this._coordinateBuffer.update(U.subarray(0,V)),g.freeFloat(U),g.free(M.data),this.bounds=[j,F],this.intensity=t.intensity||this._field[2],this.intensityBounds[0]===R&&this.intensityBounds[1]===N||(r=!0),this.intensityBounds=[R,N]}if("levels"in t){var $=t.levels;for($=Array.isArray($[0])?$.slice():[[],[],$],o=0;o<3;++o)$[o]=$[o].slice(),$.sort(function(t,e){return t-e});t:for(o=0;o<3;++o){if($[o].length!==this.contourLevels[o].length){r=!0;break}for(y=0;y<$[o].length;++y)if($[o][y]!==this.contourLevels[o][y]){r=!0;break t}}this.contourLevels=$}if(r){b=this._field,a=this.shape;for(var tt=[],et=0;et<3;++et){$=this.contourLevels[et];var rt=[],nt=[],it=[0,0,0];for(o=0;o<$.length;++o){var at=w(this._field[et],$[o]);rt.push(tt.length/5|0),q=0;t:for(y=0;y<at.cells.length;++y){var ot=at.cells[y];for(Y=0;Y<2;++Y){var st=at.positions[ot[Y]],lt=st[0],ut=0|Math.floor(lt),ct=lt-ut,ht=st[1],ft=0|Math.floor(ht),dt=ht-ft,pt=!1;e:for(var mt=0;mt<3;++mt){it[mt]=0;var vt=(et+mt+1)%3;for(H=0;H<2;++H){var gt=H?ct:1-ct;for(W=0|Math.min(Math.max(ut+H,0),a[0]),G=0;G<2;++G){var yt=G?dt:1-dt;if(Z=0|Math.min(Math.max(ft+G,0),a[1]),X=mt<2?this._field[vt].get(W,Z):(this.intensity.get(W,Z)-this.intensityBounds[0])/(this.intensityBounds[1]-this.intensityBounds[0]),!isFinite(X)||isNaN(X)){pt=!0;break e}var bt=gt*yt;it[mt]+=bt*X}}}if(pt){if(Y>0){for(var xt=0;xt<5;++xt)tt.pop();q-=1}continue t}tt.push(it[0],it[1],st[0],st[1],it[2]),q+=1}}nt.push(q)}this._contourOffsets[et]=rt,this._contourCounts[et]=nt}var _t=g.mallocFloat(tt.length);for(o=0;o<tt.length;++o)_t[o]=tt[o];this._contourBuffer.update(_t),g.freeFloat(_t)}t.colormap&&this._colorMap.setPixels(i(t.colormap))},F.dispose=function(){this._shader.dispose(),this._vao.dispose(),this._coordinateBuffer.dispose(),this._colorMap.dispose(),this._contourBuffer.dispose(),this._contourVAO.dispose(),this._contourShader.dispose(),this._contourPickShader.dispose(),this._dynamicBuffer.dispose(),this._dynamicVAO.dispose();for(var t=0;t<3;++t)g.freeFloat(this._field[t].data)},F.highlight=function(t){if(!t)return this._dynamicCounts=[0,0,0],this.dyanamicLevel=[0/0,0/0,0/0],void(this.highlightLevel=[-1,-1,-1]);for(var e=0;e<3;++e)this.enableHighlight[e]?this.highlightLevel[e]=t.level[e]:this.highlightLevel[e]=-1;var r;if(r=this.snapToData?t.dataCoordinate:t.position,this.enableDynamic[0]&&r[0]!==this.dynamicLevel[0]||this.enableDynamic[1]&&r[1]!==this.dynamicLevel[1]||this.enableDynamic[2]&&r[2]!==this.dynamicLevel[2]){for(var n=0,i=this.shape,a=g.mallocFloat(12*i[0]*i[1]),o=0;o<3;++o)if(this.enableDynamic[o]){this.dynamicLevel[o]=r[o];var s=(o+1)%3,l=(o+2)%3,u=this._field[o],c=this._field[s],h=this._field[l],f=(this.intensity,w(u,r[o])),d=f.cells,p=f.positions;for(this._dynamicOffsets[o]=n,e=0;e<d.length;++e)for(var m=d[e],v=0;v<2;++v){var y=p[m[v]],b=+y[0],x=0|b,_=0|Math.min(x+1,i[0]),M=b-x,k=1-M,A=+y[1],T=0|A,S=0|Math.min(T+1,i[1]),E=A-T,L=1-E,C=k*L,z=k*E,D=M*L,I=M*E,P=C*c.get(x,T)+z*c.get(x,S)+D*c.get(_,T)+I*c.get(_,S),O=C*h.get(x,T)+z*h.get(x,S)+D*h.get(_,T)+I*h.get(_,S);if(isNaN(P)||isNaN(O)){v&&(n-=1);break}a[2*n+0]=P,a[2*n+1]=O,n+=1}this._dynamicCounts[o]=n-this._dynamicOffsets[o]}else this.dynamicLevel[o]=0/0,this._dynamicCounts[o]=0;this._dynamicBuffer.update(a.subarray(0,2*n)),g.freeFloat(a)}}},{"./lib/shaders":260,"binary-search-bounds":62,"bit-twiddle":63,colormap:95,"gl-buffer":152,"gl-mat4/invert":176,"gl-mat4/multiply":178,"gl-texture2d":262,"gl-vao":266,ndarray:460,"ndarray-gradient":451,"ndarray-ops":454,"ndarray-pack":455,"surface-nets":523,"typedarray-pool":533}],262:[function(t,e,r){"use strict";function n(t){g=[t.LINEAR,t.NEAREST_MIPMAP_LINEAR,t.LINEAR_MIPMAP_NEAREST,t.LINEAR_MIPMAP_NEAREST],y=[t.NEAREST,t.LINEAR,t.NEAREST_MIPMAP_NEAREST,t.NEAREST_MIPMAP_LINEAR,t.LINEAR_MIPMAP_NEAREST,t.LINEAR_MIPMAP_LINEAR],b=[t.REPEAT,t.CLAMP_TO_EDGE,t.MIRRORED_REPEAT]}function i(t){return"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLVideoElement&&t instanceof HTMLVideoElement||"undefined"!=typeof ImageData&&t instanceof ImageData}function a(t,e,r){var n=t.gl,i=n.getParameter(n.MAX_TEXTURE_SIZE);if(e<0||e>i||r<0||r>i)throw new Error("gl-texture2d: Invalid texture size");return t._shape=[e,r],t.bind(),n.texImage2D(n.TEXTURE_2D,0,t.format,e,r,0,t.format,t.type,null),t._mipLevels=[0],t}function o(t,e,r,n,i,a){this.gl=t,this.handle=e,this.format=i,this.type=a,this._shape=[r,n],this._mipLevels=[0],this._magFilter=t.NEAREST,this._minFilter=t.NEAREST,this._wrapS=t.CLAMP_TO_EDGE,this._wrapT=t.CLAMP_TO_EDGE,this._anisoSamples=1;var o=this,s=[this._wrapS,this._wrapT];Object.defineProperties(s,[{get:function(){return o._wrapS},set:function(t){return o.wrapS=t}},{get:function(){return o._wrapT},set:function(t){return o.wrapT=t}}]),this._wrapVector=s;var l=[this._shape[0],this._shape[1]];Object.defineProperties(l,[{get:function(){return o._shape[0]},set:function(t){return o.width=t}},{get:function(){return o._shape[1]},set:function(t){return o.height=t}}]),this._shapeVector=l}function s(t,e){return 3===t.length?1===e[2]&&e[1]===t[0]*t[2]&&e[0]===t[2]:1===e[0]&&e[1]===t[0]}function l(t,e,r,n,i,a,o,l){var u=l.dtype,c=l.shape.slice();if(c.length<2||c.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var h=0,f=0,d=s(c,l.stride.slice());"float32"===u?h=t.FLOAT:"float64"===u?(h=t.FLOAT,d=!1,u="float32"):"uint8"===u?h=t.UNSIGNED_BYTE:(h=t.UNSIGNED_BYTE,d=!1,u="uint8");if(2===c.length)f=t.LUMINANCE,c=[c[0],c[1],1],l=p(l.data,c,[l.stride[0],l.stride[1],1],l.offset);else{if(3!==c.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===c[2])f=t.ALPHA;else if(2===c[2])f=t.LUMINANCE_ALPHA;else if(3===c[2])f=t.RGB;else{if(4!==c[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");f=t.RGBA}c[2]}if(f!==t.LUMINANCE&&f!==t.ALPHA||i!==t.LUMINANCE&&i!==t.ALPHA||(f=i),f!==i)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var g=l.size,y=o.indexOf(n)<0;if(y&&o.push(n),h===a&&d)0===l.offset&&l.data.length===g?y?t.texImage2D(t.TEXTURE_2D,n,i,c[0],c[1],0,i,a,l.data):t.texSubImage2D(t.TEXTURE_2D,n,e,r,c[0],c[1],i,a,l.data):y?t.texImage2D(t.TEXTURE_2D,n,i,c[0],c[1],0,i,a,l.data.subarray(l.offset,l.offset+g)):t.texSubImage2D(t.TEXTURE_2D,n,e,r,c[0],c[1],i,a,l.data.subarray(l.offset,l.offset+g));else{var b;b=a===t.FLOAT?v.mallocFloat32(g):v.mallocUint8(g);var _=p(b,c,[c[2],c[2]*c[0],1]);h===t.FLOAT&&a===t.UNSIGNED_BYTE?x(_,l):m.assign(_,l),y?t.texImage2D(t.TEXTURE_2D,n,i,c[0],c[1],0,i,a,b.subarray(0,g)):t.texSubImage2D(t.TEXTURE_2D,n,e,r,c[0],c[1],i,a,b.subarray(0,g)),a===t.FLOAT?v.freeFloat32(b):v.freeUint8(b)}}function u(t){var e=t.createTexture();return t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),e}function c(t,e,r,n,i){var a=t.getParameter(t.MAX_TEXTURE_SIZE);if(e<0||e>a||r<0||r>a)throw new Error("gl-texture2d: Invalid texture shape");if(i===t.FLOAT&&!t.getExtension("OES_texture_float"))throw new Error("gl-texture2d: Floating point textures not supported on this platform");var s=u(t);return t.texImage2D(t.TEXTURE_2D,0,n,e,r,0,n,i,null),new o(t,s,e,r,n,i)}function h(t,e,r,n,i,a){var s=u(t);return t.texImage2D(t.TEXTURE_2D,0,i,i,a,e),new o(t,s,r,n,i,a)}function f(t,e){var r=e.dtype,n=e.shape.slice(),i=t.getParameter(t.MAX_TEXTURE_SIZE);if(n[0]<0||n[0]>i||n[1]<0||n[1]>i)throw new Error("gl-texture2d: Invalid texture size");var a=s(n,e.stride.slice()),l=0;"float32"===r?l=t.FLOAT:"float64"===r?(l=t.FLOAT,a=!1,r="float32"):"uint8"===r?l=t.UNSIGNED_BYTE:(l=t.UNSIGNED_BYTE,a=!1,r="uint8");var c=0;if(2===n.length)c=t.LUMINANCE,n=[n[0],n[1],1],e=p(e.data,n,[e.stride[0],e.stride[1],1],e.offset);else{if(3!==n.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===n[2])c=t.ALPHA;else if(2===n[2])c=t.LUMINANCE_ALPHA;else if(3===n[2])c=t.RGB;else{if(4!==n[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");c=t.RGBA}}l!==t.FLOAT||t.getExtension("OES_texture_float")||(l=t.UNSIGNED_BYTE,a=!1);var h,f,d=e.size;if(a)h=0===e.offset&&e.data.length===d?e.data:e.data.subarray(e.offset,e.offset+d);else{var g=[n[2],n[2]*n[0],1];f=v.malloc(d,r);var y=p(f,n,g,0);"float32"!==r&&"float64"!==r||l!==t.UNSIGNED_BYTE?m.assign(y,e):x(y,e),h=f.subarray(0,d)}var b=u(t);return t.texImage2D(t.TEXTURE_2D,0,c,n[0],n[1],0,c,l,h),a||v.free(f),new o(t,b,n[0],n[1],c,l)}function d(t){if(arguments.length<=1)throw new Error("gl-texture2d: Missing arguments for texture2d constructor");if(g||n(t),"number"==typeof arguments[1])return c(t,arguments[1],arguments[2],arguments[3]||t.RGBA,arguments[4]||t.UNSIGNED_BYTE);if(Array.isArray(arguments[1]))return c(t,0|arguments[1][0],0|arguments[1][1],arguments[2]||t.RGBA,arguments[3]||t.UNSIGNED_BYTE);if("object"==typeof arguments[1]){var e=arguments[1],r=i(e)?e:e.raw;if(r)return h(t,r,0|e.width,0|e.height,arguments[2]||t.RGBA,arguments[3]||t.UNSIGNED_BYTE);if(e.shape&&e.data&&e.stride)return f(t,e)}throw new Error("gl-texture2d: Invalid arguments for texture2d constructor")}var p=t("ndarray"),m=t("ndarray-ops"),v=t("typedarray-pool");e.exports=d;var g=null,y=null,b=null,x=function(t,e){m.muls(t,e,255)},_=o.prototype;Object.defineProperties(_,{minFilter:{get:function(){return this._minFilter},set:function(t){this.bind();var e=this.gl;if(this.type===e.FLOAT&&g.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),y.indexOf(t)<0)throw new Error("gl-texture2d: Unknown filter mode "+t);return e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,t),this._minFilter=t}},magFilter:{get:function(){return this._magFilter},set:function(t){this.bind();var e=this.gl;if(this.type===e.FLOAT&&g.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),y.indexOf(t)<0)throw new Error("gl-texture2d: Unknown filter mode "+t);return e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,t),this._magFilter=t}},mipSamples:{get:function(){return this._anisoSamples},set:function(t){var e=this._anisoSamples;if(this._anisoSamples=0|Math.max(t,1),e!==this._anisoSamples){var r=this.gl.getExtension("EXT_texture_filter_anisotropic");r&&this.gl.texParameterf(this.gl.TEXTURE_2D,r.TEXTURE_MAX_ANISOTROPY_EXT,this._anisoSamples)}return this._anisoSamples}},wrapS:{get:function(){return this._wrapS},set:function(t){if(this.bind(),b.indexOf(t)<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,t),this._wrapS=t}},wrapT:{get:function(){return this._wrapT},set:function(t){if(this.bind(),b.indexOf(t)<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,t),this._wrapT=t}},wrap:{get:function(){return this._wrapVector},set:function(t){if(Array.isArray(t)||(t=[t,t]),2!==t.length)throw new Error("gl-texture2d: Must specify wrap mode for rows and columns");for(var e=0;e<2;++e)if(b.indexOf(t[e])<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);this._wrapS=t[0],this._wrapT=t[1];var r=this.gl;return this.bind(),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,this._wrapS),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,this._wrapT),t}},shape:{get:function(){return this._shapeVector},set:function(t){if(Array.isArray(t)){if(2!==t.length)throw new Error("gl-texture2d: Invalid texture shape")}else t=[0|t,0|t];return a(this,0|t[0],0|t[1]),[0|t[0],0|t[1]]}},width:{get:function(){return this._shape[0]},set:function(t){return t|=0,a(this,t,this._shape[1]),t}},height:{get:function(){return this._shape[1]},set:function(t){return t|=0,a(this,this._shape[0],t),t}}}),_.bind=function(t){var e=this.gl;return void 0!==t&&e.activeTexture(e.TEXTURE0+(0|t)),e.bindTexture(e.TEXTURE_2D,this.handle),void 0!==t?0|t:e.getParameter(e.ACTIVE_TEXTURE)-e.TEXTURE0},_.dispose=function(){this.gl.deleteTexture(this.handle)},_.generateMipmap=function(){this.bind(),this.gl.generateMipmap(this.gl.TEXTURE_2D);for(var t=Math.min(this._shape[0],this._shape[1]),e=0;t>0;++e,t>>>=1)this._mipLevels.indexOf(e)<0&&this._mipLevels.push(e)},_.setPixels=function(t,e,r,n){var a=this.gl;this.bind(),Array.isArray(e)?(n=r,r=0|e[1],e=0|e[0]):(e=e||0,r=r||0),n=n||0;var o=i(t)?t:t.raw;if(o){this._mipLevels.indexOf(n)<0?(a.texImage2D(a.TEXTURE_2D,0,this.format,this.format,this.type,o),this._mipLevels.push(n)):a.texSubImage2D(a.TEXTURE_2D,n,e,r,this.format,this.type,o)}else{if(!(t.shape&&t.stride&&t.data))throw new Error("gl-texture2d: Unsupported data type");if(t.shape.length<2||e+t.shape[1]>this._shape[1]>>>n||r+t.shape[0]>this._shape[0]>>>n||e<0||r<0)throw new Error("gl-texture2d: Texture dimensions are out of bounds");l(a,e,r,n,this.format,this.type,this._mipLevels,t)}}},{ndarray:460,"ndarray-ops":454,"typedarray-pool":533}],263:[function(t,e,r){"use strict";function n(t,e,r){e?e.bind():t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null);var n=0|t.getParameter(t.MAX_VERTEX_ATTRIBS);if(r){if(r.length>n)throw new Error("gl-vao: Too many vertex attributes");for(var i=0;i<r.length;++i){var a=r[i];if(a.buffer){var o=a.buffer,s=a.size||4,l=a.type||t.FLOAT,u=!!a.normalized,c=a.stride||0,h=a.offset||0;o.bind(),t.enableVertexAttribArray(i),t.vertexAttribPointer(i,s,l,u,c,h)}else{if("number"==typeof a)t.vertexAttrib1f(i,a);else if(1===a.length)t.vertexAttrib1f(i,a[0]);else if(2===a.length)t.vertexAttrib2f(i,a[0],a[1]);else if(3===a.length)t.vertexAttrib3f(i,a[0],a[1],a[2]);else{if(4!==a.length)throw new Error("gl-vao: Invalid vertex attribute");t.vertexAttrib4f(i,a[0],a[1],a[2],a[3])}t.disableVertexAttribArray(i)}}for(;i<n;++i)t.disableVertexAttribArray(i)}else{t.bindBuffer(t.ARRAY_BUFFER,null);for(var i=0;i<n;++i)t.disableVertexAttribArray(i)}}e.exports=n},{}],264:[function(t,e,r){"use strict";function n(t){this.gl=t,this._elements=null,this._attributes=null,this._elementsType=t.UNSIGNED_SHORT}function i(t){return new n(t)}var a=t("./do-bind.js");n.prototype.bind=function(){a(this.gl,this._elements,this._attributes)},n.prototype.update=function(t,e,r){this._elements=e,this._attributes=t,this._elementsType=r||this.gl.UNSIGNED_SHORT},n.prototype.dispose=function(){},n.prototype.unbind=function(){},n.prototype.draw=function(t,e,r){r=r||0;var n=this.gl;this._elements?n.drawElements(t,e,this._elementsType,r):n.drawArrays(t,r,e)},e.exports=i},{"./do-bind.js":263}],265:[function(t,e,r){"use strict";function n(t,e,r,n,i,a){this.location=t,this.dimension=e,this.a=r,this.b=n,this.c=i,this.d=a}function i(t,e,r){this.gl=t,this._ext=e,this.handle=r,this._attribs=[],this._useElements=!1,this._elementsType=t.UNSIGNED_SHORT}function a(t,e){return new i(t,e,e.createVertexArrayOES())}var o=t("./do-bind.js");n.prototype.bind=function(t){switch(this.dimension){case 1:t.vertexAttrib1f(this.location,this.a);break;case 2:t.vertexAttrib2f(this.location,this.a,this.b);break;case 3:t.vertexAttrib3f(this.location,this.a,this.b,this.c);break;case 4:t.vertexAttrib4f(this.location,this.a,this.b,this.c,this.d)}},i.prototype.bind=function(){this._ext.bindVertexArrayOES(this.handle);for(var t=0;t<this._attribs.length;++t)this._attribs[t].bind(this.gl)},i.prototype.unbind=function(){this._ext.bindVertexArrayOES(null)},i.prototype.dispose=function(){this._ext.deleteVertexArrayOES(this.handle)},i.prototype.update=function(t,e,r){if(this.bind(),o(this.gl,e,t),this.unbind(),this._attribs.length=0,t)for(var i=0;i<t.length;++i){var a=t[i];"number"==typeof a?this._attribs.push(new n(i,1,a)):Array.isArray(a)&&this._attribs.push(new n(i,a.length,a[0],a[1],a[2],a[3]))}this._useElements=!!e,this._elementsType=r||this.gl.UNSIGNED_SHORT},i.prototype.draw=function(t,e,r){r=r||0;var n=this.gl;this._useElements?n.drawElements(t,e,this._elementsType,r):n.drawArrays(t,r,e)},e.exports=a},{"./do-bind.js":263}],266:[function(t,e,r){"use strict";function n(t){this.bindVertexArrayOES=t.bindVertexArray.bind(t),this.createVertexArrayOES=t.createVertexArray.bind(t),this.deleteVertexArrayOES=t.deleteVertexArray.bind(t)}function i(t,e,r,i){var s,l=t.createVertexArray?new n(t):t.getExtension("OES_vertex_array_object");return s=l?a(t,l):o(t),s.update(e,r,i),s}var a=t("./lib/vao-native.js"),o=t("./lib/vao-emulated.js");e.exports=i},{"./lib/vao-emulated.js":264,"./lib/vao-native.js":265}],267:[function(t,e,r){function n(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2];return t[0]=i*l-a*s,t[1]=a*o-n*l,t[2]=n*s-i*o,t}e.exports=n},{}],268:[function(t,e,r){function n(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}e.exports=n},{}],269:[function(t,e,r){function n(t){var e=t[0],r=t[1],n=t[2];return Math.sqrt(e*e+r*r+n*n)}e.exports=n},{}],270:[function(t,e,r){function n(t,e,r,n){var i=e[0],a=e[1],o=e[2];return t[0]=i+n*(r[0]-i),t[1]=a+n*(r[1]-a),t[2]=o+n*(r[2]-o),t}e.exports=n},{}],271:[function(t,e,r){function n(t,e){var r=e[0],n=e[1],i=e[2],a=r*r+n*n+i*i;return a>0&&(a=1/Math.sqrt(a),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a),t}e.exports=n},{}],272:[function(t,e,r){function n(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}e.exports=n},{}],273:[function(t,e,r){function n(t,e,r,n){return i[0]=n,i[1]=r,i[2]=e,i[3]=t,a[0]}e.exports=n;var i=new Uint8Array(4),a=new Float32Array(i.buffer)},{}],274:[function(t,e,r){function n(t){for(var e=Array.isArray(t)?t:i(t),r=0;r<e.length;r++){var n=e[r];if("preprocessor"===n.type){var o=n.data.match(/\#define\s+SHADER_NAME(_B64)?\s+(.+)$/);if(o&&o[2]){var s=o[1],l=o[2];return(s?a(l):l).trim()}}}}var i=t("glsl-tokenizer"),a=t("atob-lite");e.exports=n},{"atob-lite":44,"glsl-tokenizer":281}],275:[function(t,e,r){function n(t){function e(t){t.length&&V.push({type:M[B],data:t,position:G,line:q,column:H})}function r(t){R=0,W+=t,F=W.length;for(var e;O=W[R],R<F;){switch(e=R,B){case h:R=E();break;case f:R=S();break;case d:R=T();break;case p:R=L();break;case m:R=D();break;case w:R=z();break;case v:R=I();break;case c:R=P();break;case x:R=A();break;case u:R=k()}if(e!==R)switch(W[e]){case"\n":H=0,++q;break;default:++H}}return N+=R,W=W.slice(R),V}function n(t){return U.length&&e(U.join("")),B=_,e("(eof)"),V}function k(){return U=U.length?[]:U,"/"===j&&"*"===O?(G=N+R-1,B=h,j=O,R+1):"/"===j&&"/"===O?(G=N+R-1,B=f,j=O,R+1):"#"===O?(B=d,G=N+R,R):/\s/.test(O)?(B=x,G=N+R,R):(Y=/\d/.test(O),X=/[^\w_]/.test(O),G=N+R,B=Y?m:X?p:c,R)}function A(){return/[^\s]/g.test(O)?(e(U.join("")),B=u,R):(U.push(O),j=O,R+1)}function T(){return"\r"!==O&&"\n"!==O||"\\"===j?(U.push(O),j=O,R+1):(e(U.join("")),B=u,R)}function S(){return T()}function E(){return"/"===O&&"*"===j?(U.push(O),e(U.join("")),B=u,R+1):(U.push(O),j=O,R+1)}function L(){if("."===j&&/\d/.test(O))return B=v,R;if("/"===j&&"*"===O)return B=h,R;if("/"===j&&"/"===O)return B=f,R;if("."===O&&U.length){for(;C(U););return B=v,R}if(";"===O||")"===O||"("===O){if(U.length)for(;C(U););return e(O),B=u,R+1}var t=2===U.length&&"="!==O;if(/[\w_\d\s]/.test(O)||t){for(;C(U););return B=u,R}return U.push(O),j=O,R+1}function C(t){for(var r,n,i=0;;){if(r=a.indexOf(t.slice(0,t.length+i).join("")),n=a[r],r===-1){if(i--+t.length>0)continue;n=t.slice(0,1).join("")}return e(n),G+=n.length,U=U.slice(n.length),U.length}}function z(){return/[^a-fA-F0-9]/.test(O)?(e(U.join("")),B=u,R):(U.push(O),j=O,R+1)}function D(){return"."===O?(U.push(O),B=v,j=O,R+1):/[eE]/.test(O)?(U.push(O),B=v,j=O,R+1):"x"===O&&1===U.length&&"0"===U[0]?(B=w,U.push(O),j=O,R+1):/[^\d]/.test(O)?(e(U.join("")),B=u,R):(U.push(O),j=O,R+1)}function I(){return"f"===O&&(U.push(O),j=O,R+=1),/[eE]/.test(O)?(U.push(O),j=O,R+1):"-"===O&&/[eE]/.test(j)?(U.push(O),j=O,R+1):/[^\d]/.test(O)?(e(U.join("")),B=u,R):(U.push(O),j=O,R+1)}function P(){if(/[^\d\w_]/.test(O)){var t=U.join("");return B=J.indexOf(t)>-1?b:Z.indexOf(t)>-1?y:g,e(U.join("")),B=u,R}return U.push(O),j=O,R+1}var O,j,F,R=0,N=0,B=u,U=[],V=[],q=1,H=0,G=0,Y=!1,X=!1,W="";t=t||{};var Z=o,J=i;return"300 es"===t.version&&(Z=l,J=s),function(t){return V=[],null!==t?r(t.replace?t.replace(/\r\n/g,"\n"):t):n()}}e.exports=n;var i=t("./lib/literals"),a=t("./lib/operators"),o=t("./lib/builtins"),s=t("./lib/literals-300es"),l=t("./lib/builtins-300es"),u=999,c=9999,h=0,f=1,d=2,p=3,m=4,v=5,g=6,y=7,b=8,x=9,_=10,w=11,M=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"]},{"./lib/builtins":277,"./lib/builtins-300es":276,"./lib/literals":279,"./lib/literals-300es":278,"./lib/operators":280}],276:[function(t,e,r){var n=t("./builtins");n=n.slice().filter(function(t){return!/^(gl\_|texture)/.test(t)}),e.exports=n.concat(["gl_VertexID","gl_InstanceID","gl_Position","gl_PointSize","gl_FragCoord","gl_FrontFacing","gl_FragDepth","gl_PointCoord","gl_MaxVertexAttribs","gl_MaxVertexUniformVectors","gl_MaxVertexOutputVectors","gl_MaxFragmentInputVectors","gl_MaxVertexTextureImageUnits","gl_MaxCombinedTextureImageUnits","gl_MaxTextureImageUnits","gl_MaxFragmentUniformVectors","gl_MaxDrawBuffers","gl_MinProgramTexelOffset","gl_MaxProgramTexelOffset","gl_DepthRangeParameters","gl_DepthRange","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"])},{"./builtins":277}],277:[function(t,e,r){e.exports=["abs","acos","all","any","asin","atan","ceil","clamp","cos","cross","dFdx","dFdy","degrees","distance","dot","equal","exp","exp2","faceforward","floor","fract","gl_BackColor","gl_BackLightModelProduct","gl_BackLightProduct","gl_BackMaterial","gl_BackSecondaryColor","gl_ClipPlane","gl_ClipVertex","gl_Color","gl_DepthRange","gl_DepthRangeParameters","gl_EyePlaneQ","gl_EyePlaneR","gl_EyePlaneS","gl_EyePlaneT","gl_Fog","gl_FogCoord","gl_FogFragCoord","gl_FogParameters","gl_FragColor","gl_FragCoord","gl_FragData","gl_FragDepth","gl_FragDepthEXT","gl_FrontColor","gl_FrontFacing","gl_FrontLightModelProduct","gl_FrontLightProduct","gl_FrontMaterial","gl_FrontSecondaryColor","gl_LightModel","gl_LightModelParameters","gl_LightModelProducts","gl_LightProducts","gl_LightSource","gl_LightSourceParameters","gl_MaterialParameters","gl_MaxClipPlanes","gl_MaxCombinedTextureImageUnits","gl_MaxDrawBuffers","gl_MaxFragmentUniformComponents","gl_MaxLights","gl_MaxTextureCoords","gl_MaxTextureImageUnits","gl_MaxTextureUnits","gl_MaxVaryingFloats","gl_MaxVertexAttribs","gl_MaxVertexTextureImageUnits","gl_MaxVertexUniformComponents","gl_ModelViewMatrix","gl_ModelViewMatrixInverse","gl_ModelViewMatrixInverseTranspose","gl_ModelViewMatrixTranspose","gl_ModelViewProjectionMatrix","gl_ModelViewProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixTranspose","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_Normal","gl_NormalMatrix","gl_NormalScale","gl_ObjectPlaneQ","gl_ObjectPlaneR","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_Point","gl_PointCoord","gl_PointParameters","gl_PointSize","gl_Position","gl_ProjectionMatrix","gl_ProjectionMatrixInverse","gl_ProjectionMatrixInverseTranspose","gl_ProjectionMatrixTranspose","gl_SecondaryColor","gl_TexCoord","gl_TextureEnvColor","gl_TextureMatrix","gl_TextureMatrixInverse","gl_TextureMatrixInverseTranspose","gl_TextureMatrixTranspose","gl_Vertex","greaterThan","greaterThanEqual","inversesqrt","length","lessThan","lessThanEqual","log","log2","matrixCompMult","max","min","mix","mod","normalize","not","notEqual","pow","radians","reflect","refract","sign","sin","smoothstep","sqrt","step","tan","texture2D","texture2DLod","texture2DProj","texture2DProjLod","textureCube","textureCubeLod","texture2DLodEXT","texture2DProjLodEXT","textureCubeLodEXT","texture2DGradEXT","texture2DProjGradEXT","textureCubeGradEXT"]},{}],278:[function(t,e,r){var n=t("./literals");e.exports=n.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uint","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray"])},{"./literals":279}],279:[function(t,e,r){e.exports=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","void","bool","true","false","discard","return","mat2","mat3","mat4","vec2","vec3","vec4","ivec2","ivec3","ivec4","bvec2","bvec3","bvec4","sampler1D","sampler2D","sampler3D","samplerCube","sampler1DShadow","sampler2DShadow","struct","asm","class","union","enum","typedef","template","this","packed","goto","switch","default","inline","noinline","volatile","public","static","extern","external","interface","long","short","double","half","fixed","unsigned","input","output","hvec2","hvec3","hvec4","dvec2","dvec3","dvec4","fvec2","fvec3","fvec4","sampler2DRect","sampler3DRect","sampler2DRectShadow","sizeof","cast","namespace","using"]},{}],280:[function(t,e,r){e.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},{}],281:[function(t,e,r){function n(t,e){var r=i(e),n=[];return n=n.concat(r(t)),n=n.concat(r(null))}var i=t("./index");e.exports=n},{"./index":275}],282:[function(t,e,r){"use strict";function n(t,e,r){var n=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;var a=new Int32Array(this.arrayBuffer);t=a[0],e=a[1],r=a[2],this.d=e+2*r;for(var o=0;o<this.d*this.d;o++){var s=a[i+o],l=a[i+o+1];n.push(s===l?null:a.subarray(s,l))}var u=a[i+n.length],c=a[i+n.length+1];this.keys=a.subarray(u,c),this.bboxes=a.subarray(c),this.insert=this._insertReadonly}else{this.d=e+2*r;for(var h=0;h<this.d*this.d;h++)n.push([]);this.keys=[],this.bboxes=[]}
29 this.n=e,this.extent=t,this.padding=r,this.scale=e/t,this.uid=0;var f=r/e*t;this.min=-f,this.max=t+f}e.exports=n;var i=3;n.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)},n.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},n.prototype._insertCell=function(t,e,r,n,i,a){this.cells[i].push(a)},n.prototype.query=function(t,e,r,n){var i=this.min,a=this.max;if(t<=i&&e<=i&&a<=r&&a<=n)return Array.prototype.slice.call(this.keys);var o=[],s={};return this._forEachCell(t,e,r,n,this._queryCell,o,s),o},n.prototype._queryCell=function(t,e,r,n,i,a,o){var s=this.cells[i];if(null!==s)for(var l=this.keys,u=this.bboxes,c=0;c<s.length;c++){var h=s[c];if(void 0===o[h]){var f=4*h;t<=u[f+2]&&e<=u[f+3]&&r>=u[f+0]&&n>=u[f+1]?(o[h]=!0,a.push(l[h])):o[h]=!1}}},n.prototype._forEachCell=function(t,e,r,n,i,a,o){for(var s=this._convertToCellCoord(t),l=this._convertToCellCoord(e),u=this._convertToCellCoord(r),c=this._convertToCellCoord(n),h=s;h<=u;h++)for(var f=l;f<=c;f++){var d=this.d*f+h;if(i.call(this,t,e,r,n,d,a,o))return}},n.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},n.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=i+this.cells.length+1+1,r=0,n=0;n<this.cells.length;n++)r+=this.cells[n].length;var a=new Int32Array(e+r+this.keys.length+this.bboxes.length);a[0]=this.extent,a[1]=this.n,a[2]=this.padding;for(var o=e,s=0;s<t.length;s++){var l=t[s];a[i+s]=o,a.set(l,o),o+=l.length}return a[i+t.length]=o,a.set(this.keys,o),o+=this.keys.length,a[i+t.length+1]=o,a.set(this.bboxes,o),o+=this.bboxes.length,a.buffer}},{}],283:[function(t,e,r){r.read=function(t,e,r,n,i){var a,o,s=8*i-n-1,l=(1<<s)-1,u=l>>1,c=-7,h=r?i-1:0,f=r?-1:1,d=t[e+h];for(h+=f,a=d&(1<<-c)-1,d>>=-c,c+=s;c>0;a=256*a+t[e+h],h+=f,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=n;c>0;o=256*o+t[e+h],h+=f,c-=8);if(0===a)a=1-u;else{if(a===l)return o?0/0:1/0*(d?-1:1);o+=Math.pow(2,n),a-=u}return(d?-1:1)*o*Math.pow(2,a-n)},r.write=function(t,e,r,n,i,a){var o,s,l,u=8*a-i-1,c=(1<<u)-1,h=c>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:a-1,p=n?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||1/0===e?(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+h>=1?f/l:f*Math.pow(2,1-h),e*l>=2&&(o++,l/=2),o+h>=c?(s=0,o=c):o+h>=1?(s=(e*l-1)*Math.pow(2,i),o+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;t[r+d]=255&s,d+=p,s/=256,i-=8);for(o=o<<i|s,u+=i;u>0;t[r+d]=255&o,d+=p,o/=256,u-=8);t[r+d-p]|=128*m}},{}],284:[function(t,e,r){"use strict";function n(t,e,r){this.vertices=t,this.adjacent=e,this.boundary=r,this.lastVisited=-1}function i(t,e,r){this.vertices=t,this.cell=e,this.index=r}function a(t,e){return c(t.vertices,e.vertices)}function o(t){for(var e=["function orient(){var tuple=this.tuple;return test("],r=0;r<=t;++r)r>0&&e.push(","),e.push("tuple[",r,"]");e.push(")}return orient");var n=new Function("test",e.join("")),i=u[t+1];return i||(i=u),n(i)}function s(t,e,r){this.dimension=t,this.vertices=e,this.simplices=r,this.interior=r.filter(function(t){return!t.boundary}),this.tuple=new Array(t+1);for(var n=0;n<=t;++n)this.tuple[n]=this.vertices[n];var i=h[t];i||(i=h[t]=o(t)),this.orient=i}function l(t,e){var r=t.length;if(0===r)throw new Error("Must have at least d+1 points");var i=t[0].length;if(r<=i)throw new Error("Must input at least d+1 points");var a=t.slice(0,i+1),o=u.apply(void 0,a);if(0===o)throw new Error("Input not in general position");for(var l=new Array(i+1),c=0;c<=i;++c)l[c]=c;o<0&&(l[0]=1,l[1]=0);for(var h=new n(l,new Array(i+1),!1),f=h.adjacent,d=new Array(i+2),c=0;c<=i;++c){for(var p=l.slice(),m=0;m<=i;++m)m===c&&(p[m]=-1);var v=p[0];p[0]=p[1],p[1]=v;var g=new n(p,new Array(i+1),!0);f[c]=g,d[c]=g}d[i+1]=h;for(var c=0;c<=i;++c)for(var p=f[c].vertices,y=f[c].adjacent,m=0;m<=i;++m){var b=p[m];if(b<0)y[m]=h;else for(var x=0;x<=i;++x)f[x].vertices.indexOf(b)<0&&(y[m]=f[x])}for(var _=new s(i,a,d),w=!!e,c=i+1;c<r;++c)_.insert(t[c],w);return _.boundary()}e.exports=l;var u=t("robust-orientation"),c=t("simplicial-complex").compareCells;n.prototype.flip=function(){var t=this.vertices[0];this.vertices[0]=this.vertices[1],this.vertices[1]=t;var e=this.adjacent[0];this.adjacent[0]=this.adjacent[1],this.adjacent[1]=e};var h=[],f=s.prototype;f.handleBoundaryDegeneracy=function(t,e){var r=this.dimension,n=this.vertices.length-1,i=this.tuple,a=this.vertices,o=[t];for(t.lastVisited=-n;o.length>0;){t=o.pop();for(var s=(t.vertices,t.adjacent),l=0;l<=r;++l){var u=s[l];if(u.boundary&&!(u.lastVisited<=-n)){for(var c=u.vertices,h=0;h<=r;++h){var f=c[h];i[h]=f<0?e:a[f]}var d=this.orient();if(d>0)return u;u.lastVisited=-n,0===d&&o.push(u)}}}return null},f.walk=function(t,e){var r=this.vertices.length-1,n=this.dimension,i=this.vertices,a=this.tuple,o=e?this.interior.length*Math.random()|0:this.interior.length-1,s=this.interior[o];t:for(;!s.boundary;){for(var l=s.vertices,u=s.adjacent,c=0;c<=n;++c)a[c]=i[l[c]];s.lastVisited=r;for(var c=0;c<=n;++c){var h=u[c];if(!(h.lastVisited>=r)){var f=a[c];a[c]=t;var d=this.orient();if(a[c]=f,d<0){s=h;continue t}h.boundary?h.lastVisited=-r:h.lastVisited=r}}return}return s},f.addPeaks=function(t,e){var r=this.vertices.length-1,o=this.dimension,s=this.vertices,l=this.tuple,u=this.interior,c=this.simplices,h=[e];e.lastVisited=r,e.vertices[e.vertices.indexOf(-1)]=r,e.boundary=!1,u.push(e);for(var f=[];h.length>0;){var e=h.pop(),d=e.vertices,p=e.adjacent,m=d.indexOf(r);if(!(m<0))for(var v=0;v<=o;++v)if(v!==m){var g=p[v];if(g.boundary&&!(g.lastVisited>=r)){var y=g.vertices;if(g.lastVisited!==-r){for(var b=0,x=0;x<=o;++x)y[x]<0?(b=x,l[x]=t):l[x]=s[y[x]];var _=this.orient();if(_>0){y[b]=r,g.boundary=!1,u.push(g),h.push(g),g.lastVisited=r;continue}g.lastVisited=-r}var w=g.adjacent,M=d.slice(),k=p.slice(),A=new n(M,k,!0);c.push(A);var T=w.indexOf(e);if(!(T<0)){w[T]=A,k[m]=g,M[v]=-1,k[v]=e,p[v]=A,A.flip();for(var x=0;x<=o;++x){var S=M[x];if(!(S<0||S===r)){for(var E=new Array(o-1),L=0,C=0;C<=o;++C){var z=M[C];z<0||C===x||(E[L++]=z)}f.push(new i(E,A,x))}}}}}}f.sort(a);for(var v=0;v+1<f.length;v+=2){var D=f[v],I=f[v+1],P=D.index,O=I.index;P<0||O<0||(D.cell.adjacent[D.index]=I.cell,I.cell.adjacent[I.index]=D.cell)}},f.insert=function(t,e){var r=this.vertices;r.push(t);var n=this.walk(t,e);if(n){for(var i=this.dimension,a=this.tuple,o=0;o<=i;++o){var s=n.vertices[o];a[o]=s<0?t:r[s]}var l=this.orient(a);l<0||(0!==l||(n=this.handleBoundaryDegeneracy(n,t)))&&this.addPeaks(t,n)}},f.boundary=function(){for(var t=this.dimension,e=[],r=this.simplices,n=r.length,i=0;i<n;++i){var a=r[i];if(a.boundary){for(var o=new Array(t),s=a.vertices,l=0,u=0,c=0;c<=t;++c)s[c]>=0?o[l++]=s[c]:u=1&c;if(u===(1&t)){var h=o[0];o[0]=o[1],o[1]=h}e.push(o)}}return e}},{"robust-orientation":500,"simplicial-complex":511}],285:[function(t,e,r){"use strict";function n(t,e,r,n,i){this.mid=t,this.left=e,this.right=r,this.leftPoints=n,this.rightPoints=i,this.count=(e?e.count:0)+(r?r.count:0)+n.length}function i(t,e){t.mid=e.mid,t.left=e.left,t.right=e.right,t.leftPoints=e.leftPoints,t.rightPoints=e.rightPoints,t.count=e.count}function a(t,e){var r=p(e);t.mid=r.mid,t.left=r.left,t.right=r.right,t.leftPoints=r.leftPoints,t.rightPoints=r.rightPoints,t.count=r.count}function o(t,e){var r=t.intervals([]);r.push(e),a(t,r)}function s(t,e){var r=t.intervals([]),n=r.indexOf(e);return n<0?y:(r.splice(n,1),a(t,r),b)}function l(t,e,r){for(var n=0;n<t.length&&t[n][0]<=e;++n){var i=r(t[n]);if(i)return i}}function u(t,e,r){for(var n=t.length-1;n>=0&&t[n][1]>=e;--n){var i=r(t[n]);if(i)return i}}function c(t,e){for(var r=0;r<t.length;++r){var n=e(t[r]);if(n)return n}}function h(t,e){return t-e}function f(t,e){var r=t[0]-e[0];return r||t[1]-e[1]}function d(t,e){var r=t[1]-e[1];return r||t[0]-e[0]}function p(t){if(0===t.length)return null;for(var e=[],r=0;r<t.length;++r)e.push(t[r][0],t[r][1]);e.sort(h);for(var i=e[e.length>>1],a=[],o=[],s=[],r=0;r<t.length;++r){var l=t[r];l[1]<i?a.push(l):i<l[0]?o.push(l):s.push(l)}var u=s,c=s.slice();return u.sort(f),c.sort(d),new n(i,p(a),p(o),u,c)}function m(t){this.root=t}function v(t){return new m(t&&0!==t.length?p(t):null)}var g=t("binary-search-bounds"),y=0,b=1;e.exports=v;var x=n.prototype;x.intervals=function(t){return t.push.apply(t,this.leftPoints),this.left&&this.left.intervals(t),this.right&&this.right.intervals(t),t},x.insert=function(t){var e=this.count-this.leftPoints.length;if(this.count+=1,t[1]<this.mid)this.left?4*(this.left.count+1)>3*(e+1)?o(this,t):this.left.insert(t):this.left=p([t]);else if(t[0]>this.mid)this.right?4*(this.right.count+1)>3*(e+1)?o(this,t):this.right.insert(t):this.right=p([t]);else{var r=g.ge(this.leftPoints,t,f),n=g.ge(this.rightPoints,t,d);this.leftPoints.splice(r,0,t),this.rightPoints.splice(n,0,t)}},x.remove=function(t){var e=this.count-this.leftPoints;if(t[1]<this.mid){if(!this.left)return y;if(4*(this.right?this.right.count:0)>3*(e-1))return s(this,t);var r=this.left.remove(t);return 2===r?(this.left=null,this.count-=1,b):(r===b&&(this.count-=1),r)}if(t[0]>this.mid){if(!this.right)return y;if(4*(this.left?this.left.count:0)>3*(e-1))return s(this,t);var r=this.right.remove(t);return 2===r?(this.right=null,this.count-=1,b):(r===b&&(this.count-=1),r)}if(1===this.count)return this.leftPoints[0]===t?2:y;if(1===this.leftPoints.length&&this.leftPoints[0]===t){if(this.left&&this.right){for(var n=this,a=this.left;a.right;)n=a,a=a.right;if(n===this)a.right=this.right;else{var o=this.left,r=this.right;n.count-=a.count,n.right=a.left,a.left=o,a.right=r}i(this,a),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?i(this,this.left):i(this,this.right);return b}for(var o=g.ge(this.leftPoints,t,f);o<this.leftPoints.length&&this.leftPoints[o][0]===t[0];++o)if(this.leftPoints[o]===t){this.count-=1,this.leftPoints.splice(o,1);for(var r=g.ge(this.rightPoints,t,d);r<this.rightPoints.length&&this.rightPoints[r][1]===t[1];++r)if(this.rightPoints[r]===t)return this.rightPoints.splice(r,1),b}return y},x.queryPoint=function(t,e){if(t<this.mid){if(this.left){var r=this.left.queryPoint(t,e);if(r)return r}return l(this.leftPoints,t,e)}if(t>this.mid){if(this.right){var r=this.right.queryPoint(t,e);if(r)return r}return u(this.rightPoints,t,e)}return c(this.leftPoints,e)},x.queryInterval=function(t,e,r){if(t<this.mid&&this.left){var n=this.left.queryInterval(t,e,r);if(n)return n}if(e>this.mid&&this.right){var n=this.right.queryInterval(t,e,r);if(n)return n}return e<this.mid?l(this.leftPoints,e,r):t>this.mid?u(this.rightPoints,t,r):c(this.leftPoints,r)};var _=m.prototype;_.insert=function(t){this.root?this.root.insert(t):this.root=new n(t[0],null,null,[t],[t])},_.remove=function(t){if(this.root){var e=this.root.remove(t);return 2===e&&(this.root=null),e!==y}return!1},_.queryPoint=function(t,e){if(this.root)return this.root.queryPoint(t,e)},_.queryInterval=function(t,e,r){if(t<=e&&this.root)return this.root.queryInterval(t,e,r)},Object.defineProperty(_,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(_,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}})},{"binary-search-bounds":62}],286:[function(t,e,r){"use strict";function n(t,e){e=e||new Array(t.length);for(var r=0;r<t.length;++r)e[t[r]]=r;return e}e.exports=n},{}],287:[function(t,e,r){"use strict";function n(t){for(var e=new Array(t),r=0;r<t;++r)e[r]=r;return e}e.exports=n},{}],288:[function(t,e,r){function n(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}function i(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&n(t.slice(0,0))}e.exports=function(t){return null!=t&&(n(t)||i(t)||!!t._isBuffer)}},{}],289:[function(t,e,r){function n(t){return t||"undefined"==typeof navigator||(t=navigator.userAgent),t&&t.headers&&"string"==typeof t.headers["user-agent"]&&(t=t.headers["user-agent"]),"string"==typeof t&&(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4)))}e.exports=n},{}],290:[function(t,e,r){"use strict";var n=Object.prototype.toString;e.exports=function(t){var e;return"[object Object]"===n.call(t)&&(null===(e=Object.getPrototypeOf(t))||e===Object.getPrototypeOf({}))}},{}],291:[function(t,e,r){"use strict";function n(t,e,r,n,a){return new i(t,e,r,n,a)}function i(t,e,r,n,i){e=e||a,r=r||o,i=i||Array,this.nodeSize=n||64,this.points=t,this.ids=new i(t.length),this.coords=new i(2*t.length);for(var l=0;l<t.length;l++)this.ids[l]=l,this.coords[2*l]=e(t[l]),this.coords[2*l+1]=r(t[l]);s(this.ids,this.coords,this.nodeSize,0,this.ids.length-1,0)}function a(t){return t[0]}function o(t){return t[1]}var s=t("./sort"),l=t("./range"),u=t("./within");e.exports=n,i.prototype={range:function(t,e,r,n){return l(this.ids,this.coords,t,e,r,n,this.nodeSize)},within:function(t,e,r){return u(this.ids,this.coords,t,e,r,this.nodeSize)}}},{"./range":292,"./sort":293,"./within":294}],292:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o){for(var s,l,u=[0,t.length-1,0],c=[];u.length;){var h=u.pop(),f=u.pop(),d=u.pop();if(f-d<=o)for(var p=d;p<=f;p++)s=e[2*p],l=e[2*p+1],s>=r&&s<=i&&l>=n&&l<=a&&c.push(t[p]);else{var m=Math.floor((d+f)/2);s=e[2*m],l=e[2*m+1],s>=r&&s<=i&&l>=n&&l<=a&&c.push(t[m]);var v=(h+1)%2;(0===h?r<=s:n<=l)&&(u.push(d),u.push(m-1),u.push(v)),(0===h?i>=s:a>=l)&&(u.push(m+1),u.push(f),u.push(v))}}return c}e.exports=n},{}],293:[function(t,e,r){"use strict";function n(t,e,r,a,o,s){if(!(o-a<=r)){var l=Math.floor((a+o)/2);i(t,e,l,a,o,s%2),n(t,e,r,a,l-1,s+1),n(t,e,r,l+1,o,s+1)}}function i(t,e,r,n,o,s){for(;o>n;){if(o-n>600){var l=o-n+1,u=r-n+1,c=Math.log(l),h=.5*Math.exp(2*c/3),f=.5*Math.sqrt(c*h*(l-h)/l)*(u-l/2<0?-1:1);i(t,e,r,Math.max(n,Math.floor(r-u*h/l+f)),Math.min(o,Math.floor(r+(l-u)*h/l+f)),s)}var d=e[2*r+s],p=n,m=o;for(a(t,e,n,r),e[2*o+s]>d&&a(t,e,n,o);p<m;){for(a(t,e,p,m),p++,m--;e[2*p+s]<d;)p++;for(;e[2*m+s]>d;)m--}e[2*n+s]===d?a(t,e,n,m):(m++,a(t,e,m,o)),m<=r&&(n=m+1),r<=m&&(o=m-1)}}function a(t,e,r,n){o(t,r,n),o(e,2*r,2*n),o(e,2*r+1,2*n+1)}function o(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}e.exports=n},{}],294:[function(t,e,r){"use strict";function n(t,e,r,n,a,o){for(var s=[0,t.length-1,0],l=[],u=a*a;s.length;){var c=s.pop(),h=s.pop(),f=s.pop();if(h-f<=o)for(var d=f;d<=h;d++)i(e[2*d],e[2*d+1],r,n)<=u&&l.push(t[d]);else{var p=Math.floor((f+h)/2),m=e[2*p],v=e[2*p+1];i(m,v,r,n)<=u&&l.push(t[p]);var g=(c+1)%2;(0===c?r-a<=m:n-a<=v)&&(s.push(f),s.push(p-1),s.push(g)),(0===c?r+a>=m:n+a>=v)&&(s.push(p+1),s.push(h),s.push(g))}}return l}function i(t,e,r,n){var i=t-r,a=e-n;return i*i+a*a}e.exports=n},{}],295:[function(t,e,r){"use strict";function n(t,e){var r;if(h(t)){var l,u=t.stops&&"object"==typeof t.stops[0][0],c=u||void 0!==t.property,f=u||!c,d=t.type||e||"exponential";if("exponential"===d)l=o;else if("interval"===d)l=a;else if("categorical"===d)l=i;else{if("identity"!==d)throw new Error('Unknown function type "'+d+'"');l=s}if(u){for(var p={},m=[],v=0;v<t.stops.length;v++){var g=t.stops[v];void 0===p[g[0].zoom]&&(p[g[0].zoom]={zoom:g[0].zoom,type:t.type,property:t.property,stops:[]}),p[g[0].zoom].stops.push([g[0].value,g[1]])}for(var y in p)m.push([p[y].zoom,n(p[y])]);r=function(e,r){return o({stops:m,base:t.base},e)(e,r)},r.isFeatureConstant=!1,r.isZoomConstant=!1}else f?(r=function(e){return l(t,e)},r.isFeatureConstant=!0,r.isZoomConstant=!1):(r=function(e,r){return l(t,r[t.property])},r.isFeatureConstant=!1,r.isZoomConstant=!0)}else r=function(){return t},r.isFeatureConstant=!0,r.isZoomConstant=!0;return r}function i(t,e){for(var r=0;r<t.stops.length;r++)if(e===t.stops[r][0])return t.stops[r][1];return t.stops[0][1]}function a(t,e){for(var r=0;r<t.stops.length&&!(e<t.stops[r][0]);r++);return t.stops[Math.max(r-1,0)][1]}function o(t,e){for(var r=void 0!==t.base?t.base:1,n=0;;){if(n>=t.stops.length)break;if(e<=t.stops[n][0])break;n++}return 0===n?t.stops[n][1]:n===t.stops.length?t.stops[n-1][1]:l(e,r,t.stops[n-1][0],t.stops[n][0],t.stops[n-1][1],t.stops[n][1])}function s(t,e){return e}function l(t,e,r,n,i,a){return"function"==typeof i?function(){var o=i.apply(void 0,arguments),s=a.apply(void 0,arguments);return l(t,e,r,n,o,s)}:i.length?c(t,e,r,n,i,a):u(t,e,r,n,i,a)}function u(t,e,r,n,i,a){var o,s=n-r,l=t-r;return o=1===e?l/s:(Math.pow(e,l)-1)/(Math.pow(e,s)-1),i*(1-o)+a*o}function c(t,e,r,n,i,a){for(var o=[],s=0;s<i.length;s++)o[s]=u(t,e,r,n,i[s],a[s]);return o}function h(t){return"object"==typeof t&&(t.stops||"identity"===t.type)}e.exports.isFunctionDefinition=h,e.exports.interpolated=function(t){return n(t,"exponential")},e.exports["piecewise-constant"]=function(t){return n(t,"interval")}},{}],296:[function(t,e,r){t("path");e.exports={debug:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform lowp vec4 u_color;\n\nvoid main() {\n gl_FragColor = u_color;\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nattribute vec2 a_pos;\n\nuniform mat4 u_matrix;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, step(32767.0, a_pos.x), 1);\n}\n"},fill:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\n#pragma mapbox: define lowp vec4 color\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp vec4 color\n #pragma mapbox: initialize lowp float opacity\n\n gl_FragColor = color * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nattribute vec2 a_pos;\n\nuniform mat4 u_matrix;\n\n#pragma mapbox: define lowp vec4 color\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp vec4 color\n #pragma mapbox: initialize lowp float opacity\n\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n}\n"},circle:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\n#pragma mapbox: define lowp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n\nvarying vec2 v_extrude;\nvarying lowp float v_antialiasblur;\n\nvoid main() {\n #pragma mapbox: initialize lowp vec4 color\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n\n float t = smoothstep(1.0 - max(blur, v_antialiasblur), 1.0, length(v_extrude));\n gl_FragColor = color * (1.0 - t) * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform mat4 u_matrix;\nuniform bool u_scale_with_map;\nuniform vec2 u_extrude_scale;\nuniform float u_devicepixelratio;\n\nattribute vec2 a_pos;\n\n#pragma mapbox: define lowp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n\nvarying vec2 v_extrude;\nvarying lowp float v_antialiasblur;\n\nvoid main(void) {\n #pragma mapbox: initialize lowp vec4 color\n #pragma mapbox: initialize mediump float radius\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n\n // unencode the extrusion vector that we snuck into the a_pos vector\n v_extrude = vec2(mod(a_pos, 2.0) * 2.0 - 1.0);\n\n vec2 extrude = v_extrude * radius * u_extrude_scale;\n // multiply a_pos by 0.5, since we had it * 2 in order to sneak\n // in extrusion data\n gl_Position = u_matrix * vec4(floor(a_pos * 0.5), 0, 1);\n\n if (u_scale_with_map) {\n gl_Position.xy += extrude;\n } else {\n gl_Position.xy += extrude * gl_Position.w;\n }\n\n // This is a minimum blur distance that serves as a faux-antialiasing for\n // the circle. since blur is a ratio of the circle's size and the intent is\n // to keep the blur at roughly 1px, the two are inversely related.\n v_antialiasblur = 1.0 / u_devicepixelratio / radius;\n}\n"},line:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform lowp vec4 u_color;\nuniform lowp float u_opacity;\nuniform float u_blur;\n\nvarying vec2 v_linewidth;\nvarying vec2 v_normal;\nvarying float v_gamma_scale;\n\nvoid main() {\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * v_linewidth.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_linewidth.t) or when fading out\n // (v_linewidth.s)\n float blur = u_blur * v_gamma_scale;\n float alpha = clamp(min(dist - (v_linewidth.t - blur), v_linewidth.s - dist) / blur, 0.0, 1.0);\n\n gl_FragColor = u_color * (alpha * u_opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\n// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\nattribute vec2 a_pos;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform mediump float u_linewidth;\nuniform mediump float u_gapwidth;\nuniform mediump float u_antialiasing;\nuniform mediump float u_extra;\nuniform mat2 u_antialiasingmatrix;\nuniform mediump float u_offset;\nuniform mediump float u_blur;\n\nvarying vec2 v_normal;\nvarying vec2 v_linewidth;\nvarying float v_gamma_scale;\n\nvoid main() {\n vec2 a_extrude = a_data.xy - 128.0;\n float a_direction = mod(a_data.z, 4.0) - 1.0;\n\n // We store the texture normals in the most insignificant bit\n // transform y so that 0 => -1 and 1 => 1\n // In the texture normal, x is 0 if the normal points straight up/down and 1 if it's a round cap\n // y is 1 if the normal points up, and -1 if it points down\n mediump vec2 normal = mod(a_pos, 2.0);\n normal.y = sign(normal.y - 0.5);\n v_normal = normal;\n\n float inset = u_gapwidth + (u_gapwidth > 0.0 ? u_antialiasing : 0.0);\n float outset = u_gapwidth + u_linewidth * (u_gapwidth > 0.0 ? 2.0 : 1.0) + u_antialiasing;\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist = outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset = u_offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n // Remove the texture normal bit of the position before scaling it with the\n // model/view matrix.\n gl_Position = u_matrix * vec4(floor(a_pos * 0.5) + (offset + dist) / u_ratio, 0.0, 1.0);\n\n // position of y on the screen\n float y = gl_Position.y / gl_Position.w;\n\n // how much features are squished in the y direction by the tilt\n float squish_scale = length(a_extrude) / length(u_antialiasingmatrix * a_extrude);\n\n // how much features are squished in all directions by the perspectiveness\n float perspective_scale = 1.0 / (1.0 - min(y * u_extra, 0.9));\n\n v_linewidth = vec2(outset, inset);\n v_gamma_scale = perspective_scale * squish_scale;\n}\n"},linepattern:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform float u_blur;\n\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform float u_fade;\nuniform float u_opacity;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_normal;\nvarying vec2 v_linewidth;\nvarying float v_linesofar;\nvarying float v_gamma_scale;\n\nvoid main() {\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * v_linewidth.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_linewidth.t) or when fading out\n // (v_linewidth.s)\n float blur = u_blur * v_gamma_scale;\n float alpha = clamp(min(dist - (v_linewidth.t - blur), v_linewidth.s - dist) / blur, 0.0, 1.0);\n\n float x_a = mod(v_linesofar / u_pattern_size_a.x, 1.0);\n float x_b = mod(v_linesofar / u_pattern_size_b.x, 1.0);\n float y_a = 0.5 + (v_normal.y * v_linewidth.s / u_pattern_size_a.y);\n float y_b = 0.5 + (v_normal.y * v_linewidth.s / u_pattern_size_b.y);\n vec2 pos_a = mix(u_pattern_tl_a, u_pattern_br_a, vec2(x_a, y_a));\n vec2 pos_b = mix(u_pattern_tl_b, u_pattern_br_b, vec2(x_b, y_b));\n\n vec4 color = mix(texture2D(u_image, pos_a), texture2D(u_image, pos_b), u_fade);\n\n alpha *= u_opacity;\n\n gl_FragColor = color * alpha;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\n// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\n// We scale the distance before adding it to the buffers so that we can store\n// long distances for long segments. Use this value to unscale the distance.\n#define LINE_DISTANCE_SCALE 2.0\n\nattribute vec2 a_pos;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform mediump float u_linewidth;\nuniform mediump float u_gapwidth;\nuniform mediump float u_antialiasing;\nuniform mediump float u_extra;\nuniform mat2 u_antialiasingmatrix;\nuniform mediump float u_offset;\n\nvarying vec2 v_normal;\nvarying vec2 v_linewidth;\nvarying float v_linesofar;\nvarying float v_gamma_scale;\n\nvoid main() {\n vec2 a_extrude = a_data.xy - 128.0;\n float a_direction = mod(a_data.z, 4.0) - 1.0;\n float a_linesofar = (floor(a_data.z / 4.0) + a_data.w * 64.0) * LINE_DISTANCE_SCALE;\n\n // We store the texture normals in the most insignificant bit\n // transform y so that 0 => -1 and 1 => 1\n // In the texture normal, x is 0 if the normal points straight up/down and 1 if it's a round cap\n // y is 1 if the normal points up, and -1 if it points down\n mediump vec2 normal = mod(a_pos, 2.0);\n normal.y = sign(normal.y - 0.5);\n v_normal = normal;\n\n float inset = u_gapwidth + (u_gapwidth > 0.0 ? u_antialiasing : 0.0);\n float outset = u_gapwidth + u_linewidth * (u_gapwidth > 0.0 ? 2.0 : 1.0) + u_antialiasing;\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist = outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset = u_offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n // Remove the texture normal bit of the position before scaling it with the\n // model/view matrix.\n gl_Position = u_matrix * vec4(floor(a_pos * 0.5) + (offset + dist) / u_ratio, 0.0, 1.0);\n v_linesofar = a_linesofar;\n\n // position of y on the screen\n float y = gl_Position.y / gl_Position.w;\n\n // how much features are squished in the y direction by the tilt\n float squish_scale = length(a_extrude) / length(u_antialiasingmatrix * a_extrude);\n\n // how much features are squished in all directions by the perspectiveness\n float perspective_scale = 1.0 / (1.0 - min(y * u_extra, 0.9));\n\n v_linewidth = vec2(outset, inset);\n v_gamma_scale = perspective_scale * squish_scale;\n}\n"},linesdfpattern:{
30 fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform lowp vec4 u_color;\nuniform lowp float u_opacity;\n\nuniform float u_blur;\nuniform sampler2D u_image;\nuniform float u_sdfgamma;\nuniform float u_mix;\n\nvarying vec2 v_normal;\nvarying vec2 v_linewidth;\nvarying vec2 v_tex_a;\nvarying vec2 v_tex_b;\nvarying float v_gamma_scale;\n\nvoid main() {\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * v_linewidth.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_linewidth.t) or when fading out\n // (v_linewidth.s)\n float blur = u_blur * v_gamma_scale;\n float alpha = clamp(min(dist - (v_linewidth.t - blur), v_linewidth.s - dist) / blur, 0.0, 1.0);\n\n float sdfdist_a = texture2D(u_image, v_tex_a).a;\n float sdfdist_b = texture2D(u_image, v_tex_b).a;\n float sdfdist = mix(sdfdist_a, sdfdist_b, u_mix);\n alpha *= smoothstep(0.5 - u_sdfgamma, 0.5 + u_sdfgamma, sdfdist);\n\n gl_FragColor = u_color * (alpha * u_opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\n// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\n// We scale the distance before adding it to the buffers so that we can store\n// long distances for long segments. Use this value to unscale the distance.\n#define LINE_DISTANCE_SCALE 2.0\n\nattribute vec2 a_pos;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform mediump float u_linewidth;\nuniform mediump float u_gapwidth;\nuniform mediump float u_antialiasing;\nuniform vec2 u_patternscale_a;\nuniform float u_tex_y_a;\nuniform vec2 u_patternscale_b;\nuniform float u_tex_y_b;\nuniform float u_extra;\nuniform mat2 u_antialiasingmatrix;\nuniform mediump float u_offset;\n\nvarying vec2 v_normal;\nvarying vec2 v_linewidth;\nvarying vec2 v_tex_a;\nvarying vec2 v_tex_b;\nvarying float v_gamma_scale;\n\nvoid main() {\n vec2 a_extrude = a_data.xy - 128.0;\n float a_direction = mod(a_data.z, 4.0) - 1.0;\n float a_linesofar = (floor(a_data.z / 4.0) + a_data.w * 64.0) * LINE_DISTANCE_SCALE;\n\n // We store the texture normals in the most insignificant bit\n // transform y so that 0 => -1 and 1 => 1\n // In the texture normal, x is 0 if the normal points straight up/down and 1 if it's a round cap\n // y is 1 if the normal points up, and -1 if it points down\n mediump vec2 normal = mod(a_pos, 2.0);\n normal.y = sign(normal.y - 0.5);\n v_normal = normal;\n\n float inset = u_gapwidth + (u_gapwidth > 0.0 ? u_antialiasing : 0.0);\n float outset = u_gapwidth + u_linewidth * (u_gapwidth > 0.0 ? 2.0 : 1.0) + u_antialiasing;\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist = outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset = u_offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n // Remove the texture normal bit of the position before scaling it with the\n // model/view matrix.\n gl_Position = u_matrix * vec4(floor(a_pos * 0.5) + (offset + dist) / u_ratio, 0.0, 1.0);\n\n v_tex_a = vec2(a_linesofar * u_patternscale_a.x, normal.y * u_patternscale_a.y + u_tex_y_a);\n v_tex_b = vec2(a_linesofar * u_patternscale_b.x, normal.y * u_patternscale_b.y + u_tex_y_b);\n\n // position of y on the screen\n float y = gl_Position.y / gl_Position.w;\n\n // how much features are squished in the y direction by the tilt\n float squish_scale = length(a_extrude) / length(u_antialiasingmatrix * a_extrude);\n\n // how much features are squished in all directions by the perspectiveness\n float perspective_scale = 1.0 / (1.0 - min(y * u_extra, 0.9));\n\n v_linewidth = vec2(outset, inset);\n v_gamma_scale = perspective_scale * squish_scale;\n}\n"},outline:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\n#pragma mapbox: define lowp vec4 outline_color\n#pragma mapbox: define lowp float opacity\n\nvarying vec2 v_pos;\n\nvoid main() {\n #pragma mapbox: initialize lowp vec4 outline_color\n #pragma mapbox: initialize lowp float opacity\n\n float dist = length(v_pos - gl_FragCoord.xy);\n float alpha = smoothstep(1.0, 0.0, dist);\n gl_FragColor = outline_color * (alpha * opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nattribute vec2 a_pos;\n\nuniform mat4 u_matrix;\nuniform vec2 u_world;\n\nvarying vec2 v_pos;\n\n#pragma mapbox: define lowp vec4 outline_color\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp vec4 outline_color\n #pragma mapbox: initialize lowp float opacity\n\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n v_pos = (gl_Position.xy / gl_Position.w + 1.0) / 2.0 * u_world;\n}\n"},outlinepattern:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform float u_opacity;\nuniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform float u_mix;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec2 v_pos;\n\nvoid main() {\n vec2 imagecoord = mod(v_pos_a, 1.0);\n vec2 pos = mix(u_pattern_tl_a, u_pattern_br_a, imagecoord);\n vec4 color1 = texture2D(u_image, pos);\n\n vec2 imagecoord_b = mod(v_pos_b, 1.0);\n vec2 pos2 = mix(u_pattern_tl_b, u_pattern_br_b, imagecoord_b);\n vec4 color2 = texture2D(u_image, pos2);\n\n // find distance to outline for alpha interpolation\n\n float dist = length(v_pos - gl_FragCoord.xy);\n float alpha = smoothstep(1.0, 0.0, dist);\n \n\n gl_FragColor = mix(color1, color2, u_mix) * alpha * u_opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pixel_coord_upper;\nuniform vec2 u_pixel_coord_lower;\nuniform float u_scale_a;\nuniform float u_scale_b;\nuniform float u_tile_units_to_pixels;\n\nattribute vec2 a_pos;\n\nuniform mat4 u_matrix;\nuniform vec2 u_world;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec2 v_pos;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n vec2 scaled_size_a = u_scale_a * u_pattern_size_a;\n vec2 scaled_size_b = u_scale_b * u_pattern_size_b;\n\n // the correct offset needs to be calculated.\n //\n // The offset depends on how many pixels are between the world origin and\n // the edge of the tile:\n // vec2 offset = mod(pixel_coord, size)\n //\n // At high zoom levels there are a ton of pixels between the world origin\n // and the edge of the tile. The glsl spec only guarantees 16 bits of\n // precision for highp floats. We need more than that.\n //\n // The pixel_coord is passed in as two 16 bit values:\n // pixel_coord_upper = floor(pixel_coord / 2^16)\n // pixel_coord_lower = mod(pixel_coord, 2^16)\n //\n // The offset is calculated in a series of steps that should preserve this precision:\n vec2 offset_a = mod(mod(mod(u_pixel_coord_upper, scaled_size_a) * 256.0, scaled_size_a) * 256.0 + u_pixel_coord_lower, scaled_size_a);\n vec2 offset_b = mod(mod(mod(u_pixel_coord_upper, scaled_size_b) * 256.0, scaled_size_b) * 256.0 + u_pixel_coord_lower, scaled_size_b);\n\n v_pos_a = (u_tile_units_to_pixels * a_pos + offset_a) / scaled_size_a;\n v_pos_b = (u_tile_units_to_pixels * a_pos + offset_b) / scaled_size_b;\n\n v_pos = (gl_Position.xy / gl_Position.w + 1.0) / 2.0 * u_world;\n}\n"},pattern:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform float u_opacity;\nuniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform float u_mix;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\n\nvoid main() {\n\n vec2 imagecoord = mod(v_pos_a, 1.0);\n vec2 pos = mix(u_pattern_tl_a, u_pattern_br_a, imagecoord);\n vec4 color1 = texture2D(u_image, pos);\n\n vec2 imagecoord_b = mod(v_pos_b, 1.0);\n vec2 pos2 = mix(u_pattern_tl_b, u_pattern_br_b, imagecoord_b);\n vec4 color2 = texture2D(u_image, pos2);\n\n gl_FragColor = mix(color1, color2, u_mix) * u_opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform mat4 u_matrix;\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pixel_coord_upper;\nuniform vec2 u_pixel_coord_lower;\nuniform float u_scale_a;\nuniform float u_scale_b;\nuniform float u_tile_units_to_pixels;\n\nattribute vec2 a_pos;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n vec2 scaled_size_a = u_scale_a * u_pattern_size_a;\n vec2 scaled_size_b = u_scale_b * u_pattern_size_b;\n\n // the correct offset needs to be calculated.\n //\n // The offset depends on how many pixels are between the world origin and\n // the edge of the tile:\n // vec2 offset = mod(pixel_coord, size)\n //\n // At high zoom levels there are a ton of pixels between the world origin\n // and the edge of the tile. The glsl spec only guarantees 16 bits of\n // precision for highp floats. We need more than that.\n //\n // The pixel_coord is passed in as two 16 bit values:\n // pixel_coord_upper = floor(pixel_coord / 2^16)\n // pixel_coord_lower = mod(pixel_coord, 2^16)\n //\n // The offset is calculated in a series of steps that should preserve this precision:\n vec2 offset_a = mod(mod(mod(u_pixel_coord_upper, scaled_size_a) * 256.0, scaled_size_a) * 256.0 + u_pixel_coord_lower, scaled_size_a);\n vec2 offset_b = mod(mod(mod(u_pixel_coord_upper, scaled_size_b) * 256.0, scaled_size_b) * 256.0 + u_pixel_coord_lower, scaled_size_b);\n\n v_pos_a = (u_tile_units_to_pixels * a_pos + offset_a) / scaled_size_a;\n v_pos_b = (u_tile_units_to_pixels * a_pos + offset_b) / scaled_size_b;\n}\n"},raster:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform float u_opacity0;\nuniform float u_opacity1;\nuniform sampler2D u_image0;\nuniform sampler2D u_image1;\nvarying vec2 v_pos0;\nvarying vec2 v_pos1;\n\nuniform float u_brightness_low;\nuniform float u_brightness_high;\n\nuniform float u_saturation_factor;\nuniform float u_contrast_factor;\nuniform vec3 u_spin_weights;\n\nvoid main() {\n\n // read and cross-fade colors from the main and parent tiles\n vec4 color0 = texture2D(u_image0, v_pos0);\n vec4 color1 = texture2D(u_image1, v_pos1);\n vec4 color = color0 * u_opacity0 + color1 * u_opacity1;\n vec3 rgb = color.rgb;\n\n // spin\n rgb = vec3(\n dot(rgb, u_spin_weights.xyz),\n dot(rgb, u_spin_weights.zxy),\n dot(rgb, u_spin_weights.yzx));\n\n // saturation\n float average = (color.r + color.g + color.b) / 3.0;\n rgb += (average - rgb) * u_saturation_factor;\n\n // contrast\n rgb = (rgb - 0.5) * u_contrast_factor + 0.5;\n\n // brightness\n vec3 u_high_vec = vec3(u_brightness_low, u_brightness_low, u_brightness_low);\n vec3 u_low_vec = vec3(u_brightness_high, u_brightness_high, u_brightness_high);\n\n gl_FragColor = vec4(mix(u_high_vec, u_low_vec, rgb), color.a);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform mat4 u_matrix;\nuniform vec2 u_tl_parent;\nuniform float u_scale_parent;\nuniform float u_buffer_scale;\n\nattribute vec2 a_pos;\nattribute vec2 a_texture_pos;\n\nvarying vec2 v_pos0;\nvarying vec2 v_pos1;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n v_pos0 = (((a_texture_pos / 32767.0) - 0.5) / u_buffer_scale ) + 0.5;\n v_pos1 = (v_pos0 * u_scale_parent) + u_tl_parent;\n}\n"},icon:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform sampler2D u_texture;\nuniform sampler2D u_fadetexture;\nuniform lowp float u_opacity;\n\nvarying vec2 v_tex;\nvarying vec2 v_fade_tex;\n\nvoid main() {\n lowp float alpha = texture2D(u_fadetexture, v_fade_tex).a * u_opacity;\n gl_FragColor = texture2D(u_texture, v_tex) * alpha;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nattribute vec2 a_pos;\nattribute vec2 a_offset;\nattribute vec2 a_texture_pos;\nattribute vec4 a_data;\n\n\n// matrix is for the vertex position.\nuniform mat4 u_matrix;\n\nuniform mediump float u_zoom;\nuniform bool u_rotate_with_map;\nuniform vec2 u_extrude_scale;\n\nuniform vec2 u_texsize;\n\nvarying vec2 v_tex;\nvarying vec2 v_fade_tex;\n\nvoid main() {\n vec2 a_tex = a_texture_pos.xy;\n mediump float a_labelminzoom = a_data[0];\n mediump vec2 a_zoom = a_data.pq;\n mediump float a_minzoom = a_zoom[0];\n mediump float a_maxzoom = a_zoom[1];\n\n // u_zoom is the current zoom level adjusted for the change in font size\n mediump float z = 2.0 - step(a_minzoom, u_zoom) - (1.0 - step(a_maxzoom, u_zoom));\n\n vec2 extrude = u_extrude_scale * (a_offset / 64.0);\n if (u_rotate_with_map) {\n gl_Position = u_matrix * vec4(a_pos + extrude, 0, 1);\n gl_Position.z += z * gl_Position.w;\n } else {\n gl_Position = u_matrix * vec4(a_pos, 0, 1) + vec4(extrude, 0, 0);\n }\n\n v_tex = a_tex / u_texsize;\n v_fade_tex = vec2(a_labelminzoom / 255.0, 0.0);\n}\n"},sdf:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform sampler2D u_texture;\nuniform sampler2D u_fadetexture;\nuniform lowp vec4 u_color;\nuniform lowp float u_opacity;\nuniform lowp float u_buffer;\nuniform lowp float u_gamma;\n\nvarying vec2 v_tex;\nvarying vec2 v_fade_tex;\nvarying float v_gamma_scale;\n\nvoid main() {\n lowp float dist = texture2D(u_texture, v_tex).a;\n lowp float fade_alpha = texture2D(u_fadetexture, v_fade_tex).a;\n lowp float gamma = u_gamma * v_gamma_scale;\n lowp float alpha = smoothstep(u_buffer - gamma, u_buffer + gamma, dist) * fade_alpha;\n\n gl_FragColor = u_color * (alpha * u_opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nconst float PI = 3.141592653589793;\n\nattribute vec2 a_pos;\nattribute vec2 a_offset;\nattribute vec2 a_texture_pos;\nattribute vec4 a_data;\n\n\n// matrix is for the vertex position.\nuniform mat4 u_matrix;\n\nuniform mediump float u_zoom;\nuniform bool u_rotate_with_map;\nuniform bool u_pitch_with_map;\nuniform mediump float u_pitch;\nuniform mediump float u_bearing;\nuniform mediump float u_aspect_ratio;\nuniform vec2 u_extrude_scale;\n\nuniform vec2 u_texsize;\n\nvarying vec2 v_tex;\nvarying vec2 v_fade_tex;\nvarying float v_gamma_scale;\n\nvoid main() {\n vec2 a_tex = a_texture_pos.xy;\n mediump float a_labelminzoom = a_data[0];\n mediump vec2 a_zoom = a_data.pq;\n mediump float a_minzoom = a_zoom[0];\n mediump float a_maxzoom = a_zoom[1];\n\n // u_zoom is the current zoom level adjusted for the change in font size\n mediump float z = 2.0 - step(a_minzoom, u_zoom) - (1.0 - step(a_maxzoom, u_zoom));\n\n // pitch-alignment: map\n // rotation-alignment: map | viewport\n if (u_pitch_with_map) {\n lowp float angle = u_rotate_with_map ? (a_data[1] / 256.0 * 2.0 * PI) : u_bearing;\n lowp float asin = sin(angle);\n lowp float acos = cos(angle);\n mat2 RotationMatrix = mat2(acos, asin, -1.0 * asin, acos);\n vec2 offset = RotationMatrix * a_offset;\n vec2 extrude = u_extrude_scale * (offset / 64.0);\n gl_Position = u_matrix * vec4(a_pos + extrude, 0, 1);\n gl_Position.z += z * gl_Position.w;\n // pitch-alignment: viewport\n // rotation-alignment: map\n } else if (u_rotate_with_map) {\n // foreshortening factor to apply on pitched maps\n // as a label goes from horizontal <=> vertical in angle\n // it goes from 0% foreshortening to up to around 70% foreshortening\n lowp float pitchfactor = 1.0 - cos(u_pitch * sin(u_pitch * 0.75));\n\n lowp float lineangle = a_data[1] / 256.0 * 2.0 * PI;\n\n // use the lineangle to position points a,b along the line\n // project the points and calculate the label angle in projected space\n // this calculation allows labels to be rendered unskewed on pitched maps\n vec4 a = u_matrix * vec4(a_pos, 0, 1);\n vec4 b = u_matrix * vec4(a_pos + vec2(cos(lineangle),sin(lineangle)), 0, 1);\n lowp float angle = atan((b[1]/b[3] - a[1]/a[3])/u_aspect_ratio, b[0]/b[3] - a[0]/a[3]);\n lowp float asin = sin(angle);\n lowp float acos = cos(angle);\n mat2 RotationMatrix = mat2(acos, -1.0 * asin, asin, acos);\n\n vec2 offset = RotationMatrix * (vec2((1.0-pitchfactor)+(pitchfactor*cos(angle*2.0)), 1.0) * a_offset);\n vec2 extrude = u_extrude_scale * (offset / 64.0);\n gl_Position = u_matrix * vec4(a_pos, 0, 1) + vec4(extrude, 0, 0);\n gl_Position.z += z * gl_Position.w;\n // pitch-alignment: viewport\n // rotation-alignment: viewport\n } else {\n vec2 extrude = u_extrude_scale * (a_offset / 64.0);\n gl_Position = u_matrix * vec4(a_pos, 0, 1) + vec4(extrude, 0, 0);\n }\n\n v_gamma_scale = (gl_Position.w - 0.5);\n\n v_tex = a_tex / u_texsize;\n v_fade_tex = vec2(a_labelminzoom / 255.0, 0.0);\n}\n"},collisionbox:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform float u_zoom;\nuniform float u_maxzoom;\n\nvarying float v_max_zoom;\nvarying float v_placement_zoom;\n\nvoid main() {\n\n float alpha = 0.5;\n\n gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0) * alpha;\n\n if (v_placement_zoom > u_zoom) {\n gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0) * alpha;\n }\n\n if (u_zoom >= v_max_zoom) {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0) * alpha * 0.25;\n }\n\n if (v_placement_zoom >= u_maxzoom) {\n gl_FragColor = vec4(0.0, 0.0, 1.0, 1.0) * alpha * 0.2;\n }\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nattribute vec2 a_pos;\nattribute vec2 a_extrude;\nattribute vec2 a_data;\n\nuniform mat4 u_matrix;\nuniform float u_scale;\n\nvarying float v_max_zoom;\nvarying float v_placement_zoom;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos + a_extrude / u_scale, 0.0, 1.0);\n\n v_max_zoom = a_data.x;\n v_placement_zoom = a_data.y;\n}\n"}},e.exports.util="float evaluate_zoom_function_1(const vec4 values, const float t) {\n if (t < 1.0) {\n return mix(values[0], values[1], t);\n } else if (t < 2.0) {\n return mix(values[1], values[2], t - 1.0);\n } else {\n return mix(values[2], values[3], t - 2.0);\n }\n}\nvec4 evaluate_zoom_function_4(const vec4 value0, const vec4 value1, const vec4 value2, const vec4 value3, const float t) {\n if (t < 1.0) {\n return mix(value0, value1, t);\n } else if (t < 2.0) {\n return mix(value1, value2, t - 1.0);\n } else {\n return mix(value2, value3, t - 2.0);\n }\n}\n"},{path:468}],297:[function(t,e,r){"use strict";function n(t,e){this.message=(t?t+": ":"")+i.apply(i,Array.prototype.slice.call(arguments,2)),null!==e&&void 0!==e&&e.__line__&&(this.line=e.__line__)}var i=t("util").format;e.exports=n},{util:541}],298:[function(t,e,r){"use strict";e.exports=function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)t[n]=r[n]}return t}},{}],299:[function(t,e,r){"use strict";e.exports=function(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}},{}],300:[function(t,e,r){"use strict";e.exports=function(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}},{}],301:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/get_type"),a=t("../util/extend");e.exports=function(e){var r=t("./validate_function"),o=t("./validate_object"),s={"*":function(){return[]},array:t("./validate_array"),boolean:t("./validate_boolean"),number:t("./validate_number"),color:t("./validate_color"),constants:t("./validate_constants"),enum:t("./validate_enum"),filter:t("./validate_filter"),function:t("./validate_function"),layer:t("./validate_layer"),object:t("./validate_object"),source:t("./validate_source"),string:t("./validate_string")},l=e.value,u=e.valueSpec,c=e.key,h=e.styleSpec,f=e.style;if("string"===i(l)&&"@"===l[0]){if(h.$version>7)return[new n(c,l,"constants have been deprecated as of v8")];if(!(l in f.constants))return[new n(c,l,'constant "%s" not found',l)];e=a({},e,{value:f.constants[l]})}return u.function&&"object"===i(l)?r(e):u.type&&s[u.type]?s[u.type](e):o(a({},e,{valueSpec:u.type?h[u.type]:u}))}},{"../error/validation_error":297,"../util/extend":298,"../util/get_type":299,"./validate_array":302,"./validate_boolean":303,"./validate_color":304,"./validate_constants":305,"./validate_enum":306,"./validate_filter":307,"./validate_function":308,"./validate_layer":310,"./validate_number":312,"./validate_object":313,"./validate_source":315,"./validate_string":316}],302:[function(t,e,r){"use strict";var n=t("../util/get_type"),i=t("./validate"),a=t("../error/validation_error");e.exports=function(t){var e=t.value,r=t.valueSpec,o=t.style,s=t.styleSpec,l=t.key,u=t.arrayElementValidator||i;if("array"!==n(e))return[new a(l,e,"array expected, %s found",n(e))];if(r.length&&e.length!==r.length)return[new a(l,e,"array length %d expected, length %d found",r.length,e.length)];if(r["min-length"]&&e.length<r["min-length"])return[new a(l,e,"array length at least %d expected, length %d found",r["min-length"],e.length)];var c={type:r.value};s.$version<7&&(c.function=r.function),"object"===n(r.value)&&(c=r.value);for(var h=[],f=0;f<e.length;f++)h=h.concat(u({array:e,arrayIndex:f,value:e[f],valueSpec:c,style:o,styleSpec:s,key:l+"["+f+"]"}));return h}},{"../error/validation_error":297,"../util/get_type":299,"./validate":301}],303:[function(t,e,r){"use strict";var n=t("../util/get_type"),i=t("../error/validation_error");e.exports=function(t){var e=t.value,r=t.key,a=n(e);return"boolean"!==a?[new i(r,e,"boolean expected, %s found",a)]:[]}},{"../error/validation_error":297,"../util/get_type":299}],304:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/get_type"),a=t("csscolorparser").parseCSSColor;e.exports=function(t){var e=t.key,r=t.value,o=i(r);return"string"!==o?[new n(e,r,"color expected, %s found",o)]:null===a(r)?[new n(e,r,'color expected, "%s" found',r)]:[]}},{"../error/validation_error":297,"../util/get_type":299,csscolorparser:104}],305:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/get_type");e.exports=function(t){var e=t.key,r=t.value;if(t.styleSpec.$version>7)return r?[new n(e,r,"constants have been deprecated as of v8")]:[];var a=i(r);if("object"!==a)return[new n(e,r,"object expected, %s found",a)];var o=[];for(var s in r)"@"!==s[0]&&o.push(new n(e+"."+s,r[s],'constants must start with "@"'));return o}},{"../error/validation_error":297,"../util/get_type":299}],306:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/unbundle_jsonlint");e.exports=function(t){var e=t.key,r=t.value,a=t.valueSpec,o=[];return a.values.indexOf(i(r))===-1&&o.push(new n(e,r,"expected one of [%s], %s found",a.values.join(", "),r)),o}},{"../error/validation_error":297,"../util/unbundle_jsonlint":300}],307:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("./validate_enum"),a=t("../util/get_type"),o=t("../util/unbundle_jsonlint");e.exports=function t(e){var r,s=e.value,l=e.key,u=e.styleSpec,c=[];if("array"!==a(s))return[new n(l,s,"array expected, %s found",a(s))];if(s.length<1)return[new n(l,s,"filter array must have at least 1 element")];switch(c=c.concat(i({key:l+"[0]",value:s[0],valueSpec:u.filter_operator,style:e.style,styleSpec:e.styleSpec})),o(s[0])){case"<":case"<=":case">":case">=":s.length>=2&&"$type"==s[1]&&c.push(new n(l,s,'"$type" cannot be use with operator "%s"',s[0]));case"==":case"!=":3!=s.length&&c.push(new n(l,s,'filter array for operator "%s" must have 3 elements',s[0]));case"in":case"!in":s.length>=2&&(r=a(s[1]),"string"!==r?c.push(new n(l+"[1]",s[1],"string expected, %s found",r)):"@"===s[1][0]&&c.push(new n(l+"[1]",s[1],"filter key cannot be a constant")));for(var h=2;h<s.length;h++)r=a(s[h]),"$type"==s[1]?c=c.concat(i({key:l+"["+h+"]",value:s[h],valueSpec:u.geometry_type,style:e.style,styleSpec:e.styleSpec})):"string"===r&&"@"===s[h][0]?c.push(new n(l+"["+h+"]",s[h],"filter value cannot be a constant")):"string"!==r&&"number"!==r&&"boolean"!==r&&c.push(new n(l+"["+h+"]",s[h],"string, number, or boolean expected, %s found",r));break;case"any":case"all":case"none":for(h=1;h<s.length;h++)c=c.concat(t({key:l+"["+h+"]",value:s[h],style:e.style,styleSpec:e.styleSpec}));break;case"has":case"!has":r=a(s[1]),2!==s.length?c.push(new n(l,s,'filter array for "%s" operator must have 2 elements',s[0])):"string"!==r?c.push(new n(l+"[1]",s[1],"string expected, %s found",r)):"@"===s[1][0]&&c.push(new n(l+"[1]",s[1],"filter key cannot be a constant"))}return c}},{"../error/validation_error":297,"../util/get_type":299,"../util/unbundle_jsonlint":300,"./validate_enum":306}],308:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/get_type"),a=t("./validate"),o=t("./validate_object"),s=t("./validate_array"),l=t("./validate_number");e.exports=function(t){function e(t){var e=[],a=t.value;return e=e.concat(s({key:t.key,value:a,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:r})),"array"===i(a)&&0===a.length&&e.push(new n(t.key,a,"array must have at least one stop")),e}function r(t){var e=[],r=t.value,s=t.key;if("array"!==i(r))return[new n(s,r,"array expected, %s found",i(r))];if(2!==r.length)return[new n(s,r,"array length %d expected, length %d found",2,r.length)];var f=i(r[0]);if(c||(c=f),f!==c)return[new n(s,r,"%s stop key type must match previous stop key type %s",f,c)];if("object"===f){if(void 0===r[0].zoom)return[new n(s,r,"object stop key must have zoom")];if(void 0===r[0].value)return[new n(s,r,"object stop key must have value")];e=e.concat(o({key:s+"[0]",value:r[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:l,value:u}}))}else e=e.concat((d?l:u)({key:s+"[0]",value:r[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec}));return e=e.concat(a({key:s+"[1]",value:r[1],valueSpec:h,style:t.style,styleSpec:t.styleSpec})),"number"===i(r[0])&&("piecewise-constant"===h.function&&r[0]%1!=0&&e.push(new n(s+"[0]",r[0],"zoom level for piecewise-constant functions must be an integer")),0!==t.arrayIndex&&r[0]<t.array[t.arrayIndex-1][0]&&e.push(new n(s+"[0]",r[0],"array stops must appear in ascending order"))),e}function u(t){var e=[],r=i(t.value);return"number"!==r&&"string"!==r&&"array"!==r&&e.push(new n(t.key,t.value,"property value must be a number, string or array")),e}var c,h=t.valueSpec,f=void 0!==t.value.property||"object"===c,d=void 0===t.value.property||"object"===c,p=o({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:e}});return t.styleSpec.$version>=8&&(f&&!t.valueSpec["property-function"]?p.push(new n(t.key,t.value,"property functions not supported")):d&&!t.valueSpec["zoom-function"]&&p.push(new n(t.key,t.value,"zoom functions not supported"))),p}},{"../error/validation_error":297,"../util/get_type":299,"./validate":301,"./validate_array":302,"./validate_number":312,"./validate_object":313}],309:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("./validate_string");e.exports=function(t){var e=t.value,r=t.key,a=i(t);return a.length?a:(e.indexOf("{fontstack}")===-1&&a.push(new n(r,e,'"glyphs" url must include a "{fontstack}" token')),e.indexOf("{range}")===-1&&a.push(new n(r,e,'"glyphs" url must include a "{range}" token')),a)}},{"../error/validation_error":297,"./validate_string":316}],310:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/unbundle_jsonlint"),a=t("./validate_object"),o=t("./validate_filter"),s=t("./validate_paint_property"),l=t("./validate_layout_property"),u=t("../util/extend");e.exports=function(t){var e=[],r=t.value,c=t.key,h=t.style,f=t.styleSpec;r.type||r.ref||e.push(new n(c,r,'either "type" or "ref" is required'));var d=i(r.type),p=i(r.ref);if(r.id)for(var m=0;m<t.arrayIndex;m++){var v=h.layers[m];i(v.id)===i(r.id)&&e.push(new n(c,r.id,'duplicate layer id "%s", previously used at line %d',r.id,v.id.__line__))}if("ref"in r){["type","source","source-layer","filter","layout"].forEach(function(t){t in r&&e.push(new n(c,r[t],'"%s" is prohibited for ref layers',t))});var g;h.layers.forEach(function(t){t.id==p&&(g=t)}),g?g.ref?e.push(new n(c,r.ref,"ref cannot reference another ref layer")):d=i(g.type):e.push(new n(c,r.ref,'ref layer "%s" not found',p))}else if("background"!==d)if(r.source){var y=h.sources&&h.sources[r.source];y?"vector"==y.type&&"raster"==d?e.push(new n(c,r.source,'layer "%s" requires a raster source',r.id)):"raster"==y.type&&"raster"!=d?e.push(new n(c,r.source,'layer "%s" requires a vector source',r.id)):"vector"!=y.type||r["source-layer"]||e.push(new n(c,r,'layer "%s" must specify a "source-layer"',r.id)):e.push(new n(c,r.source,'source "%s" not found',r.source))}else e.push(new n(c,r,'missing required property "source"'));return e=e.concat(a({key:c,value:r,valueSpec:f.layer,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{filter:o,layout:function(t){return a({layer:r,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return l(u({layerType:d},t))}}})},paint:function(t){return a({layer:r,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return s(u({layerType:d},t))}}})}}}))}},{"../error/validation_error":297,"../util/extend":298,"../util/unbundle_jsonlint":300,"./validate_filter":307,
31 "./validate_layout_property":311,"./validate_object":313,"./validate_paint_property":314}],311:[function(t,e,r){"use strict";var n=t("./validate"),i=t("../error/validation_error");e.exports=function(t){var e=t.key,r=t.style,a=t.styleSpec,o=t.value,s=t.objectKey,l=a["layout_"+t.layerType];if(t.valueSpec||l[s]){var u=[];return"symbol"===t.layerType&&("icon-image"===s&&r&&!r.sprite?u.push(new i(e,o,'use of "icon-image" requires a style "sprite" property')):"text-field"===s&&r&&!r.glyphs&&u.push(new i(e,o,'use of "text-field" requires a style "glyphs" property'))),u.concat(n({key:t.key,value:o,valueSpec:t.valueSpec||l[s],style:r,styleSpec:a}))}return[new i(e,o,'unknown property "%s"',s)]}},{"../error/validation_error":297,"./validate":301}],312:[function(t,e,r){"use strict";var n=t("../util/get_type"),i=t("../error/validation_error");e.exports=function(t){var e=t.key,r=t.value,a=t.valueSpec,o=n(r);return"number"!==o?[new i(e,r,"number expected, %s found",o)]:"minimum"in a&&r<a.minimum?[new i(e,r,"%s is less than the minimum value %s",r,a.minimum)]:"maximum"in a&&r>a.maximum?[new i(e,r,"%s is greater than the maximum value %s",r,a.maximum)]:[]}},{"../error/validation_error":297,"../util/get_type":299}],313:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/get_type"),a=t("./validate");e.exports=function(t){var e=t.key,r=t.value,o=t.valueSpec,s=t.objectElementValidators||{},l=t.style,u=t.styleSpec,c=[],h=i(r);if("object"!==h)return[new n(e,r,"object expected, %s found",h)];for(var f in r){var d=f.split(".")[0],p=o&&(o[d]||o["*"]),m=s[d]||s["*"];p||m?c=c.concat((m||a)({key:(e?e+".":e)+f,value:r[f],valueSpec:p,style:l,styleSpec:u,object:r,objectKey:f})):""!==e&&1!==e.split(".").length&&c.push(new n(e,r[f],'unknown property "%s"',f))}for(d in o)o[d].required&&void 0===o[d].default&&void 0===r[d]&&c.push(new n(e,r,'missing required property "%s"',d));return c}},{"../error/validation_error":297,"../util/get_type":299,"./validate":301}],314:[function(t,e,r){"use strict";var n=t("./validate"),i=t("../error/validation_error");e.exports=function(t){var e=t.key,r=t.style,a=t.styleSpec,o=t.value,s=t.objectKey,l=a["paint_"+t.layerType],u=s.match(/^(.*)-transition$/);return u&&l[u[1]]&&l[u[1]].transition?n({key:e,value:o,valueSpec:a.transition,style:r,styleSpec:a}):t.valueSpec||l[s]?n({key:t.key,value:o,valueSpec:t.valueSpec||l[s],style:r,styleSpec:a}):[new i(e,o,'unknown property "%s"',s)]}},{"../error/validation_error":297,"./validate":301}],315:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/unbundle_jsonlint"),a=t("./validate_object"),o=t("./validate_enum");e.exports=function(t){var e=t.value,r=t.key,s=t.styleSpec,l=t.style;if(!e.type)return[new n(r,e,'"type" is required')];switch(i(e.type)){case"vector":case"raster":var u=[];if(u=u.concat(a({key:r,value:e,valueSpec:s.source_tile,style:t.style,styleSpec:s})),"url"in e)for(var c in e)["type","url","tileSize"].indexOf(c)<0&&u.push(new n(r+"."+c,e[c],'a source with a "url" property may not include a "%s" property',c));return u;case"geojson":return a({key:r,value:e,valueSpec:s.source_geojson,style:l,styleSpec:s});case"video":return a({key:r,value:e,valueSpec:s.source_video,style:l,styleSpec:s});case"image":return a({key:r,value:e,valueSpec:s.source_image,style:l,styleSpec:s});default:return o({key:r+".type",value:e.type,valueSpec:{values:["vector","raster","geojson","video","image"]},style:l,styleSpec:s})}}},{"../error/validation_error":297,"../util/unbundle_jsonlint":300,"./validate_enum":306,"./validate_object":313}],316:[function(t,e,r){"use strict";var n=t("../util/get_type"),i=t("../error/validation_error");e.exports=function(t){var e=t.value,r=t.key,a=n(e);return"string"!==a?[new i(r,e,"string expected, %s found",a)]:[]}},{"../error/validation_error":297,"../util/get_type":299}],317:[function(t,e,r){"use strict";function n(t,e){e=e||l;var r=[];return r=r.concat(s({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,objectElementValidators:{glyphs:u}})),e.$version>7&&t.constants&&(r=r.concat(o({key:"constants",value:t.constants,style:t,styleSpec:e}))),i(r)}function i(t){return[].concat(t).sort(function(t,e){return t.line-e.line})}function a(t){return function(){return i(t.apply(this,arguments))}}var o=t("./validate/validate_constants"),s=t("./validate/validate"),l=t("../reference/latest.min"),u=t("./validate/validate_glyphs_url");n.source=a(t("./validate/validate_source")),n.layer=a(t("./validate/validate_layer")),n.filter=a(t("./validate/validate_filter")),n.paintProperty=a(t("./validate/validate_paint_property")),n.layoutProperty=a(t("./validate/validate_layout_property")),e.exports=n},{"../reference/latest.min":318,"./validate/validate":301,"./validate/validate_constants":305,"./validate/validate_filter":307,"./validate/validate_glyphs_url":309,"./validate/validate_layer":310,"./validate/validate_layout_property":311,"./validate/validate_paint_property":314,"./validate/validate_source":315}],318:[function(t,e,r){e.exports=t("./v8.min.json")},{"./v8.min.json":319}],319:[function(t,e,r){e.exports={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_tile","source_geojson","source_video","source_image"],source_tile:{type:{required:!0,type:"enum",values:["vector","raster"]},url:{type:"string"},tiles:{type:"array",value:"string"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:["geojson"]},data:{type:"*"},maxzoom:{type:"number",default:14},buffer:{type:"number",default:64},tolerance:{type:"number",default:3},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:400},clusterMaxZoom:{type:"number"}},source_video:{type:{required:!0,type:"enum",values:["video"]},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:["image"]},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:["fill","line","symbol","circle","raster","background"]},metadata:{type:"*"},ref:{type:"string"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:22},maxzoom:{type:"number",minimum:0,maximum:22},interactive:{type:"boolean",default:!1},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"},"paint.*":{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_symbol","layout_raster","layout_background"],layout_background:{visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:["visible","none"],default:"visible"}},layout_fill:{visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:["visible","none"],default:"visible"}},layout_circle:{visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:["visible","none"],default:"visible"}},layout_line:{"line-cap":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["butt","round","square"],default:"butt"},"line-join":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["bevel","round","miter"],default:"miter"},"line-miter-limit":{type:"number",default:2,function:"interpolated","zoom-function":!0,"property-function":!0,requires:[{"line-join":"miter"}]},"line-round-limit":{type:"number",default:1.05,function:"interpolated","zoom-function":!0,"property-function":!0,requires:[{"line-join":"round"}]},visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:["visible","none"],default:"visible"}},layout_symbol:{"symbol-placement":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["point","line"],default:"point"},"symbol-spacing":{type:"number",default:250,minimum:1,function:"interpolated","zoom-function":!0,"property-function":!0,units:"pixels",requires:[{"symbol-placement":"line"}]},"symbol-avoid-edges":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1},"icon-allow-overlap":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["icon-image"]},"icon-ignore-placement":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["icon-image"]},"icon-optional":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["icon-image","text-field"]},"icon-rotation-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"viewport",requires:["icon-image"]},"icon-size":{type:"number",default:1,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,requires:["icon-image"]},"icon-text-fit":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!1,values:["none","both","width","height"],default:"none",requires:["icon-image","text-field"]},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["icon-image","icon-text-fit","text-field"]},"icon-image":{type:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,tokens:!0},"icon-rotate":{type:"number",default:0,period:360,function:"interpolated","zoom-function":!0,"property-function":!0,units:"degrees",requires:["icon-image"]},"icon-padding":{type:"number",default:2,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,units:"pixels",requires:["icon-image"]},"icon-keep-upright":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":"line"}]},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,requires:["icon-image"]},"text-pitch-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],requires:["text-field"]},"text-rotation-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"viewport",requires:["text-field"]},"text-field":{type:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:"",tokens:!0},"text-font":{type:"array",value:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"]},"text-size":{type:"number",default:16,minimum:0,units:"pixels",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-max-width":{type:"number",default:10,minimum:0,units:"em",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-line-height":{type:"number",default:1.2,units:"em",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-letter-spacing":{type:"number",default:0,units:"em",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-justify":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["left","center","right"],default:"center",requires:["text-field"]},"text-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"],default:"center",requires:["text-field"]},"text-max-angle":{type:"number",default:45,units:"degrees",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field",{"symbol-placement":"line"}]},"text-rotate":{type:"number",default:0,period:360,units:"degrees",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-keep-upright":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":"line"}]},"text-transform":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["none","uppercase","lowercase"],default:"none",requires:["text-field"]},"text-offset":{type:"array",value:"number",units:"ems",function:"interpolated","zoom-function":!0,"property-function":!0,length:2,default:[0,0],requires:["text-field"]},"text-allow-overlap":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["text-field"]},"text-ignore-placement":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["text-field"]},"text-optional":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["text-field","icon-image"]},visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:["visible","none"],default:"visible"}},layout_raster:{visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:["visible","none"],default:"visible"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:["==","!=",">",">=","<","<=","in","!in","all","any","none","has","!has"]},geometry_type:{type:"enum",values:["Point","LineString","Polygon"]},color_operation:{type:"enum",values:["lighten","saturate","spin","fade","mix"]},function:{stops:{type:"array",required:!0,value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:["exponential","interval","categorical"],default:"exponential"}},function_stop:{type:"array",minimum:0,maximum:22,value:["number","color"],length:2},paint:["paint_fill","paint_line","paint_circle","paint_symbol","paint_raster","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!0},"fill-opacity":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!0,default:1,minimum:0,maximum:1,transition:!0},"fill-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"fill-pattern"}]},"fill-outline-color":{type:"color",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}]},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"fill-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"map",requires:["fill-translate"]},"fill-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,transition:!0}},paint_line:{"line-opacity":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!0,default:1,minimum:0,maximum:1,transition:!0},"line-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"line-pattern"}]},"line-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"map",requires:["line-translate"]},"line-width":{type:"number",default:1,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-gap-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-offset":{type:"number",default:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-blur":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-dasharray":{type:"array",value:"number",function:"piecewise-constant","zoom-function":!0,"property-function":!0,minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}]},"line-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,transition:!0}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"circle-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0},"circle-blur":{type:"number",default:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"circle-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"map",requires:["circle-translate"]},"circle-pitch-scale":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"map"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["icon-image"]},"icon-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["icon-image"]},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["icon-image"]},"icon-halo-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["icon-image"]},"icon-halo-blur":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["icon-image"]},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["icon-image"]},"icon-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"map",requires:["icon-image","icon-translate"]},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["text-field"]},"text-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["text-field"]},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["text-field"]},"text-halo-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["text-field"]},"text-halo-blur":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["text-field"]},"text-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["text-field"]},"text-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"map",requires:["text-field","text-translate"]}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,transition:!0},"raster-hue-rotate":{type:"number",default:0,period:360,function:"interpolated","zoom-function":!0,transition:!0,units:"degrees"},"raster-brightness-min":{type:"number",function:"interpolated","zoom-function":!0,default:0,minimum:0,maximum:1,transition:!0},"raster-brightness-max":{type:"number",function:"interpolated","zoom-function":!0,default:1,minimum:0,maximum:1,transition:!0},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,function:"interpolated","zoom-function":!0,transition:!0},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,function:"interpolated","zoom-function":!0,transition:!0},"raster-fade-duration":{type:"number",default:300,minimum:0,function:"interpolated","zoom-function":!0,transition:!0,units:"milliseconds"}},paint_background:{"background-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,transition:!0,requires:[{"!":"background-pattern"}]},"background-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,transition:!0},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,transition:!0}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}}}},{}],320:[function(t,e,r){"use strict";function n(t){return!!(i()&&a()&&o()&&s()&&l()&&u()&&c()&&h(t&&t.failIfMajorPerformanceCaveat))}function i(){return"undefined"!=typeof window&&"undefined"!=typeof document}function a(){return 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 o(){return Function.prototype&&Function.prototype.bind}function s(){return 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}function l(){return"JSON"in window&&"parse"in JSON&&"stringify"in JSON}function u(){return"Worker"in window}function c(){return"Uint8ClampedArray"in window}function h(t){return void 0===d[t]&&(d[t]=f(t)),d[t]}function f(t){var e=document.createElement("canvas"),r=Object.create(n.webGLContextAttributes);return r.failIfMajorPerformanceCaveat=t,e.probablySupportsContext?e.probablySupportsContext("webgl",r)||e.probablySupportsContext("experimental-webgl",r):e.supportsContext?e.supportsContext("webgl",r)||e.supportsContext("experimental-webgl",r):e.getContext("webgl",r)||e.getContext("experimental-webgl",r)}void 0!==e&&e.exports?e.exports=n:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=n);var d={};n.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}},{}],321:[function(t,e,r){"use strict";function n(t){var e=t.layoutVertexArrayType;this.layoutVertexArray=new e;var r=t.elementArrayType;r&&(this.elementArray=new r);var n=t.elementArrayType2;n&&(this.elementArray2=new n),this.paintVertexArrays=i.mapObject(t.paintVertexArrayTypes,function(t){return new t})}var i=t("../util/util");e.exports=n,n.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,n.prototype.hasCapacityFor=function(t){return this.layoutVertexArray.length+t<=n.MAX_VERTEX_ARRAY_LENGTH},n.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},n.prototype.trim=function(){this.layoutVertexArray.trim(),this.elementArray&&this.elementArray.trim(),this.elementArray2&&this.elementArray2.trim();for(var t in this.paintVertexArrays)this.paintVertexArrays[t].trim()},n.prototype.serialize=function(){return{layoutVertexArray:this.layoutVertexArray.serialize(),elementArray:this.elementArray&&this.elementArray.serialize(),elementArray2:this.elementArray2&&this.elementArray2.serialize(),paintVertexArrays:i.mapObject(this.paintVertexArrays,function(t){return t.serialize()})}},n.prototype.getTransferables=function(t){t.push(this.layoutVertexArray.arrayBuffer),this.elementArray&&t.push(this.elementArray.arrayBuffer),this.elementArray2&&t.push(this.elementArray2.arrayBuffer);for(var e in this.paintVertexArrays)t.push(this.paintVertexArrays[e].arrayBuffer)}},{"../util/util":435}],322:[function(t,e,r){"use strict";function n(t){if(this.zoom=t.zoom,this.overscaling=t.overscaling,this.layer=t.layer,this.childLayers=t.childLayers,this.type=this.layer.type,this.features=[],this.id=this.layer.id,this.index=t.index,this.sourceLayer=this.layer.sourceLayer,this.sourceLayerIndex=t.sourceLayerIndex,this.minZoom=this.layer.minzoom,this.maxZoom=this.layer.maxzoom,this.paintAttributes=i(this),t.arrays){var e=this.programInterfaces;this.bufferGroups=c.mapObject(t.arrays,function(r,n){var i=e[n],a=t.paintVertexArrayTypes[n];return r.map(function(t){return new u(t,{layoutVertexArrayType:i.layoutVertexArrayType.serialize(),elementArrayType:i.elementArrayType&&i.elementArrayType.serialize(),elementArrayType2:i.elementArrayType2&&i.elementArrayType2.serialize(),paintVertexArrayTypes:a})})})}}function i(t){var e={};for(var r in t.programInterfaces){for(var n=e[r]={},i=0;i<t.childLayers.length;i++){n[t.childLayers[i].id]={attributes:[],uniforms:[],defines:[],vertexPragmas:{define:{},initialize:{}},fragmentPragmas:{define:{},initialize:{}}}}var s=t.programInterfaces[r];if(s.paintAttributes)for(var l=0;l<s.paintAttributes.length;l++){var u=s.paintAttributes[l];u.multiplier=u.multiplier||1;for(var h=0;h<t.childLayers.length;h++){var d=t.childLayers[h],p=n[d.id],m=u.name;f("a_"===u.name.slice(0,2));var v,g=u.name.slice(2);if(p.fragmentPragmas.initialize[g]="",d.isPaintValueFeatureConstant(u.paintProperty))p.uniforms.push(u),p.fragmentPragmas.define[g]=p.vertexPragmas.define[g]=["uniform","{precision}","{type}",m].join(" ")+";",p.fragmentPragmas.initialize[g]=p.vertexPragmas.initialize[g]=["{precision}","{type}",g,"=",m].join(" ")+";\n";else if(d.isPaintValueZoomConstant(u.paintProperty)){p.attributes.push(c.extend({},u,{name:m})),v=["varying","{precision}","{type}",g].join(" ")+";\n";var y=[p.fragmentPragmas.define[g],"attribute","{precision}","{type}",m].join(" ")+";\n";p.fragmentPragmas.define[g]=v,p.vertexPragmas.define[g]=v+y,p.vertexPragmas.initialize[g]=[g,"=",m,"/",u.multiplier.toFixed(1)].join(" ")+";\n"}else{for(var b="u_"+m.slice(2)+"_t",x=d.getPaintValueStopZoomLevels(u.paintProperty),_=0;_<x.length&&x[_]<t.zoom;)_++;for(var w=Math.max(0,Math.min(x.length-4,_-2)),M=[],k=0;k<4;k++)M.push(x[Math.min(w+k,x.length-1)]);v=["varying","{precision}","{type}",g].join(" ")+";\n",p.vertexPragmas.define[g]=v+["uniform","lowp","float",b].join(" ")+";\n",p.fragmentPragmas.define[g]=v,p.uniforms.push(c.extend({},u,{name:b,getValue:o(u,w),components:1}));var A=u.components;if(1===A)p.attributes.push(c.extend({},u,{getValue:a(u,M),isFunction:!0,components:4*A})),p.vertexPragmas.define[g]+=["attribute","{precision}","vec4",m].join(" ")+";\n",p.vertexPragmas.initialize[g]=[g,"=","evaluate_zoom_function_1("+m+", "+b+")","/",u.multiplier.toFixed(1)].join(" ")+";\n";else{for(var T=[],S=0;S<4;S++)T.push(m+S),p.attributes.push(c.extend({},u,{getValue:a(u,[M[S]]),isFunction:!0,name:m+S})),p.vertexPragmas.define[g]+=["attribute","{precision}","{type}",m+S].join(" ")+";\n";p.vertexPragmas.initialize[g]=[g," = ","evaluate_zoom_function_4("+T.join(", ")+", "+b+")","/",u.multiplier.toFixed(1)].join(" ")+";\n"}}}}}return e}function a(t,e){return function(r,n,i){if(1===e.length)return t.getValue(r,c.extend({},n,{zoom:e[0]}),i);for(var a=[],o=0;o<e.length;o++){var s=e[o];a.push(t.getValue(r,c.extend({},n,{zoom:s}),i)[0])}return a}}function o(t,e){return function(r,n){var i=r.getPaintInterpolationT(t.paintProperty,n.zoom);return[Math.max(0,Math.min(4,i-e))]}}var s=t("feature-filter"),l=t("./array_group"),u=t("./buffer_group"),c=t("../util/util"),h=t("../util/struct_array"),f=t("assert");e.exports=n,n.create=function(e){return new({fill:t("./bucket/fill_bucket"),line:t("./bucket/line_bucket"),circle:t("./bucket/circle_bucket"),symbol:t("./bucket/symbol_bucket")}[e.layer.type])(e)},n.EXTENT=8192,n.prototype.populateArrays=function(){this.createArrays(),this.recalculateStyleLayers();for(var t=0;t<this.features.length;t++)this.addFeature(this.features[t]);this.trimArrays()},n.prototype.prepareArrayGroup=function(t,e){var r=this.arrayGroups[t],n=r.length&&r[r.length-1];return n&&n.hasCapacityFor(e)||(n=new l({layoutVertexArrayType:this.programInterfaces[t].layoutVertexArrayType,elementArrayType:this.programInterfaces[t].elementArrayType,elementArrayType2:this.programInterfaces[t].elementArrayType2,paintVertexArrayTypes:this.paintVertexArrayTypes[t]}),n.index=r.length,r.push(n)),n},n.prototype.createArrays=function(){this.arrayGroups={},this.paintVertexArrayTypes={};for(var t in this.programInterfaces){this.arrayGroups[t]=[];var e=this.paintVertexArrayTypes[t]={},r=this.paintAttributes[t];for(var i in r)e[i]=new n.VertexArrayType(r[i].attributes)}},n.prototype.destroy=function(t){for(var e in this.bufferGroups)for(var r=this.bufferGroups[e],n=0;n<r.length;n++)r[n].destroy(t)},n.prototype.trimArrays=function(){for(var t in this.arrayGroups)for(var e=this.arrayGroups[t],r=0;r<e.length;r++)e[r].trim()},n.prototype.isEmpty=function(){for(var t in this.arrayGroups)for(var e=this.arrayGroups[t],r=0;r<e.length;r++)if(!e[r].isEmpty())return!1;return!0},n.prototype.getTransferables=function(t){for(var e in this.arrayGroups)for(var r=this.arrayGroups[e],n=0;n<r.length;n++)r[n].getTransferables(t)},n.prototype.setUniforms=function(t,e,r,n,i){for(var a=this.paintAttributes[e][n.id].uniforms,o=0;o<a.length;o++){var s=a[o],l=r[s.name];t["uniform"+s.components+"fv"](l,s.getValue(n,i))}},n.prototype.serialize=function(){return{layerId:this.layer.id,zoom:this.zoom,arrays:c.mapObject(this.arrayGroups,function(t){return t.map(function(t){return t.serialize()})}),paintVertexArrayTypes:c.mapObject(this.paintVertexArrayTypes,function(t){return c.mapObject(t,function(t){return t.serialize()})}),childLayerIds:this.childLayers.map(function(t){return t.id})}},n.prototype.createFilter=function(){this.filter||(this.filter=s(this.layer.filter))};var d={lastIntegerZoom:1/0,lastIntegerZoomTime:0,lastZoom:0};n.prototype.recalculateStyleLayers=function(){for(var t=0;t<this.childLayers.length;t++)this.childLayers[t].recalculate(this.zoom,d)},n.prototype.populatePaintArrays=function(t,e,r,n,i){for(var a=0;a<this.childLayers.length;a++)for(var o=this.childLayers[a],s=this.arrayGroups[t],l=n.index;l<s.length;l++){var u=s[l],c=u.layoutVertexArray.length,h=u.paintVertexArrays[o.id];h.resize(c);for(var f=this.paintAttributes[t][o.id].attributes,d=0;d<f.length;d++)for(var p=f[d],m=p.getValue(o,e,r),v=p.multiplier||1,g=p.components||1,y=l===n.index?i:0,b=y;b<c;b++)for(var x=h.get(b),_=0;_<g;_++){var w=g>1?p.name+_:p.name;x[w]=m[_]*v}}},n.VertexArrayType=function(t){return new h({members:t,alignment:4})},
32 n.ElementArrayType=function(t){return new h({members:[{type:"Uint16",name:"vertices",components:t||3}]})}},{"../util/struct_array":433,"../util/util":435,"./array_group":321,"./bucket/circle_bucket":323,"./bucket/fill_bucket":324,"./bucket/line_bucket":325,"./bucket/symbol_bucket":326,"./buffer_group":328,assert:43,"feature-filter":128}],323:[function(t,e,r){"use strict";function n(){i.apply(this,arguments)}var i=t("../bucket"),a=t("../../util/util"),o=t("../load_geometry"),s=i.EXTENT;e.exports=n,n.prototype=a.inherit(i,{}),n.prototype.addCircleVertex=function(t,e,r,n,i){return t.emplaceBack(2*e+(n+1)/2,2*r+(i+1)/2)},n.prototype.programInterfaces={circle:{layoutVertexArrayType:new i.VertexArrayType([{name:"a_pos",components:2,type:"Int16"}]),elementArrayType:new i.ElementArrayType,paintAttributes:[{name:"a_color",components:4,type:"Uint8",getValue:function(t,e,r){return t.getPaintValue("circle-color",e,r)},multiplier:255,paintProperty:"circle-color"},{name:"a_radius",components:1,type:"Uint16",isLayerConstant:!1,getValue:function(t,e,r){return[t.getPaintValue("circle-radius",e,r)]},multiplier:10,paintProperty:"circle-radius"},{name:"a_blur",components:1,type:"Uint16",isLayerConstant:!1,getValue:function(t,e,r){return[t.getPaintValue("circle-blur",e,r)]},multiplier:10,paintProperty:"circle-blur"},{name:"a_opacity",components:1,type:"Uint16",isLayerConstant:!1,getValue:function(t,e,r){return[t.getPaintValue("circle-opacity",e,r)]},multiplier:255,paintProperty:"circle-opacity"}]}},n.prototype.addFeature=function(t){for(var e={zoom:this.zoom},r=o(t),n=this.prepareArrayGroup("circle",0),i=n.layoutVertexArray.length,a=0;a<r.length;a++)for(var l=0;l<r[a].length;l++){var u=r[a][l].x,c=r[a][l].y;if(!(u<0||u>=s||c<0||c>=s)){var h=this.prepareArrayGroup("circle",4),f=h.layoutVertexArray,d=this.addCircleVertex(f,u,c,-1,-1);this.addCircleVertex(f,u,c,1,-1),this.addCircleVertex(f,u,c,1,1),this.addCircleVertex(f,u,c,-1,1),h.elementArray.emplaceBack(d,d+1,d+2),h.elementArray.emplaceBack(d,d+3,d+2)}}this.populatePaintArrays("circle",e,t.properties,n,i)}},{"../../util/util":435,"../bucket":322,"../load_geometry":330}],324:[function(t,e,r){"use strict";function n(){i.apply(this,arguments)}var i=t("../bucket"),a=t("../../util/util"),o=t("../load_geometry"),s=t("earcut"),l=t("../../util/classify_rings");e.exports=n,n.prototype=a.inherit(i,{}),n.prototype.programInterfaces={fill:{layoutVertexArrayType:new i.VertexArrayType([{name:"a_pos",components:2,type:"Int16"}]),elementArrayType:new i.ElementArrayType(1),elementArrayType2:new i.ElementArrayType(2),paintAttributes:[{name:"a_color",components:4,type:"Uint8",getValue:function(t,e,r){return t.getPaintValue("fill-color",e,r)},multiplier:255,paintProperty:"fill-color"},{name:"a_outline_color",components:4,type:"Uint8",getValue:function(t,e,r){return t.getPaintValue("fill-outline-color",e,r)},multiplier:255,paintProperty:"fill-outline-color"},{name:"a_opacity",components:1,type:"Uint8",getValue:function(t,e,r){return[t.getPaintValue("fill-opacity",e,r)]},multiplier:255,paintProperty:"fill-opacity"}]}},n.prototype.addFeature=function(t){for(var e=o(t),r=l(e,500),n=this.prepareArrayGroup("fill",0),i=n.layoutVertexArray.length,a=0;a<r.length;a++)this.addPolygon(r[a]);this.populatePaintArrays("fill",{zoom:this.zoom},t.properties,n,i)},n.prototype.addPolygon=function(t){for(var e=0,r=0;r<t.length;r++)e+=t[r].length;for(var n=this.prepareArrayGroup("fill",e),i=[],a=[],o=n.layoutVertexArray.length,l=0;l<t.length;l++){var u=t[l];l>0&&a.push(i.length/2);for(var c=0;c<u.length;c++){var h=u[c],f=n.layoutVertexArray.emplaceBack(h.x,h.y);c>=1&&n.elementArray2.emplaceBack(f-1,f),i.push(h.x),i.push(h.y)}}for(var d=s(i,a),p=0;p<d.length;p++)n.elementArray.emplaceBack(d[p]+o)}},{"../../util/classify_rings":423,"../../util/util":435,"../bucket":322,"../load_geometry":330,earcut:122}],325:[function(t,e,r){"use strict";function n(){i.apply(this,arguments)}var i=t("../bucket"),a=t("../../util/util"),o=t("../load_geometry"),s=i.EXTENT,l=Math.cos(Math.PI/180*37.5),u=Math.pow(2,14)/.5;e.exports=n,n.prototype=a.inherit(i,{}),n.prototype.addLineVertex=function(t,e,r,n,i,a,o){return t.emplaceBack(e.x<<1|n,e.y<<1|i,Math.round(63*r.x)+128,Math.round(63*r.y)+128,1+(0===a?0:a<0?-1:1)|(.5*o&63)<<2,.5*o>>6)},n.prototype.programInterfaces={line:{layoutVertexArrayType:new i.VertexArrayType([{name:"a_pos",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}]),elementArrayType:new i.ElementArrayType}},n.prototype.addFeature=function(t){for(var e=o(t,15),r=0;r<e.length;r++)this.addLine(e[r],this.layer.layout["line-join"],this.layer.layout["line-cap"],this.layer.layout["line-miter-limit"],this.layer.layout["line-round-limit"])},n.prototype.addLine=function(t,e,r,n,i){for(var a=t.length;a>2&&t[a-1].equals(t[a-2]);)a--;if(!(t.length<2)){"bevel"===e&&(n=1.05);var o=s/(512*this.overscaling)*15,u=t[0],c=t[a-1],h=u.equals(c);if(this.prepareArrayGroup("line",10*a),2!==a||!h){this.distance=0;var f,d,p,m,v,g,y,b=r,x=h?"butt":r,_=!0;this.e1=this.e2=this.e3=-1,h&&(f=t[a-2],v=u.sub(f)._unit()._perp());for(var w=0;w<a;w++)if(!(p=h&&w===a-1?t[1]:t[w+1])||!t[w].equals(p)){v&&(m=v),f&&(d=f),f=t[w],v=p?p.sub(f)._unit()._perp():m,m=m||v;var M=m.add(v)._unit(),k=M.x*v.x+M.y*v.y,A=1/k,T=k<l&&d&&p;if(T&&w>0){var S=f.dist(d);if(S>2*o){var E=f.sub(f.sub(d)._mult(o/S)._round());this.distance+=E.dist(d),this.addCurrentVertex(E,this.distance,m.mult(1),0,0,!1),d=E}}var L=d&&p,C=L?e:p?b:x;if(L&&"round"===C&&(A<i?C="miter":A<=2&&(C="fakeround")),"miter"===C&&A>n&&(C="bevel"),"bevel"===C&&(A>2&&(C="flipbevel"),A<n&&(C="miter")),d&&(this.distance+=f.dist(d)),"miter"===C)M._mult(A),this.addCurrentVertex(f,this.distance,M,0,0,!1);else if("flipbevel"===C){if(A>100)M=v.clone();else{var z=m.x*v.y-m.y*v.x>0?-1:1,D=A*m.add(v).mag()/m.sub(v).mag();M._perp()._mult(D*z)}this.addCurrentVertex(f,this.distance,M,0,0,!1),this.addCurrentVertex(f,this.distance,M.mult(-1),0,0,!1)}else if("bevel"===C||"fakeround"===C){var I=m.x*v.y-m.y*v.x>0,P=-Math.sqrt(A*A-1);if(I?(y=0,g=P):(g=0,y=P),_||this.addCurrentVertex(f,this.distance,m,g,y,!1),"fakeround"===C){for(var O,j=Math.floor(8*(.5-(k-.5))),F=0;F<j;F++)O=v.mult((F+1)/(j+1))._add(m)._unit(),this.addPieSliceVertex(f,this.distance,O,I);this.addPieSliceVertex(f,this.distance,M,I);for(var R=j-1;R>=0;R--)O=m.mult((R+1)/(j+1))._add(v)._unit(),this.addPieSliceVertex(f,this.distance,O,I)}p&&this.addCurrentVertex(f,this.distance,v,-g,-y,!1)}else"butt"===C?(_||this.addCurrentVertex(f,this.distance,m,0,0,!1),p&&this.addCurrentVertex(f,this.distance,v,0,0,!1)):"square"===C?(_||(this.addCurrentVertex(f,this.distance,m,1,1,!1),this.e1=this.e2=-1),p&&this.addCurrentVertex(f,this.distance,v,-1,-1,!1)):"round"===C&&(_||(this.addCurrentVertex(f,this.distance,m,0,0,!1),this.addCurrentVertex(f,this.distance,m,1,1,!0),this.e1=this.e2=-1),p&&(this.addCurrentVertex(f,this.distance,v,-1,-1,!0),this.addCurrentVertex(f,this.distance,v,0,0,!1)));if(T&&w<a-1){var N=f.dist(p);if(N>2*o){var B=f.add(p.sub(f)._mult(o/N)._round());this.distance+=B.dist(f),this.addCurrentVertex(B,this.distance,v.mult(1),0,0,!1),f=B}}_=!1}}}},n.prototype.addCurrentVertex=function(t,e,r,n,i,a){var o,s=a?1:0,l=this.arrayGroups.line[this.arrayGroups.line.length-1],c=l.layoutVertexArray,h=l.elementArray;o=r.clone(),n&&o._sub(r.perp()._mult(n)),this.e3=this.addLineVertex(c,t,o,s,0,n,e),this.e1>=0&&this.e2>=0&&h.emplaceBack(this.e1,this.e2,this.e3),this.e1=this.e2,this.e2=this.e3,o=r.mult(-1),i&&o._sub(r.perp()._mult(i)),this.e3=this.addLineVertex(c,t,o,s,1,-i,e),this.e1>=0&&this.e2>=0&&h.emplaceBack(this.e1,this.e2,this.e3),this.e1=this.e2,this.e2=this.e3,e>u/2&&(this.distance=0,this.addCurrentVertex(t,this.distance,r,n,i,a))},n.prototype.addPieSliceVertex=function(t,e,r,n){var i=n?1:0;r=r.mult(n?-1:1);var a=this.arrayGroups.line[this.arrayGroups.line.length-1],o=a.layoutVertexArray,s=a.elementArray;this.e3=this.addLineVertex(o,t,r,0,i,0,e),this.e1>=0&&this.e2>=0&&s.emplaceBack(this.e1,this.e2,this.e3),n?this.e2=this.e3:this.e1=this.e3}},{"../../util/util":435,"../bucket":322,"../load_geometry":330}],326:[function(t,e,r){"use strict";function n(t){o.apply(this,arguments),this.showCollisionBoxes=t.showCollisionBoxes,this.overscaling=t.overscaling,this.collisionBoxArray=t.collisionBoxArray,this.symbolQuadsArray=t.symbolQuadsArray,this.symbolInstancesArray=t.symbolInstancesArray,this.sdfIcons=t.sdfIcons,this.iconsNeedLinear=t.iconsNeedLinear,this.adjustedTextSize=t.adjustedTextSize,this.adjustedIconSize=t.adjustedIconSize,this.fontstack=t.fontstack}function i(t,e,r,n,i,a,o,s,l,u,c){return t.emplaceBack(e,r,Math.round(64*n),Math.round(64*i),a/4,o/4,10*(u||0),c,10*(s||0),10*Math.min(l||25,25))}var a=t("point-geometry"),o=t("../bucket"),s=t("../../symbol/anchor"),l=t("../../symbol/get_anchors"),u=t("../../util/token"),c=t("../../symbol/quads"),h=t("../../symbol/shaping"),f=t("../../symbol/resolve_text"),d=t("../../symbol/mergelines"),p=t("../../symbol/clip_line"),m=t("../../util/util"),v=t("../load_geometry"),g=t("../../symbol/collision_feature"),y=h.shapeText,b=h.shapeIcon,x=c.getGlyphQuads,_=c.getIconQuads,w=o.EXTENT;e.exports=n,n.MAX_QUADS=65535,n.prototype=m.inherit(o,{}),n.prototype.serialize=function(){var t=o.prototype.serialize.apply(this);return t.sdfIcons=this.sdfIcons,t.iconsNeedLinear=this.iconsNeedLinear,t.adjustedTextSize=this.adjustedTextSize,t.adjustedIconSize=this.adjustedIconSize,t.fontstack=this.fontstack,t};var M=new o.VertexArrayType([{name:"a_pos",components:2,type:"Int16"},{name:"a_offset",components:2,type:"Int16"},{name:"a_texture_pos",components:2,type:"Uint16"},{name:"a_data",components:4,type:"Uint8"}]),k=new o.ElementArrayType;n.prototype.addCollisionBoxVertex=function(t,e,r,n,i){return t.emplaceBack(e.x,e.y,Math.round(r.x),Math.round(r.y),10*n,10*i)},n.prototype.programInterfaces={glyph:{layoutVertexArrayType:M,elementArrayType:k},icon:{layoutVertexArrayType:M,elementArrayType:k},collisionBox:{layoutVertexArrayType:new o.VertexArrayType([{name:"a_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"},{name:"a_data",components:2,type:"Uint8"}])}},n.prototype.populateArrays=function(t,e,r){var n={lastIntegerZoom:1/0,lastIntegerZoomTime:0,lastZoom:0};this.adjustedTextMaxSize=this.layer.getLayoutValue("text-size",{zoom:18,zoomHistory:n}),this.adjustedTextSize=this.layer.getLayoutValue("text-size",{zoom:this.zoom+1,zoomHistory:n}),this.adjustedIconMaxSize=this.layer.getLayoutValue("icon-size",{zoom:18,zoomHistory:n}),this.adjustedIconSize=this.layer.getLayoutValue("icon-size",{zoom:this.zoom+1,zoomHistory:n});var i=512*this.overscaling;this.tilePixelRatio=w/i,this.compareText={},this.iconsNeedLinear=!1,this.symbolInstancesStartIndex=this.symbolInstancesArray.length;var a=this.layer.layout,o=this.features,s=this.textFeatures,l=.5,c=.5;switch(a["text-anchor"]){case"right":case"top-right":case"bottom-right":l=1;break;case"left":case"top-left":case"bottom-left":l=0}switch(a["text-anchor"]){case"bottom":case"bottom-right":case"bottom-left":c=1;break;case"top":case"top-right":case"top-left":c=0}for(var h="right"===a["text-justify"]?1:"left"===a["text-justify"]?0:.5,f=24*a["text-line-height"],p="line"!==a["symbol-placement"]?24*a["text-max-width"]:0,g=24*a["text-letter-spacing"],x=[24*a["text-offset"][0],24*a["text-offset"][1]],_=this.fontstack=a["text-font"].join(","),M=[],k=0;k<o.length;k++)M.push(v(o[k]));if("line"===a["symbol-placement"]){var A=d(o,s,M);M=A.geometries,o=A.features,s=A.textFeatures}for(var T,S,E=0;E<o.length;E++)if(M[E]){if(T=s[E]?y(s[E],e[_],p,f,l,c,h,g,x):null,a["icon-image"]){var L=u(o[E].properties,a["icon-image"]),C=r[L];S=b(C,a),C&&(void 0===this.sdfIcons?this.sdfIcons=C.sdf:this.sdfIcons!==C.sdf&&m.warnOnce("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),1!==C.pixelRatio?this.iconsNeedLinear=!0:0===a["icon-rotate"]&&this.layer.isLayoutValueFeatureConstant("icon-rotate")||(this.iconsNeedLinear=!0))}else S=null;(T||S)&&this.addFeature(M[E],T,S,o[E])}this.symbolInstancesEndIndex=this.symbolInstancesArray.length,this.placeFeatures(t,this.showCollisionBoxes),this.trimArrays()},n.prototype.addFeature=function(t,e,r,n){var i=this.layer.layout,a=this.adjustedTextSize/24,o=void 0!==this.adjustedTextMaxSize?this.adjustedTextMaxSize:this.adjustedTextSize,u=this.tilePixelRatio*a,c=this.tilePixelRatio*o/24,h=this.tilePixelRatio*this.adjustedIconSize,f=this.tilePixelRatio*i["symbol-spacing"],d=i["symbol-avoid-edges"],m=i["text-padding"]*this.tilePixelRatio,v=i["icon-padding"]*this.tilePixelRatio,g=i["text-max-angle"]/180*Math.PI,y="map"===i["text-rotation-alignment"]&&"line"===i["symbol-placement"],b="map"===i["icon-rotation-alignment"]&&"line"===i["symbol-placement"],x=i["text-allow-overlap"]||i["icon-allow-overlap"]||i["text-ignore-placement"]||i["icon-ignore-placement"],_="line"===i["symbol-placement"],M=f/2;_&&(t=p(t,0,0,w,w));for(var k=0;k<t.length;k++){var A,T=t[k];A=_?l(T,f,g,e,r,24,c,this.overscaling,w):[new s(T[0].x,T[0].y,0)];for(var S=0,E=A.length;S<E;S++){var L=A[S];if(!(e&&_&&this.anchorIsTooClose(e.text,M,L))){var C=!(L.x<0||L.x>w||L.y<0||L.y>w);if(!d||C){var z=C||x;this.addSymbolInstance(L,T,e,r,this.layer,z,this.symbolInstancesArray.length,this.collisionBoxArray,n.index,this.sourceLayerIndex,this.index,u,m,y,h,v,b,{zoom:this.zoom},n.properties)}}}}},n.prototype.anchorIsTooClose=function(t,e,r){var n=this.compareText;if(t in n){for(var i=n[t],a=i.length-1;a>=0;a--)if(r.dist(i[a])<e)return!0}else n[t]=[];return n[t].push(r),!1},n.prototype.placeFeatures=function(t,e){this.recalculateStyleLayers(),this.createArrays();var r=this.layer.layout,n=t.maxScale,i="map"===r["text-rotation-alignment"]&&"line"===r["symbol-placement"],a="map"===r["icon-rotation-alignment"]&&"line"===r["symbol-placement"];if(r["text-allow-overlap"]||r["icon-allow-overlap"]||r["text-ignore-placement"]||r["icon-ignore-placement"]){var o=this.symbolInstancesArray.toArray(this.symbolInstancesStartIndex,this.symbolInstancesEndIndex),s=t.angle,l=Math.sin(s),u=Math.cos(s);this.sortedSymbolInstances=o.sort(function(t,e){return(l*t.anchorPointX+u*t.anchorPointY|0)-(l*e.anchorPointX+u*e.anchorPointY|0)||e.index-t.index})}for(var c=this.symbolInstancesStartIndex;c<this.symbolInstancesEndIndex;c++){var h=this.sortedSymbolInstances?this.sortedSymbolInstances[c-this.symbolInstancesStartIndex]:this.symbolInstancesArray.get(c),f={boxStartIndex:h.textBoxStartIndex,boxEndIndex:h.textBoxEndIndex},d={boxStartIndex:h.iconBoxStartIndex,boxEndIndex:h.iconBoxEndIndex},p=!(h.textBoxStartIndex===h.textBoxEndIndex),m=!(h.iconBoxStartIndex===h.iconBoxEndIndex),v=r["text-optional"]||!p,g=r["icon-optional"]||!m,y=p?t.placeCollisionFeature(f,r["text-allow-overlap"],r["symbol-avoid-edges"]):t.minScale,b=m?t.placeCollisionFeature(d,r["icon-allow-overlap"],r["symbol-avoid-edges"]):t.minScale;v||g?!g&&y?y=Math.max(b,y):!v&&b&&(b=Math.max(b,y)):b=y=Math.max(b,y),p&&(t.insertCollisionFeature(f,y,r["text-ignore-placement"]),y<=n&&this.addSymbols("glyph",h.glyphQuadStartIndex,h.glyphQuadEndIndex,y,r["text-keep-upright"],i,t.angle)),m&&(t.insertCollisionFeature(d,b,r["icon-ignore-placement"]),b<=n&&this.addSymbols("icon",h.iconQuadStartIndex,h.iconQuadEndIndex,b,r["icon-keep-upright"],a,t.angle))}e&&this.addToDebugBuffers(t)},n.prototype.addSymbols=function(t,e,r,n,a,o,s){for(var l=this.prepareArrayGroup(t,4*(r-e)),u=l.elementArray,c=l.layoutVertexArray,h=this.zoom,f=Math.max(Math.log(n)/Math.LN2+h,0),d=e;d<r;d++){var p=this.symbolQuadsArray.get(d).SymbolQuad,m=(p.anchorAngle+s+Math.PI)%(2*Math.PI);if(!(a&&o&&(m<=Math.PI/2||m>3*Math.PI/2))){var v=p.tl,g=p.tr,y=p.bl,b=p.br,x=p.tex,_=p.anchorPoint,w=Math.max(h+Math.log(p.minScale)/Math.LN2,f),M=Math.min(h+Math.log(p.maxScale)/Math.LN2,25);if(!(M<=w)){w===f&&(w=0);var k=Math.round(p.glyphAngle/(2*Math.PI)*256),A=i(c,_.x,_.y,v.x,v.y,x.x,x.y,w,M,f,k);i(c,_.x,_.y,g.x,g.y,x.x+x.w,x.y,w,M,f,k),i(c,_.x,_.y,y.x,y.y,x.x,x.y+x.h,w,M,f,k),i(c,_.x,_.y,b.x,b.y,x.x+x.w,x.y+x.h,w,M,f,k),u.emplaceBack(A,A+1,A+2),u.emplaceBack(A+1,A+2,A+3)}}}},n.prototype.updateIcons=function(t){this.recalculateStyleLayers();var e=this.layer.layout["icon-image"];if(e)for(var r=0;r<this.features.length;r++){var n=u(this.features[r].properties,e);n&&(t[n]=!0)}},n.prototype.updateFont=function(t){this.recalculateStyleLayers();var e=this.layer.layout["text-font"],r=t[e]=t[e]||{};this.textFeatures=f(this.features,this.layer.layout,r)},n.prototype.addToDebugBuffers=function(t){for(var e=this.prepareArrayGroup("collisionBox",0),r=e.layoutVertexArray,n=-t.angle,i=t.yStretch,o=this.symbolInstancesStartIndex;o<this.symbolInstancesEndIndex;o++){var s=this.symbolInstancesArray.get(o);s.textCollisionFeature={boxStartIndex:s.textBoxStartIndex,boxEndIndex:s.textBoxEndIndex},s.iconCollisionFeature={boxStartIndex:s.iconBoxStartIndex,boxEndIndex:s.iconBoxEndIndex};for(var l=0;l<2;l++){var u=s[0===l?"textCollisionFeature":"iconCollisionFeature"];if(u)for(var c=u.boxStartIndex;c<u.boxEndIndex;c++){var h=this.collisionBoxArray.get(c),f=h.anchorPoint,d=new a(h.x1,h.y1*i)._rotate(n),p=new a(h.x2,h.y1*i)._rotate(n),m=new a(h.x1,h.y2*i)._rotate(n),v=new a(h.x2,h.y2*i)._rotate(n),g=Math.max(0,Math.min(25,this.zoom+Math.log(h.maxScale)/Math.LN2)),y=Math.max(0,Math.min(25,this.zoom+Math.log(h.placementScale)/Math.LN2));this.addCollisionBoxVertex(r,f,d,g,y),this.addCollisionBoxVertex(r,f,p,g,y),this.addCollisionBoxVertex(r,f,p,g,y),this.addCollisionBoxVertex(r,f,v,g,y),this.addCollisionBoxVertex(r,f,v,g,y),this.addCollisionBoxVertex(r,f,m,g,y),this.addCollisionBoxVertex(r,f,m,g,y),this.addCollisionBoxVertex(r,f,d,g,y)}}}},n.prototype.addSymbolInstance=function(t,e,r,i,a,o,s,l,u,c,h,f,d,p,v,y,b,w,M){var k,A,T,S,E,L,C,z;if(r&&(C=o?x(t,r,f,e,a,p):[],E=new g(l,e,t,u,c,h,r,f,d,p,!1)),k=this.symbolQuadsArray.length,C&&C.length)for(var D=0;D<C.length;D++)this.addSymbolQuad(C[D]);A=this.symbolQuadsArray.length;var I=E?E.boxStartIndex:this.collisionBoxArray.length,P=E?E.boxEndIndex:this.collisionBoxArray.length;i&&(z=o?_(t,i,v,e,a,b,r,w,M):[],L=new g(l,e,t,u,c,h,i,v,y,b,!0)),T=this.symbolQuadsArray.length,z&&1===z.length&&this.addSymbolQuad(z[0]),S=this.symbolQuadsArray.length;var O=L?L.boxStartIndex:this.collisionBoxArray.length,j=L?L.boxEndIndex:this.collisionBoxArray.length;return S>n.MAX_QUADS&&m.warnOnce("Too many symbols being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),A>n.MAX_QUADS&&m.warnOnce("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),this.symbolInstancesArray.emplaceBack(I,P,O,j,k,A,T,S,t.x,t.y,s)},n.prototype.addSymbolQuad=function(t){return this.symbolQuadsArray.emplaceBack(t.anchorPoint.x,t.anchorPoint.y,t.tl.x,t.tl.y,t.tr.x,t.tr.y,t.bl.x,t.bl.y,t.br.x,t.br.y,t.tex.h,t.tex.w,t.tex.x,t.tex.y,t.anchorAngle,t.glyphAngle,t.maxScale,t.minScale)}},{"../../symbol/anchor":384,"../../symbol/clip_line":386,"../../symbol/collision_feature":388,"../../symbol/get_anchors":390,"../../symbol/mergelines":393,"../../symbol/quads":394,"../../symbol/resolve_text":395,"../../symbol/shaping":396,"../../util/token":434,"../../util/util":435,"../bucket":322,"../load_geometry":330,"point-geometry":476}],327:[function(t,e,r){"use strict";function n(t,e,r){this.arrayBuffer=t.arrayBuffer,this.length=t.length,this.attributes=e.members,this.itemSize=e.bytesPerElement,this.type=r,this.arrayType=e}e.exports=n,n.prototype.bind=function(t){var e=t[this.type];this.buffer?t.bindBuffer(e,this.buffer):(this.buffer=t.createBuffer(),t.bindBuffer(e,this.buffer),t.bufferData(e,this.arrayBuffer,t.STATIC_DRAW),this.arrayBuffer=null)};var i={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT"};n.prototype.setVertexAttribPointers=function(t,e){for(var r=0;r<this.attributes.length;r++){var n=this.attributes[r],a=e[n.name];void 0!==a&&t.vertexAttribPointer(a,n.components,t[i[n.type]],!1,this.arrayType.bytesPerElement,n.offset)}},n.prototype.destroy=function(t){this.buffer&&t.deleteBuffer(this.buffer)},n.BufferType={VERTEX:"ARRAY_BUFFER",ELEMENT:"ELEMENT_ARRAY_BUFFER"}},{}],328:[function(t,e,r){"use strict";function n(t,e){this.layoutVertexBuffer=new a(t.layoutVertexArray,e.layoutVertexArrayType,a.BufferType.VERTEX),t.elementArray&&(this.elementBuffer=new a(t.elementArray,e.elementArrayType,a.BufferType.ELEMENT));var r,n=this.vaos={};t.elementArray2&&(this.elementBuffer2=new a(t.elementArray2,e.elementArrayType2,a.BufferType.ELEMENT),r=this.secondVaos={}),this.paintVertexBuffers=i.mapObject(t.paintVertexArrays,function(i,s){return n[s]=new o,t.elementArray2&&(r[s]=new o),new a(i,e.paintVertexArrayTypes[s],a.BufferType.VERTEX)})}var i=t("../util/util"),a=t("./buffer"),o=t("../render/vertex_array_object");e.exports=n,n.prototype.destroy=function(t){this.layoutVertexBuffer.destroy(t),this.elementBuffer&&this.elementBuffer.destroy(t),this.elementBuffer2&&this.elementBuffer2.destroy(t);for(var e in this.paintVertexBuffers)this.paintVertexBuffers[e].destroy(t);for(var r in this.vaos)this.vaos[r].destroy(t);for(var n in this.secondVaos)this.secondVaos[n].destroy(t)}},{"../render/vertex_array_object":350,"../util/util":435,"./buffer":327}],329:[function(t,e,r){"use strict";function n(t,e,r){if(t.grid){var n=t,i=e;t=n.coord,e=n.overscaling,this.grid=new p(n.grid),this.featureIndexArray=new k(n.featureIndexArray),this.rawTileData=i,this.bucketLayerIDs=n.bucketLayerIDs}else this.grid=new p(h,16,0),this.featureIndexArray=new k;this.coord=t,this.overscaling=e,this.x=t.x,this.y=t.y,this.z=t.z-Math.log(e)/Math.LN2,this.setCollisionTile(r)}function i(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function a(t,e){return e-t}function o(t){return t["line-gap-width"]>0?t["line-gap-width"]+2*t["line-width"]:t["line-width"]}function s(t,e,r,n,i){if(!e[0]&&!e[1])return t;e=u.convert(e),"viewport"===r&&e._rotate(-n);for(var a=[],o=0;o<t.length;o++){for(var s=t[o],l=[],c=0;c<s.length;c++)l.push(s[c].sub(e._mult(i)));a.push(l)}return a}function l(t,e){for(var r=[],n=new u(0,0),i=0;i<t.length;i++){for(var a=t[i],o=[],s=0;s<a.length;s++){var l=a[s-1],c=a[s],h=a[s+1],f=0===s?n:c.sub(l)._unit()._perp(),d=s===a.length-1?n:h.sub(c)._unit()._perp(),p=f._add(d)._unit(),m=p.x*d.x+p.y*d.y;p._mult(1/m),o.push(p._mult(e)._add(c))}r.push(o)}return r}var u=t("point-geometry"),c=t("./load_geometry"),h=t("./bucket").EXTENT,f=t("feature-filter"),d=t("../util/struct_array"),p=t("grid-index"),m=t("../util/dictionary_coder"),v=t("vector-tile"),g=t("pbf"),y=t("../util/vectortile_to_geojson"),b=t("../util/util").arraysIntersect,x=t("../util/intersection_tests"),_=x.multiPolygonIntersectsBufferedMultiPoint,w=x.multiPolygonIntersectsMultiPolygon,M=x.multiPolygonIntersectsBufferedMultiLine,k=new d({members:[{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]});e.exports=n,n.prototype.insert=function(t,e,r,n){var i=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(e,r,n);for(var a=c(t),o=0;o<a.length;o++){for(var s=a[o],l=[1/0,1/0,-1/0,-1/0],u=0;u<s.length;u++){var h=s[u];l[0]=Math.min(l[0],h.x),l[1]=Math.min(l[1],h.y),l[2]=Math.max(l[2],h.x),l[3]=Math.max(l[3],h.y)}this.grid.insert(i,l[0],l[1],l[2],l[3])}},n.prototype.setCollisionTile=function(t){this.collisionTile=t},n.prototype.serialize=function(){var t={coord:this.coord,overscaling:this.overscaling,grid:this.grid.toArrayBuffer(),featureIndexArray:this.featureIndexArray.serialize(),bucketLayerIDs:this.bucketLayerIDs};return{data:t,transferables:[t.grid,t.featureIndexArray.arrayBuffer]}},n.prototype.query=function(t,e){this.vtLayers||(this.vtLayers=new v.VectorTile(new g(new Uint8Array(this.rawTileData))).layers,this.sourceLayerCoder=new m(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"]));var r={},n=t.params||{},s=h/t.tileSize/t.scale,l=f(n.filter),c=0;for(var d in e){var p=e[d],y=p.paint,b=0;"line"===p.type?b=o(y)/2+Math.abs(y["line-offset"])+i(y["line-translate"]):"fill"===p.type?b=i(y["fill-translate"]):"circle"===p.type&&(b=y["circle-radius"]+i(y["circle-translate"])),c=Math.max(c,b*s)}for(var x=t.queryGeometry.map(function(t){return t.map(function(t){return new u(t.x,t.y)})}),_=1/0,w=1/0,M=-1/0,k=-1/0,A=0;A<x.length;A++)for(var T=x[A],S=0;S<T.length;S++){var E=T[S];_=Math.min(_,E.x),w=Math.min(w,E.y),M=Math.max(M,E.x),k=Math.max(k,E.y)}var L=this.grid.query(_-c,w-c,M+c,k+c);L.sort(a),this.filterMatching(r,L,this.featureIndexArray,x,l,n.layers,e,t.bearing,s);var C=this.collisionTile.queryRenderedSymbols(_,w,M,k,t.scale);return C.sort(),this.filterMatching(r,C,this.collisionTile.collisionBoxArray,x,l,n.layers,e,t.bearing,s),r},n.prototype.filterMatching=function(t,e,r,n,i,a,u,h,f){for(var d,p=0;p<e.length;p++){var m=e[p];if(m!==d){d=m;var v=r.get(m),g=this.bucketLayerIDs[v.bucketIndex];if(!a||b(a,g)){var x=this.sourceLayerCoder.decode(v.sourceLayerIndex),k=this.vtLayers[x],A=k.feature(v.featureIndex);if(i(A))for(var T=null,S=0;S<g.length;S++){var E=g[S];if(!(a&&a.indexOf(E)<0)){var L=u[E];if(L){var C;if("symbol"!==L.type){T||(T=c(A));var z=L.paint;if("line"===L.type){C=s(n,z["line-translate"],z["line-translate-anchor"],h,f);var D=o(z)/2*f;if(z["line-offset"]&&(T=l(T,z["line-offset"]*f)),!M(C,T,D))continue}else if("fill"===L.type){if(C=s(n,z["fill-translate"],z["fill-translate-anchor"],h,f),!w(C,T))continue}else if("circle"===L.type){C=s(n,z["circle-translate"],z["circle-translate-anchor"],h,f);var I=z["circle-radius"]*f;if(!_(C,T,I))continue}}var P=new y(A,this.z,this.x,this.y);P.layer=L.serialize({includeRefProperties:!0});var O=t[E];void 0===O&&(O=t[E]=[]),O.push(P)}}}}}}}},{"../util/dictionary_coder":425,"../util/intersection_tests":430,"../util/struct_array":433,"../util/util":435,"../util/vectortile_to_geojson":436,"./bucket":322,"./load_geometry":330,"feature-filter":128,"grid-index":282,pbf:470,"point-geometry":476,"vector-tile":542}],330:[function(t,e,r){"use strict";function n(t){return{min:-1*Math.pow(2,t-1),max:Math.pow(2,t-1)-1}}var i=t("../util/util"),a=t("./bucket").EXTENT,o=t("assert"),s={15:n(15),16:n(16)};e.exports=function(t,e){var r=s[e||16];o(r);for(var n=a/t.extent,l=t.loadGeometry(),u=0;u<l.length;u++)for(var c=l[u],h=0;h<c.length;h++){var f=c[h];f.x=Math.round(f.x*n),f.y=Math.round(f.y*n),(f.x<r.min||f.x>r.max||f.y<r.min||f.y>r.max)&&i.warnOnce("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return l}},{"../util/util":435,"./bucket":322,assert:43}],331:[function(t,e,r){"use strict";function n(t,e,r){this.column=t,this.row=e,this.zoom=r}e.exports=n,n.prototype={clone:function(){return new n(this.column,this.row,this.zoom)},zoomTo:function(t){return this.clone()._zoomTo(t)},sub:function(t){return this.clone()._sub(t)},_zoomTo:function(t){var e=Math.pow(2,t-this.zoom);return this.column*=e,this.row*=e,this.zoom=t,this},_sub:function(t){return t=t.zoomTo(this.zoom),this.column-=t.column,this.row-=t.row,this}}},{}],332:[function(t,e,r){"use strict";function n(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")}e.exports=n;var i=t("../util/util").wrap;n.prototype.wrap=function(){return new n(i(this.lng,-180,180),this.lat)},n.prototype.toArray=function(){return[this.lng,this.lat]},n.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},n.convert=function(t){return t instanceof n?t:Array.isArray(t)?new n(t[0],t[1]):t}},{"../util/util":435}],333:[function(t,e,r){"use strict";function n(t,e){t&&(e?this.extend(t).extend(e):4===t.length?this.extend([t[0],t[1]]).extend([t[2],t[3]]):this.extend(t[0]).extend(t[1]))}e.exports=n;var i=t("./lng_lat");n.prototype={extend:function(t){var e,r,a=this._sw,o=this._ne;if(t instanceof i)e=t,r=t;else{if(!(t instanceof n))return t?this.extend(i.convert(t)||n.convert(t)):this;if(e=t._sw,r=t._ne,!e||!r)return this}return a||o?(a.lng=Math.min(e.lng,a.lng),a.lat=Math.min(e.lat,a.lat),o.lng=Math.max(r.lng,o.lng),o.lat=Math.max(r.lat,o.lat)):(this._sw=new i(e.lng,e.lat),this._ne=new i(r.lng,r.lat)),this},getCenter:function(){return new i((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},getSouthWest:function(){return this._sw},getNorthEast:function(){return this._ne},getNorthWest:function(){return new i(this.getWest(),this.getNorth())},getSouthEast:function(){return new i(this.getEast(),this.getSouth())},getWest:function(){return this._sw.lng},getSouth:function(){return this._sw.lat},getEast:function(){return this._ne.lng},getNorth:function(){return this._ne.lat},toArray:function(){return[this._sw.toArray(),this._ne.toArray()]},toString:function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"}},n.convert=function(t){return!t||t instanceof n?t:new n(t)}},{"./lng_lat":332}],334:[function(t,e,r){"use strict";function n(t,e){this.tileSize=512,this._minZoom=t||0,this._maxZoom=e||22,this.latRange=[-85.05113,85.05113],this.width=0,this.height=0,this._center=new i(0,0),this.zoom=0,this.angle=0,this._altitude=1.5,this._pitch=0,this._unmodified=!0}var i=t("./lng_lat"),a=t("point-geometry"),o=t("./coordinate"),s=t("../util/util").wrap,l=t("../util/interpolate"),u=t("../source/tile_coord"),c=t("../data/bucket").EXTENT,h=t("gl-matrix"),f=h.vec4,d=h.mat4,p=h.mat2;e.exports=n,n.prototype={get minZoom(){return this._minZoom},set minZoom(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))},get maxZoom(){return this._maxZoom},set maxZoom(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))},get worldSize(){return this.tileSize*this.scale},get centerPoint(){return this.size._div(2)},get size(){return new a(this.width,this.height)},get bearing(){return-this.angle/Math.PI*180},set bearing(t){var e=-s(t,-180,180)*Math.PI/180;this.angle!==e&&(this._unmodified=!1,this.angle=e,this._calcMatrices(),this.rotationMatrix=p.create(),p.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},get pitch(){return this._pitch/Math.PI*180},set pitch(t){var e=Math.min(60,t)/180*Math.PI;this._pitch!==e&&(this._unmodified=!1,this._pitch=e,this._calcMatrices())},get altitude(){return this._altitude},set altitude(t){var e=Math.max(.75,t);this._altitude!==e&&(this._unmodified=!1,this._altitude=e,this._calcMatrices())},get zoom(){return this._zoom},set zoom(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._calcMatrices(),this._constrain())},get center(){return this._center},set center(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._calcMatrices(),this._constrain())},coveringZoomLevel:function(t){return(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize))},coveringTiles:function(t){var e=this.coveringZoomLevel(t),r=e;if(e<t.minzoom)return[];e>t.maxzoom&&(e=t.maxzoom);var n=this,i=n.locationCoordinate(n.center)._zoomTo(e),o=new a(i.column-.5,i.row-.5);return u.cover(e,[n.pointCoordinate(new a(0,0))._zoomTo(e),n.pointCoordinate(new a(n.width,0))._zoomTo(e),n.pointCoordinate(new a(n.width,n.height))._zoomTo(e),n.pointCoordinate(new a(0,n.height))._zoomTo(e)],t.reparseOverscaled?r:e).sort(function(t,e){return o.dist(t)-o.dist(e)})},resize:function(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._calcMatrices(),this._constrain()},get unmodified(){return this._unmodified},zoomScale:function(t){return Math.pow(2,t)},scaleZoom:function(t){return Math.log(t)/Math.LN2},project:function(t,e){return new a(this.lngX(t.lng,e),this.latY(t.lat,e))},unproject:function(t,e){return new i(this.xLng(t.x,e),this.yLat(t.y,e))},get x(){return this.lngX(this.center.lng)},get y(){return this.latY(this.center.lat)},get point(){return new a(this.x,this.y)},lngX:function(t,e){return(180+t)*(e||this.worldSize)/360},latY:function(t,e){
33 return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))*(e||this.worldSize)/360},xLng:function(t,e){return 360*t/(e||this.worldSize)-180},yLat:function(t,e){var r=180-360*t/(e||this.worldSize);return 360/Math.PI*Math.atan(Math.exp(r*Math.PI/180))-90},panBy:function(t){var e=this.centerPoint._add(t);this.center=this.pointLocation(e)},setLocationAtPoint:function(t,e){var r=this.locationCoordinate(t),n=this.pointCoordinate(e),i=this.pointCoordinate(this.centerPoint),a=n._sub(r);this._unmodified=!1,this.center=this.coordinateLocation(i._sub(a))},locationPoint:function(t){return this.coordinatePoint(this.locationCoordinate(t))},pointLocation:function(t){return this.coordinateLocation(this.pointCoordinate(t))},locationCoordinate:function(t){var e=this.zoomScale(this.tileZoom)/this.worldSize,r=i.convert(t);return new o(this.lngX(r.lng)*e,this.latY(r.lat)*e,this.tileZoom)},coordinateLocation:function(t){var e=this.zoomScale(t.zoom);return new i(this.xLng(t.column,e),this.yLat(t.row,e))},pointCoordinate:function(t){var e=[t.x,t.y,0,1],r=[t.x,t.y,1,1];f.transformMat4(e,e,this.pixelMatrixInverse),f.transformMat4(r,r,this.pixelMatrixInverse);var n=e[3],i=r[3],a=e[0]/n,s=r[0]/i,u=e[1]/n,c=r[1]/i,h=e[2]/n,d=r[2]/i,p=h===d?0:(0-h)/(d-h),m=this.worldSize/this.zoomScale(this.tileZoom);return new o(l(a,s,p)/m,l(u,c,p)/m,this.tileZoom)},coordinatePoint:function(t){var e=this.worldSize/this.zoomScale(t.zoom),r=[t.column*e,t.row*e,0,1];return f.transformMat4(r,r,this.pixelMatrix),new a(r[0]/r[3],r[1]/r[3])},calculatePosMatrix:function(t,e){void 0===e&&(e=1/0),t instanceof u&&(t=t.toCoordinate(e));var r=Math.min(t.zoom,e),n=this.worldSize/Math.pow(2,r),i=new Float64Array(16);return d.identity(i),d.translate(i,i,[t.column*n,t.row*n,0]),d.scale(i,i,[n/c,n/c,1]),d.multiply(i,this.projMatrix,i),new Float32Array(i)},_constrain:function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var t,e,r,n,i,o,s,l,u=this.size,c=this._unmodified;this.latRange&&(t=this.latY(this.latRange[1]),e=this.latY(this.latRange[0]),i=e-t<u.y?u.y/(e-t):0),this.lngRange&&(r=this.lngX(this.lngRange[0]),n=this.lngX(this.lngRange[1]),o=n-r<u.x?u.x/(n-r):0);var h=Math.max(o||0,i||0);if(h)return this.center=this.unproject(new a(o?(n+r)/2:this.x,i?(e+t)/2:this.y)),this.zoom+=this.scaleZoom(h),this._unmodified=c,void(this._constraining=!1);if(this.latRange){var f=this.y,d=u.y/2;f-d<t&&(l=t+d),f+d>e&&(l=e-d)}if(this.lngRange){var p=this.x,m=u.x/2;p-m<r&&(s=r+m),p+m>n&&(s=n-m)}void 0===s&&void 0===l||(this.center=this.unproject(new a(void 0!==s?s:this.x,void 0!==l?l:this.y))),this._unmodified=c,this._constraining=!1}},_calcMatrices:function(){if(this.height){var t=Math.atan(.5/this.altitude),e=Math.sin(t)*this.altitude/Math.sin(Math.PI/2-this._pitch-t),r=Math.cos(Math.PI/2-this._pitch)*e+this.altitude,n=new Float64Array(16);if(d.perspective(n,2*Math.atan(this.height/2/this.altitude),this.width/this.height,.1,r),d.translate(n,n,[0,0,-this.altitude]),d.scale(n,n,[1,-1,1/this.height]),d.rotateX(n,n,this._pitch),d.rotateZ(n,n,this.angle),d.translate(n,n,[-this.x,-this.y,0]),this.projMatrix=n,n=d.create(),d.scale(n,n,[this.width/2,-this.height/2,1]),d.translate(n,n,[1,-1,0]),this.pixelMatrix=d.multiply(new Float64Array(16),n,this.projMatrix),!(n=d.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=n}}}},{"../data/bucket":322,"../source/tile_coord":362,"../util/interpolate":429,"../util/util":435,"./coordinate":331,"./lng_lat":332,"gl-matrix":188,"point-geometry":476}],335:[function(t,e,r){"use strict";var n={" ":[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]]};e.exports=function(t,e,r,i){i=i||1;var a,o,s,l,u,c,h,f,d=[];for(a=0,o=t.length;a<o;a++)if(u=n[t[a]]){for(f=null,s=0,l=u[1].length;s<l;s+=2)u[1][s]===-1&&u[1][s+1]===-1?f=null:(c=e+u[1][s]*i,h=r-u[1][s+1]*i,f&&d.push(f.x,f.y,c,h),f={x:c,y:h});e+=u[0]*i}return d}},{}],336:[function(t,e,r){"use strict";var n=e.exports={};n.version=t("../package.json").version,n.Map=t("./ui/map"),n.Control=t("./ui/control/control"),n.Navigation=t("./ui/control/navigation"),n.Geolocate=t("./ui/control/geolocate"),n.Attribution=t("./ui/control/attribution"),n.Popup=t("./ui/popup"),n.Marker=t("./ui/marker"),n.Style=t("./style/style"),n.LngLat=t("./geo/lng_lat"),n.LngLatBounds=t("./geo/lng_lat_bounds"),n.Point=t("point-geometry"),n.Evented=t("./util/evented"),n.util=t("./util/util"),n.supported=t("./util/browser").supported;var i=t("./util/ajax");n.util.getJSON=i.getJSON,n.util.getArrayBuffer=i.getArrayBuffer;var a=t("./util/config");n.config=a,Object.defineProperty(n,"accessToken",{get:function(){return a.ACCESS_TOKEN},set:function(t){a.ACCESS_TOKEN=t}})},{"../package.json":437,"./geo/lng_lat":332,"./geo/lng_lat_bounds":333,"./style/style":371,"./ui/control/attribution":402,"./ui/control/control":403,"./ui/control/geolocate":404,"./ui/control/navigation":405,"./ui/map":414,"./ui/marker":415,"./ui/popup":416,"./util/ajax":418,"./util/browser":419,"./util/config":424,"./util/evented":427,"./util/util":435,"point-geometry":476}],337:[function(t,e,r){"use strict";var n=t("assert");e.exports=function(t){for(var e={define:{},initialize:{}},r=0;r<t.length;r++){var i=t[r];n("u_"===i.name.slice(0,2));var a="{precision} "+(1===i.components?"float":"vec"+i.components);e.define[i.name.slice(2)]="uniform "+a+" "+i.name+";\n",e.initialize[i.name.slice(2)]=a+" "+i.name.slice(2)+" = "+i.name+";\n"}return e}},{assert:43}],338:[function(t,e,r){"use strict";function n(t,e,r){var n,s=t.gl,l=t.transform,u=r.paint["background-color"],c=r.paint["background-pattern"],h=r.paint["background-opacity"],f=c?t.spriteAtlas.getPosition(c.from,!0):null,d=c?t.spriteAtlas.getPosition(c.to,!0):null;if(t.setDepthSublayer(0),f&&d){if(t.isOpaquePass)return;n=t.useProgram("pattern"),s.uniform1i(n.u_image,0),s.uniform2fv(n.u_pattern_tl_a,f.tl),s.uniform2fv(n.u_pattern_br_a,f.br),s.uniform2fv(n.u_pattern_tl_b,d.tl),s.uniform2fv(n.u_pattern_br_b,d.br),s.uniform1f(n.u_opacity,h),s.uniform1f(n.u_mix,c.t),s.uniform2fv(n.u_pattern_size_a,f.size),s.uniform2fv(n.u_pattern_size_b,d.size),s.uniform1f(n.u_scale_a,c.fromScale),s.uniform1f(n.u_scale_b,c.toScale),s.activeTexture(s.TEXTURE0),t.spriteAtlas.bind(s,!0),t.tileExtentPatternVAO.bind(s,n,t.tileExtentBuffer)}else{if(t.isOpaquePass!==(1===u[3]))return;var p=a([{name:"u_color",components:4},{name:"u_opacity",components:1}]);n=t.useProgram("fill",[],p,p),s.uniform4fv(n.u_color,u),s.uniform1f(n.u_opacity,h),t.tileExtentVAO.bind(s,n,t.tileExtentBuffer)}s.disable(s.STENCIL_TEST);for(var m=l.coveringTiles({tileSize:o}),v=0;v<m.length;v++){var g=m[v];if(f&&d){var y={coord:g,tileSize:o};s.uniform1f(n.u_tile_units_to_pixels,1/i(y,1,t.transform.tileZoom));var b=y.tileSize*Math.pow(2,t.transform.tileZoom-y.coord.z),x=b*(y.coord.x+g.w*Math.pow(2,y.coord.z)),_=b*y.coord.y;s.uniform2f(n.u_pixel_coord_upper,x>>16,_>>16),s.uniform2f(n.u_pixel_coord_lower,65535&x,65535&_)}s.uniformMatrix4fv(n.u_matrix,!1,t.transform.calculatePosMatrix(g)),s.drawArrays(s.TRIANGLE_STRIP,0,t.tileExtentBuffer.length)}s.stencilMask(0),s.stencilFunc(s.EQUAL,128,128)}var i=t("../source/pixels_to_tile_units"),a=t("./create_uniform_pragmas"),o=512;e.exports=n},{"../source/pixels_to_tile_units":356,"./create_uniform_pragmas":337}],339:[function(t,e,r){"use strict";function n(t,e,r,n){if(!t.isOpaquePass){var a=t.gl;t.setDepthSublayer(0),t.depthMask(!1),a.disable(a.STENCIL_TEST);for(var o=0;o<n.length;o++){var s=n[o],l=e.getTile(s),u=l.getBucket(r);if(u){var c=u.bufferGroups.circle;if(c){var h=u.paintAttributes.circle[r.id],f=t.useProgram("circle",h.defines,h.vertexPragmas,h.fragmentPragmas);"map"===r.paint["circle-pitch-scale"]?(a.uniform1i(f.u_scale_with_map,!0),a.uniform2f(f.u_extrude_scale,t.transform.pixelsToGLUnits[0]*t.transform.altitude,t.transform.pixelsToGLUnits[1]*t.transform.altitude)):(a.uniform1i(f.u_scale_with_map,!1),a.uniform2fv(f.u_extrude_scale,t.transform.pixelsToGLUnits)),a.uniform1f(f.u_devicepixelratio,i.devicePixelRatio),a.uniformMatrix4fv(f.u_matrix,!1,t.translatePosMatrix(s.posMatrix,l,r.paint["circle-translate"],r.paint["circle-translate-anchor"])),u.setUniforms(a,"circle",f,r,{zoom:t.transform.zoom});for(var d=0;d<c.length;d++){var p=c[d];p.vaos[r.id].bind(a,f,p.layoutVertexBuffer,p.elementBuffer,p.paintVertexBuffers[r.id]),a.drawElements(a.TRIANGLES,3*p.elementBuffer.length,a.UNSIGNED_SHORT,0)}}}}}}var i=t("../util/browser");e.exports=n},{"../util/browser":419}],340:[function(t,e,r){"use strict";function n(t,e,r,n){var i=t.gl;i.enable(i.STENCIL_TEST);for(var a=t.useProgram("collisionbox"),o=0;o<n.length;o++){var s=n[o],l=e.getTile(s),u=l.getBucket(r);if(u){var c=u.bufferGroups.collisionBox;if(c&&c.length){var h=c[0];0!==h.layoutVertexBuffer.length&&(i.uniformMatrix4fv(a.u_matrix,!1,s.posMatrix),t.enableTileClippingMask(s),t.lineWidth(1),i.uniform1f(a.u_scale,Math.pow(2,t.transform.zoom-l.coord.z)),i.uniform1f(a.u_zoom,10*t.transform.zoom),i.uniform1f(a.u_maxzoom,10*(l.coord.z+1)),h.vaos[r.id].bind(i,a,h.layoutVertexBuffer),i.drawArrays(i.LINES,0,h.layoutVertexBuffer.length))}}}}e.exports=n},{}],341:[function(t,e,r){"use strict";function n(t,e,r){if(!t.isOpaquePass&&t.options.debug)for(var n=0;n<r.length;n++)i(t,e,r[n])}function i(t,e,r){var n=t.gl;n.disable(n.STENCIL_TEST),t.lineWidth(1*o.devicePixelRatio);var i=r.posMatrix,h=t.useProgram("debug");n.uniformMatrix4fv(h.u_matrix,!1,i),n.uniform4f(h.u_color,1,0,0,1),t.debugVAO.bind(n,h,t.debugBuffer),n.drawArrays(n.LINE_STRIP,0,t.debugBuffer.length);for(var f=a(r.toString(),50,200,5),d=new t.PosArray,p=0;p<f.length;p+=2)d.emplaceBack(f[p],f[p+1]);var m=new u(d.serialize(),t.PosArray.serialize(),u.BufferType.VERTEX);(new c).bind(n,h,m),n.uniform4f(h.u_color,1,1,1,1);for(var v=e.getTile(r).tileSize,g=l/(Math.pow(2,t.transform.zoom-r.z)*v),y=[[-1,-1],[-1,1],[1,-1],[1,1]],b=0;b<y.length;b++){var x=y[b];n.uniformMatrix4fv(h.u_matrix,!1,s.translate([],i,[g*x[0],g*x[1],0])),n.drawArrays(n.LINES,0,m.length)}n.uniform4f(h.u_color,0,0,0,1),n.uniformMatrix4fv(h.u_matrix,!1,i),n.drawArrays(n.LINES,0,m.length)}var a=t("../lib/debugtext"),o=t("../util/browser"),s=t("gl-matrix").mat4,l=t("../data/bucket").EXTENT,u=t("../data/buffer"),c=t("./vertex_array_object");e.exports=n},{"../data/bucket":322,"../data/buffer":327,"../lib/debugtext":335,"../util/browser":419,"./vertex_array_object":350,"gl-matrix":188}],342:[function(t,e,r){"use strict";function n(t,e,r,n){var o=t.gl;o.enable(o.STENCIL_TEST);var s;if(s=!r.paint["fill-pattern"]&&(r.isPaintValueFeatureConstant("fill-color")&&r.isPaintValueFeatureConstant("fill-opacity")&&1===r.paint["fill-color"][3]&&1===r.paint["fill-opacity"]),t.isOpaquePass===s){t.setDepthSublayer(1);for(var l=0;l<n.length;l++)i(t,e,r,n[l])}if(!t.isOpaquePass&&r.paint["fill-antialias"]){t.lineWidth(2),t.depthMask(!1);var u=r.getPaintProperty("fill-outline-color");(u||!r.paint["fill-pattern"])&&u?t.setDepthSublayer(2):t.setDepthSublayer(0);for(var c=0;c<n.length;c++)a(t,e,r,n[c])}}function i(t,e,r,n){var i=e.getTile(n),a=i.getBucket(r);if(a){var s=a.bufferGroups.fill;if(s){var l,u=t.gl,c=r.paint["fill-pattern"];if(c)l=t.useProgram("pattern"),o(c,r.paint["fill-opacity"],i,n,t,l),u.activeTexture(u.TEXTURE0),t.spriteAtlas.bind(u,!0);else{var h=a.paintAttributes.fill[r.id];l=t.useProgram("fill",h.defines,h.vertexPragmas,h.fragmentPragmas),a.setUniforms(u,"fill",l,r,{zoom:t.transform.zoom})}u.uniformMatrix4fv(l.u_matrix,!1,t.translatePosMatrix(n.posMatrix,i,r.paint["fill-translate"],r.paint["fill-translate-anchor"])),t.enableTileClippingMask(n);for(var f=0;f<s.length;f++){var d=s[f];d.vaos[r.id].bind(u,l,d.layoutVertexBuffer,d.elementBuffer,d.paintVertexBuffers[r.id]),u.drawElements(u.TRIANGLES,d.elementBuffer.length,u.UNSIGNED_SHORT,0)}}}}function a(t,e,r,n){var i=e.getTile(n),a=i.getBucket(r);if(a){var s,l=t.gl,u=a.bufferGroups.fill,c=r.paint["fill-pattern"],h=r.paint["fill-opacity"],f=r.getPaintProperty("fill-outline-color");if(c&&!f)s=t.useProgram("outlinepattern"),l.uniform2f(s.u_world,l.drawingBufferWidth,l.drawingBufferHeight);else{var d=a.paintAttributes.fill[r.id];s=t.useProgram("outline",d.defines,d.vertexPragmas,d.fragmentPragmas),l.uniform2f(s.u_world,l.drawingBufferWidth,l.drawingBufferHeight),l.uniform1f(s.u_opacity,h),a.setUniforms(l,"fill",s,r,{zoom:t.transform.zoom})}l.uniformMatrix4fv(s.u_matrix,!1,t.translatePosMatrix(n.posMatrix,i,r.paint["fill-translate"],r.paint["fill-translate-anchor"])),c&&o(c,h,i,n,t,s),t.enableTileClippingMask(n);for(var p=0;p<u.length;p++){var m=u[p];m.secondVaos[r.id].bind(l,s,m.layoutVertexBuffer,m.elementBuffer2,m.paintVertexBuffers[r.id]),l.drawElements(l.LINES,2*m.elementBuffer2.length,l.UNSIGNED_SHORT,0)}}}function o(t,e,r,n,i,a){var o=i.gl,l=i.spriteAtlas.getPosition(t.from,!0),u=i.spriteAtlas.getPosition(t.to,!0);if(l&&u){o.uniform1i(a.u_image,0),o.uniform2fv(a.u_pattern_tl_a,l.tl),o.uniform2fv(a.u_pattern_br_a,l.br),o.uniform2fv(a.u_pattern_tl_b,u.tl),o.uniform2fv(a.u_pattern_br_b,u.br),o.uniform1f(a.u_opacity,e),o.uniform1f(a.u_mix,t.t),o.uniform1f(a.u_tile_units_to_pixels,1/s(r,1,i.transform.tileZoom)),o.uniform2fv(a.u_pattern_size_a,l.size),o.uniform2fv(a.u_pattern_size_b,u.size),o.uniform1f(a.u_scale_a,t.fromScale),o.uniform1f(a.u_scale_b,t.toScale);var c=r.tileSize*Math.pow(2,i.transform.tileZoom-r.coord.z),h=c*(r.coord.x+n.w*Math.pow(2,r.coord.z)),f=c*r.coord.y;o.uniform2f(a.u_pixel_coord_upper,h>>16,f>>16),o.uniform2f(a.u_pixel_coord_lower,65535&h,65535&f),o.activeTexture(o.TEXTURE0),i.spriteAtlas.bind(o,!0)}}var s=t("../source/pixels_to_tile_units");e.exports=n},{"../source/pixels_to_tile_units":356}],343:[function(t,e,r){"use strict";var n=t("../util/browser"),i=t("gl-matrix").mat2,a=t("../source/pixels_to_tile_units");e.exports=function(t,e,r,o){if(!t.isOpaquePass){t.setDepthSublayer(0),t.depthMask(!1);var s=t.gl;if(s.enable(s.STENCIL_TEST),!(r.paint["line-width"]<=0)){var l=1/n.devicePixelRatio,u=r.paint["line-blur"]+l,c=r.paint["line-color"],h=t.transform,f=i.create();i.scale(f,f,[1,Math.cos(h._pitch)]),i.rotate(f,f,t.transform.angle);var d,p,m,v,g,y=Math.sqrt(h.height*h.height/4*(1+h.altitude*h.altitude)),b=h.height/2*Math.tan(h._pitch),x=(y+b)/y-1,_=r.paint["line-dasharray"],w=r.paint["line-pattern"];if(_)d=t.useProgram("linesdfpattern"),s.uniform1f(d.u_linewidth,r.paint["line-width"]/2),s.uniform1f(d.u_gapwidth,r.paint["line-gap-width"]/2),s.uniform1f(d.u_antialiasing,l/2),s.uniform1f(d.u_blur,u),s.uniform4fv(d.u_color,c),s.uniform1f(d.u_opacity,r.paint["line-opacity"]),p=t.lineAtlas.getDash(_.from,"round"===r.layout["line-cap"]),m=t.lineAtlas.getDash(_.to,"round"===r.layout["line-cap"]),s.uniform1i(d.u_image,0),s.activeTexture(s.TEXTURE0),t.lineAtlas.bind(s),s.uniform1f(d.u_tex_y_a,p.y),s.uniform1f(d.u_tex_y_b,m.y),s.uniform1f(d.u_mix,_.t),s.uniform1f(d.u_extra,x),s.uniform1f(d.u_offset,-r.paint["line-offset"]),s.uniformMatrix2fv(d.u_antialiasingmatrix,!1,f);else if(w){if(v=t.spriteAtlas.getPosition(w.from,!0),g=t.spriteAtlas.getPosition(w.to,!0),!v||!g)return;d=t.useProgram("linepattern"),s.uniform1i(d.u_image,0),s.activeTexture(s.TEXTURE0),t.spriteAtlas.bind(s,!0),s.uniform1f(d.u_linewidth,r.paint["line-width"]/2),s.uniform1f(d.u_gapwidth,r.paint["line-gap-width"]/2),s.uniform1f(d.u_antialiasing,l/2),s.uniform1f(d.u_blur,u),s.uniform2fv(d.u_pattern_tl_a,v.tl),s.uniform2fv(d.u_pattern_br_a,v.br),s.uniform2fv(d.u_pattern_tl_b,g.tl),s.uniform2fv(d.u_pattern_br_b,g.br),s.uniform1f(d.u_fade,w.t),s.uniform1f(d.u_opacity,r.paint["line-opacity"]),s.uniform1f(d.u_extra,x),s.uniform1f(d.u_offset,-r.paint["line-offset"]),s.uniformMatrix2fv(d.u_antialiasingmatrix,!1,f)}else d=t.useProgram("line"),s.uniform1f(d.u_linewidth,r.paint["line-width"]/2),s.uniform1f(d.u_gapwidth,r.paint["line-gap-width"]/2),s.uniform1f(d.u_antialiasing,l/2),s.uniform1f(d.u_blur,u),s.uniform1f(d.u_extra,x),s.uniform1f(d.u_offset,-r.paint["line-offset"]),s.uniformMatrix2fv(d.u_antialiasingmatrix,!1,f),s.uniform4fv(d.u_color,c),s.uniform1f(d.u_opacity,r.paint["line-opacity"]);for(var M=0;M<o.length;M++){var k=o[M],A=e.getTile(k),T=A.getBucket(r);if(T){var S=T.bufferGroups.line;if(S){t.enableTileClippingMask(k);var E=t.translatePosMatrix(k.posMatrix,A,r.paint["line-translate"],r.paint["line-translate-anchor"]);s.uniformMatrix4fv(d.u_matrix,!1,E);var L=1/a(A,1,t.transform.zoom);if(_){var C=p.width*_.fromScale,z=m.width*_.toScale,D=[1/a(A,C,t.transform.tileZoom),-p.height/2],I=[1/a(A,z,t.transform.tileZoom),-m.height/2],P=t.lineAtlas.width/(256*Math.min(C,z)*n.devicePixelRatio)/2;s.uniform1f(d.u_ratio,L),s.uniform2fv(d.u_patternscale_a,D),s.uniform2fv(d.u_patternscale_b,I),s.uniform1f(d.u_sdfgamma,P)}else w?(s.uniform1f(d.u_ratio,L),s.uniform2fv(d.u_pattern_size_a,[a(A,v.size[0]*w.fromScale,t.transform.tileZoom),g.size[1]]),s.uniform2fv(d.u_pattern_size_b,[a(A,g.size[0]*w.toScale,t.transform.tileZoom),g.size[1]])):s.uniform1f(d.u_ratio,L);for(var O=0;O<S.length;O++){var j=S[O];j.vaos[r.id].bind(s,d,j.layoutVertexBuffer,j.elementBuffer),s.drawElements(s.TRIANGLES,3*j.elementBuffer.length,s.UNSIGNED_SHORT,0)}}}}}}}},{"../source/pixels_to_tile_units":356,"../util/browser":419,"gl-matrix":188}],344:[function(t,e,r){"use strict";function n(t,e,r,n){if(!t.isOpaquePass){var a=t.gl;a.enable(a.DEPTH_TEST),t.depthMask(!0),a.depthFunc(a.LESS);for(var o=n.length&&n[0].z,s=0;s<n.length;s++){var l=n[s];t.setDepthSublayer(l.z-o),i(t,e,r,l)}a.depthFunc(a.LEQUAL)}}function i(t,e,r,n){var i=t.gl;i.disable(i.STENCIL_TEST);var u=e.getTile(n),c=t.transform.calculatePosMatrix(n,e.maxzoom),h=t.useProgram("raster");i.uniformMatrix4fv(h.u_matrix,!1,c),i.uniform1f(h.u_brightness_low,r.paint["raster-brightness-min"]),i.uniform1f(h.u_brightness_high,r.paint["raster-brightness-max"]),i.uniform1f(h.u_saturation_factor,s(r.paint["raster-saturation"])),i.uniform1f(h.u_contrast_factor,o(r.paint["raster-contrast"])),i.uniform3fv(h.u_spin_weights,a(r.paint["raster-hue-rotate"]));var f,d,p=u.source&&u.source.findLoadedParent(n,0,{}),m=l(u,p,r,t.transform);i.activeTexture(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,u.texture),i.activeTexture(i.TEXTURE1),p?(i.bindTexture(i.TEXTURE_2D,p.texture),f=Math.pow(2,p.coord.z-u.coord.z),d=[u.coord.x*f%1,u.coord.y*f%1]):(i.bindTexture(i.TEXTURE_2D,u.texture),m[1]=0),i.uniform2fv(h.u_tl_parent,d||[0,0]),i.uniform1f(h.u_scale_parent,f||1),i.uniform1f(h.u_buffer_scale,1),i.uniform1f(h.u_opacity0,m[0]),i.uniform1f(h.u_opacity1,m[1]),i.uniform1i(h.u_image0,0),i.uniform1i(h.u_image1,1);var v=u.boundsBuffer||t.rasterBoundsBuffer;(u.boundsVAO||t.rasterBoundsVAO).bind(i,h,v),i.drawArrays(i.TRIANGLE_STRIP,0,v.length)}function a(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]}function o(t){return t>0?1/(1-t):1+t}function s(t){return t>0?1-1/(1.001-t):-t}function l(t,e,r,n){var i=[1,0],a=r.paint["raster-fade-duration"];if(t.source&&a>0){var o=(new Date).getTime(),s=(o-t.timeAdded)/a,l=e?(o-e.timeAdded)/a:-1,c=n.coveringZoomLevel(t.source),h=!!e&&Math.abs(e.coord.z-c)>Math.abs(t.coord.z-c);!e||h?(i[0]=u.clamp(s,0,1),i[1]=1-i[0]):(i[0]=u.clamp(1-l,0,1),i[1]=1-i[0])}var f=r.paint["raster-opacity"];return i[0]*=f,i[1]*=f,i}var u=t("../util/util"),c=t("../util/struct_array");e.exports=n,n.RasterBoundsArray=new c({members:[{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]})},{"../util/struct_array":433,"../util/util":435}],345:[function(t,e,r){"use strict";function n(t,e,r,n){if(!t.isOpaquePass){var a=!(r.layout["text-allow-overlap"]||r.layout["icon-allow-overlap"]||r.layout["text-ignore-placement"]||r.layout["icon-ignore-placement"]),o=t.gl;a?o.disable(o.STENCIL_TEST):o.enable(o.STENCIL_TEST),t.setDepthSublayer(0),t.depthMask(!1),o.disable(o.DEPTH_TEST),i(t,e,r,n,!1,r.paint["icon-translate"],r.paint["icon-translate-anchor"],r.layout["icon-rotation-alignment"],r.layout["icon-rotation-alignment"],r.layout["icon-size"],r.paint["icon-halo-width"],r.paint["icon-halo-color"],r.paint["icon-halo-blur"],r.paint["icon-opacity"],r.paint["icon-color"]),i(t,e,r,n,!0,r.paint["text-translate"],r.paint["text-translate-anchor"],r.layout["text-rotation-alignment"],r.layout["text-pitch-alignment"],r.layout["text-size"],r.paint["text-halo-width"],r.paint["text-halo-color"],r.paint["text-halo-blur"],r.paint["text-opacity"],r.paint["text-color"]),o.enable(o.DEPTH_TEST),e.map.showCollisionBoxes&&s(t,e,r,n)}}function i(t,e,r,n,i,o,s,l,u,c,h,f,d,p,m){for(var v=0;v<n.length;v++){var g=e.getTile(n[v]),y=g.getBucket(r);if(y){var b=y.bufferGroups,x=i?b.glyph:b.icon;x.length&&(t.enableTileClippingMask(n[v]),a(t,r,n[v].posMatrix,g,y,x,i,i||y.sdfIcons,!i&&y.iconsNeedLinear,i?y.adjustedTextSize:y.adjustedIconSize,y.fontstack,o,s,l,u,c,h,f,d,p,m))}}}function a(t,e,r,n,i,a,s,u,c,h,f,d,p,m,v,g,y,b,x,_,w){var M,k,A,T=t.gl,S=t.transform,E="map"===m,L="map"===v,C=s?24:1,z=g/C;if(L?(k=l(n,1,t.transform.zoom)*z,A=1/Math.cos(S._pitch),M=[k,k]):(k=t.transform.altitude*z,A=1,M=[S.pixelsToGLUnits[0]*k,S.pixelsToGLUnits[1]*k]),s||t.style.sprite.loaded()){var D=t.useProgram(u?"sdf":"icon");if(T.uniformMatrix4fv(D.u_matrix,!1,t.translatePosMatrix(r,n,d,p)),T.uniform1i(D.u_rotate_with_map,E),T.uniform1i(D.u_pitch_with_map,L),T.uniform2fv(D.u_extrude_scale,M),T.activeTexture(T.TEXTURE0),T.uniform1i(D.u_texture,0),s){var I=f&&t.glyphSource.getGlyphAtlas(f);if(!I)return;I.updateTexture(T),T.uniform2f(D.u_texsize,I.width/4,I.height/4)}else{var P=t.options.rotating||t.options.zooming,O=1!==z||o.devicePixelRatio!==t.spriteAtlas.pixelRatio||c,j=L||t.transform.pitch;t.spriteAtlas.bind(T,u||P||O||j),T.uniform2f(D.u_texsize,t.spriteAtlas.width/4,t.spriteAtlas.height/4)}var F=Math.log(g/h)/Math.LN2||0;T.uniform1f(D.u_zoom,10*(t.transform.zoom-F)),T.activeTexture(T.TEXTURE1),t.frameHistory.bind(T),T.uniform1i(D.u_fadetexture,1);var R;if(u){var N=.105*C/g/o.devicePixelRatio;if(y){T.uniform1f(D.u_gamma,(1.19*x/z/8+N)*A),T.uniform4fv(D.u_color,b),T.uniform1f(D.u_opacity,_),T.uniform1f(D.u_buffer,(6-y/z)/8);for(var B=0;B<a.length;B++)R=a[B],R.vaos[e.id].bind(T,D,R.layoutVertexBuffer,R.elementBuffer),T.drawElements(T.TRIANGLES,3*R.elementBuffer.length,T.UNSIGNED_SHORT,0)}T.uniform1f(D.u_gamma,N*A),T.uniform4fv(D.u_color,w),T.uniform1f(D.u_opacity,_),T.uniform1f(D.u_buffer,.75),T.uniform1f(D.u_pitch,S.pitch/360*2*Math.PI),T.uniform1f(D.u_bearing,S.bearing/360*2*Math.PI),T.uniform1f(D.u_aspect_ratio,S.width/S.height);for(var U=0;U<a.length;U++)R=a[U],R.vaos[e.id].bind(T,D,R.layoutVertexBuffer,R.elementBuffer),T.drawElements(T.TRIANGLES,3*R.elementBuffer.length,T.UNSIGNED_SHORT,0)}else{T.uniform1f(D.u_opacity,_);for(var V=0;V<a.length;V++)R=a[V],R.vaos[e.id].bind(T,D,R.layoutVertexBuffer,R.elementBuffer),T.drawElements(T.TRIANGLES,3*R.elementBuffer.length,T.UNSIGNED_SHORT,0)}}}var o=t("../util/browser"),s=t("./draw_collision_debug"),l=t("../source/pixels_to_tile_units");e.exports=n},{"../source/pixels_to_tile_units":356,"../util/browser":419,"./draw_collision_debug":340}],346:[function(t,e,r){"use strict";function n(){this.changeTimes=new Float64Array(256),this.changeOpacities=new Uint8Array(256),this.opacities=new Uint8ClampedArray(256),this.array=new Uint8Array(this.opacities.buffer),this.fadeDuration=300,this.previousZoom=0,this.firstFrame=!0}e.exports=n,n.prototype.record=function(t){var e=Date.now();this.firstFrame&&(e=0,this.firstFrame=!1),t=Math.floor(10*t);var r;if(t<this.previousZoom)for(r=t+1;r<=this.previousZoom;r++)this.changeTimes[r]=e,this.changeOpacities[r]=this.opacities[r];else for(r=t;r>this.previousZoom;r--)this.changeTimes[r]=e,this.changeOpacities[r]=this.opacities[r];for(r=0;r<256;r++){var n=e-this.changeTimes[r],i=n/this.fadeDuration*255;this.opacities[r]=r<=t?this.changeOpacities[r]+i:this.changeOpacities[r]-i}this.changed=!0,this.previousZoom=t},n.prototype.bind=function(t){this.texture?(t.bindTexture(t.TEXTURE_2D,this.texture),this.changed&&(t.texSubImage2D(t.TEXTURE_2D,0,0,0,256,1,t.ALPHA,t.UNSIGNED_BYTE,this.array),this.changed=!1)):(this.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texImage2D(t.TEXTURE_2D,0,t.ALPHA,256,1,0,t.ALPHA,t.UNSIGNED_BYTE,this.array))}},{}],347:[function(t,e,r){"use strict";function n(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={}}var i=t("../util/util");e.exports=n,n.prototype.setSprite=function(t){this.sprite=t},n.prototype.getDash=function(t,e){var r=t.join(",")+e;return this.positions[r]||(this.positions[r]=this.addDash(t,e)),this.positions[r]},n.prototype.addDash=function(t,e){var r=e?7:0,n=2*r+1;if(this.nextRow+n>this.height)return i.warnOnce("LineAtlas out of space"),null;for(var a=0,o=0;o<t.length;o++)a+=t[o]
34 ;for(var s=this.width/a,l=s/2,u=t.length%2==1,c=-r;c<=r;c++)for(var h=this.nextRow+r+c,f=this.width*h,d=u?-t[t.length-1]:0,p=t[0],m=1,v=0;v<this.width;v++){for(;p<v/s;)d=p,p+=t[m],u&&m===t.length-1&&(p+=t[0]),m++;var g,y=Math.abs(v-d*s),b=Math.abs(v-p*s),x=Math.min(y,b),_=m%2==1;if(e){var w=r?c/r*(l+1):0;if(_){var M=l-Math.abs(w);g=Math.sqrt(x*x+M*M)}else g=l-Math.sqrt(x*x+w*w)}else g=(_?1:-1)*x;this.data[3+4*(f+v)]=Math.max(0,Math.min(255,g+128))}var k={y:(this.nextRow+r+.5)/this.height,height:2*r/this.height,width:a};return this.nextRow+=n,this.dirty=!0,k},n.prototype.bind=function(t){this.texture?(t.bindTexture(t.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,t.texSubImage2D(t.TEXTURE_2D,0,0,0,this.width,this.height,t.RGBA,t.UNSIGNED_BYTE,this.data))):(this.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,this.width,this.height,0,t.RGBA,t.UNSIGNED_BYTE,this.data))}},{"../util/util":435}],348:[function(t,e,r){"use strict";function n(t,e){this.gl=t,this.transform=e,this.reusableTextures={},this.preFbos={},this.frameHistory=new o,this.setup(),this.numSublayers=s.maxUnderzooming+s.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.lineWidthRange=t.getParameter(t.ALIASED_LINE_WIDTH_RANGE)}var i=t("../util/browser"),a=t("gl-matrix").mat4,o=t("./frame_history"),s=t("../source/source_cache"),l=t("../data/bucket").EXTENT,u=t("../source/pixels_to_tile_units"),c=t("../util/util"),h=t("../util/struct_array"),f=t("../data/buffer"),d=t("./vertex_array_object"),p=t("./draw_raster").RasterBoundsArray,m=t("./create_uniform_pragmas");e.exports=n,c.extend(n.prototype,t("./painter/use_program")),n.prototype.resize=function(t,e){var r=this.gl;this.width=t*i.devicePixelRatio,this.height=e*i.devicePixelRatio,r.viewport(0,0,this.width,this.height)},n.prototype.setup=function(){var t=this.gl;t.verbose=!0,t.enable(t.BLEND),t.blendFunc(t.ONE,t.ONE_MINUS_SRC_ALPHA),t.enable(t.STENCIL_TEST),t.enable(t.DEPTH_TEST),t.depthFunc(t.LEQUAL),this._depthMask=!1,t.depthMask(!1);var e=this.PosArray=new h({members:[{name:"a_pos",type:"Int16",components:2}]}),r=new e;r.emplaceBack(0,0),r.emplaceBack(l,0),r.emplaceBack(0,l),r.emplaceBack(l,l),this.tileExtentBuffer=new f(r.serialize(),e.serialize(),f.BufferType.VERTEX),this.tileExtentVAO=new d,this.tileExtentPatternVAO=new d;var n=new e;n.emplaceBack(0,0),n.emplaceBack(l,0),n.emplaceBack(l,l),n.emplaceBack(0,l),n.emplaceBack(0,0),this.debugBuffer=new f(n.serialize(),e.serialize(),f.BufferType.VERTEX),this.debugVAO=new d;var i=new p;i.emplaceBack(0,0,0,0),i.emplaceBack(l,0,32767,0),i.emplaceBack(0,l,0,32767),i.emplaceBack(l,l,32767,32767),this.rasterBoundsBuffer=new f(i.serialize(),p.serialize(),f.BufferType.VERTEX),this.rasterBoundsVAO=new d},n.prototype.clearColor=function(){var t=this.gl;t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT)},n.prototype.clearStencil=function(){var t=this.gl;t.clearStencil(0),t.stencilMask(255),t.clear(t.STENCIL_BUFFER_BIT)},n.prototype.clearDepth=function(){var t=this.gl;t.clearDepth(1),this.depthMask(!0),t.clear(t.DEPTH_BUFFER_BIT)},n.prototype._renderTileClippingMasks=function(t){var e=this.gl;e.colorMask(!1,!1,!1,!1),this.depthMask(!1),e.disable(e.DEPTH_TEST),e.enable(e.STENCIL_TEST),e.stencilMask(248),e.stencilOp(e.KEEP,e.KEEP,e.REPLACE);var r=1;this._tileClippingMaskIDs={};for(var n=0;n<t.length;n++){var i=t[n],a=this._tileClippingMaskIDs[i.id]=r++<<3;e.stencilFunc(e.ALWAYS,a,248);var o=m([{name:"u_color",components:4},{name:"u_opacity",components:1}]),s=this.useProgram("fill",[],o,o);e.uniformMatrix4fv(s.u_matrix,!1,i.posMatrix),this.tileExtentVAO.bind(e,s,this.tileExtentBuffer),e.drawArrays(e.TRIANGLE_STRIP,0,this.tileExtentBuffer.length)}e.stencilMask(0),e.colorMask(!0,!0,!0,!0),this.depthMask(!0),e.enable(e.DEPTH_TEST)},n.prototype.enableTileClippingMask=function(t){var e=this.gl;e.stencilFunc(e.EQUAL,this._tileClippingMaskIDs[t.id],248)},n.prototype.prepareBuffers=function(){},n.prototype.bindDefaultFramebuffer=function(){var t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,null)};var v={symbol:t("./draw_symbol"),circle:t("./draw_circle"),line:t("./draw_line"),fill:t("./draw_fill"),raster:t("./draw_raster"),background:t("./draw_background"),debug:t("./draw_debug")};n.prototype.render=function(t,e){this.style=t,this.options=e,this.lineAtlas=t.lineAtlas,this.spriteAtlas=t.spriteAtlas,this.spriteAtlas.setSprite(t.sprite),this.glyphSource=t.glyphSource,this.frameHistory.record(this.transform.zoom),this.prepareBuffers(),this.clearColor(),this.clearDepth(),this.showOverdrawInspector(e.showOverdrawInspector),this.depthRange=(t._order.length+2)*this.numSublayers*this.depthEpsilon,this.renderPass({isOpaquePass:!0}),this.renderPass({isOpaquePass:!1})},n.prototype.renderPass=function(t){var e=this.style._groups,r=t.isOpaquePass;this.currentLayer=r?this.style._order.length:-1;for(var n=0;n<e.length;n++){var i,a=e[r?e.length-1-n:n],o=this.style.sources[a.source],s=[];if(o){for(s=o.getVisibleCoordinates(),i=0;i<s.length;i++)s[i].posMatrix=this.transform.calculatePosMatrix(s[i],o.maxzoom);this.clearStencil(),o.prepare&&o.prepare(),o.isTileClipped&&this._renderTileClippingMasks(s)}for(r?(this._showOverdrawInspector||this.gl.disable(this.gl.BLEND),this.isOpaquePass=!0):(this.gl.enable(this.gl.BLEND),this.isOpaquePass=!1,s.reverse()),i=0;i<a.length;i++){var l=a[r?a.length-1-i:i];this.currentLayer+=r?-1:1,this.renderLayer(this,o,l,s)}o&&v.debug(this,o,s)}},n.prototype.depthMask=function(t){t!==this._depthMask&&(this._depthMask=t,this.gl.depthMask(t))},n.prototype.renderLayer=function(t,e,r,n){r.isHidden(this.transform.zoom)||("background"===r.type||n.length)&&(this.id=r.id,v[r.type](t,e,r,n))},n.prototype.setDepthSublayer=function(t){var e=1-((1+this.currentLayer)*this.numSublayers+t)*this.depthEpsilon,r=e-1+this.depthRange;this.gl.depthRange(r,e)},n.prototype.translatePosMatrix=function(t,e,r,n){if(!r[0]&&!r[1])return t;if("viewport"===n){var i=Math.sin(-this.transform.angle),o=Math.cos(-this.transform.angle);r=[r[0]*o-r[1]*i,r[0]*i+r[1]*o]}var s=[u(e,r[0],this.transform.zoom),u(e,r[1],this.transform.zoom),0],l=new Float32Array(16);return a.translate(l,t,s),l},n.prototype.saveTexture=function(t){var e=this.reusableTextures[t.size];e?e.push(t):this.reusableTextures[t.size]=[t]},n.prototype.getTexture=function(t){var e=this.reusableTextures[t];return e&&e.length>0?e.pop():null},n.prototype.lineWidth=function(t){this.gl.lineWidth(c.clamp(t,this.lineWidthRange[0],this.lineWidthRange[1]))},n.prototype.showOverdrawInspector=function(t){if(t||this._showOverdrawInspector){this._showOverdrawInspector=t;var e=this.gl;if(t){e.blendFunc(e.CONSTANT_COLOR,e.ONE);e.blendColor(1/8,1/8,1/8,0),e.clearColor(0,0,0,1),e.clear(e.COLOR_BUFFER_BIT)}else e.blendFunc(e.ONE,e.ONE_MINUS_SRC_ALPHA)}}},{"../data/bucket":322,"../data/buffer":327,"../source/pixels_to_tile_units":356,"../source/source_cache":360,"../util/browser":419,"../util/struct_array":433,"../util/util":435,"./create_uniform_pragmas":337,"./draw_background":338,"./draw_circle":339,"./draw_debug":341,"./draw_fill":342,"./draw_line":343,"./draw_raster":344,"./draw_symbol":345,"./frame_history":346,"./painter/use_program":349,"./vertex_array_object":350,"gl-matrix":188}],349:[function(t,e,r){"use strict";function n(t,e){return t.replace(/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,function(t,r,n,i,a){return e[r][a].replace(/{type}/g,i).replace(/{precision}/g,n)})}var i=t("assert"),a=t("../../util/util"),o=t("mapbox-gl-shaders"),s=o.util;e.exports._createProgram=function(t,e,r,l){for(var u=this.gl,c=u.createProgram(),h=o[t],f="#define MAPBOX_GL_JS;\n",d=0;d<e.length;d++)f+="#define "+e[d]+";\n";var p=u.createShader(u.FRAGMENT_SHADER);u.shaderSource(p,n(f+h.fragmentSource,l)),u.compileShader(p),i(u.getShaderParameter(p,u.COMPILE_STATUS),u.getShaderInfoLog(p)),u.attachShader(c,p);var m=u.createShader(u.VERTEX_SHADER);u.shaderSource(m,n(f+s+h.vertexSource,r)),u.compileShader(m),i(u.getShaderParameter(m,u.COMPILE_STATUS),u.getShaderInfoLog(m)),u.attachShader(c,m),u.linkProgram(c),i(u.getProgramParameter(c,u.LINK_STATUS),u.getProgramInfoLog(c));for(var v={},g=u.getProgramParameter(c,u.ACTIVE_ATTRIBUTES),y=0;y<g;y++){var b=u.getActiveAttrib(c,y);v[b.name]=u.getAttribLocation(c,b.name)}for(var x={},_=u.getProgramParameter(c,u.ACTIVE_UNIFORMS),w=0;w<_;w++){var M=u.getActiveUniform(c,w);x[M.name]=u.getUniformLocation(c,M.name)}return a.extend({program:c,definition:h,attributes:v,numAttributes:g},v,x)},e.exports._createProgramCached=function(t,e,r,n){this.cache=this.cache||{};var i=JSON.stringify({name:t,defines:e,vertexPragmas:r,fragmentPragmas:n});return this.cache[i]||(this.cache[i]=this._createProgram(t,e,r,n)),this.cache[i]},e.exports.useProgram=function(t,e,r,n){var i=this.gl;e=e||[],this._showOverdrawInspector&&(e=e.concat("OVERDRAW_INSPECTOR"));var a=this._createProgramCached(t,e,r,n);return this.currentProgram!==a&&(i.useProgram(a.program),this.currentProgram=a),a}},{"../../util/util":435,assert:43,"mapbox-gl-shaders":296}],350:[function(t,e,r){"use strict";function n(){this.boundProgram=null,this.boundVertexBuffer=null,this.boundVertexBuffer2=null,this.boundElementBuffer=null,this.vao=null}var i=t("assert");e.exports=n,n.prototype.bind=function(t,e,r,n,i){void 0===t.extVertexArrayObject&&(t.extVertexArrayObject=t.getExtension("OES_vertex_array_object"));var a=!this.vao||this.boundProgram!==e||this.boundVertexBuffer!==r||this.boundVertexBuffer2!==i||this.boundElementBuffer!==n;!t.extVertexArrayObject||a?this.freshBind(t,e,r,n,i):t.extVertexArrayObject.bindVertexArrayOES(this.vao)},n.prototype.freshBind=function(t,e,r,n,a){var o,s=e.numAttributes;if(t.extVertexArrayObject)this.vao&&this.destroy(t),this.vao=t.extVertexArrayObject.createVertexArrayOES(),t.extVertexArrayObject.bindVertexArrayOES(this.vao),o=0,this.boundProgram=e,this.boundVertexBuffer=r,this.boundVertexBuffer2=a,this.boundElementBuffer=n;else{o=t.currentNumAttributes||0;for(var l=s;l<o;l++)i(0!==l),t.disableVertexAttribArray(l)}for(var u=o;u<s;u++)t.enableVertexAttribArray(u);r.bind(t),r.setVertexAttribPointers(t,e),a&&(a.bind(t),a.setVertexAttribPointers(t,e)),n&&n.bind(t),t.currentNumAttributes=s},n.prototype.unbind=function(t){var e=t.extVertexArrayObject;e&&e.bindVertexArrayOES(null)},n.prototype.destroy=function(t){var e=t.extVertexArrayObject;e&&this.vao&&(e.deleteVertexArrayOES(this.vao),this.vao=null)}},{assert:43}],351:[function(t,e,r){"use strict";function n(t,e,r){e=e||{},this.id=t,this.dispatcher=r,this._data=e.data,void 0!==e.maxzoom&&(this.maxzoom=e.maxzoom),e.type&&(this.type=e.type);var n=s/this.tileSize;this.workerOptions=a.extend({source:this.id,cluster:e.cluster||!1,geojsonVtOptions:{buffer:(void 0!==e.buffer?e.buffer:128)*n,tolerance:(void 0!==e.tolerance?e.tolerance:.375)*n,extent:s,maxZoom:this.maxzoom},superclusterOptions:{maxZoom:Math.min(e.clusterMaxZoom,this.maxzoom-1)||this.maxzoom-1,extent:s,radius:(e.clusterRadius||50)*n,log:!1}},e.workerOptions),this._updateWorkerData(function(t){if(t)return void this.fire("error",{error:t});this.fire("load")}.bind(this))}var i=t("../util/evented"),a=t("../util/util"),o=t("resolve-url"),s=t("../data/bucket").EXTENT;e.exports=n,n.prototype=a.inherit(i,{type:"geojson",minzoom:0,maxzoom:18,tileSize:512,isTileClipped:!0,reparseOverscaled:!0,onAdd:function(t){this.map=t},setData:function(t){return this._data=t,this._updateWorkerData(function(t){if(t)return this.fire("error",{error:t});this.fire("change")}.bind(this)),this},_updateWorkerData:function(t){var e=a.extend({},this.workerOptions),r=this._data;"string"==typeof r?e.url="undefined"!=typeof window?o(window.location.href,r):r:e.data=JSON.stringify(r),this.workerID=this.dispatcher.send(this.type+".loadData",e,function(e){this._loaded=!0,t(e)}.bind(this))},loadTile:function(t,e){var r=t.coord.z>this.maxzoom?Math.pow(2,t.coord.z-this.maxzoom):1,n={type:this.type,uid:t.uid,coord:t.coord,zoom:t.coord.z,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,overscaling:r,angle:this.map.transform.angle,pitch:this.map.transform.pitch,showCollisionBoxes:this.map.showCollisionBoxes};t.workerID=this.dispatcher.send("load tile",n,function(r,n){if(t.unloadVectorData(this.map.painter),!t.aborted)return r?e(r):(t.loadVectorData(n,this.map.style),t.redoWhenDone&&(t.redoWhenDone=!1,t.redoPlacement(this)),e(null))}.bind(this),this.workerID)},abortTile:function(t){t.aborted=!0},unloadTile:function(t){t.unloadVectorData(this.map.painter),this.dispatcher.send("remove tile",{uid:t.uid,source:this.id},function(){},t.workerID)},serialize:function(){return{type:this.type,data:this._data}}})},{"../data/bucket":322,"../util/evented":427,"../util/util":435,"resolve-url":493}],352:[function(t,e,r){"use strict";function n(t,e,r){r&&(this.loadGeoJSON=r),h.call(this,t,e)}var i=t("../util/util"),a=t("../util/ajax"),o=t("geojson-rewind"),s=t("./geojson_wrapper"),l=t("vt-pbf"),u=t("supercluster"),c=t("geojson-vt"),h=t("./vector_tile_worker_source");e.exports=n,n.prototype=i.inherit(h,{_geoJSONIndexes:{},loadVectorData:function(t,e){var r=t.source,n=t.coord;if(!this._geoJSONIndexes[r])return e(null,null);var i=this._geoJSONIndexes[r].getTile(Math.min(n.z,t.maxZoom),n.x,n.y);if(!i)return e(null,null);var a=new s(i.features);a.name="_geojsonTileLayer";var o=l({layers:{_geojsonTileLayer:a}});0===o.byteOffset&&o.byteLength===o.buffer.byteLength||(o=new Uint8Array(o)),e(null,{tile:a,rawTileData:o.buffer})},loadData:function(t,e){var r=function(r,n){return r?e(r):"object"!=typeof n?e(new Error("Input data is not a valid GeoJSON object.")):(o(n,!0),void this._indexData(n,t,function(r,n){if(r)return e(r);this._geoJSONIndexes[t.source]=n,e(null)}.bind(this)))}.bind(this);this.loadGeoJSON(t,r)},loadGeoJSON:function(t,e){if(t.url)a.getJSON(t.url,e);else{if("string"!=typeof t.data)return e(new Error("Input data is not a valid GeoJSON object."));try{return e(null,JSON.parse(t.data))}catch(t){return e(new Error("Input data is not a valid GeoJSON object."))}}},_indexData:function(t,e,r){try{e.cluster?r(null,u(e.superclusterOptions).load(t.features)):r(null,c(t,e.geojsonVtOptions))}catch(t){return r(t)}}})},{"../util/ajax":418,"../util/util":435,"./geojson_wrapper":353,"./vector_tile_worker_source":364,"geojson-rewind":134,"geojson-vt":138,supercluster:521,"vt-pbf":548}],353:[function(t,e,r){"use strict";function n(t){this.features=t,this.length=t.length,this.extent=s}function i(t){if(this.type=t.type,1===t.type){this.rawGeometry=[];for(var e=0;e<t.geometry.length;e++)this.rawGeometry.push([t.geometry[e]])}else this.rawGeometry=t.geometry;this.properties=t.tags,this.extent=s}var a=t("point-geometry"),o=t("vector-tile").VectorTileFeature,s=t("../data/bucket").EXTENT;e.exports=n,n.prototype.feature=function(t){return new i(this.features[t])},i.prototype.loadGeometry=function(){var t=this.rawGeometry;this.geometry=[];for(var e=0;e<t.length;e++){for(var r=t[e],n=[],i=0;i<r.length;i++)n.push(new a(r[i][0],r[i][1]));this.geometry.push(n)}return this.geometry},i.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]},i.prototype.toGeoJSON=o.prototype.toGeoJSON},{"../data/bucket":322,"point-geometry":476,"vector-tile":542}],354:[function(t,e,r){"use strict";function n(t,e,r){this.id=t,this.dispatcher=r,this.url=e.url,this.coordinates=e.coordinates,u.getImage(e.url,function(t,r){if(t)return this.fire("error",{error:t});this.image=r,this.image.addEventListener("load",function(){this.map._rerender()}.bind(this)),this._loaded=!0,this.fire("load"),this.map&&this.setCoordinates(e.coordinates)}.bind(this))}var i=t("../util/util"),a=t("./tile_coord"),o=t("../geo/lng_lat"),s=t("point-geometry"),l=t("../util/evented"),u=t("../util/ajax"),c=t("../data/bucket").EXTENT,h=t("../render/draw_raster").RasterBoundsArray,f=t("../data/buffer"),d=t("../render/vertex_array_object");e.exports=n,n.prototype=i.inherit(l,{minzoom:0,maxzoom:22,tileSize:512,onAdd:function(t){this.map=t,this.image&&this.setCoordinates(this.coordinates)},setCoordinates:function(t){this.coordinates=t;var e=this.map,r=t.map(function(t){return e.transform.locationCoordinate(o.convert(t)).zoomTo(0)}),n=this.centerCoord=i.getCoordinatesCenter(r);return n.column=Math.round(n.column),n.row=Math.round(n.row),this.minzoom=this.maxzoom=n.zoom,this._coord=new a(n.zoom,n.column,n.row),this._tileCoords=r.map(function(t){var e=t.zoomTo(n.zoom);return new s(Math.round((e.column-n.column)*c),Math.round((e.row-n.row)*c))}),this.fire("change"),this},_setTile:function(t){this._prepared=!1,this.tile=t;var e=new h;e.emplaceBack(this._tileCoords[0].x,this._tileCoords[0].y,0,0),e.emplaceBack(this._tileCoords[1].x,this._tileCoords[1].y,32767,0),e.emplaceBack(this._tileCoords[3].x,this._tileCoords[3].y,0,32767),e.emplaceBack(this._tileCoords[2].x,this._tileCoords[2].y,32767,32767),this.tile.buckets={},this.tile.boundsBuffer=new f(e.serialize(),h.serialize(),f.BufferType.VERTEX),this.tile.boundsVAO=new d,this.tile.state="loaded"},prepare:function(){if(this._loaded&&this.image&&this.image.complete&&this.tile){var t=this.map.painter,e=t.gl;this._prepared?(e.bindTexture(e.TEXTURE_2D,this.tile.texture),e.texSubImage2D(e.TEXTURE_2D,0,0,0,e.RGBA,e.UNSIGNED_BYTE,this.image)):(this.tile.texture=e.createTexture(),e.bindTexture(e.TEXTURE_2D,this.tile.texture),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),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,e.RGBA,e.UNSIGNED_BYTE,this.image))}},loadTile:function(t,e){this._coord&&this._coord.toString()===t.coord.toString()?(this._setTile(t),e(null)):(t.state="errored",e(null))},serialize:function(){return{type:"image",urls:this.url,coordinates:this.coordinates}}})},{"../data/bucket":322,"../data/buffer":327,"../geo/lng_lat":332,"../render/draw_raster":344,"../render/vertex_array_object":350,"../util/ajax":418,"../util/evented":427,"../util/util":435,"./tile_coord":362,"point-geometry":476}],355:[function(t,e,r){"use strict";var n=t("../util/util"),i=t("../util/ajax"),a=t("../util/browser"),o=t("../util/mapbox").normalizeSourceURL;e.exports=function(t,e){var r=function(t,r){if(t)return e(t);var i=n.pick(r,["tiles","minzoom","maxzoom","attribution"]);r.vector_layers&&(i.vectorLayers=r.vector_layers,i.vectorLayerIds=i.vectorLayers.map(function(t){return t.id})),e(null,i)};t.url?i.getJSON(o(t.url),r):a.frame(r.bind(null,null,t))}},{"../util/ajax":418,"../util/browser":419,"../util/mapbox":432,"../util/util":435}],356:[function(t,e,r){"use strict";var n=t("../data/bucket");e.exports=function(t,e,r){return e*(n.EXTENT/(t.tileSize*Math.pow(2,r-t.coord.z)))}},{"../data/bucket":322}],357:[function(t,e,r){"use strict";function n(t,e){var r=t.coord,n=e.coord;return r.z-n.z||r.y-n.y||r.w-n.w||r.x-n.x}function i(t){for(var e=t[0]||{},r=1;r<t.length;r++){var n=t[r];for(var i in n){var a=n[i],o=e[i];if(void 0===o)o=e[i]=a;else for(var s=0;s<a.length;s++)o.push(a[s])}}return e}var a=t("./tile_coord");r.rendered=function(t,e,r,a,o,s){var l=t.tilesIn(r);l.sort(n);for(var u=[],c=0;c<l.length;c++){var h=l[c];h.tile.featureIndex&&u.push(h.tile.featureIndex.query({queryGeometry:h.queryGeometry,scale:h.scale,tileSize:h.tile.tileSize,bearing:s,params:a},e))}return i(u)},r.source=function(t,e){for(var r=t.getRenderableIds().map(function(e){return t.getTileByID(e)}),n=[],i={},o=0;o<r.length;o++){var s=r[o],l=new a(Math.min(s.sourceMaxZoom,s.coord.z),s.coord.x,s.coord.y,0).id;i[l]||(i[l]=!0,s.querySourceFeatures(n,e))}return n}},{"./tile_coord":362}],358:[function(t,e,r){"use strict";function n(t,e,r){this.id=t,this.dispatcher=r,i.extend(this,i.pick(e,["url","scheme","tileSize"])),s(e,function(t,e){if(t)return this.fire("error",t);i.extend(this,e),this.fire("load")}.bind(this))}var i=t("../util/util"),a=t("../util/ajax"),o=t("../util/evented"),s=t("./load_tilejson"),l=t("../util/mapbox").normalizeTileURL;e.exports=n,n.prototype=i.inherit(o,{minzoom:0,maxzoom:22,roundZoom:!0,scheme:"xyz",tileSize:512,_loaded:!1,onAdd:function(t){this.map=t},serialize:function(){return{type:"raster",url:this.url,tileSize:this.tileSize}},loadTile:function(t,e){function r(r,n){if(delete t.request,!t.aborted){if(r)return e(r);var i=this.map.painter.gl;t.texture=this.map.painter.getTexture(n.width),t.texture?(i.bindTexture(i.TEXTURE_2D,t.texture),i.texSubImage2D(i.TEXTURE_2D,0,0,0,i.RGBA,i.UNSIGNED_BYTE,n)):(t.texture=i.createTexture(),i.bindTexture(i.TEXTURE_2D,t.texture),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR_MIPMAP_NEAREST),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,n),t.texture.size=n.width),i.generateMipmap(i.TEXTURE_2D),this.map.animationLoop.set(this.map.style.rasterFadeDuration),t.state="loaded",e(null)}}var n=l(t.coord.url(this.tiles,null,this.scheme),this.url,this.tileSize);t.request=a.getImage(n,r.bind(this))},abortTile:function(t){t.request&&(t.request.abort(),delete t.request)},unloadTile:function(t){t.texture&&this.map.painter.saveTexture(t.texture)}})},{"../util/ajax":418,"../util/evented":427,"../util/mapbox":432,"../util/util":435,"./load_tilejson":355}],359:[function(t,e,r){"use strict";var n=t("../util/util"),i={vector:t("../source/vector_tile_source"),raster:t("../source/raster_tile_source"),geojson:t("../source/geojson_source"),video:t("../source/video_source"),image:t("../source/image_source")};r.create=function(t,e,r){if(e=new i[e.type](t,e,r),e.id!==t)throw new Error("Expected Source id to be "+t+" instead of "+e.id);return n.bindAll(["load","abort","unload","serialize","prepare"],e),e},r.getType=function(t){return i[t]},r.setType=function(t,e){i[t]=e}},{"../source/geojson_source":351,"../source/image_source":354,"../source/raster_tile_source":358,"../source/vector_tile_source":363,"../source/video_source":365,"../util/util":435}],360:[function(t,e,r){"use strict";function n(t,e,r){this.id=t,this.dispatcher=r;var n=this._source=o.create(t,e,r).on("load",function(){this.map&&this._source.onAdd&&this._source.onAdd(this.map),this._sourceLoaded=!0,this.tileSize=n.tileSize,this.minzoom=n.minzoom,this.maxzoom=n.maxzoom,this.roundZoom=n.roundZoom,this.reparseOverscaled=n.reparseOverscaled,this.isTileClipped=n.isTileClipped,this.attribution=n.attribution,this.vectorLayerIds=n.vectorLayerIds,this.fire("load")}.bind(this)).on("error",function(t){this._sourceErrored=!0,this.fire("error",t)}.bind(this)).on("change",function(){this.reload(),this.transform&&this.update(this.transform,this.map&&this.map.style.rasterFadeDuration),this.fire("change")}.bind(this));this._tiles={},this._cache=new c(0,this.unloadTile.bind(this)),this._isIdRenderable=this._isIdRenderable.bind(this)}function i(t,e,r){var n=r.zoomTo(Math.min(t.z,e));return{x:(n.column-(t.x+t.w*Math.pow(2,t.z)))*d,y:(n.row-t.y)*d}}function a(t,e){return t%32-e%32}var o=t("./source"),s=t("./tile"),l=t("../util/evented"),u=t("./tile_coord"),c=t("../util/lru_cache"),h=t("../geo/coordinate"),f=t("../util/util"),d=t("../data/bucket").EXTENT;e.exports=n,n.maxOverzooming=10,n.maxUnderzooming=3,n.prototype=f.inherit(l,{onAdd:function(t){this.map=t,this._source&&this._source.onAdd&&this._source.onAdd(t)},loaded:function(){if(this._sourceErrored)return!0;if(!this._sourceLoaded)return!1;for(var t in this._tiles){var e=this._tiles[t];if("loaded"!==e.state&&"errored"!==e.state)return!1}return!0},getSource:function(){return this._source},loadTile:function(t,e){return this._source.loadTile(t,e)},unloadTile:function(t){if(this._source.unloadTile)return this._source.unloadTile(t)},abortTile:function(t){if(this._source.abortTile)return this._source.abortTile(t)},serialize:function(){return this._source.serialize()},prepare:function(){if(this._sourceLoaded&&this._source.prepare)return this._source.prepare()},getIds:function(){return Object.keys(this._tiles).map(Number).sort(a)},getRenderableIds:function(){return this.getIds().filter(this._isIdRenderable)},_isIdRenderable:function(t){return this._tiles[t].isRenderable()&&!this._coveredTiles[t]},reload:function(){this._cache.reset();for(var t in this._tiles){var e=this._tiles[t];"loading"!==e.state&&(e.state="reloading"),this.loadTile(this._tiles[t],this._tileLoaded.bind(this,this._tiles[t]))}},_tileLoaded:function(t,e){if(e)return t.state="errored",this.fire("tile.error",{tile:t,error:e}),void this._source.fire("tile.error",{tile:t,error:e});t.source=this,t.timeAdded=(new Date).getTime(),this.fire("tile.load",{tile:t}),this._source.fire("tile.load",{tile:t})},getTile:function(t){return this.getTileByID(t.id)},getTileByID:function(t){return this._tiles[t]},getZoom:function(t){return t.zoom+t.scaleZoom(t.tileSize/this.tileSize)},findLoadedChildren:function(t,e,r){var n=!1;for(var i in this._tiles){var a=this._tiles[i];if(!(r[i]||!a.isRenderable()||a.coord.z<=t.z||a.coord.z>e)){var o=Math.pow(2,Math.min(a.coord.z,this.maxzoom)-Math.min(t.z,this.maxzoom));if(Math.floor(a.coord.x/o)===t.x&&Math.floor(a.coord.y/o)===t.y)for(r[i]=!0,n=!0;a&&a.coord.z-1>t.z;){var s=a.coord.parent(this.maxzoom).id;a=this._tiles[s],a&&a.isRenderable()&&(delete r[i],r[s]=!0)}}}return n},findLoadedParent:function(t,e,r){for(var n=t.z-1;n>=e;n--){t=t.parent(this.maxzoom);var i=this._tiles[t.id];if(i&&i.isRenderable())return r[t.id]=!0,i;if(this._cache.has(t.id))return this.addTile(t),r[t.id]=!0,this._tiles[t.id]}},updateCacheSize:function(t){var e=Math.ceil(t.width/t.tileSize)+1,r=Math.ceil(t.height/t.tileSize)+1,n=e*r;this._cache.setMaxSize(Math.floor(5*n))},update:function(t,e){if(this._sourceLoaded){var r,i,a;this.updateCacheSize(t);var o=(this.roundZoom?Math.round:Math.floor)(this.getZoom(t)),s=Math.max(o-n.maxOverzooming,this.minzoom),l=Math.max(o+n.maxUnderzooming,this.minzoom),c={},h=(new Date).getTime();this._coveredTiles={};var d=this.used?t.coveringTiles(this._source):[];for(r=0;r<d.length;r++)i=d[r],a=this.addTile(i),c[i.id]=!0,a.isRenderable()||this.findLoadedChildren(i,l,c)||this.findLoadedParent(i,s,c);for(var p={},m=Object.keys(c),v=0;v<m.length;v++){var g=m[v];i=u.fromID(g),a=this._tiles[g],a&&a.timeAdded>h-(e||0)&&(this.findLoadedChildren(i,l,c)&&(c[g]=!0),this.findLoadedParent(i,s,p))}var y;for(y in p)c[y]||(this._coveredTiles[y]=!0);for(y in p)c[y]=!0;var b=f.keysDifference(this._tiles,c);for(r=0;r<b.length;r++)this.removeTile(+b[r]);this.transform=t}},addTile:function(t){var e=this._tiles[t.id];if(e)return e;var r=t.wrapped();if(e=this._tiles[r.id],e||(e=this._cache.get(r.id))&&this._redoPlacement&&this._redoPlacement(e),!e){var n=t.z,i=n>this.maxzoom?Math.pow(2,n-this.maxzoom):1;e=new s(r,this.tileSize*i,this.maxzoom),this.loadTile(e,this._tileLoaded.bind(this,e))}return e.uses++,this._tiles[t.id]=e,this.fire("tile.add",{tile:e}),this._source.fire("tile.add",{tile:e}),e},removeTile:function(t){var e=this._tiles[t];e&&(e.uses--,delete this._tiles[t],this.fire("tile.remove",{tile:e}),this._source.fire("tile.remove",{tile:e}),e.uses>0||(e.isRenderable()?this._cache.add(e.coord.wrapped().id,e):(e.aborted=!0,this.abortTile(e),this.unloadTile(e))))},clearTiles:function(){for(var t in this._tiles)this.removeTile(t);this._cache.reset()},tilesIn:function(t){for(var e={},r=this.getIds(),n=1/0,a=1/0,o=-1/0,s=-1/0,l=t[0].zoom,c=0;c<t.length;c++){var f=t[c];n=Math.min(n,f.column),a=Math.min(a,f.row),o=Math.max(o,f.column),s=Math.max(s,f.row)}for(var p=0;p<r.length;p++){var m=this._tiles[r[p]],v=u.fromID(r[p]),g=[i(v,m.sourceMaxZoom,new h(n,a,l)),i(v,m.sourceMaxZoom,new h(o,s,l))];if(g[0].x<d&&g[0].y<d&&g[1].x>=0&&g[1].y>=0){for(var y=[],b=0;b<t.length;b++)y.push(i(v,m.sourceMaxZoom,t[b]));var x=e[m.coord.id];void 0===x&&(x=e[m.coord.id]={tile:m,coord:v,queryGeometry:[],scale:Math.pow(2,this.transform.zoom-m.coord.z)}),x.queryGeometry.push(y)}}var _=[];for(var w in e)_.push(e[w]);return _},redoPlacement:function(){for(var t=this.getIds(),e=0;e<t.length;e++){this.getTileByID(t[e]).redoPlacement(this)}},getVisibleCoordinates:function(){return this.getRenderableIds().map(u.fromID)}})},{"../data/bucket":322,"../geo/coordinate":331,"../util/evented":427,"../util/lru_cache":431,"../util/util":435,"./source":359,"./tile":361,"./tile_coord":362}],361:[function(t,e,r){"use strict";function n(t,e,r){this.coord=t,this.uid=a.uniqueId(),this.uses=0,this.tileSize=e,this.sourceMaxZoom=r,this.buckets={},this.state="loading"}function i(t,e){if(e){for(var r={},n=0;n<t.length;n++){var i=e.getLayer(t[n].layerId);if(i){var s=o.create(a.extend({layer:i,childLayers:t[n].childLayerIds.map(e.getLayer.bind(e)).filter(function(t){return t})},t[n]));r[s.id]=s}}return r}}var a=t("../util/util"),o=t("../data/bucket"),s=t("../data/feature_index"),l=t("vector-tile"),u=t("pbf"),c=t("../util/vectortile_to_geojson"),h=t("feature-filter"),f=t("../symbol/collision_tile"),d=t("../symbol/collision_box"),p=t("../symbol/symbol_instances"),m=t("../symbol/symbol_quads");e.exports=n,n.prototype={loadVectorData:function(t,e){this.state="loaded",t&&(this.collisionBoxArray=new d(t.collisionBoxArray),this.collisionTile=new f(t.collisionTile,this.collisionBoxArray),this.symbolInstancesArray=new p(t.symbolInstancesArray),this.symbolQuadsArray=new m(t.symbolQuadsArray),this.featureIndex=new s(t.featureIndex,t.rawTileData,this.collisionTile),this.rawTileData=t.rawTileData,this.buckets=i(t.buckets,e))},reloadSymbolData:function(t,e,r){if("unloaded"!==this.state){this.collisionTile=new f(t.collisionTile,this.collisionBoxArray),this.featureIndex.setCollisionTile(this.collisionTile);for(var n in this.buckets){var o=this.buckets[n];"symbol"===o.type&&(o.destroy(e.gl),delete this.buckets[n])}a.extend(this.buckets,i(t.buckets,r))}},unloadVectorData:function(t){for(var e in this.buckets){this.buckets[e].destroy(t.gl)}this.collisionBoxArray=null,this.symbolQuadsArray=null,this.symbolInstancesArray=null,this.collisionTile=null,this.featureIndex=null,this.rawTileData=null,this.buckets=null,this.state="unloaded"},redoPlacement:function(t){function e(e,r){this.reloadSymbolData(r,t.map.painter,t.map.style),t.fire("tile.load",{tile:this}),this.state="loaded",this.redoWhenDone&&(this.redoPlacement(t),this.redoWhenDone=!1)}if("loaded"!==this.state||"reloading"===this.state)return void(this.redoWhenDone=!0);this.state="reloading",t.dispatcher.send("redo placement",{uid:this.uid,source:t.id,angle:t.map.transform.angle,pitch:t.map.transform.pitch,showCollisionBoxes:t.map.showCollisionBoxes},e.bind(this),this.workerID)},getBucket:function(t){return this.buckets&&this.buckets[t.ref||t.id]},querySourceFeatures:function(t,e){if(this.rawTileData){this.vtLayers||(this.vtLayers=new l.VectorTile(new u(new Uint8Array(this.rawTileData))).layers);var r=this.vtLayers._geojsonTileLayer||this.vtLayers[e.sourceLayer];if(r)for(var n=h(e.filter),i={z:this.coord.z,x:this.coord.x,y:this.coord.y},a=0;a<r.length;a++){var o=r.feature(a);if(n(o)){var s=new c(o,this.coord.z,this.coord.x,this.coord.y);s.tile=i,t.push(s)}}}},isRenderable:function(){return"loaded"===this.state||"reloading"===this.state}}},{"../data/bucket":322,"../data/feature_index":329,"../symbol/collision_box":387,"../symbol/collision_tile":389,"../symbol/symbol_instances":398,"../symbol/symbol_quads":399,"../util/util":435,"../util/vectortile_to_geojson":436,"feature-filter":128,pbf:470,"vector-tile":542}],362:[function(t,e,r){"use strict";function n(t,e,r,n){
35 l(!isNaN(t)&&t>=0&&t%1==0),l(!isNaN(e)&&e>=0&&e%1==0),l(!isNaN(r)&&r>=0&&r%1==0),isNaN(n)&&(n=0),this.z=+t,this.x=+e,this.y=+r,this.w=+n,(n*=2)<0&&(n=n*-1-1);var i=1<<this.z;this.id=32*(i*i*n+i*this.y+this.x)+this.z,this.posMatrix=null}function i(t,e,r){for(var n,i="",a=t;a>0;a--)n=1<<a-1,i+=(e&n?1:0)+(r&n?2:0);return i}function a(t,e){if(t.row>e.row){var r=t;t=e,e=r}return{x0:t.column,y0:t.row,x1:e.column,y1:e.row,dx:e.column-t.column,dy:e.row-t.row}}function o(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,h=e.dx<0,f=a;f<o;f++){var d=l*Math.max(0,Math.min(t.dy,f+c-t.y0))+t.x0,p=u*Math.max(0,Math.min(e.dy,f+h-e.y0))+e.x0;i(Math.floor(p),Math.ceil(d),f)}}function s(t,e,r,n,i,s){var l,u=a(t,e),c=a(e,r),h=a(r,t);u.dy>c.dy&&(l=u,u=c,c=l),u.dy>h.dy&&(l=u,u=h,h=l),c.dy>h.dy&&(l=c,c=h,h=l),u.dy&&o(h,u,n,i,s),c.dy&&o(h,c,n,i,s)}var l=t("assert"),u=t("whoots-js"),c=t("../geo/coordinate");e.exports=n,n.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y},n.prototype.toCoordinate=function(t){var e=Math.min(this.z,t),r=Math.pow(2,e),n=this.y,i=this.x+r*this.w;return new c(i,n,e)},n.fromID=function(t){var e=t%32,r=1<<e,i=(t-e)/32,a=i%r,o=(i-a)/r%r,s=Math.floor(i/(r*r));return s%2!=0&&(s=s*-1-1),s/=2,new n(e,a,o,s)},n.prototype.url=function(t,e,r){var n=u.getTileBBox(this.x,this.y,this.z),a=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}",Math.min(this.z,e||this.z)).replace("{x}",this.x).replace("{y}","tms"===r?Math.pow(2,this.z)-this.y-1:this.y).replace("{quadkey}",a).replace("{bbox-epsg-3857}",n)},n.prototype.parent=function(t){return 0===this.z?null:this.z>t?new n(this.z-1,this.x,this.y,this.w):new n(this.z-1,Math.floor(this.x/2),Math.floor(this.y/2),this.w)},n.prototype.wrapped=function(){return new n(this.z,this.x,this.y,0)},n.prototype.children=function(t){if(this.z>=t)return[new n(this.z+1,this.x,this.y,this.w)];var e=this.z+1,r=2*this.x,i=2*this.y;return[new n(e,r,i,this.w),new n(e,r+1,i,this.w),new n(e,r,i+1,this.w),new n(e,r+1,i+1,this.w)]},n.cover=function(t,e,r){function i(t,e,i){var s,l,u;if(i>=0&&i<=a)for(s=t;s<e;s++)l=(s%a+a)%a,u=new n(r,l,i,Math.floor(s/a)),o[u.id]=u}var a=1<<t,o={};return s(e[0],e[1],e[2],0,a,i),s(e[2],e[3],e[0],0,a,i),Object.keys(o).map(function(t){return o[t]})}},{"../geo/coordinate":331,assert:43,"whoots-js":558}],363:[function(t,e,r){"use strict";function n(t,e,r){if(this.id=t,this.dispatcher=r,a.extend(this,a.pick(e,["url","scheme","tileSize"])),this._options=a.extend({type:"vector"},e),512!==this.tileSize)throw new Error("vector tile sources must have a tileSize of 512");o(e,function(t,e){if(t)return void this.fire("error",t);a.extend(this,e),this.fire("load")}.bind(this))}var i=t("../util/evented"),a=t("../util/util"),o=t("./load_tilejson"),s=t("../util/mapbox").normalizeTileURL;e.exports=n,n.prototype=a.inherit(i,{minzoom:0,maxzoom:22,scheme:"xyz",tileSize:512,reparseOverscaled:!0,isTileClipped:!0,onAdd:function(t){this.map=t},serialize:function(){return a.extend({},this._options)},loadTile:function(t,e){function r(r,n){if(!t.aborted){if(r)return e(r);t.loadVectorData(n,this.map.style),t.redoWhenDone&&(t.redoWhenDone=!1,t.redoPlacement(this)),e(null),t.reloadCallback&&(this.loadTile(t,t.reloadCallback),t.reloadCallback=null)}}var n=t.coord.z>this.maxzoom?Math.pow(2,t.coord.z-this.maxzoom):1,i={url:s(t.coord.url(this.tiles,this.maxzoom,this.scheme),this.url),uid:t.uid,coord:t.coord,zoom:t.coord.z,tileSize:this.tileSize*n,source:this.id,overscaling:n,angle:this.map.transform.angle,pitch:this.map.transform.pitch,showCollisionBoxes:this.map.showCollisionBoxes};t.workerID?"loading"===t.state?t.reloadCallback=e:(i.rawTileData=t.rawTileData,this.dispatcher.send("reload tile",i,r.bind(this),t.workerID)):t.workerID=this.dispatcher.send("load tile",i,r.bind(this))},abortTile:function(t){this.dispatcher.send("abort tile",{uid:t.uid,source:this.id},null,t.workerID)},unloadTile:function(t){t.unloadVectorData(this.map.painter),this.dispatcher.send("remove tile",{uid:t.uid,source:this.id},null,t.workerID)}})},{"../util/evented":427,"../util/mapbox":432,"../util/util":435,"./load_tilejson":355}],364:[function(t,e,r){"use strict";function n(t,e,r){this.actor=t,this.styleLayers=e,r&&(this.loadVectorData=r),this.loading={},this.loaded={}}var i=t("../util/ajax"),a=t("vector-tile"),o=t("pbf"),s=t("./worker_tile");e.exports=n,n.prototype={loadTile:function(t,e){function r(t,r){return delete this.loading[n][i],t?e(t):r?(a.data=r.tile,a.parse(a.data,this.styleLayers.getLayerFamilies(),this.actor,r.rawTileData,e),this.loaded[n]=this.loaded[n]||{},void(this.loaded[n][i]=a)):e(null,null)}var n=t.source,i=t.uid;this.loading[n]||(this.loading[n]={});var a=this.loading[n][i]=new s(t);a.abort=this.loadVectorData(t,r.bind(this))},reloadTile:function(t,e){var r=this.loaded[t.source],n=t.uid;if(r&&r[n]){var i=r[n];i.parse(i.data,this.styleLayers.getLayerFamilies(),this.actor,t.rawTileData,e)}},abortTile:function(t){var e=this.loading[t.source],r=t.uid;e&&e[r]&&e[r].abort&&(e[r].abort(),delete e[r])},removeTile:function(t){var e=this.loaded[t.source],r=t.uid;e&&e[r]&&delete e[r]},loadVectorData:function(t,e){function r(t,r){if(t)return e(t);var n=new a.VectorTile(new o(new Uint8Array(r)));e(t,{tile:n,rawTileData:r})}var n=i.getArrayBuffer(t.url,r.bind(this));return function(){n.abort()}},redoPlacement:function(t,e){var r=this.loaded[t.source],n=this.loading[t.source],i=t.uid;if(r&&r[i]){var a=r[i],o=a.redoPlacement(t.angle,t.pitch,t.showCollisionBoxes);o.result&&e(null,o.result,o.transferables)}else n&&n[i]&&(n[i].angle=t.angle)}}},{"../util/ajax":418,"./worker_tile":367,pbf:470,"vector-tile":542}],365:[function(t,e,r){"use strict";function n(t,e){this.id=t,this.urls=e.urls,this.coordinates=e.coordinates,u.getVideo(e.urls,function(t,r){if(t)return this.fire("error",{error:t});this.video=r,this.video.loop=!0;var n;this.video.addEventListener("playing",function(){n=this.map.style.animationLoop.set(1/0),this.map._rerender()}.bind(this)),this.video.addEventListener("pause",function(){this.map.style.animationLoop.cancel(n)}.bind(this)),this.map&&(this.video.play(),this.setCoordinates(e.coordinates)),this.fire("load")}.bind(this))}var i=t("../util/util"),a=t("./tile_coord"),o=t("../geo/lng_lat"),s=t("point-geometry"),l=t("../util/evented"),u=t("../util/ajax"),c=t("../data/bucket").EXTENT,h=t("../render/draw_raster").RasterBoundsArray,f=t("../data/buffer"),d=t("../render/vertex_array_object");e.exports=n,n.prototype=i.inherit(l,{minzoom:0,maxzoom:22,tileSize:512,roundZoom:!0,getVideo:function(){return this.video},onAdd:function(t){this.map||(this.map=t,this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},setCoordinates:function(t){this.coordinates=t;var e=this.map,r=t.map(function(t){return e.transform.locationCoordinate(o.convert(t)).zoomTo(0)}),n=this.centerCoord=i.getCoordinatesCenter(r);return n.column=Math.round(n.column),n.row=Math.round(n.row),this.minzoom=this.maxzoom=n.zoom,this._coord=new a(n.zoom,n.column,n.row),this._tileCoords=r.map(function(t){var e=t.zoomTo(n.zoom);return new s(Math.round((e.column-n.column)*c),Math.round((e.row-n.row)*c))}),this.fire("change"),this},_setTile:function(t){this._prepared=!1,this.tile=t;var e=new h;e.emplaceBack(this._tileCoords[0].x,this._tileCoords[0].y,0,0),e.emplaceBack(this._tileCoords[1].x,this._tileCoords[1].y,32767,0),e.emplaceBack(this._tileCoords[3].x,this._tileCoords[3].y,0,32767),e.emplaceBack(this._tileCoords[2].x,this._tileCoords[2].y,32767,32767),this.tile.buckets={},this.tile.boundsBuffer=new f(e.serialize(),h.serialize(),f.BufferType.VERTEX),this.tile.boundsVAO=new d,this.tile.state="loaded"},prepare:function(){if(!(this.video.readyState<2)&&this.tile){var t=this.map.painter.gl;this._prepared?(t.bindTexture(t.TEXTURE_2D,this.tile.texture),t.texSubImage2D(t.TEXTURE_2D,0,0,0,t.RGBA,t.UNSIGNED_BYTE,this.video)):(this._prepared=!0,this.tile.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.tile.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,this.video)),this._currentTime=this.video.currentTime}},loadTile:function(t,e){this._coord&&this._coord.toString()===t.coord.toString()?(this._setTile(t),e(null)):(t.state="errored",e(null))},serialize:function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}})},{"../data/bucket":322,"../data/buffer":327,"../geo/lng_lat":332,"../render/draw_raster":344,"../render/vertex_array_object":350,"../util/ajax":418,"../util/evented":427,"../util/util":435,"./tile_coord":362,"point-geometry":476}],366:[function(t,e,r){"use strict";function n(t){this.self=t,this.actor=new a(t,this);var e={getLayers:function(){return this.layers}.bind(this),getLayerFamilies:function(){return this.layerFamilies}.bind(this)};this.workerSources={vector:new l(this.actor,e),geojson:new u(this.actor,e)},this.self.registerWorkerSource=function(t,r){if(this.workerSources[t])throw new Error('Worker source with name "'+t+'" already registered.');this.workerSources[t]=new r(this.actor,e)}.bind(this)}function i(t){var e={};for(var r in t){var n=t[r],i=n.ref||n.id,a=t[i];a.layout&&"none"===a.layout.visibility||(e[i]=e[i]||[],r===i?e[i].unshift(n):e[i].push(n))}return e}var a=t("../util/actor"),o=t("../style/style_layer"),s=t("../util/util"),l=t("./vector_tile_worker_source"),u=t("./geojson_worker_source");e.exports=function(t){return new n(t)},s.extend(n.prototype,{"set layers":function(t){function e(t){var e=o.create(t,t.ref&&r.layers[t.ref]);e.updatePaintTransitions({},{transition:!1}),r.layers[e.id]=e}this.layers={};for(var r=this,n=[],a=0;a<t.length;a++){var s=t[a];"fill"!==s.type&&"line"!==s.type&&"circle"!==s.type&&"symbol"!==s.type||(s.ref?n.push(a):e(s))}for(var l=0;l<n.length;l++)e(t[n[l]]);this.layerFamilies=i(this.layers)},"update layers":function(t){function e(t){var e=a.layers[t.ref];a.layers[t.id]?a.layers[t.id].set(t,e):a.layers[t.id]=o.create(t,e),a.layers[t.id].updatePaintTransitions({},{transition:!1})}var r,n,a=this;for(r in t)n=t[r],n.ref&&e(n);for(r in t)n=t[r],n.ref||e(n);this.layerFamilies=i(this.layers)},"load tile":function(t,e){var r=t.type||"vector";this.workerSources[r].loadTile(t,e)},"reload tile":function(t,e){var r=t.type||"vector";this.workerSources[r].reloadTile(t,e)},"abort tile":function(t){var e=t.type||"vector";this.workerSources[e].abortTile(t)},"remove tile":function(t){var e=t.type||"vector";this.workerSources[e].removeTile(t)},"redo placement":function(t,e){var r=t.type||"vector";this.workerSources[r].redoPlacement(t,e)},"load worker source":function(t,e){try{this.self.importScripts(t.url),e()}catch(t){e(t)}}})},{"../style/style_layer":374,"../util/actor":417,"../util/util":435,"./geojson_worker_source":352,"./vector_tile_worker_source":364}],367:[function(t,e,r){"use strict";function n(t){this.coord=t.coord,this.uid=t.uid,this.zoom=t.zoom,this.tileSize=t.tileSize,this.source=t.source,this.overscaling=t.overscaling,this.angle=t.angle,this.pitch=t.pitch,this.showCollisionBoxes=t.showCollisionBoxes}function i(t){return!t.isEmpty()}function a(t){return t.serialize()}function o(t){var e=[];for(var r in t)t[r].getTransferables(e);return e}function s(t){return t.id}var l=t("../data/feature_index"),u=t("../symbol/collision_tile"),c=t("../data/bucket"),h=t("../symbol/collision_box"),f=t("../util/dictionary_coder"),d=t("../util/util"),p=t("../symbol/symbol_instances"),m=t("../symbol/symbol_quads");e.exports=n,n.prototype.parse=function(t,e,r,n,v){function g(t,e){for(var r=0;r<t.length;r++){var n=t.feature(r);n.index=r;for(var i in e)e[i].filter(n)&&e[i].features.push(n)}}function y(t){if(t)return v(t);if(2===++N){for(var e=P.length-1;e>=0;e--)b(E,P[e]);x()}}function b(t,e){if(e.populateArrays(A,R,F),"symbol"!==e.type)for(var r=0;r<e.features.length;r++){var n=e.features[r];T.insert(n,n.index,e.sourceLayerIndex,e.index)}e.features=null}function x(){E.status="done",E.redoPlacementAfterDone&&(E.redoPlacement(E.angle,E.pitch,null),E.redoPlacementAfterDone=!1);var t=T.serialize(),e=A.serialize(),r=E.collisionBoxArray.serialize(),s=E.symbolInstancesArray.serialize(),l=E.symbolQuadsArray.serialize(),u=[n].concat(t.transferables).concat(e.transferables),c=I.filter(i);v(null,{buckets:c.map(a),featureIndex:t.data,collisionTile:e.data,collisionBoxArray:r,symbolInstancesArray:s,symbolQuadsArray:l,rawTileData:n},o(c).concat(u))}this.status="parsing",this.data=t,this.collisionBoxArray=new h,this.symbolInstancesArray=new p,this.symbolQuadsArray=new m;var _,w,M,k,A=new u(this.angle,this.pitch,this.collisionBoxArray),T=new l(this.coord,this.overscaling,A,t.layers),S=new f(t.layers?Object.keys(t.layers).sort():["_geojsonTileLayer"]),E=this,L={},C={},z=0;for(var D in e)w=e[D][0],w.source===this.source&&(w.ref||w.minzoom&&this.zoom<w.minzoom||w.maxzoom&&this.zoom>=w.maxzoom||w.layout&&"none"===w.layout.visibility||t.layers&&!t.layers[w.sourceLayer]||(k=c.create({layer:w,index:z++,childLayers:e[D],zoom:this.zoom,overscaling:this.overscaling,showCollisionBoxes:this.showCollisionBoxes,collisionBoxArray:this.collisionBoxArray,symbolQuadsArray:this.symbolQuadsArray,symbolInstancesArray:this.symbolInstancesArray,sourceLayerIndex:S.encode(w.sourceLayer||"_geojsonTileLayer")}),k.createFilter(),L[w.id]=k,t.layers&&(M=w.sourceLayer,C[M]=C[M]||{},C[M][w.id]=k)));if(t.layers)for(M in C)1===w.version&&d.warnOnce('Vector tile source "'+this.source+'" layer "'+M+'" does not use vector tile spec v2 and therefore may have some rendering errors.'),(w=t.layers[M])&&g(w,C[M]);else g(t,L);var I=[],P=this.symbolBuckets=[],O=[];T.bucketLayerIDs={};for(var j in L)k=L[j],0!==k.features.length&&(T.bucketLayerIDs[k.index]=k.childLayers.map(s),I.push(k),"symbol"===k.type?P.push(k):O.push(k));var F={},R={},N=0;if(P.length>0){for(_=P.length-1;_>=0;_--)P[_].updateIcons(F),P[_].updateFont(R);for(var B in R)R[B]=Object.keys(R[B]).map(Number);F=Object.keys(F),r.send("get glyphs",{uid:this.uid,stacks:R},function(t,e){R=e,y(t)}),F.length?r.send("get icons",{icons:F},function(t,e){F=e,y(t)}):y()}for(_=O.length-1;_>=0;_--)b(this,O[_]);if(0===P.length)return x()},n.prototype.redoPlacement=function(t,e,r){if("done"!==this.status)return this.redoPlacementAfterDone=!0,this.angle=t,{};for(var n=new u(t,e,this.collisionBoxArray),s=this.symbolBuckets,l=s.length-1;l>=0;l--)s[l].placeFeatures(n,r);var c=n.serialize(),h=s.filter(i);return{result:{buckets:h.map(a),collisionTile:c.data},transferables:o(h).concat(c.transferables)}}},{"../data/bucket":322,"../data/feature_index":329,"../symbol/collision_box":387,"../symbol/collision_tile":389,"../symbol/symbol_instances":398,"../symbol/symbol_quads":399,"../util/dictionary_coder":425,"../util/util":435}],368:[function(t,e,r){"use strict";function n(){this.n=0,this.times=[]}e.exports=n,n.prototype.stopped=function(){return this.times=this.times.filter(function(t){return t.time>=(new Date).getTime()}),!this.times.length},n.prototype.set=function(t){return this.times.push({id:this.n,time:t+(new Date).getTime()}),this.n++},n.prototype.cancel=function(t){this.times=this.times.filter(function(e){return e.id!==t})}},{}],369:[function(t,e,r){"use strict";function n(t){this.base=t,this.retina=s.devicePixelRatio>1;var e=this.retina?"@2x":"";o.getJSON(l(t,e,".json"),function(t,e){if(t)return void this.fire("error",{error:t});this.data=e,this.img&&this.fire("load")}.bind(this)),o.getImage(l(t,e,".png"),function(t,e){if(t)return void this.fire("error",{error:t});for(var r=e.getData(),n=e.data=new Uint8Array(r.length),i=0;i<r.length;i+=4){var a=r[i+3]/255;n[i+0]=r[i+0]*a,n[i+1]=r[i+1]*a,n[i+2]=r[i+2]*a,n[i+3]=r[i+3]}this.img=e,this.data&&this.fire("load")}.bind(this))}function i(){}var a=t("../util/evented"),o=t("../util/ajax"),s=t("../util/browser"),l=t("../util/mapbox").normalizeSpriteURL;e.exports=n,n.prototype=Object.create(a),n.prototype.toJSON=function(){return this.base},n.prototype.loaded=function(){return!(!this.data||!this.img)},n.prototype.resize=function(){if(s.devicePixelRatio>1!==this.retina){var t=new n(this.base);t.on("load",function(){this.img=t.img,this.data=t.data,this.retina=t.retina}.bind(this))}},i.prototype={x:0,y:0,width:0,height:0,pixelRatio:1,sdf:!1},n.prototype.getSpritePosition=function(t){if(!this.loaded())return new i;var e=this.data&&this.data[t];return e&&this.img?e:new i}},{"../util/ajax":418,"../util/browser":419,"../util/evented":427,"../util/mapbox":432}],370:[function(t,e,r){"use strict";var n=t("csscolorparser").parseCSSColor,i=t("../util/util"),a=t("./style_function"),o={};e.exports=function t(e){if(a.isFunctionDefinition(e))return i.extend({},e,{stops:e.stops.map(function(e){return[e[0],t(e[1])]})});if("string"==typeof e){if(!o[e]){var r=n(e);if(!r)throw new Error("Invalid color "+e);o[e]=[r[0]/255*r[3],r[1]/255*r[3],r[2]/255*r[3],r[3]]}return o[e]}throw new Error("Invalid color "+e)}},{"../util/util":435,"./style_function":373,csscolorparser:104}],371:[function(t,e,r){"use strict";function n(t,e,r){this.animationLoop=e||new m,this.dispatcher=new p(r||1,this),this.spriteAtlas=new l(1024,1024),this.lineAtlas=new u(256,512),this._layers={},this._order=[],this._groups=[],this.sources={},this.zoomHistory={},c.bindAll(["_forwardSourceEvent","_forwardTileEvent","_forwardLayerEvent","_redoPlacement"],this),this._resetUpdates();var n=function(t,e){if(t)return void this.fire("error",{error:t});if(!v.emitErrors(this,v(e))){this._loaded=!0,this.stylesheet=e,this.updateClasses();var r=e.sources;for(var n in r)this.addSource(n,r[n]);e.sprite&&(this.sprite=new o(e.sprite),this.sprite.on("load",this.fire.bind(this,"change"))),this.glyphSource=new s(e.glyphs),this._resolve(),this.fire("load")}}.bind(this);"string"==typeof t?h.getJSON(f(t),n):d.frame(n.bind(this,null,t)),this.on("source.load",function(t){var e=t.source;if(e&&e.vectorLayerIds)for(var r in this._layers){var n=this._layers[r];n.source===e.id&&this._validateLayer(n)}})}var i=t("../util/evented"),a=t("./style_layer"),o=t("./image_sprite"),s=t("../symbol/glyph_source"),l=t("../symbol/sprite_atlas"),u=t("../render/line_atlas"),c=t("../util/util"),h=t("../util/ajax"),f=t("../util/mapbox").normalizeStyleURL,d=t("../util/browser"),p=t("../util/dispatcher"),m=t("./animation_loop"),v=t("./validate_style"),g=t("../source/source"),y=t("../source/query_features"),b=t("../source/source_cache"),x=t("./style_spec"),_=t("./style_function");e.exports=n,n.prototype=c.inherit(i,{_loaded:!1,_validateLayer:function(t){var e=this.sources[t.source];t.sourceLayer&&e&&e.vectorLayerIds&&e.vectorLayerIds.indexOf(t.sourceLayer)===-1&&this.fire("error",{error:new Error('Source layer "'+t.sourceLayer+'" does not exist on source "'+e.id+'" as specified by style layer "'+t.id+'"')})},loaded:function(){if(!this._loaded)return!1;if(Object.keys(this._updates.sources).length)return!1;for(var t in this.sources)if(!this.sources[t].loaded())return!1;return!(this.sprite&&!this.sprite.loaded())},_resolve:function(){var t,e;this._layers={},this._order=this.stylesheet.layers.map(function(t){return t.id});for(var r=0;r<this.stylesheet.layers.length;r++)e=this.stylesheet.layers[r],e.ref||(t=a.create(e),this._layers[t.id]=t,t.on("error",this._forwardLayerEvent));for(var n=0;n<this.stylesheet.layers.length;n++)if(e=this.stylesheet.layers[n],e.ref){var i=this.getLayer(e.ref);t=a.create(e,i),this._layers[t.id]=t,t.on("error",this._forwardLayerEvent)}this._groupLayers(),this._updateWorkerLayers()},_groupLayers:function(){var t;this._groups=[];for(var e=0;e<this._order.length;++e){var r=this._layers[this._order[e]];t&&r.source===t.source||(t=[],t.source=r.source,this._groups.push(t)),t.push(r)}},_updateWorkerLayers:function(t){this.dispatcher.broadcast(t?"update layers":"set layers",this._serializeLayers(t))},_serializeLayers:function(t){t=t||this._order;for(var e=[],r={includeRefProperties:!0},n=0;n<t.length;n++)e.push(this._layers[t[n]].serialize(r));return e},_applyClasses:function(t,e){if(this._loaded){t=t||[],e=e||{transition:!0};var r=this.stylesheet.transition||{},n=this._updates.allPaintProps?this._layers:this._updates.paintProps;for(var i in n){var a=this._layers[i],o=this._updates.paintProps[i];if(this._updates.allPaintProps||o.all)a.updatePaintTransitions(t,e,r,this.animationLoop);else for(var s in o)this._layers[i].updatePaintTransition(s,t,e,r,this.animationLoop)}}},_recalculate:function(t){for(var e in this.sources)this.sources[e].used=!1;this._updateZoomHistory(t),this.rasterFadeDuration=300;for(var r in this._layers){var n=this._layers[r];n.recalculate(t,this.zoomHistory),!n.isHidden(t)&&n.source&&(this.sources[n.source].used=!0)}Math.floor(this.z)!==Math.floor(t)&&this.animationLoop.set(300),this.z=t,this.fire("zoom")},_updateZoomHistory:function(t){var e=this.zoomHistory;void 0===e.lastIntegerZoom&&(e.lastIntegerZoom=Math.floor(t),e.lastIntegerZoomTime=0,e.lastZoom=t),Math.floor(e.lastZoom)<Math.floor(t)?(e.lastIntegerZoom=Math.floor(t),e.lastIntegerZoomTime=Date.now()):Math.floor(e.lastZoom)>Math.floor(t)&&(e.lastIntegerZoom=Math.floor(t+1),e.lastIntegerZoomTime=Date.now()),e.lastZoom=t},_checkLoaded:function(){if(!this._loaded)throw new Error("Style is not done loading")},update:function(t,e){if(!this._updates.changed)return this;if(this._updates.allLayers)this._groupLayers(),this._updateWorkerLayers();else{var r=Object.keys(this._updates.layers);r.length&&this._updateWorkerLayers(r)}var n,i=Object.keys(this._updates.sources);for(n=0;n<i.length;n++)this._reloadSource(i[n]);for(n=0;n<this._updates.events.length;n++){var a=this._updates.events[n];this.fire(a[0],a[1])}return this._applyClasses(t,e),this._updates.changed&&this.fire("change"),this._resetUpdates(),this},_resetUpdates:function(){this._updates={events:[],layers:{},sources:{},paintProps:{}}},addSource:function(t,e){if(this._checkLoaded(),void 0!==this.sources[t])throw new Error("There is already a source with this ID");if(!e.type)throw new Error("The type property must be defined, but the only the following properties were given: "+Object.keys(e)+".");return["vector","raster","geojson","video","image"].indexOf(e.type)>=0&&this._handleErrors(v.source,"sources."+t,e)?this:(e=new b(t,e,this.dispatcher),this.sources[t]=e,e.style=this,e.on("load",this._forwardSourceEvent).on("error",this._forwardSourceEvent).on("change",this._forwardSourceEvent).on("tile.add",this._forwardTileEvent).on("tile.load",this._forwardTileEvent).on("tile.error",this._forwardTileEvent).on("tile.remove",this._forwardTileEvent).on("tile.stats",this._forwardTileEvent),this._updates.events.push(["source.add",{source:e}]),this._updates.changed=!0,this)},removeSource:function(t){if(this._checkLoaded(),void 0===this.sources[t])throw new Error("There is no source with this ID");var e=this.sources[t];return delete this.sources[t],delete this._updates.sources[t],e.off("load",this._forwardSourceEvent).off("error",this._forwardSourceEvent).off("change",this._forwardSourceEvent).off("tile.add",this._forwardTileEvent).off("tile.load",this._forwardTileEvent).off("tile.error",this._forwardTileEvent).off("tile.remove",this._forwardTileEvent).off("tile.stats",this._forwardTileEvent),this._updates.events.push(["source.remove",{source:e}]),this._updates.changed=!0,this},getSource:function(t){return this.sources[t]&&this.sources[t].getSource()},addLayer:function(t,e){if(this._checkLoaded(),!(t instanceof a)){if(this._handleErrors(v.layer,"layers."+t.id,t,!1,{arrayIndex:-1}))return this;var r=t.ref&&this.getLayer(t.ref);t=a.create(t,r)}return this._validateLayer(t),t.on("error",this._forwardLayerEvent),this._layers[t.id]=t,this._order.splice(e?this._order.indexOf(e):1/0,0,t.id),this._updates.allLayers=!0,t.source&&(this._updates.sources[t.source]=!0),this._updates.events.push(["layer.add",{layer:t}]),this.updateClasses(t.id)},removeLayer:function(t){this._checkLoaded();var e=this._layers[t];if(void 0===e)throw new Error("There is no layer with this ID");for(var r in this._layers)this._layers[r].ref===t&&this.removeLayer(r);return e.off("error",this._forwardLayerEvent),delete this._layers[t],delete this._updates.layers[t],delete this._updates.paintProps[t],this._order.splice(this._order.indexOf(t),1),this._updates.allLayers=!0,this._updates.events.push(["layer.remove",{layer:e}]),this._updates.changed=!0,this},getLayer:function(t){return this._layers[t]},getReferentLayer:function(t){var e=this.getLayer(t);return e.ref&&(e=this.getLayer(e.ref)),e},setLayerZoomRange:function(t,e,r){this._checkLoaded();var n=this.getReferentLayer(t);return n.minzoom===e&&n.maxzoom===r?this:(null!=e&&(n.minzoom=e),null!=r&&(n.maxzoom=r),this._updateLayer(n))},setFilter:function(t,e){this._checkLoaded();var r=this.getReferentLayer(t);return null!==e&&this._handleErrors(v.filter,"layers."+r.id+".filter",e)?this:c.deepEqual(r.filter,e)?this:(r.filter=c.clone(e),this._updateLayer(r))},getFilter:function(t){return this.getReferentLayer(t).filter},setLayoutProperty:function(t,e,r){this._checkLoaded();var n=this.getReferentLayer(t);return c.deepEqual(n.getLayoutProperty(e),r)?this:(n.setLayoutProperty(e,r),this._updateLayer(n))},getLayoutProperty:function(t,e){return this.getReferentLayer(t).getLayoutProperty(e)},setPaintProperty:function(t,e,r,n){this._checkLoaded();var i=this.getLayer(t);if(c.deepEqual(i.getPaintProperty(e,n),r))return this;var a=i.isPaintValueFeatureConstant(e);return i.setPaintProperty(e,r,n),!(r&&_.isFunctionDefinition(r)&&"$zoom"!==r.property&&void 0!==r.property)&&a||(this._updates.layers[t]=!0,i.source&&(this._updates.sources[i.source]=!0)),this.updateClasses(t,e)},getPaintProperty:function(t,e,r){return this.getLayer(t).getPaintProperty(e,r)},updateClasses:function(t,e){if(this._updates.changed=!0,t){var r=this._updates.paintProps;r[t]||(r[t]={}),r[t][e||"all"]=!0}else this._updates.allPaintProps=!0;return this},serialize:function(){return c.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,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:c.mapObject(this.sources,function(t){return t.serialize()}),layers:this._order.map(function(t){return this._layers[t].serialize()},this)},function(t){return void 0!==t})},_updateLayer:function(t){return this._updates.layers[t.id]=!0,t.source&&(this._updates.sources[t.source]=!0),this._updates.changed=!0,this},_flattenRenderedFeatures:function(t){for(var e=[],r=this._order.length-1;r>=0;r--)for(var n=this._order[r],i=0;i<t.length;i++){var a=t[i][n];if(a)for(var o=0;o<a.length;o++)e.push(a[o])}return e},queryRenderedFeatures:function(t,e,r,n){e&&e.filter&&this._handleErrors(v.filter,"queryRenderedFeatures.filter",e.filter,!0);var i={};if(e&&e.layers)for(var a=0;a<e.layers.length;a++){var o=e.layers[a];i[this._layers[o].source]=!0}var s=[];for(var l in this.sources)if(!e.layers||i[l]){var u=this.sources[l],c=y.rendered(u,this._layers,t,e,r,n);s.push(c)}return this._flattenRenderedFeatures(s)},querySourceFeatures:function(t,e){e&&e.filter&&this._handleErrors(v.filter,"querySourceFeatures.filter",e.filter,!0);var r=this.sources[t];return r?y.source(r,e):[]},addSourceType:function(t,e,r){return g.getType(t)?r(new Error('A source type called "'+t+'" already exists.')):(g.setType(t,e),e.workerSourceURL?void this.dispatcher.broadcast("load worker source",{name:t,url:e.workerSourceURL},r):r(null,null))},_handleErrors:function(t,e,r,n,i){var a=n?v.throwErrors:v.emitErrors,o=t.call(v,c.extend({key:e,style:this.serialize(),value:r,styleSpec:x},i));return a.call(v,this,o)},_remove:function(){this.dispatcher.remove()},_reloadSource:function(t){this.sources[t].reload()},_updateSources:function(t){for(var e in this.sources)this.sources[e].update(t)},_redoPlacement:function(){for(var t in this.sources)this.sources[t].redoPlacement&&this.sources[t].redoPlacement()},_forwardSourceEvent:function(t){this.fire("source."+t.type,c.extend({source:t.target.getSource()},t))},_forwardTileEvent:function(t){this.fire(t.type,c.extend({source:t.target},t))},_forwardLayerEvent:function(t){this.fire("layer."+t.type,c.extend({layer:{id:t.target.id}},t))},"get sprite json":function(t,e){var r=this.sprite;r.loaded()?e(null,{sprite:r.data,retina:r.retina}):r.on("load",function(){e(null,{sprite:r.data,retina:r.retina})})},"get icons":function(t,e){var r=this.sprite,n=this.spriteAtlas;r.loaded()?(n.setSprite(r),n.addIcons(t.icons,e)):r.on("load",function(){n.setSprite(r),n.addIcons(t.icons,e)})},"get glyphs":function(t,e){function r(t,r,n){t&&console.error(t),a[n]=r,0===--i&&e(null,a)}var n=t.stacks,i=Object.keys(n).length,a={};for(var o in n)this.glyphSource.getSimpleGlyphs(o,n[o],t.uid,r)}})},{"../render/line_atlas":347,"../source/query_features":357,"../source/source":359,"../source/source_cache":360,"../symbol/glyph_source":392,"../symbol/sprite_atlas":397,"../util/ajax":418,"../util/browser":419,"../util/dispatcher":426,"../util/evented":427,"../util/mapbox":432,"../util/util":435,"./animation_loop":368,"./image_sprite":369,"./style_function":373,"./style_layer":374,"./style_spec":381,"./validate_style":383}],372:[function(t,e,r){"use strict";function n(t,e){this.value=s.clone(e),this.isFunction=a.isFunctionDefinition(e),this.json=JSON.stringify(this.value);var r="color"===t.type&&this.value?o(this.value):e;if(this.calculate=a[t.function||"piecewise-constant"](r),this.isFeatureConstant=this.calculate.isFeatureConstant,this.isZoomConstant=this.calculate.isZoomConstant,"piecewise-constant"===t.function&&t.transition&&(this.calculate=i(this.calculate)),!this.isFeatureConstant&&!this.isZoomConstant){this.stopZoomLevels=[];for(var n=[],l=this.value.stops,u=0;u<this.value.stops.length;u++){var c=l[u][0].zoom;this.stopZoomLevels.indexOf(c)<0&&(this.stopZoomLevels.push(c),n.push([c,n.length]))}this.calculateInterpolationT=a.interpolated({stops:n,base:e.base})}}function i(t){return function(e,r){var n,i,a,o=e.zoom,s=e.zoomHistory,l=e.duration,u=o%1,c=Math.min((Date.now()-s.lastIntegerZoomTime)/l,1),h=1;return o>s.lastIntegerZoom?(n=u+(1-u)*c,h*=2,i=t({zoom:o-1},r),a=t({zoom:o},r)):(n=1-(1-c)*u,a=t({zoom:o},r),i=t({zoom:o+1},r),h/=2),void 0===i||void 0===a?void 0:{from:i,fromScale:h,to:a,toScale:1,t:n}}}var a=t("./style_function"),o=t("./parse_color"),s=t("../util/util");e.exports=n},{"../util/util":435,"./parse_color":370,"./style_function":373}],373:[function(t,e,r){"use strict";var n=t("mapbox-gl-function");r.interpolated=function(t){var e=n.interpolated(t),r=function(t,r){return e(t&&t.zoom,r||{})};return r.isFeatureConstant=e.isFeatureConstant,r.isZoomConstant=e.isZoomConstant,r},r["piecewise-constant"]=function(t){var e=n["piecewise-constant"](t),r=function(t,r){return e(t&&t.zoom,r||{})};return r.isFeatureConstant=e.isFeatureConstant,r.isZoomConstant=e.isZoomConstant,r},r.isFunctionDefinition=n.isFunctionDefinition},{"mapbox-gl-function":295}],374:[function(t,e,r){"use strict";function n(t,e){this.set(t,e)}function i(t){return t.value}var a=t("../util/util"),o=t("./style_transition"),s=t("./style_declaration"),l=t("./style_spec"),u=t("./validate_style"),c=t("./parse_color"),h=t("../util/evented");e.exports=n;n.create=function(e,r){return new({background:t("./style_layer/background_style_layer"),circle:t("./style_layer/circle_style_layer"),fill:t("./style_layer/fill_style_layer"),line:t("./style_layer/line_style_layer"),raster:t("./style_layer/raster_style_layer"),symbol:t("./style_layer/symbol_style_layer")}[(r||e).type])(e,r)},n.prototype=a.inherit(h,{set:function(t,e){this.id=t.id,
36 this.ref=t.ref,this.metadata=t.metadata,this.type=(e||t).type,this.source=(e||t).source,this.sourceLayer=(e||t)["source-layer"],this.minzoom=(e||t).minzoom,this.maxzoom=(e||t).maxzoom,this.filter=(e||t).filter,this.paint={},this.layout={},this._paintSpecifications=l["paint_"+this.type],this._layoutSpecifications=l["layout_"+this.type],this._paintTransitions={},this._paintTransitionOptions={},this._paintDeclarations={},this._layoutDeclarations={},this._layoutFunctions={};var r,n;for(var i in t){var a=i.match(/^paint(?:\.(.*))?$/);if(a){var o=a[1]||"";for(r in t[i])this.setPaintProperty(r,t[i][r],o)}}if(this.ref)this._layoutDeclarations=e._layoutDeclarations;else for(n in t.layout)this.setLayoutProperty(n,t.layout[n]);for(r in this._paintSpecifications)this.paint[r]=this.getPaintValue(r);for(n in this._layoutSpecifications)this._updateLayoutValue(n)},setLayoutProperty:function(t,e){if(null==e)delete this._layoutDeclarations[t];else{var r="layers."+this.id+".layout."+t;if(this._handleErrors(u.layoutProperty,r,t,e))return;this._layoutDeclarations[t]=new s(this._layoutSpecifications[t],e)}this._updateLayoutValue(t)},getLayoutProperty:function(t){return this._layoutDeclarations[t]&&this._layoutDeclarations[t].value},getLayoutValue:function(t,e,r){var n=this._layoutSpecifications[t],i=this._layoutDeclarations[t];return i?i.calculate(e,r):n.default},setPaintProperty:function(t,e,r){var n="layers."+this.id+(r?'["paint.'+r+'"].':".paint.")+t;if(a.endsWith(t,"-transition"))if(this._paintTransitionOptions[r||""]||(this._paintTransitionOptions[r||""]={}),null===e||void 0===e)delete this._paintTransitionOptions[r||""][t];else{if(this._handleErrors(u.paintProperty,n,t,e))return;this._paintTransitionOptions[r||""][t]=e}else if(this._paintDeclarations[r||""]||(this._paintDeclarations[r||""]={}),null===e||void 0===e)delete this._paintDeclarations[r||""][t];else{if(this._handleErrors(u.paintProperty,n,t,e))return;this._paintDeclarations[r||""][t]=new s(this._paintSpecifications[t],e)}},getPaintProperty:function(t,e){return e=e||"",a.endsWith(t,"-transition")?this._paintTransitionOptions[e]&&this._paintTransitionOptions[e][t]:this._paintDeclarations[e]&&this._paintDeclarations[e][t]&&this._paintDeclarations[e][t].value},getPaintValue:function(t,e,r){var n=this._paintSpecifications[t],i=this._paintTransitions[t];return i?i.calculate(e,r):"color"===n.type&&n.default?c(n.default):n.default},getPaintValueStopZoomLevels:function(t){var e=this._paintTransitions[t];return e?e.declaration.stopZoomLevels:[]},getPaintInterpolationT:function(t,e){return this._paintTransitions[t].declaration.calculateInterpolationT({zoom:e})},isPaintValueFeatureConstant:function(t){var e=this._paintTransitions[t];return!e||e.declaration.isFeatureConstant},isLayoutValueFeatureConstant:function(t){var e=this._layoutDeclarations[t];return!e||e.isFeatureConstant},isPaintValueZoomConstant:function(t){var e=this._paintTransitions[t];return!e||e.declaration.isZoomConstant},isHidden:function(t){return!!(this.minzoom&&t<this.minzoom)||(!!(this.maxzoom&&t>=this.maxzoom)||("none"===this.layout.visibility||0===this.paint[this.type+"-opacity"]))},updatePaintTransitions:function(t,e,r,n){for(var i=a.extend({},this._paintDeclarations[""]),o=0;o<t.length;o++)a.extend(i,this._paintDeclarations[t[o]]);var s;for(s in i)this._applyPaintDeclaration(s,i[s],e,r,n);for(s in this._paintTransitions)s in i||this._applyPaintDeclaration(s,null,e,r,n)},updatePaintTransition:function(t,e,r,n,i){for(var a=this._paintDeclarations[""][t],o=0;o<e.length;o++){var s=this._paintDeclarations[e[o]];s&&s[t]&&(a=s[t])}this._applyPaintDeclaration(t,a,r,n,i)},recalculate:function(t,e){for(var r in this._paintTransitions)this.paint[r]=this.getPaintValue(r,{zoom:t,zoomHistory:e});for(var n in this._layoutFunctions)this.layout[n]=this.getLayoutValue(n,{zoom:t,zoomHistory:e})},serialize:function(t){var e={id:this.id,ref:this.ref,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom};for(var r in this._paintDeclarations){e[""===r?"paint":"paint."+r]=a.mapObject(this._paintDeclarations[r],i)}return(!this.ref||t&&t.includeRefProperties)&&a.extend(e,{type:this.type,source:this.source,"source-layer":this.sourceLayer,filter:this.filter,layout:a.mapObject(this._layoutDeclarations,i)}),a.filterObject(e,function(t,e){return void 0!==t&&!("layout"===e&&!Object.keys(t).length)})},_applyPaintDeclaration:function(t,e,r,n,i){var l=r.transition?this._paintTransitions[t]:void 0,u=this._paintSpecifications[t];if(null!==e&&void 0!==e||(e=new s(u,u.default)),!l||l.declaration.json!==e.json){var c=a.extend({duration:300,delay:0},n,this.getPaintProperty(t+"-transition")),h=this._paintTransitions[t]=new o(u,e,l,c);h.instant()||(h.loopID=i.set(h.endTime-Date.now())),l&&i.cancel(l.loopID)}},_updateLayoutValue:function(t){var e=this._layoutDeclarations[t];e&&e.isFunction?this._layoutFunctions[t]=!0:(delete this._layoutFunctions[t],this.layout[t]=this.getLayoutValue(t))},_handleErrors:function(t,e,r,n){return u.emitErrors(this,t.call(u,{key:e,layerType:this.type,objectKey:r,value:n,styleSpec:l,style:{glyphs:!0,sprite:!0}}))}})},{"../util/evented":427,"../util/util":435,"./parse_color":370,"./style_declaration":372,"./style_layer/background_style_layer":375,"./style_layer/circle_style_layer":376,"./style_layer/fill_style_layer":377,"./style_layer/line_style_layer":378,"./style_layer/raster_style_layer":379,"./style_layer/symbol_style_layer":380,"./style_spec":381,"./style_transition":382,"./validate_style":383}],375:[function(t,e,r){"use strict";function n(){a.apply(this,arguments)}var i=t("../../util/util"),a=t("../style_layer");e.exports=n,n.prototype=i.inherit(a,{})},{"../../util/util":435,"../style_layer":374}],376:[function(t,e,r){"use strict";function n(){a.apply(this,arguments)}var i=t("../../util/util"),a=t("../style_layer");e.exports=n,n.prototype=i.inherit(a,{})},{"../../util/util":435,"../style_layer":374}],377:[function(t,e,r){"use strict";function n(){a.apply(this,arguments)}var i=t("../../util/util"),a=t("../style_layer");n.prototype=i.inherit(a,{getPaintValue:function(t,e,r){return"fill-outline-color"===t&&void 0===this.getPaintProperty("fill-outline-color")?a.prototype.getPaintValue.call(this,"fill-color",e,r):a.prototype.getPaintValue.call(this,t,e,r)},getPaintValueStopZoomLevels:function(t){return"fill-outline-color"===t&&void 0===this.getPaintProperty("fill-outline-color")?a.prototype.getPaintValueStopZoomLevels.call(this,"fill-color"):a.prototype.getPaintValueStopZoomLevels.call(this,arguments)},getPaintInterpolationT:function(t,e){return"fill-outline-color"===t&&void 0===this.getPaintProperty("fill-outline-color")?a.prototype.getPaintInterpolationT.call(this,"fill-color",e):a.prototype.getPaintInterpolationT.call(this,t,e)},isPaintValueFeatureConstant:function(t){return"fill-outline-color"===t&&void 0===this.getPaintProperty("fill-outline-color")?a.prototype.isPaintValueFeatureConstant.call(this,"fill-color"):a.prototype.isPaintValueFeatureConstant.call(this,t)},isPaintValueZoomConstant:function(t){return"fill-outline-color"===t&&void 0===this.getPaintProperty("fill-outline-color")?a.prototype.isPaintValueZoomConstant.call(this,"fill-color"):a.prototype.isPaintValueZoomConstant.call(this,t)}}),e.exports=n},{"../../util/util":435,"../style_layer":374}],378:[function(t,e,r){"use strict";function n(){a.apply(this,arguments)}var i=t("../../util/util"),a=t("../style_layer");e.exports=n,n.prototype=i.inherit(a,{getPaintValue:function(t,e,r){var n=a.prototype.getPaintValue.apply(this,arguments);if(n&&"line-dasharray"===t){var i=Math.floor(e.zoom);this._flooredZoom!==i&&(this._flooredZoom=i,this._flooredLineWidth=this.getPaintValue("line-width",e,r)),n.fromScale*=this._flooredLineWidth,n.toScale*=this._flooredLineWidth}return n}})},{"../../util/util":435,"../style_layer":374}],379:[function(t,e,r){"use strict";function n(){a.apply(this,arguments)}var i=t("../../util/util"),a=t("../style_layer");e.exports=n,n.prototype=i.inherit(a,{})},{"../../util/util":435,"../style_layer":374}],380:[function(t,e,r){"use strict";function n(){a.apply(this,arguments)}var i=t("../../util/util"),a=t("../style_layer");e.exports=n,n.prototype=i.inherit(a,{isHidden:function(){if(a.prototype.isHidden.apply(this,arguments))return!0;var t=0===this.paint["text-opacity"]||!this.layout["text-field"],e=0===this.paint["icon-opacity"]||!this.layout["icon-image"];return!(!t||!e)},getLayoutValue:function(t,e,r){return("text-rotation-alignment"!==t||"line"!==this.getLayoutValue("symbol-placement",e,r)||this.getLayoutProperty("text-rotation-alignment"))&&("icon-rotation-alignment"!==t||"line"!==this.getLayoutValue("symbol-placement",e,r)||this.getLayoutProperty("icon-rotation-alignment"))?"text-pitch-alignment"!==t||this.getLayoutProperty("text-pitch-alignment")?a.prototype.getLayoutValue.apply(this,arguments):this.getLayoutValue("text-rotation-alignment"):"map"}})},{"../../util/util":435,"../style_layer":374}],381:[function(t,e,r){"use strict";e.exports=t("mapbox-gl-style-spec/reference/latest.min")},{"mapbox-gl-style-spec/reference/latest.min":318}],382:[function(t,e,r){"use strict";function n(t,e,r,n){this.declaration=e,this.startTime=this.endTime=(new Date).getTime(),"piecewise-constant"===t.function&&t.transition?this.interp=i:this.interp=o[t.type],this.oldTransition=r,this.duration=n.duration||0,this.delay=n.delay||0,this.instant()||(this.endTime=this.startTime+this.duration+this.delay,this.ease=a.easeCubicInOut),r&&r.endTime<=this.startTime&&delete r.oldTransition}function i(t,e,r){return void 0===(t&&t.to)||void 0===(e&&e.to)?void 0:{from:t.to,fromScale:t.toScale,to:e.to,toScale:e.toScale,t:r}}var a=t("../util/util"),o=t("../util/interpolate");e.exports=n,n.prototype.instant=function(){return!this.oldTransition||!this.interp||0===this.duration&&0===this.delay},n.prototype.calculate=function(t,e){var r=this.declaration.calculate(a.extend({},t,{duration:this.duration}),e);if(this.instant())return r;var n=t.time||Date.now();if(n<this.endTime){var i=this.oldTransition.calculate(a.extend({},t,{time:this.startTime}),e),o=this.ease((n-this.startTime-this.delay)/this.duration);r=this.interp(i,r,o)}return r}},{"../util/interpolate":429,"../util/util":435}],383:[function(t,e,r){"use strict";e.exports=t("mapbox-gl-style-spec/lib/validate_style.min"),e.exports.emitErrors=function(t,e){if(e&&e.length){for(var r=0;r<e.length;r++)t.fire("error",{error:new Error(e[r].message)});return!0}return!1},e.exports.throwErrors=function(t,e){if(e)for(var r=0;r<e.length;r++)throw new Error(e[r].message)}},{"mapbox-gl-style-spec/lib/validate_style.min":317}],384:[function(t,e,r){"use strict";function n(t,e,r,n){this.x=t,this.y=e,this.angle=r,void 0!==n&&(this.segment=n)}var i=t("point-geometry");e.exports=n,n.prototype=Object.create(i.prototype),n.prototype.clone=function(){return new n(this.x,this.y,this.angle,this.segment)}},{"point-geometry":476}],385:[function(t,e,r){"use strict";function n(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],h=t[o],f=t[o+1];if(!f)return!1;var d=c.angleTo(h)-h.angleTo(f);for(d=Math.abs((d+3*Math.PI)%(2*Math.PI)-Math.PI),l.push({distance:s,angleDelta:d}),u+=d;s-l[0].distance>n;)u-=l.shift().angleDelta;if(u>i)return!1;o++,s+=h.dist(f)}return!0}e.exports=n},{}],386:[function(t,e,r){"use strict";function n(t,e,r,n,a){for(var o=[],s=0;s<t.length;s++)for(var l,u=t[s],c=0;c<u.length-1;c++){var h=u[c],f=u[c+1];h.x<e&&f.x<e||(h.x<e?h=new i(e,h.y+(f.y-h.y)*((e-h.x)/(f.x-h.x)))._round():f.x<e&&(f=new i(e,h.y+(f.y-h.y)*((e-h.x)/(f.x-h.x)))._round()),h.y<r&&f.y<r||(h.y<r?h=new i(h.x+(f.x-h.x)*((r-h.y)/(f.y-h.y)),r)._round():f.y<r&&(f=new i(h.x+(f.x-h.x)*((r-h.y)/(f.y-h.y)),r)._round()),h.x>=n&&f.x>=n||(h.x>=n?h=new i(n,h.y+(f.y-h.y)*((n-h.x)/(f.x-h.x)))._round():f.x>=n&&(f=new i(n,h.y+(f.y-h.y)*((n-h.x)/(f.x-h.x)))._round()),h.y>=a&&f.y>=a||(h.y>=a?h=new i(h.x+(f.x-h.x)*((a-h.y)/(f.y-h.y)),a)._round():f.y>=a&&(f=new i(h.x+(f.x-h.x)*((a-h.y)/(f.y-h.y)),a)._round()),l&&h.equals(l[l.length-1])||(l=[h],o.push(l)),l.push(f)))))}return o}var i=t("point-geometry");e.exports=n},{"point-geometry":476}],387:[function(t,e,r){"use strict";var n=t("../util/struct_array"),i=t("../util/util"),a=t("point-geometry"),o=e.exports=new n({members:[{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:"Float32",name:"maxScale"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"},{type:"Int16",name:"bbox0"},{type:"Int16",name:"bbox1"},{type:"Int16",name:"bbox2"},{type:"Int16",name:"bbox3"},{type:"Float32",name:"placementScale"}]});i.extendAll(o.prototype.StructType.prototype,{get anchorPoint(){return new a(this.anchorPointX,this.anchorPointY)}})},{"../util/struct_array":433,"../util/util":435,"point-geometry":476}],388:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o,s,l,u,c){var h=o.top*s-l,f=o.bottom*s+l,d=o.left*s-l,p=o.right*s+l;if(this.boxStartIndex=t.length,u){var m=f-h,v=p-d;if(m>0)if(m=Math.max(10*s,m),c){var g=e[r.segment+1].sub(e[r.segment])._unit()._mult(v),y=[r.sub(g),r.add(g)];this._addLineCollisionBoxes(t,y,r,0,v,m,n,i,a)}else this._addLineCollisionBoxes(t,e,r,r.segment,v,m,n,i,a)}else t.emplaceBack(r.x,r.y,d,h,p,f,1/0,n,i,a,0,0,0,0,0);this.boxEndIndex=t.length}e.exports=n,n.prototype._addLineCollisionBoxes=function(t,e,r,n,i,a,o,s,l){var u=a/2,c=Math.floor(i/u),h=-a/2,f=this.boxes,d=r,p=n+1,m=h;do{if(--p<0)return f;m-=e[p].dist(d),d=e[p]}while(m>-i/2);for(var v=e[p].dist(e[p+1]),g=0;g<c;g++){for(var y=-i/2+g*u;m+v<y;){if(m+=v,++p+1>=e.length)return f;v=e[p].dist(e[p+1])}var b=y-m,x=e[p],_=e[p+1],w=_.sub(x)._unit()._mult(b)._add(x)._round(),M=Math.max(Math.abs(y-h)-u/2,0),k=i/2/M;t.emplaceBack(w.x,w.y,-a/2,-a/2,a/2,a/2,k,o,s,l,0,0,0,0,0)}return f}},{}],389:[function(t,e,r){"use strict";function n(t,e,r){if("object"==typeof t){var n=t;r=e,t=n.angle,e=n.pitch,this.grid=new o(n.grid),this.ignoredGrid=new o(n.ignoredGrid)}else this.grid=new o(a,12,6),this.ignoredGrid=new o(a,12,0);this.angle=t,this.pitch=e;var i=Math.sin(t),s=Math.cos(t);if(this.rotationMatrix=[s,-i,i,s],this.reverseRotationMatrix=[s,i,-i,s],this.yStretch=1/Math.cos(e/180*Math.PI),this.yStretch=Math.pow(this.yStretch,1.3),this.collisionBoxArray=r,0===r.length){r.emplaceBack();r.emplaceBack(0,0,0,-32767,0,32767,32767,0,0,0,0,0,0,0,0,0),r.emplaceBack(a,0,0,-32767,0,32767,32767,0,0,0,0,0,0,0,0,0),r.emplaceBack(0,0,-32767,0,32767,0,32767,0,0,0,0,0,0,0,0,0),r.emplaceBack(0,a,-32767,0,32767,0,32767,0,0,0,0,0,0,0,0,0)}this.tempCollisionBox=r.get(0),this.edges=[r.get(1),r.get(2),r.get(3),r.get(4)]}var i=t("point-geometry"),a=t("../data/bucket").EXTENT,o=t("grid-index");e.exports=n,n.prototype.serialize=function(){var t={angle:this.angle,pitch:this.pitch,grid:this.grid.toArrayBuffer(),ignoredGrid:this.ignoredGrid.toArrayBuffer()};return{data:t,transferables:[t.grid,t.ignoredGrid]}},n.prototype.minScale=.25,n.prototype.maxScale=2,n.prototype.placeCollisionFeature=function(t,e,r){for(var n=this.collisionBoxArray,a=this.minScale,o=this.rotationMatrix,s=this.yStretch,l=t.boxStartIndex;l<t.boxEndIndex;l++){var u=n.get(l),c=u.anchorPoint._matMult(o),h=c.x,f=c.y,d=h+u.x1,p=f+u.y1*s,m=h+u.x2,v=f+u.y2*s;if(u.bbox0=d,u.bbox1=p,u.bbox2=m,u.bbox3=v,!e)for(var g=this.grid.query(d,p,m,v),y=0;y<g.length;y++){var b=n.get(g[y]),x=b.anchorPoint._matMult(o);if((a=this.getPlacementScale(a,c,u,x,b))>=this.maxScale)return a}if(r){var _;if(this.angle){var w=this.reverseRotationMatrix,M=new i(u.x1,u.y1).matMult(w),k=new i(u.x2,u.y1).matMult(w),A=new i(u.x1,u.y2).matMult(w),T=new i(u.x2,u.y2).matMult(w);_=this.tempCollisionBox,_.anchorPointX=u.anchorPoint.x,_.anchorPointY=u.anchorPoint.y,_.x1=Math.min(M.x,k.x,A.x,T.x),_.y1=Math.min(M.y,k.x,A.x,T.x),_.x2=Math.max(M.x,k.x,A.x,T.x),_.y2=Math.max(M.y,k.x,A.x,T.x),_.maxScale=u.maxScale}else _=u;for(var S=0;S<this.edges.length;S++){var E=this.edges[S];if((a=this.getPlacementScale(a,u.anchorPoint,_,E.anchorPoint,E))>=this.maxScale)return a}}}return a},n.prototype.queryRenderedSymbols=function(t,e,r,n,a){var o={},s=[],l=this.collisionBoxArray,u=this.rotationMatrix,c=new i(t,e)._matMult(u),h=this.tempCollisionBox;h.anchorX=c.x,h.anchorY=c.y,h.x1=0,h.y1=0,h.x2=r-t,h.y2=n-e,h.maxScale=a,a=h.maxScale;for(var f=[c.x+h.x1/a,c.y+h.y1/a*this.yStretch,c.x+h.x2/a,c.y+h.y2/a*this.yStretch],d=this.grid.query(f[0],f[1],f[2],f[3]),p=this.ignoredGrid.query(f[0],f[1],f[2],f[3]),m=0;m<p.length;m++)d.push(p[m]);for(var v=0;v<d.length;v++){var g=l.get(d[v]),y=g.sourceLayerIndex,b=g.featureIndex;if(void 0===o[y]&&(o[y]={}),!o[y][b]){var x=g.anchorPoint.matMult(u);this.getPlacementScale(this.minScale,c,h,x,g)>=a&&(o[y][b]=!0,s.push(d[v]))}}return s},n.prototype.getPlacementScale=function(t,e,r,n,i){var a=e.x-n.x,o=e.y-n.y,s=(i.x1-r.x2)/a,l=(i.x2-r.x1)/a,u=(i.y1-r.y2)*this.yStretch/o,c=(i.y2-r.y1)*this.yStretch/o;(isNaN(s)||isNaN(l))&&(s=l=1),(isNaN(u)||isNaN(c))&&(u=c=1);var h=Math.min(Math.max(s,l),Math.max(u,c)),f=i.maxScale,d=r.maxScale;return h>f&&(h=f),h>d&&(h=d),h>t&&h>=i.placementScale&&(t=h),t},n.prototype.insertCollisionFeature=function(t,e,r){for(var n=r?this.ignoredGrid:this.grid,i=this.collisionBoxArray,a=t.boxStartIndex;a<t.boxEndIndex;a++){var o=i.get(a);o.placementScale=e,e<this.maxScale&&n.insert(a,o.bbox0,o.bbox1,o.bbox2,o.bbox3)}}},{"../data/bucket":322,"grid-index":282,"point-geometry":476}],390:[function(t,e,r){"use strict";function n(t,e,r,n,a,o,s,l,u){var c=n?.6*o*s:0,h=Math.max(n?n.right-n.left:0,a?a.right-a.left:0),f=0===t[0].x||t[0].x===u||0===t[0].y||t[0].y===u;e-h*s<e/4&&(e=h*s+e/4);var d=2*o;return i(t,f?e/2*l%e:(h/2+d)*s*l%e,e,c,r,h*s,f,!1,u)}function i(t,e,r,n,l,u,c,h,f){for(var d=u/2,p=0,m=0;m<t.length-1;m++)p+=t[m].dist(t[m+1]);for(var v=0,g=e-r,y=[],b=0;b<t.length-1;b++){for(var x=t[b],_=t[b+1],w=x.dist(_),M=_.angleTo(x);g+r<v+w;){g+=r;var k=(g-v)/w,A=a(x.x,_.x,k),T=a(x.y,_.y,k);if(A>=0&&A<f&&T>=0&&T<f&&g-d>=0&&g+d<=p){var S=new o(A,T,M,b)._round();n&&!s(t,S,u,n,l)||y.push(S)}}v+=w}return h||y.length||c||(y=i(t,v/2,r,n,l,u,c,!0,f)),y}var a=t("../util/interpolate"),o=t("../symbol/anchor"),s=t("./check_max_angle");e.exports=n},{"../symbol/anchor":384,"../util/interpolate":429,"./check_max_angle":385}],391:[function(t,e,r){"use strict";function n(){this.width=o,this.height=o,this.bin=new i(this.width,this.height),this.index={},this.ids={},this.data=new Uint8Array(this.width*this.height)}var i=t("shelf-pack"),a=t("../util/util"),o=128;e.exports=n,n.prototype.getGlyphs=function(){var t,e,r,n={};for(var i in this.ids)t=i.split("#"),e=t[0],r=t[1],n[e]||(n[e]=[]),n[e].push(r);return n},n.prototype.getRects=function(){var t,e,r,n={};for(var i in this.ids)t=i.split("#"),e=t[0],r=t[1],n[e]||(n[e]={}),n[e][r]=this.index[i];return n},n.prototype.addGlyph=function(t,e,r,n){if(!r)return null;var i=e+"#"+r.id;if(this.index[i])return this.ids[i].indexOf(t)<0&&this.ids[i].push(t),this.index[i];if(!r.bitmap)return null;var o=r.width+2*n,s=r.height+2*n,l=o+2,u=s+2;l+=4-l%4,u+=4-u%4;var c=this.bin.packOne(l,u);if(c||(this.resize(),c=this.bin.packOne(l,u)),!c)return a.warnOnce("glyph bitmap overflow"),null;this.index[i]=c,this.ids[i]=[t];for(var h=this.data,f=r.bitmap,d=0;d<s;d++)for(var p=this.width*(c.y+d+1)+c.x+1,m=o*d,v=0;v<o;v++)h[p+v]=f[m+v];return this.dirty=!0,c},n.prototype.resize=function(){var t=this.width,e=this.height;if(!(t>=2048||e>=2048)){this.texture&&(this.gl&&this.gl.deleteTexture(this.texture),this.texture=null),this.width*=4,this.height*=4,this.bin.resize(this.width,this.height);for(var r=new ArrayBuffer(this.width*this.height),n=0;n<e;n++){var i=new Uint8Array(this.data.buffer,e*n,t);new Uint8Array(r,e*n*4,t).set(i)}this.data=new Uint8Array(r)}},n.prototype.bind=function(t){this.gl=t,this.texture?t.bindTexture(t.TEXTURE_2D,this.texture):(this.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texImage2D(t.TEXTURE_2D,0,t.ALPHA,this.width,this.height,0,t.ALPHA,t.UNSIGNED_BYTE,null))},n.prototype.updateTexture=function(t){this.bind(t),this.dirty&&(t.texSubImage2D(t.TEXTURE_2D,0,0,0,this.width,this.height,t.ALPHA,t.UNSIGNED_BYTE,this.data),this.dirty=!1)}},{"../util/util":435,"shelf-pack":506}],392:[function(t,e,r){"use strict";function n(t){this.url=t&&o(t),this.atlases={},this.stacks={},this.loading={}}function i(t,e,r){this.advance=t.advance,this.left=t.left-r-1,this.top=t.top+r+1,this.rect=e}function a(t,e,r,n){return n=n||"abc",r.replace("{s}",n[t.length%n.length]).replace("{fontstack}",t).replace("{range}",e)}var o=t("../util/mapbox").normalizeGlyphsURL,s=t("../util/ajax").getArrayBuffer,l=t("../util/glyphs"),u=t("../symbol/glyph_atlas"),c=t("pbf");e.exports=n,n.prototype.getSimpleGlyphs=function(t,e,r,n){void 0===this.stacks[t]&&(this.stacks[t]={}),void 0===this.atlases[t]&&(this.atlases[t]=new u);for(var a,o={},s=this.stacks[t],l=this.atlases[t],c={},h=0,f=0;f<e.length;f++){var d=e[f];if(a=Math.floor(d/256),s[a]){var p=s[a].glyphs[d],m=l.addGlyph(r,t,p,3);p&&(o[d]=new i(p,m,3))}else void 0===c[a]&&(c[a]=[],h++),c[a].push(d)}h||n(void 0,o,t);var v=function(e,a,s){if(!e)for(var u=this.stacks[t][a]=s.stacks[0],f=0;f<c[a].length;f++){var d=c[a][f],p=u.glyphs[d],m=l.addGlyph(r,t,p,3);p&&(o[d]=new i(p,m,3))}--h||n(void 0,o,t)}.bind(this);for(var g in c)this.loadRange(t,g,v)},n.prototype.loadRange=function(t,e,r){if(256*e>65535)return r("glyphs > 65535 not supported");void 0===this.loading[t]&&(this.loading[t]={});var n=this.loading[t];if(n[e])n[e].push(r);else{n[e]=[r];var i=256*e+"-"+(256*e+255),o=a(t,i,this.url);s(o,function(t,r){for(var i=!t&&new l(new c(new Uint8Array(r))),a=0;a<n[e].length;a++)n[e][a](t,e,i);delete n[e]})}},n.prototype.getGlyphAtlas=function(t){return this.atlases[t]}},{"../symbol/glyph_atlas":391,"../util/ajax":418,"../util/glyphs":428,"../util/mapbox":432,pbf:470}],393:[function(t,e,r){"use strict";e.exports=function(t,e,r){function n(n){c.push(t[n]),h.push(r[n]),f.push(e[n]),d++}function i(t,e,r){var n=u[t];return delete u[t],u[e]=n,h[n][0].pop(),h[n][0]=h[n][0].concat(r[0]),n}function a(t,e,r){var n=l[e];return delete l[e],l[t]=n,h[n][0].shift(),h[n][0]=r[0].concat(h[n][0]),n}function o(t,e,r){var n=r?e[0][e[0].length-1]:e[0][0];return t+":"+n.x+":"+n.y}var s,l={},u={},c=[],h=[],f=[],d=0;for(s=0;s<t.length;s++){var p=r[s],m=e[s];if(m){var v=o(m,p),g=o(m,p,!0);if(v in u&&g in l&&u[v]!==l[g]){var y=a(v,g,p),b=i(v,g,h[y]);delete l[v],delete u[g],u[o(m,h[b],!0)]=b,h[y]=null}else v in u?i(v,g,p):g in l?a(v,g,p):(n(s),l[v]=d-1,u[g]=d-1)}else n(s)}return{features:c,textFeatures:f,geometries:h}}},{}],394:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o,s,l,u){this.anchorPoint=t,this.tl=e,this.tr=r,this.bl=n,this.br=i,this.tex=a,this.anchorAngle=o,this.glyphAngle=s,this.minScale=l,this.maxScale=u}function i(t,e,r,i,a,o,u,c,h){var f,d,p,m,v=e.image.rect,g=a.layout,y=e.left-1,b=y+v.w/e.image.pixelRatio,x=e.top-1,_=x+v.h/e.image.pixelRatio;if("none"!==g["icon-text-fit"]&&u){var w=b-y,M=_-x,k=g["text-size"]/24,A=u.left*k,T=u.right*k,S=u.top*k,E=u.bottom*k,L=T-A,C=E-S,z=g["icon-text-fit-padding"][0],D=g["icon-text-fit-padding"][1],I=g["icon-text-fit-padding"][2],P=g["icon-text-fit-padding"][3],O="width"===g["icon-text-fit"]?.5*(C-M):0,j="height"===g["icon-text-fit"]?.5*(L-w):0,F="width"===g["icon-text-fit"]||"both"===g["icon-text-fit"]?L:w,R="height"===g["icon-text-fit"]||"both"===g["icon-text-fit"]?C:M;f=new s(A+j-P,S+O-z),d=new s(A+j+D+F,S+O-z),p=new s(A+j+D+F,S+O+I+R),m=new s(A+j-P,S+O+I+R)}else f=new s(y,x),d=new s(b,x),p=new s(b,_),m=new s(y,_);var N=a.getLayoutValue("icon-rotate",c,h)*Math.PI/180;if(o){var B=i[t.segment];if(t.y===B.y&&t.x===B.x&&t.segment+1<i.length){var U=i[t.segment+1];N+=Math.atan2(t.y-U.y,t.x-U.x)+Math.PI}else N+=Math.atan2(t.y-B.y,t.x-B.x)}if(N){var V=Math.sin(N),q=Math.cos(N),H=[q,-V,V,q];f=f.matMult(H),d=d.matMult(H),m=m.matMult(H),p=p.matMult(H)}return[new n(new s(t.x,t.y),f,d,m,p,e.image.rect,0,0,l,1/0)]}function a(t,e,r,i,a,u){for(var c=a.layout["text-rotate"]*Math.PI/180,h=a.layout["text-keep-upright"],f=e.positionedGlyphs,d=[],p=0;p<f.length;p++){var m=f[p],v=m.glyph,g=v.rect;if(g){var y,b=(m.x+v.advance/2)*r,x=l;u?(y=[],x=o(y,t,b,i,t.segment,!0),h&&(x=Math.min(x,o(y,t,b,i,t.segment,!1)))):y=[{anchorPoint:new s(t.x,t.y),offset:0,angle:0,maxScale:1/0,minScale:l}];for(var _=m.x+v.left,w=m.y-v.top,M=_+g.w,k=w+g.h,A=new s(_,w),T=new s(M,w),S=new s(_,k),E=new s(M,k),L=0;L<y.length;L++){var C=y[L],z=A,D=T,I=S,P=E;if(c){var O=Math.sin(c),j=Math.cos(c),F=[j,-O,O,j];z=z.matMult(F),D=D.matMult(F),I=I.matMult(F),P=P.matMult(F)}var R=Math.max(C.minScale,x),N=(t.angle+C.offset+2*Math.PI)%(2*Math.PI),B=(C.angle+C.offset+2*Math.PI)%(2*Math.PI);d.push(new n(C.anchorPoint,z,D,I,P,g,N,B,R,C.maxScale))}}}return d}function o(t,e,r,n,i,a){var o=!a;r<0&&(a=!a),a&&i++;var u=new s(e.x,e.y),c=n[i],h=1/0;r=Math.abs(r);for(var f=l;;){var d=u.dist(c),p=r/d,m=Math.atan2(c.y-u.y,c.x-u.x);if(a||(m+=Math.PI),t.push({anchorPoint:u,offset:o?Math.PI:0,minScale:p,maxScale:h,angle:(m+2*Math.PI)%(2*Math.PI)}),p<=f)break;for(u=c;u.equals(c);)if(i+=a?1:-1,!(c=n[i]))return p;var v=c.sub(u)._unit();u=u.sub(v._mult(d)),h=p}return f}var s=t("point-geometry");e.exports={getIconQuads:i,getGlyphQuads:a,SymbolQuad:n};var l=.5},{"point-geometry":476}],395:[function(t,e,r){"use strict";function n(t,e,r){for(var n=[],a=0,o=t.length;a<o;a++){var s=i(t[a].properties,e["text-field"]);if(s){s=s.toString();var l=e["text-transform"];"uppercase"===l?s=s.toLocaleUpperCase():"lowercase"===l&&(s=s.toLocaleLowerCase());for(var u=0;u<s.length;u++)r[s.charCodeAt(u)]=!0;n[a]=s}else n[a]=null}return n}var i=t("../util/token");e.exports=n},{"../util/token":434}],396:[function(t,e,r){"use strict";function n(t,e,r,n){this.codePoint=t,this.x=e,this.y=r,this.glyph=n}function i(t,e,r,n,i,a){this.positionedGlyphs=t,this.text=e,this.top=r,this.bottom=n,this.left=i,this.right=a}function a(t,e,r,a,s,l,u,c,h){for(var f=[],d=new i(f,t,h[1],h[1],h[0],h[0]),p=0,m=0;m<t.length;m++){var v=t.charCodeAt(m),g=e[v];g&&(f.push(new n(v,p,-17,g)),p+=g.advance+c)}return!!f.length&&(o(d,e,a,r,s,l,u,h),d)}function o(t,e,r,n,i,a,o,u){var c=null,d=0,p=0,m=0,v=0,g=t.positionedGlyphs;if(n)for(var y=0;y<g.length;y++){var b=g[y];if(b.x-=d,b.y+=r*m,b.x>n&&null!==c){var x=g[c+1].x;v=Math.max(x,v);for(var _=c+1;_<=y;_++)g[_].y+=r,g[_].x-=x;if(o){var w=c;h[g[c].codePoint]&&w--,s(g,e,p,w,o)}p=c+1,c=null,d+=x,m++}f[b.codePoint]&&(c=y)}var M=g[g.length-1],k=M.x+e[M.codePoint].advance;v=Math.max(v,k);var A=(m+1)*r;s(g,e,p,g.length-1,o),l(g,o,i,a,v,r,m,u),t.top+=-a*A,t.bottom=t.top+A,t.left+=-i*v,t.right=t.left+v}function s(t,e,r,n,i){for(var a=e[t[n].codePoint].advance,o=(t[n].x+a)*i,s=r;s<=n;s++)t[s].x-=o}function l(t,e,r,n,i,a,o,s){for(var l=(e-r)*i+s[0],u=(-n*(o+1)+.5)*a+s[1],c=0;c<t.length;c++)t[c].x+=l,t[c].y+=u}function u(t,e){if(!t||!t.rect)return null;var r=e["icon-offset"][0],n=e["icon-offset"][1],i=r-t.width/2,a=i+t.width,o=n-t.height/2;return new c(t,o,o+t.height,i,a)}function c(t,e,r,n,i){this.image=t,this.top=e,this.bottom=r,this.left=n,this.right=i}e.exports={shapeText:a,shapeIcon:u};var h={32:!0,8203:!0},f={32:!0,38:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0}},{}],397:[function(t,e,r){"use strict";function n(t,e){this.width=t,this.height=e,this.bin=new o(t,e),this.images={},this.data=!1,this.texture=0,this.filter=0,this.pixelRatio=1,this.dirty=!0}function i(t,e,r,n,i,a,o,s,l,u,c){var h,f,d=n*e+r,p=s*a+o;if(c)for(p-=a,f=-1;f<=u;f++,d=((f+u)%u+n)*e+r,p+=a)for(h=-1;h<=l;h++)i[p+h]=t[d+(h+l)%l];else for(f=0;f<u;f++,d+=e,p+=a)for(h=0;h<l;h++)i[p+h]=t[d+h]}function a(t,e,r,n,i){this.rect=t,this.width=e,this.height=r,this.sdf=n,this.pixelRatio=i}var o=t("shelf-pack"),s=t("../util/browser"),l=t("../util/util");e.exports=n,n.prototype.allocateImage=function(t,e){t/=this.pixelRatio,e/=this.pixelRatio;var r=t+2+(4-(t+2)%4),n=e+2+(4-(e+2)%4),i=this.bin.packOne(r,n);return i||(l.warnOnce("SpriteAtlas out of space."),null)},n.prototype.getImage=function(t,e){if(this.images[t])return this.images[t];if(!this.sprite)return null;var r=this.sprite.getSpritePosition(t);if(!r.width||!r.height)return null;var n=this.allocateImage(r.width,r.height);if(!n)return null;var i=new a(n,r.width/r.pixelRatio,r.height/r.pixelRatio,r.sdf,r.pixelRatio/this.pixelRatio);return this.images[t]=i,this.copy(n,r,e),i},n.prototype.getPosition=function(t,e){var r=this.getImage(t,e),n=r&&r.rect;if(!n)return null;var i=r.width*r.pixelRatio,a=r.height*r.pixelRatio;return{size:[r.width,r.height],tl:[(n.x+1)/this.width,(n.y+1)/this.height],br:[(n.x+1+i)/this.width,(n.y+1+a)/this.height]}},n.prototype.allocate=function(){if(!this.data){var t=Math.floor(this.width*this.pixelRatio),e=Math.floor(this.height*this.pixelRatio);this.data=new Uint32Array(t*e);for(var r=0;r<this.data.length;r++)this.data[r]=0}},n.prototype.copy=function(t,e,r){if(this.sprite.img.data){var n=new Uint32Array(this.sprite.img.data.buffer);this.allocate();var a=this.data;i(n,this.sprite.img.width,e.x,e.y,a,this.width*this.pixelRatio,(t.x+1)*this.pixelRatio,(t.y+1)*this.pixelRatio,e.width,e.height,r),this.dirty=!0}},n.prototype.setSprite=function(t){t&&(this.pixelRatio=s.devicePixelRatio>1?2:1,this.canvas&&(this.canvas.width=this.width*this.pixelRatio,this.canvas.height=this.height*this.pixelRatio)),this.sprite=t},n.prototype.addIcons=function(t,e){for(var r=0;r<t.length;r++)this.getImage(t[r]);e(null,this.images)},n.prototype.bind=function(t,e){var r=!1;this.texture?t.bindTexture(t.TEXTURE_2D,this.texture):(this.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),r=!0);var n=e?t.LINEAR:t.NEAREST;n!==this.filter&&(t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,n),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,n),this.filter=n),this.dirty&&(this.allocate(),r?t.texImage2D(t.TEXTURE_2D,0,t.RGBA,this.width*this.pixelRatio,this.height*this.pixelRatio,0,t.RGBA,t.UNSIGNED_BYTE,new Uint8Array(this.data.buffer)):t.texSubImage2D(t.TEXTURE_2D,0,0,0,this.width*this.pixelRatio,this.height*this.pixelRatio,t.RGBA,t.UNSIGNED_BYTE,new Uint8Array(this.data.buffer)),this.dirty=!1)}},{"../util/browser":419,"../util/util":435,"shelf-pack":506}],398:[function(t,e,r){"use strict";var n=t("../util/struct_array"),i=t("../util/util"),a=t("point-geometry"),o=e.exports=new n({members:[{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"glyphQuadStartIndex"},{type:"Uint16",name:"glyphQuadEndIndex"},{type:"Uint16",name:"iconQuadStartIndex"},{type:"Uint16",name:"iconQuadEndIndex"},{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int8",name:"index"}]});i.extendAll(o.prototype.StructType.prototype,{get anchorPoint(){return new a(this.anchorPointX,this.anchorPointY)}})},{"../util/struct_array":433,"../util/util":435,"point-geometry":476}],399:[function(t,e,r){"use strict";var n=t("../util/struct_array"),i=t("../util/util"),a=t("point-geometry"),o=t("./quads").SymbolQuad,s=e.exports=new n({members:[{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Float32",name:"tlX"},{type:"Float32",name:"tlY"},{type:"Float32",name:"trX"},{type:"Float32",name:"trY"},{type:"Float32",name:"blX"},{type:"Float32",name:"blY"},{type:"Float32",name:"brX"},{type:"Float32",name:"brY"},{type:"Int16",name:"texH"},{type:"Int16",name:"texW"},{type:"Int16",name:"texX"},{type:"Int16",name:"texY"},{
37 type:"Float32",name:"anchorAngle"},{type:"Float32",name:"glyphAngle"},{type:"Float32",name:"maxScale"},{type:"Float32",name:"minScale"}]});i.extendAll(s.prototype.StructType.prototype,{get anchorPoint(){return new a(this.anchorPointX,this.anchorPointY)},get SymbolQuad(){return new o(this.anchorPoint,new a(this.tlX,this.tlY),new a(this.trX,this.trY),new a(this.blX,this.blY),new a(this.brX,this.brY),{x:this.texX,y:this.texY,h:this.texH,w:this.texW,height:this.texH,width:this.texW},this.anchorAngle,this.glyphAngle,this.minScale,this.maxScale)}})},{"../util/struct_array":433,"../util/util":435,"./quads":394,"point-geometry":476}],400:[function(t,e,r){"use strict";var n=t("../util/dom"),i=t("point-geometry"),a={scrollZoom:t("./handler/scroll_zoom"),boxZoom:t("./handler/box_zoom"),dragRotate:t("./handler/drag_rotate"),dragPan:t("./handler/drag_pan"),keyboard:t("./handler/keyboard"),doubleClickZoom:t("./handler/dblclick_zoom"),touchZoomRotate:t("./handler/touch_zoom_rotate")};e.exports=function(t,e){function r(t){g("mouseout",t)}function o(e){t.stop(),_=n.mousePos(b,e),g("mousedown",e)}function s(e){var r=t.dragRotate&&t.dragRotate.isActive();x&&!r&&g("contextmenu",x),x=null,g("mouseup",e)}function l(e){if(!(t.dragPan&&t.dragPan.isActive()||t.dragRotate&&t.dragRotate.isActive())){for(var r=e.toElement||e.target;r&&r!==b;)r=r.parentNode;r===b&&g("mousemove",e)}}function u(e){t.stop(),y("touchstart",e),!e.touches||e.touches.length>1||(w?(clearTimeout(w),w=null,g("dblclick",e)):w=setTimeout(d,300))}function c(t){y("touchmove",t)}function h(t){y("touchend",t)}function f(t){y("touchcancel",t)}function d(){w=null}function p(t){n.mousePos(b,t).equals(_)&&g("click",t)}function m(t){g("dblclick",t),t.preventDefault()}function v(t){x=t,t.preventDefault()}function g(e,r){var i=n.mousePos(b,r);return t.fire(e,{lngLat:t.unproject(i),point:i,originalEvent:r})}function y(e,r){var a=n.touchPos(b,r),o=a.reduce(function(t,e,r,n){return t.add(e.div(n.length))},new i(0,0));return t.fire(e,{lngLat:t.unproject(o),point:o,lngLats:a.map(function(e){return t.unproject(e)},this),points:a,originalEvent:r})}var b=t.getCanvasContainer(),x=null,_=null,w=null;for(var M in a)t[M]=new a[M](t,e),e.interactive&&e[M]&&t[M].enable();b.addEventListener("mouseout",r,!1),b.addEventListener("mousedown",o,!1),b.addEventListener("mouseup",s,!1),b.addEventListener("mousemove",l,!1),b.addEventListener("touchstart",u,!1),b.addEventListener("touchend",h,!1),b.addEventListener("touchmove",c,!1),b.addEventListener("touchcancel",f,!1),b.addEventListener("click",p,!1),b.addEventListener("dblclick",m,!1),b.addEventListener("contextmenu",v,!1)}},{"../util/dom":421,"./handler/box_zoom":406,"./handler/dblclick_zoom":407,"./handler/drag_pan":408,"./handler/drag_rotate":409,"./handler/keyboard":410,"./handler/scroll_zoom":411,"./handler/touch_zoom_rotate":412,"point-geometry":476}],401:[function(t,e,r){"use strict";var n=t("../util/util"),i=t("../util/interpolate"),a=t("../util/browser"),o=t("../geo/lng_lat"),s=t("../geo/lng_lat_bounds"),l=t("point-geometry"),u=e.exports=function(){};n.extend(u.prototype,{getCenter:function(){return this.transform.center},setCenter:function(t,e){return this.jumpTo({center:t},e),this},panBy:function(t,e,r){return this.panTo(this.transform.center,n.extend({offset:l.convert(t).mult(-1)},e),r),this},panTo:function(t,e,r){return this.easeTo(n.extend({center:t},e),r)},getZoom:function(){return this.transform.zoom},setZoom:function(t,e){return this.jumpTo({zoom:t},e),this},zoomTo:function(t,e,r){return this.easeTo(n.extend({zoom:t},e),r)},zoomIn:function(t,e){return this.zoomTo(this.getZoom()+1,t,e),this},zoomOut:function(t,e){return this.zoomTo(this.getZoom()-1,t,e),this},getBearing:function(){return this.transform.bearing},setBearing:function(t,e){return this.jumpTo({bearing:t},e),this},rotateTo:function(t,e,r){return this.easeTo(n.extend({bearing:t},e),r)},resetNorth:function(t,e){return this.rotateTo(0,n.extend({duration:1e3},t),e),this},snapToNorth:function(t,e){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(t,e):this},getPitch:function(){return this.transform.pitch},setPitch:function(t,e){return this.jumpTo({pitch:t},e),this},fitBounds:function(t,e,r){e=n.extend({padding:0,offset:[0,0],maxZoom:1/0},e),t=s.convert(t);var i=l.convert(e.offset),a=this.transform,o=a.project(t.getNorthWest()),u=a.project(t.getSouthEast()),c=u.sub(o),h=(a.width-2*e.padding-2*Math.abs(i.x))/c.x,f=(a.height-2*e.padding-2*Math.abs(i.y))/c.y;return e.center=a.unproject(o.add(u).div(2)),e.zoom=Math.min(a.scaleZoom(a.scale*Math.min(h,f)),e.maxZoom),e.bearing=0,e.linear?this.easeTo(e,r):this.flyTo(e,r)},jumpTo:function(t,e){this.stop();var r=this.transform,n=!1,i=!1,a=!1;return"zoom"in t&&r.zoom!==+t.zoom&&(n=!0,r.zoom=+t.zoom),"center"in t&&(r.center=o.convert(t.center)),"bearing"in t&&r.bearing!==+t.bearing&&(i=!0,r.bearing=+t.bearing),"pitch"in t&&r.pitch!==+t.pitch&&(a=!0,r.pitch=+t.pitch),this.fire("movestart",e).fire("move",e),n&&this.fire("zoomstart",e).fire("zoom",e).fire("zoomend",e),i&&this.fire("rotate",e),a&&this.fire("pitch",e),this.fire("moveend",e)},easeTo:function(t,e){this.stop(),t=n.extend({offset:[0,0],duration:500,easing:n.ease},t);var r,a,s=this.transform,u=l.convert(t.offset),c=this.getZoom(),h=this.getBearing(),f=this.getPitch(),d="zoom"in t?+t.zoom:c,p="bearing"in t?this._normalizeBearing(t.bearing,h):h,m="pitch"in t?+t.pitch:f;"center"in t?(r=o.convert(t.center),a=s.centerPoint.add(u)):"around"in t?(r=o.convert(t.around),a=s.locationPoint(r)):(a=s.centerPoint.add(u),r=s.pointLocation(a));var v=s.locationPoint(r);return t.animate===!1&&(t.duration=0),this.zooming=d!==c,this.rotating=h!==p,this.pitching=m!==f,t.noMoveStart||this.fire("movestart",e),this.zooming&&this.fire("zoomstart",e),clearTimeout(this._onEaseEnd),this._ease(function(t){this.zooming&&(s.zoom=i(c,d,t)),this.rotating&&(s.bearing=i(h,p,t)),this.pitching&&(s.pitch=i(f,m,t)),s.setLocationAtPoint(r,v.add(a.sub(v)._mult(t))),this.fire("move",e),this.zooming&&this.fire("zoom",e),this.rotating&&this.fire("rotate",e),this.pitching&&this.fire("pitch",e)},function(){t.delayEndEvents?this._onEaseEnd=setTimeout(this._easeToEnd.bind(this,e),t.delayEndEvents):this._easeToEnd(e)}.bind(this),t),this},_easeToEnd:function(t){var e=this.zooming;this.zooming=!1,this.rotating=!1,this.pitching=!1,e&&this.fire("zoomend",t),this.fire("moveend",t)},flyTo:function(t,e){function r(t){var e=(A*A-k*k+(t?-1:1)*L*L*T*T)/(2*(t?A:k)*L*T);return Math.log(Math.sqrt(e*e+1)-e)}function a(t){return(Math.exp(t)-Math.exp(-t))/2}function s(t){return(Math.exp(t)+Math.exp(-t))/2}function u(t){return a(t)/s(t)}this.stop(),t=n.extend({offset:[0,0],speed:1.2,curve:1.42,easing:n.ease},t);var c=this.transform,h=l.convert(t.offset),f=this.getZoom(),d=this.getBearing(),p=this.getPitch(),m="center"in t?o.convert(t.center):this.getCenter(),v="zoom"in t?+t.zoom:f,g="bearing"in t?this._normalizeBearing(t.bearing,d):d,y="pitch"in t?+t.pitch:p;Math.abs(c.center.lng)+Math.abs(m.lng)>180&&(c.center.lng>0&&m.lng<0?m.lng+=360:c.center.lng<0&&m.lng>0&&(m.lng-=360));var b=c.zoomScale(v-f),x=c.point,_="center"in t?c.project(m).sub(h.div(b)):x,w=c.worldSize,M=t.curve,k=Math.max(c.width,c.height),A=k/b,T=_.sub(x).mag();if("minZoom"in t){var S=n.clamp(Math.min(t.minZoom,f,v),c.minZoom,c.maxZoom),E=k/c.zoomScale(S-f);M=Math.sqrt(E/T*2)}var L=M*M,C=r(0),z=function(t){return s(C)/s(C+M*t)},D=function(t){return k*((s(C)*u(C+M*t)-a(C))/L)/T},I=(r(1)-C)/M;if(Math.abs(T)<1e-6){if(Math.abs(k-A)<1e-6)return this.easeTo(t);var P=A<k?-1:1;I=Math.abs(Math.log(A/k))/M,D=function(){return 0},z=function(t){return Math.exp(P*M*t)}}if("duration"in t)t.duration=+t.duration;else{var O="screenSpeed"in t?+t.screenSpeed/M:+t.speed;t.duration=1e3*I/O}return this.zooming=!0,d!==g&&(this.rotating=!0),p!==y&&(this.pitching=!0),this.fire("movestart",e),this.fire("zoomstart",e),this._ease(function(t){var r=t*I,n=D(r);c.zoom=f+c.scaleZoom(1/z(r)),c.center=c.unproject(x.add(_.sub(x).mult(n)),w),this.rotating&&(c.bearing=i(d,g,t)),this.pitching&&(c.pitch=i(p,y,t)),this.fire("move",e),this.fire("zoom",e),this.rotating&&this.fire("rotate",e),this.pitching&&this.fire("pitch",e)},function(){this.zooming=!1,this.rotating=!1,this.pitching=!1,this.fire("zoomend",e),this.fire("moveend",e)},t),this},isEasing:function(){return!!this._abortFn},stop:function(){return this._abortFn&&(this._abortFn(),this._finishEase()),this},_ease:function(t,e,r){this._finishFn=e,this._abortFn=a.timed(function(e){t.call(this,r.easing(e)),1===e&&this._finishEase()},r.animate===!1?0:r.duration,this)},_finishEase:function(){delete this._abortFn;var t=this._finishFn;delete this._finishFn,t.call(this)},_normalizeBearing:function(t,e){t=n.wrap(t,-180,180);var r=Math.abs(t-e);return Math.abs(t-360-e)<r&&(t-=360),Math.abs(t+360-e)<r&&(t+=360),t},_updateEasing:function(t,e,r){var i;if(this.ease){var a=this.ease,o=(Date.now()-a.start)/a.duration,s=a.easing(o+.01)-a.easing(o),l=.27/Math.sqrt(s*s+1e-4)*.01,u=Math.sqrt(.0729-l*l);i=n.bezier(l,u,.25,1)}else i=r?n.bezier.apply(n,r):n.ease;return this.ease={start:(new Date).getTime(),to:Math.pow(2,e),duration:t,easing:i},i}})},{"../geo/lng_lat":332,"../geo/lng_lat_bounds":333,"../util/browser":419,"../util/interpolate":429,"../util/util":435,"point-geometry":476}],402:[function(t,e,r){"use strict";function n(t){o.setOptions(this,t)}var i=t("./control"),a=t("../../util/dom"),o=t("../../util/util");e.exports=n,n.createAttributionString=function(t){var e=[];for(var r in t){var n=t[r];n.attribution&&e.indexOf(n.attribution)<0&&e.push(n.attribution)}return e.sort(function(t,e){return t.length-e.length}),e=e.filter(function(t,r){for(var n=r+1;n<e.length;n++)if(e[n].indexOf(t)>=0)return!1;return!0}),e.join(" | ")},n.prototype=o.inherit(i,{options:{position:"bottom-right"},onAdd:function(t){var e=this._container=a.create("div","mapboxgl-ctrl-attrib",t.getContainer());return this._update(),t.on("source.load",this._update.bind(this)),t.on("source.change",this._update.bind(this)),t.on("source.remove",this._update.bind(this)),t.on("moveend",this._updateEditLink.bind(this)),e},_update:function(){this._map.style&&(this._container.innerHTML=n.createAttributionString(this._map.style.sources)),this._editLink=this._container.getElementsByClassName("mapbox-improve-map")[0],this._updateEditLink()},_updateEditLink:function(){if(this._editLink){var t=this._map.getCenter();this._editLink.href="https://www.mapbox.com/map-feedback/#/"+t.lng+"/"+t.lat+"/"+Math.round(this._map.getZoom()+1)}}})},{"../../util/dom":421,"../../util/util":435,"./control":403}],403:[function(t,e,r){"use strict";function n(){}var i=t("../../util/util"),a=t("../../util/evented");e.exports=n,n.prototype={addTo:function(t){this._map=t;var e=this._container=this.onAdd(t);if(this.options&&this.options.position){var r=this.options.position,n=t._controlCorners[r];e.className+=" mapboxgl-ctrl",r.indexOf("bottom")!==-1?n.insertBefore(e,n.firstChild):n.appendChild(e)}return this},remove:function(){return this._container.parentNode.removeChild(this._container),this.onRemove&&this.onRemove(this._map),this._map=null,this}},i.extend(n.prototype,a)},{"../../util/evented":427,"../../util/util":435}],404:[function(t,e,r){"use strict";function n(t){s.setOptions(this,t)}var i=t("./control"),a=t("../../util/browser"),o=t("../../util/dom"),s=t("../../util/util");e.exports=n;var l={enableHighAccuracy:!1,timeout:6e3};n.prototype=s.inherit(i,{options:{position:"top-right"},onAdd:function(t){var e=this._container=o.create("div","mapboxgl-ctrl-group",t.getContainer());return a.supportsGeolocation?(this._container.addEventListener("contextmenu",this._onContextMenu.bind(this)),this._geolocateButton=o.create("button","mapboxgl-ctrl-icon mapboxgl-ctrl-geolocate",this._container),this._geolocateButton.type="button",this._geolocateButton.addEventListener("click",this._onClickGeolocate.bind(this)),e):e},_onContextMenu:function(t){t.preventDefault()},_onClickGeolocate:function(){navigator.geolocation.getCurrentPosition(this._success.bind(this),this._error.bind(this),l),this._timeoutId=setTimeout(this._finish.bind(this),1e4)},_success:function(t){this._map.jumpTo({center:[t.coords.longitude,t.coords.latitude],zoom:17,bearing:0,pitch:0}),this.fire("geolocate",t),this._finish()},_error:function(t){this.fire("error",t),this._finish()},_finish:function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}})},{"../../util/browser":419,"../../util/dom":421,"../../util/util":435,"./control":403}],405:[function(t,e,r){"use strict";function n(t){s.setOptions(this,t)}function i(t){return new MouseEvent(t.type,{button:2,buttons:2,bubbles:!0,cancelable:!0,detail:t.detail,view:t.view,screenX:t.screenX,screenY:t.screenY,clientX:t.clientX,clientY:t.clientY,movementX:t.movementX,movementY:t.movementY,ctrlKey:t.ctrlKey,shiftKey:t.shiftKey,altKey:t.altKey,metaKey:t.metaKey})}var a=t("./control"),o=t("../../util/dom"),s=t("../../util/util");e.exports=n,n.prototype=s.inherit(a,{options:{position:"top-right"},onAdd:function(t){var e="mapboxgl-ctrl",r=this._container=o.create("div",e+"-group",t.getContainer());return this._container.addEventListener("contextmenu",this._onContextMenu.bind(this)),this._zoomInButton=this._createButton(e+"-icon "+e+"-zoom-in",t.zoomIn.bind(t)),this._zoomOutButton=this._createButton(e+"-icon "+e+"-zoom-out",t.zoomOut.bind(t)),this._compass=this._createButton(e+"-icon "+e+"-compass",t.resetNorth.bind(t)),this._compassArrow=o.create("div","arrow",this._compass),this._compass.addEventListener("mousedown",this._onCompassDown.bind(this)),this._onCompassMove=this._onCompassMove.bind(this),this._onCompassUp=this._onCompassUp.bind(this),t.on("rotate",this._rotateCompassArrow.bind(this)),this._rotateCompassArrow(),this._el=t.getCanvasContainer(),r},_onContextMenu:function(t){t.preventDefault()},_onCompassDown:function(t){0===t.button&&(o.disableDrag(),document.addEventListener("mousemove",this._onCompassMove),document.addEventListener("mouseup",this._onCompassUp),this._el.dispatchEvent(i(t)),t.stopPropagation())},_onCompassMove:function(t){0===t.button&&(this._el.dispatchEvent(i(t)),t.stopPropagation())},_onCompassUp:function(t){0===t.button&&(document.removeEventListener("mousemove",this._onCompassMove),document.removeEventListener("mouseup",this._onCompassUp),o.enableDrag(),this._el.dispatchEvent(i(t)),t.stopPropagation())},_createButton:function(t,e){var r=o.create("button",t,this._container);return r.type="button",r.addEventListener("click",function(){e()}),r},_rotateCompassArrow:function(){var t="rotate("+this._map.transform.angle*(180/Math.PI)+"deg)";this._compassArrow.style.transform=t}})},{"../../util/dom":421,"../../util/util":435,"./control":403}],406:[function(t,e,r){"use strict";function n(t){this._map=t,this._el=t.getCanvasContainer(),this._container=t.getContainer(),o.bindHandlers(this)}var i=t("../../util/dom"),a=t("../../geo/lng_lat_bounds"),o=t("../../util/util");e.exports=n,n.prototype={_enabled:!1,_active:!1,isEnabled:function(){return this._enabled},isActive:function(){return this._active},enable:function(){this.isEnabled()||(this._el.addEventListener("mousedown",this._onMouseDown,!1),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("mousedown",this._onMouseDown),this._enabled=!1)},_onMouseDown:function(t){t.shiftKey&&0===t.button&&(document.addEventListener("mousemove",this._onMouseMove,!1),document.addEventListener("keydown",this._onKeyDown,!1),document.addEventListener("mouseup",this._onMouseUp,!1),i.disableDrag(),this._startPos=i.mousePos(this._el,t),this._active=!0)},_onMouseMove:function(t){var e=this._startPos,r=i.mousePos(this._el,t);this._box||(this._box=i.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",t));var n=Math.min(e.x,r.x),a=Math.max(e.x,r.x),o=Math.min(e.y,r.y),s=Math.max(e.y,r.y);i.setTransform(this._box,"translate("+n+"px,"+o+"px)"),this._box.style.width=a-n+"px",this._box.style.height=s-o+"px"},_onMouseUp:function(t){if(0===t.button){var e=this._startPos,r=i.mousePos(this._el,t),n=new a(this._map.unproject(e),this._map.unproject(r));this._finish(),e.x===r.x&&e.y===r.y?this._fireEvent("boxzoomcancel",t):this._map.fitBounds(n,{linear:!0}).fire("boxzoomend",{originalEvent:t,boxZoomBounds:n})}},_onKeyDown:function(t){27===t.keyCode&&(this._finish(),this._fireEvent("boxzoomcancel",t))},_finish:function(){this._active=!1,document.removeEventListener("mousemove",this._onMouseMove,!1),document.removeEventListener("keydown",this._onKeyDown,!1),document.removeEventListener("mouseup",this._onMouseUp,!1),this._container.classList.remove("mapboxgl-crosshair"),this._box&&(this._box.parentNode.removeChild(this._box),this._box=null),i.enableDrag()},_fireEvent:function(t,e){return this._map.fire(t,{originalEvent:e})}}},{"../../geo/lng_lat_bounds":333,"../../util/dom":421,"../../util/util":435}],407:[function(t,e,r){"use strict";function n(t){this._map=t,this._onDblClick=this._onDblClick.bind(this)}e.exports=n,n.prototype={_enabled:!1,isEnabled:function(){return this._enabled},enable:function(){this.isEnabled()||(this._map.on("dblclick",this._onDblClick),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._map.off("dblclick",this._onDblClick),this._enabled=!1)},_onDblClick:function(t){this._map.zoomTo(this._map.getZoom()+(t.originalEvent.shiftKey?-1:1),{around:t.lngLat},t)}}},{}],408:[function(t,e,r){"use strict";function n(t){this._map=t,this._el=t.getCanvasContainer(),a.bindHandlers(this)}var i=t("../../util/dom"),a=t("../../util/util");e.exports=n;var o=a.bezier(0,0,.3,1);n.prototype={_enabled:!1,_active:!1,isEnabled:function(){return this._enabled},isActive:function(){return this._active},enable:function(){this.isEnabled()||(this._el.addEventListener("mousedown",this._onDown),this._el.addEventListener("touchstart",this._onDown),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("mousedown",this._onDown),this._el.removeEventListener("touchstart",this._onDown),this._enabled=!1)},_onDown:function(t){this._ignoreEvent(t)||this.isActive()||(t.touches?(document.addEventListener("touchmove",this._onMove),document.addEventListener("touchend",this._onTouchEnd)):(document.addEventListener("mousemove",this._onMove),document.addEventListener("mouseup",this._onMouseUp)),this._active=!1,this._startPos=this._pos=i.mousePos(this._el,t),this._inertia=[[Date.now(),this._pos]])},_onMove:function(t){if(!this._ignoreEvent(t)){this.isActive()||(this._active=!0,this._fireEvent("dragstart",t),this._fireEvent("movestart",t));var e=i.mousePos(this._el,t),r=this._map;r.stop(),this._drainInertiaBuffer(),this._inertia.push([Date.now(),e]),r.transform.setLocationAtPoint(r.transform.pointLocation(this._pos),e),this._fireEvent("drag",t),this._fireEvent("move",t),this._pos=e,t.preventDefault()}},_onUp:function(t){if(this.isActive()){this._active=!1,this._fireEvent("dragend",t),this._drainInertiaBuffer();var e=function(){this._fireEvent("moveend",t)}.bind(this),r=this._inertia;if(r.length<2)return void e();var n=r[r.length-1],i=r[0],a=n[1].sub(i[1]),s=(n[0]-i[0])/1e3;if(0===s||n[1].equals(i[1]))return void e();var l=a.mult(.3/s),u=l.mag();u>1400&&(u=1400,l._unit()._mult(u));var c=u/750,h=l.mult(-c/2);this._map.panBy(h,{duration:1e3*c,easing:o,noMoveStart:!0},{originalEvent:t})}},_onMouseUp:function(t){this._ignoreEvent(t)||(this._onUp(t),document.removeEventListener("mousemove",this._onMove),document.removeEventListener("mouseup",this._onMouseUp))},_onTouchEnd:function(t){this._ignoreEvent(t)||(this._onUp(t),document.removeEventListener("touchmove",this._onMove),document.removeEventListener("touchend",this._onTouchEnd))},_fireEvent:function(t,e){return this._map.fire(t,{originalEvent:e})},_ignoreEvent:function(t){var e=this._map;if(e.boxZoom&&e.boxZoom.isActive())return!0;if(e.dragRotate&&e.dragRotate.isActive())return!0;if(t.touches)return t.touches.length>1;if(t.ctrlKey)return!0;return"mousemove"===t.type?t.buttons&!1:0!==t.button},_drainInertiaBuffer:function(){for(var t=this._inertia,e=Date.now();t.length>0&&e-t[0][0]>160;)t.shift()}}},{"../../util/dom":421,"../../util/util":435}],409:[function(t,e,r){"use strict";function n(t,e){this._map=t,this._el=t.getCanvasContainer(),this._bearingSnap=e.bearingSnap,o.bindHandlers(this)}var i=t("../../util/dom"),a=t("point-geometry"),o=t("../../util/util");e.exports=n;var s=o.bezier(0,0,.25,1);n.prototype={_enabled:!1,_active:!1,isEnabled:function(){return this._enabled},isActive:function(){return this._active},enable:function(){this.isEnabled()||(this._el.addEventListener("mousedown",this._onDown),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("mousedown",this._onDown),this._enabled=!1)},_onDown:function(t){if(!this._ignoreEvent(t)&&!this.isActive()){document.addEventListener("mousemove",this._onMove),document.addEventListener("mouseup",this._onUp),this._active=!1,this._inertia=[[Date.now(),this._map.getBearing()]],this._startPos=this._pos=i.mousePos(this._el,t),this._center=this._map.transform.centerPoint;var e=this._startPos.sub(this._center);e.mag()<200&&(this._center=this._startPos.add(new a(-200,0)._rotate(e.angle()))),t.preventDefault()}},_onMove:function(t){if(!this._ignoreEvent(t)){this.isActive()||(this._active=!0,this._fireEvent("rotatestart",t),this._fireEvent("movestart",t));var e=this._map;e.stop();var r=this._pos,n=i.mousePos(this._el,t),a=this._center,o=r.sub(a).angleWith(n.sub(a))/Math.PI*180,s=e.getBearing()-o,l=this._inertia,u=l[l.length-1];this._drainInertiaBuffer(),l.push([Date.now(),e._normalizeBearing(s,u[1])]),e.transform.bearing=s,this._fireEvent("rotate",t),this._fireEvent("move",t),this._pos=n}},_onUp:function(t){if(!this._ignoreEvent(t)&&(document.removeEventListener("mousemove",this._onMove),document.removeEventListener("mouseup",this._onUp),this.isActive())){this._active=!1,this._fireEvent("rotateend",t),this._drainInertiaBuffer();var e=this._map,r=e.getBearing(),n=this._inertia,i=function(){Math.abs(r)<this._bearingSnap?e.resetNorth({noMoveStart:!0},{originalEvent:t}):this._fireEvent("moveend",t)}.bind(this);if(n.length<2)return void i();var a=n[0],o=n[n.length-1],l=n[n.length-2],u=e._normalizeBearing(r,l[1]),c=o[1]-a[1],h=c<0?-1:1,f=(o[0]-a[0])/1e3;if(0===c||0===f)return void i();var d=Math.abs(c*(.25/f));d>180&&(d=180);var p=d/180;u+=h*d*(p/2),Math.abs(e._normalizeBearing(u,0))<this._bearingSnap&&(u=e._normalizeBearing(0,u)),e.rotateTo(u,{duration:1e3*p,easing:s,noMoveStart:!0},{originalEvent:t})}},_fireEvent:function(t,e){return this._map.fire(t,{originalEvent:e})},_ignoreEvent:function(t){var e=this._map;if(e.boxZoom&&e.boxZoom.isActive())return!0;if(e.dragPan&&e.dragPan.isActive())return!0;if(t.touches)return t.touches.length>1;var r=t.ctrlKey?1:2,n=t.ctrlKey?0:2;return"mousemove"===t.type?t.buttons&0===r:t.button!==n},_drainInertiaBuffer:function(){for(var t=this._inertia,e=Date.now();t.length>0&&e-t[0][0]>160;)t.shift()}}},{"../../util/dom":421,"../../util/util":435,"point-geometry":476}],410:[function(t,e,r){"use strict";function n(t){this._map=t,this._el=t.getCanvasContainer(),this._onKeyDown=this._onKeyDown.bind(this)}e.exports=n;n.prototype={_enabled:!1,isEnabled:function(){return this._enabled},enable:function(){this.isEnabled()||(this._el.addEventListener("keydown",this._onKeyDown,!1),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("keydown",this._onKeyDown),this._enabled=!1)},_onKeyDown:function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var e=this._map,r={originalEvent:t};if(!e.isEasing())switch(t.keyCode){case 61:case 107:case 171:case 187:e.zoomTo(Math.round(e.getZoom())+(t.shiftKey?2:1),r);break;case 189:case 109:case 173:e.zoomTo(Math.round(e.getZoom())-(t.shiftKey?2:1),r);break;case 37:t.shiftKey?e.easeTo({bearing:e.getBearing()-2},r):(t.preventDefault(),e.panBy([-80,0],r));break;case 39:t.shiftKey?e.easeTo({bearing:e.getBearing()+2},r):(t.preventDefault(),e.panBy([80,0],r));break;case 38:t.shiftKey?e.easeTo({pitch:e.getPitch()+5},r):(t.preventDefault(),e.panBy([0,-80],r));break;case 40:t.shiftKey?e.easeTo({pitch:Math.max(e.getPitch()-5,0)},r):(t.preventDefault(),e.panBy([0,80],r))}}}}},{}],411:[function(t,e,r){"use strict";function n(t){this._map=t,this._el=t.getCanvasContainer(),o.bindHandlers(this)}var i=t("../../util/dom"),a=t("../../util/browser"),o=t("../../util/util");e.exports=n;var s="undefined"!=typeof navigator?navigator.userAgent.toLowerCase():"",l=s.indexOf("firefox")!==-1,u=s.indexOf("safari")!==-1&&s.indexOf("chrom")===-1;n.prototype={_enabled:!1,isEnabled:function(){return this._enabled},enable:function(){this.isEnabled()||(this._el.addEventListener("wheel",this._onWheel,!1),this._el.addEventListener("mousewheel",this._onWheel,!1),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("wheel",this._onWheel),this._el.removeEventListener("mousewheel",this._onWheel),this._enabled=!1)},_onWheel:function(t){var e;"wheel"===t.type?(e=t.deltaY,l&&t.deltaMode===window.WheelEvent.DOM_DELTA_PIXEL&&(e/=a.devicePixelRatio),t.deltaMode===window.WheelEvent.DOM_DELTA_LINE&&(e*=40)):"mousewheel"===t.type&&(e=-t.wheelDeltaY,u&&(e/=3));var r=a.now(),n=r-(this._time||0);this._pos=i.mousePos(this._el,t),this._time=r,0!==e&&e%4.000244140625==0?(this._type="wheel",e=Math.floor(e/4)):0!==e&&Math.abs(e)<4?this._type="trackpad":n>400?(this._type=null,this._lastValue=e,this._timeout=setTimeout(this._onTimeout,40)):this._type||(this._type=Math.abs(n*e)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,e+=this._lastValue)),t.shiftKey&&e&&(e/=4),this._type&&this._zoom(-e,t),t.preventDefault()},_onTimeout:function(){this._type="wheel",this._zoom(-this._lastValue)},_zoom:function(t,e){if(0!==t){var r=this._map,n=2/(1+Math.exp(-Math.abs(t/100)));t<0&&0!==n&&(n=1/n);var i=r.ease?r.ease.to:r.transform.scale,a=r.transform.scaleZoom(i*n);r.zoomTo(a,{duration:0,around:r.unproject(this._pos),delayEndEvents:200},{originalEvent:e})}}}},{"../../util/browser":419,"../../util/dom":421,"../../util/util":435}],412:[function(t,e,r){"use strict";function n(t){this._map=t,this._el=t.getCanvasContainer(),a.bindHandlers(this)}var i=t("../../util/dom"),a=t("../../util/util");e.exports=n;var o=a.bezier(0,0,.15,1);n.prototype={_enabled:!1,isEnabled:function(){return this._enabled},enable:function(){this.isEnabled()||(this._el.addEventListener("touchstart",this._onStart,!1),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("touchstart",this._onStart),this._enabled=!1)},disableRotation:function(){this._rotationDisabled=!0},enableRotation:function(){this._rotationDisabled=!1},_onStart:function(t){if(2===t.touches.length){var e=i.mousePos(this._el,t.touches[0]),r=i.mousePos(this._el,t.touches[1]);this._startVec=e.sub(r),this._startScale=this._map.transform.scale,this._startBearing=this._map.transform.bearing,this._gestureIntent=void 0,this._inertia=[],document.addEventListener("touchmove",this._onMove,!1),document.addEventListener("touchend",this._onEnd,!1)}},_onMove:function(t){if(2===t.touches.length){var e=i.mousePos(this._el,t.touches[0]),r=i.mousePos(this._el,t.touches[1]),n=e.add(r).div(2),a=e.sub(r),o=a.mag()/this._startVec.mag(),s=this._rotationDisabled?0:180*a.angleWith(this._startVec)/Math.PI,l=this._map;if(this._gestureIntent){var u={duration:0,around:l.unproject(n)};"rotate"===this._gestureIntent&&(u.bearing=this._startBearing+s),"zoom"!==this._gestureIntent&&"rotate"!==this._gestureIntent||(u.zoom=l.transform.scaleZoom(this._startScale*o)),l.stop(),this._drainInertiaBuffer(),this._inertia.push([Date.now(),o,n]),l.easeTo(u,{originalEvent:t})}else{var c=Math.abs(1-o)>.15;Math.abs(s)>4?this._gestureIntent="rotate":c&&(this._gestureIntent="zoom"),this._gestureIntent&&(this._startVec=a,this._startScale=l.transform.scale,this._startBearing=l.transform.bearing)}t.preventDefault()}},_onEnd:function(t){document.removeEventListener("touchmove",this._onMove),document.removeEventListener("touchend",this._onEnd),this._drainInertiaBuffer();var e=this._inertia,r=this._map;if(e.length<2)return void r.snapToNorth({},{originalEvent:t});var n=e[e.length-1],i=e[0],a=r.transform.scaleZoom(this._startScale*n[1]),s=r.transform.scaleZoom(this._startScale*i[1]),l=a-s,u=(n[0]-i[0])/1e3,c=n[2];if(0===u||a===s)return void r.snapToNorth({},{originalEvent:t});var h=.15*l/u;Math.abs(h)>2.5&&(h=h>0?2.5:-2.5);var f=1e3*Math.abs(h/(12*.15)),d=a+h*f/2e3;d<0&&(d=0),r.easeTo({zoom:d,duration:f,easing:o,around:r.unproject(c)},{originalEvent:t})},_drainInertiaBuffer:function(){for(var t=this._inertia,e=Date.now();t.length>2&&e-t[0][0]>160;)t.shift()}}},{"../../util/dom":421,"../../util/util":435}],413:[function(t,e,r){"use strict";function n(){i.bindAll(["_onHashChange","_updateHash"],this)}e.exports=n;var i=t("../util/util");n.prototype={addTo:function(t){return this._map=t,window.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},remove:function(){return window.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),delete this._map,this},_onHashChange:function(){var t=location.hash.replace("#","").split("/");return t.length>=3&&(this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:+(t[3]||0)}),!0)},_updateHash:function(){var t=this._map.getCenter(),e=this._map.getZoom(),r=this._map.getBearing(),n=Math.max(0,Math.ceil(Math.log(e)/Math.LN2)),i="#"+Math.round(100*e)/100+"/"+t.lat.toFixed(n)+"/"+t.lng.toFixed(n)+(r?"/"+Math.round(10*r)/10:"");window.history.replaceState("","",i)}}},{"../util/util":435}],414:[function(t,e,r){"use strict";function n(t){t.parentNode&&t.parentNode.removeChild(t)}var i=t("../util/canvas"),a=t("../util/util"),o=t("../util/browser"),s=t("../util/browser").window,l=t("../util/evented"),u=t("../util/dom"),c=t("../style/style"),h=t("../style/animation_loop"),f=t("../render/painter"),d=t("../geo/transform"),p=t("./hash"),m=t("./bind_handlers"),v=t("./camera"),g=t("../geo/lng_lat"),y=t("../geo/lng_lat_bounds"),b=t("point-geometry"),x=t("./control/attribution"),_={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:0,maxZoom:20,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,bearingSnap:7,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,workerCount:Math.max(o.hardwareConcurrency-1,1)},w=e.exports=function(t){if(t=a.extend({},_,t),t.workerCount<1)throw new Error("workerCount must an integer greater than or equal to 1.");this._interactive=t.interactive,this._failIfMajorPerformanceCaveat=t.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=t.preserveDrawingBuffer,this._trackResize=t.trackResize,this._workerCount=t.workerCount,this._bearingSnap=t.bearingSnap,"string"==typeof t.container?this._container=document.getElementById(t.container):this._container=t.container,this.animationLoop=new h,this.transform=new d(t.minZoom,t.maxZoom),t.maxBounds&&this.setMaxBounds(t.maxBounds),a.bindAll(["_forwardStyleEvent","_forwardSourceEvent","_forwardLayerEvent","_forwardTileEvent","_onStyleLoad","_onStyleChange","_onSourceAdd","_onSourceRemove","_onSourceUpdate","_onWindowOnline","_onWindowResize","_update","_render"],this),this._setupContainer(),this._setupPainter(),this.on("move",this._update.bind(this,!1)),this.on("zoom",this._update.bind(this,!0)),this.on("moveend",function(){this.animationLoop.set(300),this._rerender()}.bind(this)),void 0!==s&&(s.addEventListener("online",this._onWindowOnline,!1),s.addEventListener("resize",this._onWindowResize,!1)),m(this,t),this._hash=t.hash&&(new p).addTo(this),this._hash&&this._hash._onHashChange()||this.jumpTo({center:t.center,zoom:t.zoom,bearing:t.bearing,pitch:t.pitch}),this.stacks={},this._classes=[],this.resize(),t.classes&&this.setClasses(t.classes),
38 t.style&&this.setStyle(t.style),t.attributionControl&&this.addControl(new x(t.attributionControl));var e=this.fire.bind(this,"error");this.on("style.error",e),this.on("source.error",e),this.on("tile.error",e),this.on("layer.error",e)};a.extend(w.prototype,l),a.extend(w.prototype,v.prototype),a.extend(w.prototype,{addControl:function(t){return t.addTo(this),this},addClass:function(t,e){return this._classes.indexOf(t)>=0||""===t?this:(this._classes.push(t),this._classOptions=e,this.style&&this.style.updateClasses(),this._update(!0))},removeClass:function(t,e){var r=this._classes.indexOf(t);return r<0||""===t?this:(this._classes.splice(r,1),this._classOptions=e,this.style&&this.style.updateClasses(),this._update(!0))},setClasses:function(t,e){for(var r={},n=0;n<t.length;n++)""!==t[n]&&(r[t[n]]=!0);return this._classes=Object.keys(r),this._classOptions=e,this.style&&this.style.updateClasses(),this._update(!0)},hasClass:function(t){return this._classes.indexOf(t)>=0},getClasses:function(){return this._classes},resize:function(){var t=0,e=0;return this._container&&(t=this._container.offsetWidth||400,e=this._container.offsetHeight||300),this._canvas.resize(t,e),this.transform.resize(t,e),this.painter.resize(t,e),this.fire("movestart").fire("move").fire("resize").fire("moveend")},getBounds:function(){var t=new y(this.transform.pointLocation(new b(0,0)),this.transform.pointLocation(this.transform.size));return(this.transform.angle||this.transform.pitch)&&(t.extend(this.transform.pointLocation(new b(this.transform.size.x,0))),t.extend(this.transform.pointLocation(new b(0,this.transform.size.y)))),t},setMaxBounds:function(t){if(t){var e=y.convert(t);this.transform.lngRange=[e.getWest(),e.getEast()],this.transform.latRange=[e.getSouth(),e.getNorth()],this.transform._constrain(),this._update()}else null!==t&&void 0!==t||(this.transform.lngRange=[],this.transform.latRange=[],this._update());return this},setMinZoom:function(t){if((t=null===t||void 0===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")},setMaxZoom:function(t){if((t=null===t||void 0===t?20:t)>=this.transform.minZoom&&t<=20)return this.transform.maxZoom=t,this._update(),this.getZoom()>t&&this.setZoom(t),this;throw new Error("maxZoom must be between the current minZoom and 20, inclusive")},project:function(t){return this.transform.locationPoint(g.convert(t))},unproject:function(t){return this.transform.pointLocation(b.convert(t))},queryRenderedFeatures:function(){var t,e={};return 2===arguments.length?(t=arguments[0],e=arguments[1]):1===arguments.length&&function(t){return t instanceof b||Array.isArray(t)}(arguments[0])?t=arguments[0]:1===arguments.length&&(e=arguments[0]),this.style.queryRenderedFeatures(this._makeQueryGeometry(t),e,this.transform.zoom,this.transform.angle)},_makeQueryGeometry:function(t){void 0===t&&(t=[b.convert([0,0]),b.convert([this.transform.width,this.transform.height])]);var e;if(t instanceof b||"number"==typeof t[0])e=[b.convert(t)];else{var r=[b.convert(t[0]),b.convert(t[1])];e=[r[0],new b(r[1].x,r[0].y),r[1],new b(r[0].x,r[1].y),r[0]]}return e=e.map(function(t){return this.transform.pointCoordinate(t)}.bind(this))},querySourceFeatures:function(t,e){return this.style.querySourceFeatures(t,e)},setStyle:function(t){return this.style&&(this.style.off("load",this._onStyleLoad).off("error",this._forwardStyleEvent).off("change",this._onStyleChange).off("source.add",this._onSourceAdd).off("source.remove",this._onSourceRemove).off("source.load",this._onSourceUpdate).off("source.error",this._forwardSourceEvent).off("source.change",this._onSourceUpdate).off("layer.add",this._forwardLayerEvent).off("layer.remove",this._forwardLayerEvent).off("layer.error",this._forwardLayerEvent).off("tile.add",this._forwardTileEvent).off("tile.remove",this._forwardTileEvent).off("tile.load",this._update).off("tile.error",this._forwardTileEvent).off("tile.stats",this._forwardTileEvent)._remove(),this.off("rotate",this.style._redoPlacement),this.off("pitch",this.style._redoPlacement)),t?(this.style=t instanceof c?t:new c(t,this.animationLoop,this._workerCount),this.style.on("load",this._onStyleLoad).on("error",this._forwardStyleEvent).on("change",this._onStyleChange).on("source.add",this._onSourceAdd).on("source.remove",this._onSourceRemove).on("source.load",this._onSourceUpdate).on("source.error",this._forwardSourceEvent).on("source.change",this._onSourceUpdate).on("layer.add",this._forwardLayerEvent).on("layer.remove",this._forwardLayerEvent).on("layer.error",this._forwardLayerEvent).on("tile.add",this._forwardTileEvent).on("tile.remove",this._forwardTileEvent).on("tile.load",this._update).on("tile.error",this._forwardTileEvent).on("tile.stats",this._forwardTileEvent),this.on("rotate",this.style._redoPlacement),this.on("pitch",this.style._redoPlacement),this):(this.style=null,this)},getStyle:function(){if(this.style)return this.style.serialize()},addSource:function(t,e){return this.style.addSource(t,e),this._update(!0),this},addSourceType:function(t,e,r){return this.style.addSourceType(t,e,r)},removeSource:function(t){return this.style.removeSource(t),this._update(!0),this},getSource:function(t){return this.style.getSource(t)},addLayer:function(t,e){return this.style.addLayer(t,e),this._update(!0),this},removeLayer:function(t){return this.style.removeLayer(t),this._update(!0),this},getLayer:function(t){return this.style.getLayer(t)},setFilter:function(t,e){return this.style.setFilter(t,e),this._update(!0),this},setLayerZoomRange:function(t,e,r){return this.style.setLayerZoomRange(t,e,r),this._update(!0),this},getFilter:function(t){return this.style.getFilter(t)},setPaintProperty:function(t,e,r,n){return this.style.setPaintProperty(t,e,r,n),this._update(!0),this},getPaintProperty:function(t,e,r){return this.style.getPaintProperty(t,e,r)},setLayoutProperty:function(t,e,r){return this.style.setLayoutProperty(t,e,r),this._update(!0),this},getLayoutProperty:function(t,e){return this.style.getLayoutProperty(t,e)},getContainer:function(){return this._container},getCanvasContainer:function(){return this._canvasContainer},getCanvas:function(){return this._canvas.getElement()},_setupContainer:function(){var t=this._container;t.classList.add("mapboxgl-map");var e=this._canvasContainer=u.create("div","mapboxgl-canvas-container",t);this._interactive&&e.classList.add("mapboxgl-interactive"),this._canvas=new i(this,e);var r=this._controlContainer=u.create("div","mapboxgl-control-container",t),n=this._controlCorners={};["top-left","top-right","bottom-left","bottom-right"].forEach(function(t){n[t]=u.create("div","mapboxgl-ctrl-"+t,r)})},_setupPainter:function(){var t=this._canvas.getWebGLContext({failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer});if(!t)return void this.fire("error",{error:new Error("Failed to initialize WebGL")});this.painter=new f(t,this.transform)},_contextLost:function(t){t.preventDefault(),this._frameId&&o.cancelFrame(this._frameId),this.fire("webglcontextlost",{originalEvent:t})},_contextRestored:function(t){this._setupPainter(),this.resize(),this._update(),this.fire("webglcontextrestored",{originalEvent:t})},loaded:function(){return!this._styleDirty&&!this._sourcesDirty&&!(!this.style||!this.style.loaded())},_update:function(t){return this.style?(this._styleDirty=this._styleDirty||t,this._sourcesDirty=!0,this._rerender(),this):this},_render:function(){try{this.style&&this._styleDirty&&(this._styleDirty=!1,this.style.update(this._classes,this._classOptions),this._classOptions=null,this.style._recalculate(this.transform.zoom)),this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.painter.render(this.style,{debug:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,vertices:this.vertices,rotating:this.rotating,zooming:this.zooming}),this.fire("render"),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire("load")),this._frameId=null,this.animationLoop.stopped()||(this._styleDirty=!0),(this._sourcesDirty||this._repaint||this._styleDirty)&&this._rerender()}catch(t){this.fire("error",{error:t})}return this},remove:function(){this._hash&&this._hash.remove(),o.cancelFrame(this._frameId),this.setStyle(null),void 0!==s&&s.removeEventListener("resize",this._onWindowResize,!1);var t=this.painter.gl.getExtension("WEBGL_lose_context");t&&t.loseContext(),n(this._canvasContainer),n(this._controlContainer),this._container.classList.remove("mapboxgl-map")},_rerender:function(){this.style&&!this._frameId&&(this._frameId=o.frame(this._render))},_forwardStyleEvent:function(t){this.fire("style."+t.type,a.extend({style:t.target},t))},_forwardSourceEvent:function(t){this.fire(t.type,a.extend({style:t.target},t))},_forwardLayerEvent:function(t){this.fire(t.type,a.extend({style:t.target},t))},_forwardTileEvent:function(t){this.fire(t.type,a.extend({style:t.target},t))},_onStyleLoad:function(t){this.transform.unmodified&&this.jumpTo(this.style.stylesheet),this.style.update(this._classes,{transition:!1}),this._forwardStyleEvent(t)},_onStyleChange:function(t){this._update(!0),this._forwardStyleEvent(t)},_onSourceAdd:function(t){var e=t.source;e.onAdd&&e.onAdd(this),this._forwardSourceEvent(t)},_onSourceRemove:function(t){var e=t.source;e.onRemove&&e.onRemove(this),this._forwardSourceEvent(t)},_onSourceUpdate:function(t){this._update(),this._forwardSourceEvent(t)},_onWindowOnline:function(){this._update()},_onWindowResize:function(){this._trackResize&&this.stop().resize()._update()}}),a.extendAll(w.prototype,{_showTileBoundaries:!1,get showTileBoundaries(){return this._showTileBoundaries},set showTileBoundaries(t){this._showTileBoundaries!==t&&(this._showTileBoundaries=t,this._update())},_showCollisionBoxes:!1,get showCollisionBoxes(){return this._showCollisionBoxes},set showCollisionBoxes(t){this._showCollisionBoxes!==t&&(this._showCollisionBoxes=t,this.style._redoPlacement())},_showOverdrawInspector:!1,get showOverdrawInspector(){return this._showOverdrawInspector},set showOverdrawInspector(t){this._showOverdrawInspector!==t&&(this._showOverdrawInspector=t,this._update())},_repaint:!1,get repaint(){return this._repaint},set repaint(t){this._repaint=t,this._update()},_vertices:!1,get vertices(){return this._vertices},set vertices(t){this._vertices=t,this._update()}})},{"../geo/lng_lat":332,"../geo/lng_lat_bounds":333,"../geo/transform":334,"../render/painter":348,"../style/animation_loop":368,"../style/style":371,"../util/browser":419,"../util/canvas":420,"../util/dom":421,"../util/evented":427,"../util/util":435,"./bind_handlers":400,"./camera":401,"./control/attribution":402,"./hash":413,"point-geometry":476}],415:[function(t,e,r){"use strict";function n(t,e){t||(t=i.create("div")),t.classList.add("mapboxgl-marker"),this._el=t,this._offset=o.convert(e&&e.offset||[0,0]),this._update=this._update.bind(this)}e.exports=n;var i=t("../util/dom"),a=t("../geo/lng_lat"),o=t("point-geometry");n.prototype={addTo:function(t){return this.remove(),this._map=t,t.getCanvasContainer().appendChild(this._el),t.on("move",this._update),this._update(),this},remove:function(){this._map&&(this._map.off("move",this._update),this._map=null);var t=this._el.parentNode;return t&&t.removeChild(this._el),this},getLngLat:function(){return this._lngLat},setLngLat:function(t){return this._lngLat=a.convert(t),this._update(),this},getElement:function(){return this._el},_update:function(){if(this._map){var t=this._map.project(this._lngLat)._add(this._offset);i.setTransform(this._el,"translate("+t.x+"px,"+t.y+"px)")}}}},{"../geo/lng_lat":332,"../util/dom":421,"point-geometry":476}],416:[function(t,e,r){"use strict";function n(t){i.setOptions(this,t),i.bindAll(["_update","_onClickClose"],this)}e.exports=n;var i=t("../util/util"),a=t("../util/evented"),o=t("../util/dom"),s=t("../geo/lng_lat");n.prototype=i.inherit(a,{options:{closeButton:!0,closeOnClick:!0},addTo:function(t){return this._map=t,this._map.on("move",this._update),this.options.closeOnClick&&this._map.on("click",this._onClickClose),this._update(),this},remove:function(){return this._content&&this._content.parentNode&&this._content.parentNode.removeChild(this._content),this._container&&(this._container.parentNode.removeChild(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("click",this._onClickClose),delete this._map),this.fire("close"),this},getLngLat:function(){return this._lngLat},setLngLat:function(t){return this._lngLat=s.convert(t),this._update(),this},setText:function(t){return this.setDOMContent(document.createTextNode(t))},setHTML:function(t){var e,r=document.createDocumentFragment(),n=document.createElement("body");for(n.innerHTML=t;;){if(!(e=n.firstChild))break;r.appendChild(e)}return this.setDOMContent(r)},setDOMContent:function(t){return this._createContent(),this._content.appendChild(t),this._update(),this},_createContent:function(){this._content&&this._content.parentNode&&this._content.parentNode.removeChild(this._content),this._content=o.create("div","mapboxgl-popup-content",this._container),this.options.closeButton&&(this._closeButton=o.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="&#215;",this._closeButton.addEventListener("click",this._onClickClose))},_update:function(){if(this._map&&this._lngLat&&this._content){this._container||(this._container=o.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=o.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content));var t=this._map.project(this._lngLat).round(),e=this.options.anchor;if(!e){var r=this._container.offsetWidth,n=this._container.offsetHeight;e=t.y<n?["top"]:t.y>this._map.transform.height-n?["bottom"]:[],t.x<r/2?e.push("left"):t.x>this._map.transform.width-r/2&&e.push("right"),e=0===e.length?"bottom":e.join("-")}var i={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%)"},a=this._container.classList;for(var s in i)a.remove("mapboxgl-popup-anchor-"+s);a.add("mapboxgl-popup-anchor-"+e),o.setTransform(this._container,i[e]+" translate("+t.x+"px,"+t.y+"px)")}},_onClickClose:function(){this.remove()}})},{"../geo/lng_lat":332,"../util/dom":421,"../util/evented":427,"../util/util":435}],417:[function(t,e,r){"use strict";function n(t,e){this.target=t,this.parent=e,this.callbacks={},this.callbackID=0,this.receive=this.receive.bind(this),this.target.addEventListener("message",this.receive,!1)}e.exports=n,n.prototype.receive=function(t){function e(t,e,r){this.postMessage({type:"<response>",id:String(i),error:t?String(t):null,data:e},r)}var r,n=t.data,i=n.id;if("<response>"===n.type)r=this.callbacks[n.id],delete this.callbacks[n.id],r&&r(n.error||null,n.data);else if(void 0!==n.id&&this.parent[n.type])this.parent[n.type](n.data,e.bind(this));else if(void 0!==n.id&&this.parent.workerSources){var a=n.type.split(".");this.parent.workerSources[a[0]][a[1]](n.data,e.bind(this))}else this.parent[n.type](n.data)},n.prototype.send=function(t,e,r,n){var i=null;r&&(this.callbacks[i=this.callbackID++]=r),this.postMessage({type:t,id:String(i),data:e},n)},n.prototype.postMessage=function(t,e){this.target.postMessage(t,e)}},{}],418:[function(t,e,r){"use strict";function n(t){var e=document.createElement("a");return e.href=t,e.protocol===document.location.protocol&&e.host===document.location.host}r.getJSON=function(t,e){var r=new XMLHttpRequest;return r.open("GET",t,!0),r.setRequestHeader("Accept","application/json"),r.onerror=function(t){e(t)},r.onload=function(){if(r.status>=200&&r.status<300&&r.response){var t;try{t=JSON.parse(r.response)}catch(t){return e(t)}e(null,t)}else e(new Error(r.statusText))},r.send(),r},r.getArrayBuffer=function(t,e){var r=new XMLHttpRequest;return r.open("GET",t,!0),r.responseType="arraybuffer",r.onerror=function(t){e(t)},r.onload=function(){r.status>=200&&r.status<300&&r.response?e(null,r.response):e(new Error(r.statusText))},r.send(),r},r.getImage=function(t,e){return r.getArrayBuffer(t,function(t,r){if(t)return e(t);var n=new Image;n.onload=function(){e(null,n),(window.URL||window.webkitURL).revokeObjectURL(n.src)};var i=new Blob([new Uint8Array(r)],{type:"image/png"});return n.src=(window.URL||window.webkitURL).createObjectURL(i),n.getData=function(){var t=document.createElement("canvas"),e=t.getContext("2d");return t.width=n.width,t.height=n.height,e.drawImage(n,0,0),e.getImageData(0,0,n.width,n.height).data},n})},r.getVideo=function(t,e){var r=document.createElement("video");r.onloadstart=function(){e(null,r)};for(var i=0;i<t.length;i++){var a=document.createElement("source");n(t[i])||(r.crossOrigin="Anonymous"),a.src=t[i],r.appendChild(a)}return r.getData=function(){return r},r}},{}],419:[function(t,e,r){"use strict";r.window=window,e.exports.now=function(){return window.performance&&window.performance.now?window.performance.now.bind(window.performance):Date.now.bind(Date)}();var n=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame;r.frame=function(t){return n(t)};var i=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||window.msCancelAnimationFrame;r.cancelFrame=function(t){i(t)},r.timed=function(t,n,i){function a(l){o||(l=e.exports.now(),l>=s+n?t.call(i,1):(t.call(i,(l-s)/n),r.frame(a)))}if(!n)return t.call(i,1),null;var o=!1,s=e.exports.now();return r.frame(a),function(){o=!0}},r.supported=t("mapbox-gl-supported"),r.hardwareConcurrency=navigator.hardwareConcurrency||4,Object.defineProperty(r,"devicePixelRatio",{get:function(){return window.devicePixelRatio}}),r.supportsWebp=!1;var a=document.createElement("img");a.onload=function(){r.supportsWebp=!0},a.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=",r.supportsGeolocation=!!navigator.geolocation},{"mapbox-gl-supported":320}],420:[function(t,e,r){"use strict";function n(t,e){this.canvas=document.createElement("canvas"),t&&e&&(this.canvas.style.position="absolute",this.canvas.classList.add("mapboxgl-canvas"),this.canvas.addEventListener("webglcontextlost",t._contextLost.bind(t),!1),this.canvas.addEventListener("webglcontextrestored",t._contextRestored.bind(t),!1),this.canvas.setAttribute("tabindex",0),e.appendChild(this.canvas))}var i=t("../util"),a=t("mapbox-gl-supported");e.exports=n,n.prototype.resize=function(t,e){var r=window.devicePixelRatio||1;this.canvas.width=r*t,this.canvas.height=r*e,this.canvas.style.width=t+"px",this.canvas.style.height=e+"px"},n.prototype.getWebGLContext=function(t){return t=i.extend({},t,a.webGLContextAttributes),this.canvas.getContext("webgl",t)||this.canvas.getContext("experimental-webgl",t)},n.prototype.getElement=function(){return this.canvas}},{"../util":435,"mapbox-gl-supported":320}],421:[function(t,e,r){"use strict";function n(t){for(var e=0;e<t.length;e++)if(t[e]in s)return t[e]}function i(t){t.preventDefault(),t.stopPropagation(),window.removeEventListener("click",i,!0)}var a=t("point-geometry");r.create=function(t,e,r){var n=document.createElement(t);return e&&(n.className=e),r&&r.appendChild(n),n};var o,s=document.documentElement.style,l=n(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]);r.disableDrag=function(){l&&(o=s[l],s[l]="none")},r.enableDrag=function(){l&&(s[l]=o)};var u=n(["transform","WebkitTransform"]);r.setTransform=function(t,e){t.style[u]=e},r.suppressClick=function(){window.addEventListener("click",i,!0),window.setTimeout(function(){window.removeEventListener("click",i,!0)},0)},r.mousePos=function(t,e){var r=t.getBoundingClientRect();return e=e.touches?e.touches[0]:e,new a(e.clientX-r.left-t.clientLeft,e.clientY-r.top-t.clientTop)},r.touchPos=function(t,e){for(var r=t.getBoundingClientRect(),n=[],i=0;i<e.touches.length;i++)n.push(new a(e.touches[i].clientX-r.left-t.clientLeft,e.touches[i].clientY-r.top-t.clientTop));return n}},{"point-geometry":476}],422:[function(t,e,r){"use strict";var n=t("webworkify");e.exports=function(){return new n(t("../../source/worker"))}},{"../../source/worker":366,webworkify:556}],423:[function(t,e,r){"use strict";function n(t,e){return e.area-t.area}function i(t){for(var e,r,n=0,i=0,a=t.length,o=a-1;i<a;o=i++)e=t[i],r=t[o],n+=(r.x-e.x)*(e.y+r.y);return n}var a=t("quickselect");e.exports=function(t,e){var r=t.length;if(r<=1)return[t];for(var o,s,l=[],u=0;u<r;u++){var c=i(t[u]);0!==c&&(t[u].area=Math.abs(c),void 0===s&&(s=c<0),s===c<0?(o&&l.push(o),o=[t[u]]):o.push(t[u]))}if(o&&l.push(o),e>1)for(var h=0;h<l.length;h++)l[h].length<=e||(a(l[h],e,1,l[h].length-1,n),l[h]=l[h].slice(0,e));return l}},{quickselect:485}],424:[function(t,e,r){"use strict";e.exports={API_URL:"https://api.mapbox.com",REQUIRE_ACCESS_TOKEN:!0}},{}],425:[function(t,e,r){"use strict";function n(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}}var i=t("assert");e.exports=n,n.prototype.encode=function(t){return i(t in this._stringToNumber),this._stringToNumber[t]},n.prototype.decode=function(t){return i(t<this._numberToString.length),this._numberToString[t]}},{assert:43}],426:[function(t,e,r){"use strict";function n(t,e){this.actors=[],this.currentActor=0;for(var r=0;r<t;r++){var n=new o,i=new a(n,e);i.name="Worker "+r,this.actors.push(i)}}var i=t("./util"),a=t("./actor"),o=t("./web_worker");e.exports=n,n.prototype={broadcast:function(t,e,r){r=r||function(){},i.asyncAll(this.actors,function(r,n){r.send(t,e,n)},r)},send:function(t,e,r,n,i){return("number"!=typeof n||isNaN(n))&&(n=this.currentActor=(this.currentActor+1)%this.actors.length),this.actors[n].send(t,e,r,i),n},remove:function(){for(var t=0;t<this.actors.length;t++)this.actors[t].target.terminate();this.actors=[]}}},{"./actor":417,"./util":435,"./web_worker":422}],427:[function(t,e,r){"use strict";var n=t("./util"),i={on:function(t,e){return this._events=this._events||{},this._events[t]=this._events[t]||[],this._events[t].push(e),this},off:function(t,e){if(!t)return delete this._events,this;if(!this.listens(t))return this;if(e){var r=this._events[t].indexOf(e);r>=0&&this._events[t].splice(r,1),this._events[t].length||delete this._events[t]}else delete this._events[t];return this},once:function(t,e){var r=function(n){this.off(t,r),e.call(this,n)}.bind(this);return this.on(t,r),this},fire:function(t,e){if(!this.listens(t))return n.endsWith(t,"error")&&console.error(e&&e.error||e||"Empty error event"),this;e=n.extend({},e),n.extend(e,{type:t,target:this});for(var r=this._events[t].slice(),i=0;i<r.length;i++)r[i].call(this,e);return this},listens:function(t){return!(!this._events||!this._events[t])}};e.exports=i},{"./util":435}],428:[function(t,e,r){"use strict";function n(t,e){this.stacks=t.readFields(i,[],e)}function i(t,e,r){if(1===t){var n=r.readMessage(a,{glyphs:{}});e.push(n)}}function a(t,e,r){if(1===t)e.name=r.readString();else if(2===t)e.range=r.readString();else if(3===t){var n=r.readMessage(o,{});e.glyphs[n.id]=n}}function o(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())}e.exports=n},{}],429:[function(t,e,r){"use strict";function n(t,e,r){return t*(1-r)+e*r}e.exports=n,n.number=n,n.vec2=function(t,e,r){return[n(t[0],e[0],r),n(t[1],e[1],r)]},n.color=function(t,e,r){return[n(t[0],e[0],r),n(t[1],e[1],r),n(t[2],e[2],r),n(t[3],e[3],r)]},n.array=function(t,e,r){return t.map(function(t,i){return n(t,e[i],r)})}},{}],430:[function(t,e,r){"use strict";function n(t,e,r){for(var n=0;n<t.length;n++)for(var i=t[n],a=0;a<e.length;a++)for(var o=e[a],s=0;s<o.length;s++){var l=o[s];if(d(i,l))return!0;if(c(l,i,r))return!0}return!1}function i(t,e){if(1===t.length&&1===t[0].length)return f(e,t[0][0]);for(var r=0;r<e.length;r++)for(var n=e[r],i=0;i<n.length;i++)if(f(t,n[i]))return!0;for(var a=0;a<t.length;a++){for(var o=t[a],l=0;l<o.length;l++)if(f(e,o[l]))return!0;for(var u=0;u<e.length;u++)if(s(o,e[u]))return!0}return!1}function a(t,e,r){for(var n=0;n<e.length;n++)for(var i=e[n],a=0;a<t.length;a++){var s=t[a];if(s.length>=3)for(var l=0;l<i.length;l++)if(d(s,i[l]))return!0;if(o(s,i,r))return!0}return!1}function o(t,e,r){if(t.length>1){if(s(t,e))return!0;for(var n=0;n<e.length;n++)if(c(e[n],t,r))return!0}for(var i=0;i<t.length;i++)if(c(t[i],e,r))return!0;return!1}function s(t,e){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++){var o=e[a],s=e[a+1];if(u(n,i,o,s))return!0}return!1}function l(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}function u(t,e,r,n){return l(t,r,n)!==l(e,r,n)&&l(t,e,r)!==l(t,e,n)}function c(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(h(t,e[i-1],e[i])<n)return!0}return!1}function h(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 f(t,e){for(var r,n,i,a=!1,o=0;o<t.length;o++){r=t[o];for(var s=0,l=r.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 d(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}e.exports={multiPolygonIntersectsBufferedMultiPoint:n,multiPolygonIntersectsMultiPolygon:i,multiPolygonIntersectsBufferedMultiLine:a}},{}],431:[function(t,e,r){"use strict";function n(t,e){this.max=t,this.onRemove=e,this.reset()}e.exports=n,n.prototype.reset=function(){for(var t in this.data)this.onRemove(this.data[t]);return this.data={},this.order=[],this},n.prototype.add=function(t,e){if(this.has(t))this.order.splice(this.order.indexOf(t),1),this.data[t]=e,this.order.push(t);else if(this.data[t]=e,this.order.push(t),this.order.length>this.max){var r=this.get(this.order[0]);r&&this.onRemove(r)}return this},n.prototype.has=function(t){return t in this.data},n.prototype.keys=function(){return this.order},n.prototype.get=function(t){if(!this.has(t))return null;var e=this.data[t];return delete this.data[t],this.order.splice(this.order.indexOf(t),1),e},n.prototype.setMaxSize=function(t){for(this.max=t;this.order.length>this.max;){var e=this.get(this.order[0]);e&&this.onRemove(e)}return this}},{}],432:[function(t,e,r){"use strict";function n(t,e,r){if(!(r=r||o.ACCESS_TOKEN)&&o.REQUIRE_ACCESS_TOKEN)throw new Error("An API access token is required to use Mapbox GL. See https://www.mapbox.com/developers/api/#access-tokens");if(t=t.replace(/^mapbox:\/\//,o.API_URL+e),t+=t.indexOf("?")!==-1?"&access_token=":"?access_token=",o.REQUIRE_ACCESS_TOKEN){if("s"===r[0])throw new Error("Use a public access token (pk.*) with Mapbox GL JS, not a secret access token (sk.*). See https://www.mapbox.com/developers/api/#access-tokens");t+=r}return t}function i(t){return t?"?"+t:""}function a(t){return t.access_token&&"tk."===t.access_token.slice(0,3)?u.extend({},t,{access_token:o.ACCESS_TOKEN}):t}var o=t("./config"),s=t("./browser"),l=t("url"),u=t("./util");e.exports.normalizeStyleURL=function(t,e){var r=l.parse(t);return"mapbox:"!==r.protocol?t:n("mapbox:/"+r.pathname+i(r.query),"/styles/v1/",e)},e.exports.normalizeSourceURL=function(t,e){return"mapbox:"!==l.parse(t).protocol?t:n(t+".json","/v4/",e)+"&secure"},e.exports.normalizeGlyphsURL=function(t,e){var r=l.parse(t);return"mapbox:"!==r.protocol?t:n("mapbox://"+r.pathname.split("/")[1]+"/{fontstack}/{range}.pbf"+i(r.query),"/fonts/v1/",e)},e.exports.normalizeSpriteURL=function(t,e,r,a){var o=l.parse(t);return"mapbox:"!==o.protocol?(o.pathname+=e+r,l.format(o)):n("mapbox:/"+o.pathname+"/sprite"+e+r+i(o.query),"/styles/v1/",a)},e.exports.normalizeTileURL=function(t,e,r){var n=l.parse(t,!0);if(!e)return t;if("mapbox:"!==l.parse(e).protocol)return t;var i=s.supportsWebp?".webp":"$1",o=s.devicePixelRatio>=2||512===r?"@2x":"";return l.format({protocol:n.protocol,hostname:n.hostname,pathname:n.pathname.replace(/(\.(?:png|jpg)\d*)/,o+i),query:a(n.query)})}},{"./browser":419,"./config":424,"./util":435,url:537}],433:[function(t,e,r){"use strict";function n(t){function e(){f.apply(this,arguments)}function r(){d.apply(this,arguments),this.members=e.prototype.members}var n=JSON.stringify(t);if(v[n])return v[n];void 0===t.alignment&&(t.alignment=1),e.prototype=Object.create(f.prototype);var s=0,u=0,g=["Uint8"];return e.prototype.members=t.members.map(function(r){r={name:r.name,type:r.type,components:r.components||1},p(r.name.length),p(r.type in m),g.indexOf(r.type)<0&&g.push(r.type);var n=o(r.type);u=Math.max(u,n),r.offset=s=a(s,Math.max(t.alignment,n));for(var i=0;i<r.components;i++)Object.defineProperty(e.prototype,r.name+(1===r.components?"":i),{get:c(r,i),set:h(r,i)});return s+=n*r.components,r}),e.prototype.alignment=t.alignment,e.prototype.size=a(s,Math.max(u,t.alignment)),r.serialize=i,r.prototype=Object.create(d.prototype),r.prototype.StructType=e,r.prototype.bytesPerElement=e.prototype.size,r.prototype.emplaceBack=l(e.prototype.members,e.prototype.size),r.prototype._usedTypes=g,v[n]=r,r}function i(){return{members:this.prototype.StructType.prototype.members,alignment:this.prototype.StructType.prototype.alignment,bytesPerElement:this.prototype.bytesPerElement}}function a(t,e){return Math.ceil(t/e)*e}function o(t){return m[t].BYTES_PER_ELEMENT}function s(t){return t.toLowerCase()}function l(t,e){for(var r=[],n=[],i="var i = this.length;\nthis.resize(this.length + 1);\n",a=0;a<t.length;a++){var l=t[a],u=o(l.type);r.indexOf(u)<0&&(r.push(u),i+="var o"+u.toFixed(0)+" = i * "+(e/u).toFixed(0)+";\n");for(var c=0;c<l.components;c++){var h="v"+n.length,f="o"+u.toFixed(0)+" + "+(l.offset/u+c).toFixed(0);i+="this."+s(l.type)+"["+f+"] = "+h+";\n",n.push(h)}}return i+="return i;",new Function(n,i)}function u(t,e){var r="this._pos"+o(t.type).toFixed(0),n=(t.offset/o(t.type)+e).toFixed(0),i=r+" + "+n;return"this._structArray."+s(t.type)+"["+i+"]"}function c(t,e){return new Function([],"return "+u(t,e)+";")}function h(t,e){return new Function(["x"],u(t,e)+" = x;")}function f(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}function d(t){void 0!==t?(this.arrayBuffer=t.arrayBuffer,this.length=t.length,this.capacity=this.arrayBuffer.byteLength/this.bytesPerElement,this._refreshViews()):(this.capacity=-1,this.resize(0))}var p=t("assert");e.exports=n;var m={Int8:Int8Array,Uint8:Uint8Array,Uint8Clamped:Uint8ClampedArray,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array,Float64:Float64Array},v={};d.prototype.DEFAULT_CAPACITY=128,d.prototype.RESIZE_MULTIPLIER=5,d.prototype.serialize=function(){return this.trim(),{length:this.length,arrayBuffer:this.arrayBuffer}},d.prototype.get=function(t){return new this.StructType(this,t)},d.prototype.trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},d.prototype.resize=function(t){if(this.length=t,t>this.capacity){this.capacity=Math.max(t,Math.floor(this.capacity*this.RESIZE_MULTIPLIER),this.DEFAULT_CAPACITY),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}},d.prototype._refreshViews=function(){for(var t=0;t<this._usedTypes.length;t++){var e=this._usedTypes[t];this[s(e)]=new m[e](this.arrayBuffer)}},d.prototype.toArray=function(t,e){for(var r=[],n=t;n<e;n++){var i=this.get(n);r.push(i)}
39 return r}},{assert:43}],434:[function(t,e,r){"use strict";function n(t,e){return e.replace(/{([^{}]+)}/g,function(e,r){return r in t?t[r]:""})}e.exports=n},{}],435:[function(t,e,r){"use strict";var n=t("unitbezier"),i=t("../geo/coordinate");r.easeCubicInOut=function(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)},r.bezier=function(t,e,r,i){var a=new n(t,e,r,i);return function(t){return a.solve(t)}},r.ease=r.bezier(.25,.1,.25,1),r.clamp=function(t,e,r){return Math.min(r,Math.max(e,t))},r.wrap=function(t,e,r){var n=r-e,i=((t-e)%n+n)%n+e;return i===e?r:i},r.coalesce=function(){for(var t=0;t<arguments.length;t++){var e=arguments[t];if(null!==e&&void 0!==e)return e}},r.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)})})},r.keysDifference=function(t,e){var r=[];for(var n in t)n in e||r.push(n);return r},r.extend=function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)t[n]=r[n]}return t},r.extendAll=function(t,e){for(var r in e)Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r));return t},r.inherit=function(t,e){var n="function"==typeof t?t.prototype:t,i=Object.create(n);return r.extendAll(i,e),i},r.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};var a=1;r.uniqueId=function(){return a++},r.debounce=function(t,e){var r,n;return function(){n=arguments,clearTimeout(r),r=setTimeout(function(){t.apply(null,n)},e)}},r.bindAll=function(t,e){t.forEach(function(t){e[t]&&(e[t]=e[t].bind(e))})},r.bindHandlers=function(t){for(var e in t)"function"==typeof t[e]&&0===e.indexOf("_on")&&(t[e]=t[e].bind(t))},r.setOptions=function(t,e){t.hasOwnProperty("options")||(t.options=t.options?Object.create(t.options):{});for(var r in e)t.options[r]=e[r];return t.options},r.getCoordinatesCenter=function(t){for(var e=1/0,r=1/0,n=-1/0,a=-1/0,o=0;o<t.length;o++)e=Math.min(e,t[o].column),r=Math.min(r,t[o].row),n=Math.max(n,t[o].column),a=Math.max(a,t[o].row);var s=n-e,l=a-r,u=Math.max(s,l);return new i((e+n)/2,(r+a)/2,0).zoomTo(Math.floor(-Math.log(u)/Math.LN2))},r.endsWith=function(t,e){return t.indexOf(e,t.length-e.length)!==-1},r.startsWith=function(t,e){return 0===t.indexOf(e)},r.mapObject=function(t,e,r){var n={};for(var i in t)n[i]=e.call(r||this,t[i],i,t);return n},r.filterObject=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},r.deepEqual=function t(e,r){if(Array.isArray(e)){if(!Array.isArray(r)||e.length!==r.length)return!1;for(var n=0;n<e.length;n++)if(!t(e[n],r[n]))return!1;return!0}if("object"==typeof e&&null!==e&&null!==r){if("object"!=typeof r)return!1;if(Object.keys(e).length!==Object.keys(r).length)return!1;for(var i in e)if(!t(e[i],r[i]))return!1;return!0}return e===r},r.clone=function(t){return Array.isArray(t)?t.map(r.clone):"object"==typeof t?r.mapObject(t,r.clone):t},r.arraysIntersect=function(t,e){for(var r=0;r<t.length;r++)if(e.indexOf(t[r])>=0)return!0;return!1};var o={};r.warnOnce=function(t){o[t]||("undefined"!=typeof console&&console.warn(t),o[t]=!0)}},{"../geo/coordinate":331,unitbezier:536}],436:[function(t,e,r){"use strict";function n(t,e,r,n){this._vectorTileFeature=t,t._z=e,t._x=r,t._y=n,this.properties=t.properties,null!=t.id&&(this.id=t.id)}e.exports=n,n.prototype={type:"Feature",get geometry(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry},set geometry(t){this._geometry=t},toJSON:function(){var t={};for(var e in this)"_geometry"!==e&&"_vectorTileFeature"!==e&&"toJSON"!==e&&(t[e]=this[e]);return t}}},{}],437:[function(t,e,r){e.exports={_args:[[{raw:"mapbox-gl@^0.22.0",scope:null,escapedName:"mapbox-gl",name:"mapbox-gl",rawSpec:"^0.22.0",spec:">=0.22.0 <0.23.0",type:"range"},"/home/etienne/Documents/plotly/plotly.js"]],_from:"mapbox-gl@>=0.22.0 <0.23.0",_id:"mapbox-gl@0.22.1",_inCache:!0,_location:"/mapbox-gl",_nodeVersion:"4.4.5",_npmOperationalInternal:{host:"packages-12-west.internal.npmjs.com",tmp:"tmp/mapbox-gl-0.22.1.tgz_1471549891670_0.8762630566488951"},_npmUser:{name:"lucaswoj",email:"lucas@lucaswoj.com"},_npmVersion:"2.15.5",_phantomChildren:{},_requested:{raw:"mapbox-gl@^0.22.0",scope:null,escapedName:"mapbox-gl",name:"mapbox-gl",rawSpec:"^0.22.0",spec:">=0.22.0 <0.23.0",type:"range"},_requiredBy:["#USER","/"],_resolved:"https://registry.npmjs.org/mapbox-gl/-/mapbox-gl-0.22.1.tgz",_shasum:"92a965547d4c2f24c22cbc487eeda48694cb627a",_shrinkwrap:null,_spec:"mapbox-gl@^0.22.0",_where:"/home/etienne/Documents/plotly/plotly.js",browser:{"./js/util/ajax.js":"./js/util/browser/ajax.js","./js/util/browser.js":"./js/util/browser/browser.js","./js/util/canvas.js":"./js/util/browser/canvas.js","./js/util/dom.js":"./js/util/browser/dom.js","./js/util/web_worker.js":"./js/util/browser/web_worker.js"},bugs:{url:"https://github.com/mapbox/mapbox-gl-js/issues"},dependencies:{csscolorparser:"^1.0.2",earcut:"^2.0.3","feature-filter":"^2.2.0","geojson-rewind":"^0.1.0","geojson-vt":"^2.4.0","gl-matrix":"^2.3.1","grid-index":"^1.0.0","mapbox-gl-function":"^1.2.1","mapbox-gl-shaders":"github:mapbox/mapbox-gl-shaders#de2ab007455aa2587c552694c68583f94c9f2747","mapbox-gl-style-spec":"github:mapbox/mapbox-gl-style-spec#83b1a3e5837d785af582efd5ed1a212f2df6a4ae","mapbox-gl-supported":"^1.2.0",pbf:"^1.3.2",pngjs:"^2.2.0","point-geometry":"^0.0.0",quickselect:"^1.0.0",request:"^2.39.0","resolve-url":"^0.2.1","shelf-pack":"^1.0.0",supercluster:"^2.0.1",unassertify:"^2.0.0",unitbezier:"^0.0.0","vector-tile":"^1.3.0","vt-pbf":"^2.0.2",webworkify:"^1.3.0","whoots-js":"^2.0.0"},description:"A WebGL interactive maps library",devDependencies:{"babel-preset-react":"^6.11.1",babelify:"^7.3.0",benchmark:"~2.1.0",browserify:"^13.0.0",clipboard:"^1.5.12","concat-stream":"1.5.1",coveralls:"^2.11.8",doctrine:"^1.2.1",documentation:"https://github.com/documentationjs/documentation/archive/bb41619c734e59ef3fbc3648610032efcfdaaace.tar.gz","documentation-theme-utils":"3.0.0",envify:"^3.4.0",eslint:"^2.5.3","eslint-config-mourner":"^2.0.0","eslint-plugin-html":"^1.5.1",gl:"^4.0.1",handlebars:"4.0.5","highlight.js":"9.3.0",istanbul:"^0.4.2","json-loader":"^0.5.4",lodash:"^4.13.1","mapbox-gl-test-suite":"github:mapbox/mapbox-gl-test-suite#7babab52fb02788ebbc38384139bf350e8e38552","memory-fs":"^0.3.0",minifyify:"^7.0.1","npm-run-all":"^3.0.0",nyc:"6.4.0",proxyquire:"^1.7.9",remark:"4.2.2","remark-html":"3.0.0",sinon:"^1.15.4",st:"^1.2.0",tap:"^5.7.0","transform-loader":"^0.2.3","unist-util-visit":"1.1.0",vinyl:"1.1.1","vinyl-fs":"2.4.3",watchify:"^3.7.0",webpack:"^1.13.1","webworkify-webpack":"^1.1.3"},directories:{},dist:{shasum:"92a965547d4c2f24c22cbc487eeda48694cb627a",tarball:"https://registry.npmjs.org/mapbox-gl/-/mapbox-gl-0.22.1.tgz"},engines:{node:">=4.0.0"},gitHead:"13a9015341f0602ccb55c98c53079838ad4b70b5",homepage:"https://github.com/mapbox/mapbox-gl-js#readme",license:"BSD-3-Clause",main:"js/mapbox-gl.js",maintainers:[{name:"aaronlidman",email:"aaronlidman@gmail.com"},{name:"ajashton",email:"aj.ashton@gmail.com"},{name:"ansis",email:"ansis.brammanis@gmail.com"},{name:"bergwerkgis",email:"wb@bergwerk-gis.at"},{name:"bhousel",email:"bryan@mapbox.com"},{name:"bsudekum",email:"bobby@mapbox.com"},{name:"camilleanne",email:"camille@mapbox.com"},{name:"dnomadb",email:"damon@mapbox.com"},{name:"dthompson",email:"dthompson@gmail.com"},{name:"emilymcafee",email:"emily@mapbox.com"},{name:"flippmoke",email:"flippmoke@gmail.com"},{name:"freenerd",email:"spam@freenerd.de"},{name:"gretacb",email:"carol@mapbox.com"},{name:"ian29",email:"ian.villeda@gmail.com"},{name:"ianshward",email:"ian@mapbox.com"},{name:"ingalls",email:"nicholas.ingalls@gmail.com"},{name:"jfirebaugh",email:"john.firebaugh@gmail.com"},{name:"jrpruit1",email:"jake@jakepruitt.com"},{name:"karenzshea",email:"karen@mapbox.com"},{name:"kkaefer",email:"kkaefer@gmail.com"},{name:"lbud",email:"lauren@mapbox.com"},{name:"lucaswoj",email:"lucas@lucaswoj.com"},{name:"lxbarth",email:"alex@mapbox.com"},{name:"lyzidiamond",email:"lyzi@mapbox.com"},{name:"mapbox-admin",email:"accounts@mapbox.com"},{name:"mateov",email:"matt@mapbox.com"},{name:"mcwhittemore",email:"mcwhittemore@gmail.com"},{name:"miccolis",email:"jeff@miccolis.net"},{name:"mikemorris",email:"michael.patrick.morris@gmail.com"},{name:"morganherlocker",email:"morgan.herlocker@gmail.com"},{name:"mourner",email:"agafonkin@gmail.com"},{name:"nickidlugash",email:"nicki@mapbox.com"},{name:"rclark",email:"ryan.clark.j@gmail.com"},{name:"samanbb",email:"saman@mapbox.com"},{name:"sbma44",email:"tlee@mapbox.com"},{name:"scothis",email:"scothis@gmail.com"},{name:"sgillies",email:"sean@mapbox.com"},{name:"springmeyer",email:"dane@mapbox.com"},{name:"themarex",email:"patrick@mapbox.com"},{name:"tmcw",email:"tom@macwright.org"},{name:"tristen",email:"tristen.brown@gmail.com"},{name:"willwhite",email:"will@mapbox.com"},{name:"yhahn",email:"young@mapbox.com"}],name:"mapbox-gl",optionalDependencies:{},readme:"ERROR: No README data found!",repository:{type:"git",url:"git://github.com/mapbox/mapbox-gl-js.git"},scripts:{build:"npm run build-docs # invoked by publisher when publishing docs on the mb-pages branch","build-dev":"browserify js/mapbox-gl.js --debug --standalone mapboxgl > dist/mapbox-gl-dev.js && tap --no-coverage test/build/dev.test.js","build-docs":"documentation build --github --format html -c documentation.yml --theme ./docs/_theme --output docs/api/","build-min":"browserify js/mapbox-gl.js --debug -t unassertify --plugin [minifyify --map mapbox-gl.js.map --output dist/mapbox-gl.js.map] --standalone mapboxgl > dist/mapbox-gl.js && tap --no-coverage test/build/min.test.js","build-token":"browserify debug/access-token-src.js --debug -t envify > debug/access-token.js",lint:"eslint --ignore-path .gitignore js test bench docs/_posts/examples/*.html","open-changed-examples":"git diff --name-only mb-pages HEAD -- docs/_posts/examples/*.html | awk '{print \"http://127.0.0.1:4000/mapbox-gl-js/example/\" substr($0,33,length($0)-37)}' | xargs open",start:"run-p build-token watch-dev watch-bench start-server","start-bench":"run-p build-token watch-bench start-server","start-debug":"run-p build-token watch-dev start-server","start-docs":"npm run build-min && npm run build-docs && jekyll serve -w","start-server":"st --no-cache --localhost --port 9966 --index index.html .",test:"npm run lint && tap --reporter dot test/js/*/*.js test/build/webpack.test.js","test-suite":"node test/render.test.js && node test/query.test.js","watch-bench":"node bench/download-data.js && watchify bench/index.js --plugin [minifyify --no-map] -t [babelify --presets react] -t unassertify -t envify -o bench/bench.js -v","watch-dev":"watchify js/mapbox-gl.js --debug --standalone mapboxgl -o dist/mapbox-gl-dev.js -v"},version:"0.22.1"}},{}],438:[function(t,e,r){"use strict";function n(t,e,r){for(var n=new Array(t),i=0;i<t;++i)n[i]=0,i===e&&(n[i]+=.5),i===r&&(n[i]+=.5);return n}function i(t,e){if(0===e||e===(1<<t+1)-1)return[];for(var r=[],i=[],a=0;a<=t;++a)if(e&1<<a){r.push(n(t,a-1,a-1)),i.push(null);for(var s=0;s<=t;++s)~e&1<<s&&(r.push(n(t,a-1,s-1)),i.push([a,s]))}var l=o(r),u=[];t:for(var a=0;a<l.length;++a){for(var c=l[a],h=[],s=0;s<c.length;++s){if(!i[c[s]])continue t;h.push(i[c[s]].slice())}u.push(h)}return u}function a(t){for(var e=1<<t+1,r=new Array(e),n=0;n<e;++n)r[n]=i(t,n);return r}e.exports=a;var o=t("convex-hull")},{"convex-hull":99}],439:[function(t,e,r){function n(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}function i(t,e){t[0][0]=e[0],t[0][1]=e[1],t[0][2]=e[2],t[1][0]=e[4],t[1][1]=e[5],t[1][2]=e[6],t[2][0]=e[8],t[2][1]=e[9],t[2][2]=e[10]}function a(t,e,r,n,i){t[0]=e[0]*n+r[0]*i,t[1]=e[1]*n+r[1]*i,t[2]=e[2]*n+r[2]*i}var o=t("./normalize"),s=t("gl-mat4/create"),l=t("gl-mat4/clone"),u=t("gl-mat4/determinant"),c=t("gl-mat4/invert"),h=t("gl-mat4/transpose"),f={length:t("gl-vec3/length"),normalize:t("gl-vec3/normalize"),dot:t("gl-vec3/dot"),cross:t("gl-vec3/cross")},d=s(),p=s(),m=[0,0,0,0],v=[[0,0,0],[0,0,0],[0,0,0]],g=[0,0,0];e.exports=function(t,e,r,s,y,b){if(e||(e=[0,0,0]),r||(r=[0,0,0]),s||(s=[0,0,0]),y||(y=[0,0,0,1]),b||(b=[0,0,0,1]),!o(d,t))return!1;if(l(p,d),p[3]=0,p[7]=0,p[11]=0,p[15]=1,Math.abs(u(p)<1e-8))return!1;var x=d[3],_=d[7],w=d[11],M=d[12],k=d[13],A=d[14],T=d[15];if(0!==x||0!==_||0!==w){m[0]=x,m[1]=_,m[2]=w,m[3]=T;if(!c(p,p))return!1;h(p,p),n(y,m,p)}else y[0]=y[1]=y[2]=0,y[3]=1;if(e[0]=M,e[1]=k,e[2]=A,i(v,d),r[0]=f.length(v[0]),f.normalize(v[0],v[0]),s[0]=f.dot(v[0],v[1]),a(v[1],v[1],v[0],1,-s[0]),r[1]=f.length(v[1]),f.normalize(v[1],v[1]),s[0]/=r[1],s[1]=f.dot(v[0],v[2]),a(v[2],v[2],v[0],1,-s[1]),s[2]=f.dot(v[1],v[2]),a(v[2],v[2],v[1],1,-s[2]),r[2]=f.length(v[2]),f.normalize(v[2],v[2]),s[1]/=r[2],s[2]/=r[2],f.cross(g,v[1],v[2]),f.dot(v[0],g)<0)for(var S=0;S<3;S++)r[S]*=-1,v[S][0]*=-1,v[S][1]*=-1,v[S][2]*=-1;return b[0]=.5*Math.sqrt(Math.max(1+v[0][0]-v[1][1]-v[2][2],0)),b[1]=.5*Math.sqrt(Math.max(1-v[0][0]+v[1][1]-v[2][2],0)),b[2]=.5*Math.sqrt(Math.max(1-v[0][0]-v[1][1]+v[2][2],0)),b[3]=.5*Math.sqrt(Math.max(1+v[0][0]+v[1][1]+v[2][2],0)),v[2][1]>v[1][2]&&(b[0]=-b[0]),v[0][2]>v[2][0]&&(b[1]=-b[1]),v[1][0]>v[0][1]&&(b[2]=-b[2]),!0}},{"./normalize":440,"gl-mat4/clone":170,"gl-mat4/create":171,"gl-mat4/determinant":172,"gl-mat4/invert":176,"gl-mat4/transpose":186,"gl-vec3/cross":267,"gl-vec3/dot":268,"gl-vec3/length":269,"gl-vec3/normalize":271}],440:[function(t,e,r){e.exports=function(t,e){var r=e[15];if(0===r)return!1;for(var n=1/r,i=0;i<16;i++)t[i]=e[i]*n;return!0}},{}],441:[function(t,e,r){function n(t,e,r,n){if(0===c(e)||0===c(r))return!1;var i=u(e,f.translate,f.scale,f.skew,f.perspective,f.quaternion),a=u(r,d.translate,d.scale,d.skew,d.perspective,d.quaternion);return!(!i||!a)&&(s(p.translate,f.translate,d.translate,n),s(p.skew,f.skew,d.skew,n),s(p.scale,f.scale,d.scale,n),s(p.perspective,f.perspective,d.perspective,n),h(p.quaternion,f.quaternion,d.quaternion,n),l(t,p.translate,p.scale,p.skew,p.perspective,p.quaternion),!0)}function i(){return{translate:a(),scale:a(1),skew:a(),perspective:o(),quaternion:o()}}function a(t){return[t||0,t||0,t||0]}function o(){return[0,0,0,1]}var s=t("gl-vec3/lerp"),l=t("mat4-recompose"),u=t("mat4-decompose"),c=t("gl-mat4/determinant"),h=t("quat-slerp"),f=i(),d=i(),p=i();e.exports=n},{"gl-mat4/determinant":172,"gl-vec3/lerp":270,"mat4-decompose":439,"mat4-recompose":442,"quat-slerp":481}],442:[function(t,e,r){var n={identity:t("gl-mat4/identity"),translate:t("gl-mat4/translate"),multiply:t("gl-mat4/multiply"),create:t("gl-mat4/create"),scale:t("gl-mat4/scale"),fromRotationTranslation:t("gl-mat4/fromRotationTranslation")},i=(n.create(),n.create());e.exports=function(t,e,r,a,o,s){return n.identity(t),n.fromRotationTranslation(t,s,e),t[3]=o[0],t[7]=o[1],t[11]=o[2],t[15]=o[3],n.identity(i),0!==a[2]&&(i[9]=a[2],n.multiply(t,t,i)),0!==a[1]&&(i[9]=0,i[8]=a[1],n.multiply(t,t,i)),0!==a[0]&&(i[8]=0,i[4]=a[0],n.multiply(t,t,i)),n.scale(t,t,r),t}},{"gl-mat4/create":171,"gl-mat4/fromRotationTranslation":174,"gl-mat4/identity":175,"gl-mat4/multiply":178,"gl-mat4/scale":184,"gl-mat4/translate":185}],443:[function(t,e,r){"use strict";function n(t){this._components=t.slice(),this._time=[0],this.prevMatrix=t.slice(),this.nextMatrix=t.slice(),this.computedMatrix=t.slice(),this.computedInverse=t.slice(),this.computedEye=[0,0,0],this.computedUp=[0,0,0],this.computedCenter=[0,0,0],this.computedRadius=[0],this._limits=[-1/0,1/0]}function i(t){return t=t||{},new n(t.matrix||[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}var a=t("binary-search-bounds"),o=t("mat4-interpolate"),s=t("gl-mat4/invert"),l=t("gl-mat4/rotateX"),u=t("gl-mat4/rotateY"),c=t("gl-mat4/rotateZ"),h=t("gl-mat4/lookAt"),f=t("gl-mat4/translate"),d=(t("gl-mat4/scale"),t("gl-vec3/normalize")),p=[0,0,0];e.exports=i;var m=n.prototype;m.recalcMatrix=function(t){var e=this._time,r=a.le(e,t),n=this.computedMatrix;if(!(r<0)){var i=this._components;if(r===e.length-1)for(var l=16*r,u=0;u<16;++u)n[u]=i[l++];else{for(var c=e[r+1]-e[r],l=16*r,h=this.prevMatrix,f=!0,u=0;u<16;++u)h[u]=i[l++];for(var p=this.nextMatrix,u=0;u<16;++u)p[u]=i[l++],f=f&&h[u]===p[u];if(c<1e-6||f)for(var u=0;u<16;++u)n[u]=h[u];else o(n,h,p,(t-e[r])/c)}var m=this.computedUp;m[0]=n[1],m[1]=n[5],m[2]=n[9],d(m,m);var v=this.computedInverse;s(v,n);var g=this.computedEye,y=v[15];g[0]=v[12]/y,g[1]=v[13]/y,g[2]=v[14]/y;for(var b=this.computedCenter,x=Math.exp(this.computedRadius[0]),u=0;u<3;++u)b[u]=g[u]-n[2+4*u]*x}},m.idle=function(t){if(!(t<this.lastT())){for(var e=this._components,r=e.length-16,n=0;n<16;++n)e.push(e[r++]);this._time.push(t)}},m.flush=function(t){var e=a.gt(this._time,t)-2;e<0||(this._time.splice(0,e),this._components.splice(0,16*e))},m.lastT=function(){return this._time[this._time.length-1]},m.lookAt=function(t,e,r,n){this.recalcMatrix(t),e=e||this.computedEye,r=r||p,n=n||this.computedUp,this.setMatrix(t,h(this.computedMatrix,e,r,n));for(var i=0,a=0;a<3;++a)i+=Math.pow(r[a]-e[a],2);i=Math.log(Math.sqrt(i)),this.computedRadius[0]=i},m.rotate=function(t,e,r,n){this.recalcMatrix(t);var i=this.computedInverse;e&&u(i,i,e),r&&l(i,i,r),n&&c(i,i,n),this.setMatrix(t,s(this.computedMatrix,i))};var v=[0,0,0];m.pan=function(t,e,r,n){v[0]=-(e||0),v[1]=-(r||0),v[2]=-(n||0),this.recalcMatrix(t);var i=this.computedInverse;f(i,i,v),this.setMatrix(t,s(i,i))},m.translate=function(t,e,r,n){v[0]=e||0,v[1]=r||0,v[2]=n||0,this.recalcMatrix(t);var i=this.computedMatrix;f(i,i,v),this.setMatrix(t,i)},m.setMatrix=function(t,e){if(!(t<this.lastT())){this._time.push(t);for(var r=0;r<16;++r)this._components.push(e[r])}},m.setDistance=function(t,e){this.computedRadius[0]=e},m.setDistanceLimits=function(t,e){var r=this._limits;r[0]=t,r[1]=e},m.getDistanceLimits=function(t){var e=this._limits;return t?(t[0]=e[0],t[1]=e[1],t):e}},{"binary-search-bounds":62,"gl-mat4/invert":176,"gl-mat4/lookAt":177,"gl-mat4/rotateX":181,"gl-mat4/rotateY":182,"gl-mat4/rotateZ":183,"gl-mat4/scale":184,"gl-mat4/translate":185,"gl-vec3/normalize":271,"mat4-interpolate":441}],444:[function(t,e,r){"use strict";function n(t){var e=t.length;if(e<3){for(var r=new Array(e),n=0;n<e;++n)r[n]=n;return 2===e&&t[0][0]===t[1][0]&&t[0][1]===t[1][1]?[0]:r}for(var a=new Array(e),n=0;n<e;++n)a[n]=n;a.sort(function(e,r){var n=t[e][0]-t[r][0];return n||t[e][1]-t[r][1]});for(var o=[a[0],a[1]],s=[a[0],a[1]],n=2;n<e;++n){for(var l=a[n],u=t[l],c=o.length;c>1&&i(t[o[c-2]],t[o[c-1]],u)<=0;)c-=1,o.pop();for(o.push(l),c=s.length;c>1&&i(t[s[c-2]],t[s[c-1]],u)>=0;)c-=1,s.pop();s.push(l)}for(var r=new Array(s.length+o.length-2),h=0,n=0,f=o.length;n<f;++n)r[h++]=o[n];for(var d=s.length-2;d>0;--d)r[h++]=s[d];return r}e.exports=n;var i=t("robust-orientation")[3]},{"robust-orientation":500}],445:[function(t,e,r){"use strict";function n(t,e){function r(t){var e=!1;return"altKey"in t&&(e=e||t.altKey!==v.alt,v.alt=!!t.altKey),"shiftKey"in t&&(e=e||t.shiftKey!==v.shift,v.shift=!!t.shiftKey),"ctrlKey"in t&&(e=e||t.ctrlKey!==v.control,v.control=!!t.ctrlKey),"metaKey"in t&&(e=e||t.metaKey!==v.meta,v.meta=!!t.metaKey),e}function n(t,n){var a=i.x(n),o=i.y(n);"buttons"in n&&(t=0|n.buttons),(t!==d||a!==p||o!==m||r(n))&&(d=0|t,p=a||0,m=o||0,e&&e(d,p,m,v))}function a(t){n(0,t)}function o(){(d||p||m||v.shift||v.alt||v.meta||v.control)&&(p=m=0,d=0,v.shift=v.alt=v.control=v.meta=!1,e&&e(0,0,0,v))}function s(t){r(t)&&e&&e(d,p,m,v)}function l(t){0===i.buttons(t)?n(0,t):n(d,t)}function u(t){n(d|i.buttons(t),t)}function c(t){n(d&~i.buttons(t),t)}function h(){g||(g=!0,t.addEventListener("mousemove",l),t.addEventListener("mousedown",u),t.addEventListener("mouseup",c),t.addEventListener("mouseleave",a),t.addEventListener("mouseenter",a),t.addEventListener("mouseout",a),t.addEventListener("mouseover",a),t.addEventListener("blur",o),t.addEventListener("keyup",s),t.addEventListener("keydown",s),t.addEventListener("keypress",s),t!==window&&(window.addEventListener("blur",o),window.addEventListener("keyup",s),window.addEventListener("keydown",s),window.addEventListener("keypress",s)))}function f(){g&&(g=!1,t.removeEventListener("mousemove",l),t.removeEventListener("mousedown",u),t.removeEventListener("mouseup",c),t.removeEventListener("mouseleave",a),t.removeEventListener("mouseenter",a),t.removeEventListener("mouseout",a),t.removeEventListener("mouseover",a),t.removeEventListener("blur",o),t.removeEventListener("keyup",s),t.removeEventListener("keydown",s),t.removeEventListener("keypress",s),t!==window&&(window.removeEventListener("blur",o),window.removeEventListener("keyup",s),window.removeEventListener("keydown",s),window.removeEventListener("keypress",s)))}e||(e=t,t=window);var d=0,p=0,m=0,v={shift:!1,alt:!1,control:!1,meta:!1},g=!1;h();var y={element:t};return Object.defineProperties(y,{enabled:{get:function(){return g},set:function(t){t?h():f()},enumerable:!0},buttons:{get:function(){return d},enumerable:!0},x:{get:function(){return p},enumerable:!0},y:{get:function(){return m},enumerable:!0},mods:{get:function(){return v},enumerable:!0}}),y}e.exports=n;var i=t("mouse-event")},{"mouse-event":447}],446:[function(t,e,r){function n(t,e,r){e=e||t.currentTarget||t.srcElement,Array.isArray(r)||(r=[0,0]);var n=t.clientX||0,a=t.clientY||0,o=i(e);return r[0]=n-o.left,r[1]=a-o.top,r}function i(t){return t===window||t===document||t===document.body?a:t.getBoundingClientRect()}var a={left:0,top:0};e.exports=n},{}],447:[function(t,e,r){"use strict";function n(t){if("object"==typeof t){if("buttons"in t)return t.buttons;if("which"in t){var e=t.which;if(2===e)return 4;if(3===e)return 2;if(e>0)return 1<<e-1}else if("button"in t){var e=t.button;if(1===e)return 4;if(2===e)return 2;if(e>=0)return 1<<e}}return 0}function i(t){return t.target||t.srcElement||window}function a(t){if("object"==typeof t){if("offsetX"in t)return t.offsetX;var e=i(t),r=e.getBoundingClientRect();return t.clientX-r.left}return 0}function o(t){if("object"==typeof t){if("offsetY"in t)return t.offsetY;var e=i(t),r=e.getBoundingClientRect();return t.clientY-r.top}return 0}r.buttons=n,r.element=i,r.x=a,r.y=o},{}],448:[function(t,e,r){"use strict";function n(t,e,r){"function"==typeof t&&(r=!!e,e=t,t=window);var n=i("ex",t),a=function(t){r&&t.preventDefault();var i=t.deltaX||0,a=t.deltaY||0,o=t.deltaZ||0,s=t.deltaMode,l=1;switch(s){case 1:l=n;break;case 2:l=window.innerHeight}if(i*=l,a*=l,o*=l,i||a||o)return e(i,a,o,t)};return t.addEventListener("wheel",a),a}var i=t("to-px");e.exports=n},{"to-px":527}],449:[function(t,e,r){"use strict";function n(t){return"a"+t}function i(t){return"d"+t}function a(t,e){return"c"+t+"_"+e}function o(t){return"s"+t}function s(t,e){return"t"+t+"_"+e}function l(t){return"o"+t}function u(t){return"x"+t}function c(t){return"p"+t}function h(t,e){return"d"+t+"_"+e}function f(t){return"i"+t}function d(t,e){return"u"+t+"_"+e}function p(t){return"b"+t}function m(t){return"y"+t}function v(t){return"e"+t}function g(t){return"v"+t}function y(t,e,r){for(var n=0,i=0;i<t;++i)e&1<<i&&(n|=1<<r[i]);return n}function b(t,e,r,b,x,E){function L(t,e){R.push("for(",f(x[t]),"=",e,";",f(x[t]),"<",o(x[t]),";","++",f(x[t]),"){")}function C(t){for(var e=0;e<O;++e)R.push(c(e),"+=",d(e,x[t]),";");R.push("}")}function z(t){for(var e=t-1;e>=0;--e)L(e,0);for(var r=[],e=0;e<O;++e)E[e]?r.push(i(e)+".get("+c(e)+")"):r.push(i(e)+"["+c(e)+"]");for(var e=0;e<b;++e)r.push(u(e));R.push(M,"[",T,"++]=phase(",r.join(),");");for(var e=0;e<t;++e)C(e);for(var n=0;n<O;++n)R.push(c(n),"+=",d(n,x[t]),";")}function D(t){for(var e=0;e<O;++e)E[e]?R.push(a(e,0),"=",i(e),".get(",c(e),");"):R.push(a(e,0),"=",i(e),"[",c(e),"];");for(var r=[],e=0;e<O;++e)r.push(a(e,0));for(var e=0;e<b;++e)r.push(u(e));R.push(p(0),"=",M,"[",T,"]=phase(",r.join(),");");for(var n=1;n<1<<j;++n)R.push(p(n),"=",M,"[",T,"+",v(n),"];");for(var o=[],n=1;n<1<<j;++n)o.push("("+p(0)+"!=="+p(n)+")");R.push("if(",o.join("||"),"){");for(var s=[],e=0;e<j;++e)s.push(f(e));for(var e=0;e<O;++e){s.push(a(e,0));for(var n=1;n<1<<j;++n)E[e]?R.push(a(e,n),"=",i(e),".get(",c(e),"+",h(e,n),");"):R.push(a(e,n),"=",i(e),"[",c(e),"+",h(e,n),"];"),s.push(a(e,n))}for(var e=0;e<1<<j;++e)s.push(p(e));for(var e=0;e<b;++e)s.push(u(e));R.push("vertex(",s.join(),");",g(0),"=",w,"[",T,"]=",k,"++;");for(var l=(1<<j)-1,d=p(l),n=0;n<j;++n)if(0==(t&~(1<<n))){for(var m=l^1<<n,y=p(m),x=[],_=m;_>0;_=_-1&m)x.push(w+"["+T+"+"+v(_)+"]");x.push(g(0));for(var _=0;_<O;++_)1&n?x.push(a(_,l),a(_,m)):x.push(a(_,m),a(_,l));1&n?x.push(d,y):x.push(y,d);for(var _=0;_<b;++_)x.push(u(_));R.push("if(",d,"!==",y,"){","face(",x.join(),")}")}R.push("}",T,"+=1;")}function I(){for(var t=1;t<1<<j;++t)R.push(S,"=",v(t),";",v(t),"=",m(t),";",m(t),"=",S,";")}function P(t,e){if(t<0)return void D(e);z(t),R.push("if(",o(x[t]),">0){",f(x[t]),"=1;"),P(t-1,e|1<<x[t]);for(var r=0;r<O;++r)R.push(c(r),"+=",d(r,x[t]),";");t===j-1&&(R.push(T,"=0;"),I()),L(t,2),P(t-1,e),t===j-1&&(R.push("if(",f(x[j-1]),"&1){",T,"=0;}"),I()),C(t),R.push("}")}var O=E.length,j=x.length;if(j<2)throw new Error("ndarray-extract-contour: Dimension must be at least 2");for(var F="extractContour"+x.join("_"),R=[],N=[],B=[],U=0;U<O;++U)B.push(n(U));for(var U=0;U<b;++U)B.push(u(U));for(var U=0;U<j;++U)N.push(o(U)+"="+n(0)+".shape["+U+"]|0");for(var U=0;U<O;++U){N.push(i(U)+"="+n(U)+".data",l(U)+"="+n(U)+".offset|0");for(var V=0;V<j;++V)N.push(s(U,V)+"="+n(U)+".stride["+V+"]|0")}for(var U=0;U<O;++U){N.push(c(U)+"="+l(U)),N.push(a(U,0));for(var V=1;V<1<<j;++V){for(var q=[],H=0;H<j;++H)V&1<<H&&q.push("-"+s(U,H));N.push(h(U,V)+"=("+q.join("")+")|0"),N.push(a(U,V)+"=0")}}for(var U=0;U<O;++U)for(var V=0;V<j;++V){var G=[s(U,x[V])];V>0&&G.push(s(U,x[V-1])+"*"+o(x[V-1])),N.push(d(U,x[V])+"=("+G.join("-")+")|0")}for(var U=0;U<j;++U)N.push(f(U)+"=0");N.push(k+"=0");for(var Y=["2"],U=j-2;U>=0;--U)Y.push(o(x[U]));N.push(A+"=("+Y.join("*")+")|0",M+"=mallocUint32("+A+")",w+"=mallocUint32("+A+")",T+"=0"),N.push(p(0)+"=0");for(var V=1;V<1<<j;++V){for(var X=[],W=[],H=0;H<j;++H)V&1<<H&&(0===W.length?X.push("1"):X.unshift(W.join("*"))),W.push(o(x[H]));var Z="";X[0].indexOf(o(x[j-2]))<0&&(Z="-");var J=y(j,V,x);N.push(v(J)+"=(-"+X.join("-")+")|0",m(J)+"=("+Z+X.join("-")+")|0",p(J)+"=0")}N.push(g(0)+"=0",S+"=0"),P(j-1,0),R.push("freeUint32(",w,");freeUint32(",M,");");var K=["'use strict';","function ",F,"(",B.join(),"){","var ",N.join(),";",R.join(""),"}","return ",F].join("");return new Function("vertex","face","phase","mallocUint32","freeUint32",K)(t,e,r,_.mallocUint32,_.freeUint32)}function x(t){function e(t){throw new Error("ndarray-extract-contour: "+t)}"object"!=typeof t&&e("Must specify arguments");var r=t.order;Array.isArray(r)||e("Must specify order");var n=t.arrayArguments||1;n<1&&e("Must have at least one array argument");var i=t.scalarArguments||0;i<0&&e("Scalar arg count must be > 0"),"function"!=typeof t.vertex&&e("Must specify vertex creation function"),"function"!=typeof t.cell&&e("Must specify cell creation function"),"function"!=typeof t.phase&&e("Must specify phase function");for(var a=t.getters||[],o=new Array(n),s=0;s<n;++s)a.indexOf(s)>=0?o[s]=!0:o[s]=!1;return b(t.vertex,t.cell,t.phase,i,r,o)}var _=t("typedarray-pool");e.exports=x;var w="V",M="P",k="N",A="Q",T="X",S="T"},{"typedarray-pool":533}],450:[function(t,e,r){"use strict";var n=t("cwise/lib/wrapper")({args:["index","array","scalar"],pre:{body:"{}",args:[],thisVars:[],localVars:[]},body:{body:"{_inline_1_arg1_=_inline_1_arg2_.apply(void 0,_inline_1_arg0_)}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_1_arg2_",lvalue:!1,rvalue:!0,count:1}],thisVars:[],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"cwise",blockSize:64});e.exports=function(t,e){return n(t,e),t}},{"cwise/lib/wrapper":109}],451:[function(t,e,r){"use strict";function n(t){if(t in l)return l[t];for(var e=[],r=0;r<t;++r)e.push("out",r,"s=0.5*(inp",r,"l-inp",r,"r);");for(var n=["array"],i=["junk"],r=0;r<t;++r){n.push("array"),i.push("out"+r+"s");var a=o(t);a[r]=-1,n.push({array:0,offset:a.slice()}),a[r]=1,n.push({array:0,offset:a.slice()}),i.push("inp"+r+"l","inp"+r+"r")}return l[t]=s({args:n,pre:c,post:c,body:{body:e.join(""),args:i.map(function(t){return{name:t,lvalue:0===t.indexOf("out"),rvalue:0===t.indexOf("inp"),count:"junk"!==t|0}}),thisVars:[],localVars:[]},funcName:"fdTemplate"+t})}function i(t){var e=t.join(),r=u[e];if(r)return r;for(var i=t.length,a=["function gradient(dst,src){var s=src.shape.slice();"],o=0;o<1<<i;++o){for(var s=[],c=0;c<i;++c)o&1<<c&&s.push(c+1);for(var d=0;d<1<<s.length;++d){for(var p=s.slice(),c=0;c<s.length;++c)d&1<<c&&(p[c]=-p[c]);!function(e){for(var r=i-e.length,n=[],o=[],s=[],l=0;l<i;++l)e.indexOf(l+1)>=0?s.push("0"):e.indexOf(-(l+1))>=0?s.push("s["+l+"]-1"):(s.push("-1"),n.push("1"),o.push("s["+l+"]-2"));var u=".lo("+n.join()+").hi("+o.join()+")";if(0===n.length&&(u=""),r>0){a.push("if(1");for(var l=0;l<i;++l)e.indexOf(l+1)>=0||e.indexOf(-(l+1))>=0||a.push("&&s[",l,"]>2");a.push("){grad",r,"(src.pick(",s.join(),")",u);for(var l=0;l<i;++l)e.indexOf(l+1)>=0||e.indexOf(-(l+1))>=0||a.push(",dst.pick(",s.join(),",",l,")",u);a.push(");")}for(var l=0;l<e.length;++l){var c=Math.abs(e[l])-1,h="dst.pick("+s.join()+","+c+")"+u;switch(t[c]){case"clamp":var f=s.slice(),d=s.slice();e[l]<0?f[c]="s["+c+"]-2":d[c]="1",0===r?a.push("if(s[",c,"]>1){dst.set(",s.join(),",",c,",0.5*(src.get(",f.join(),")-src.get(",d.join(),")))}else{dst.set(",s.join(),",",c,",0)};"):a.push("if(s[",c,"]>1){diff(",h,",src.pick(",f.join(),")",u,",src.pick(",d.join(),")",u,");}else{zero(",h,");};");break;case"mirror":0===r?a.push("dst.set(",s.join(),",",c,",0);"):a.push("zero(",h,");");break;case"wrap":var p=s.slice(),m=s.slice();e[l]<0?(p[c]="s["+c+"]-2",m[c]="0"):(p[c]="s["+c+"]-1",m[c]="1"),0===r?a.push("if(s[",c,"]>2){dst.set(",s.join(),",",c,",0.5*(src.get(",p.join(),")-src.get(",m.join(),")))}else{dst.set(",s.join(),",",c,",0)};"):a.push("if(s[",c,"]>2){diff(",h,",src.pick(",p.join(),")",u,",src.pick(",m.join(),")",u,");}else{zero(",h,");};");break;default:throw new Error("ndarray-gradient: Invalid boundary condition")}}r>0&&a.push("};")}(p)}}a.push("return dst;};return gradient");for(var m=["diff","zero"],v=[h,f],o=1;o<=i;++o)m.push("grad"+o),v.push(n(o));m.push(a.join(""));var g=Function.apply(void 0,m),r=g.apply(void 0,v);return l[e]=r,r}function a(t,e,r){if(Array.isArray(r)){if(r.length!==e.dimension)throw new Error("ndarray-gradient: invalid boundary conditions")}else r="string"==typeof r?o(e.dimension,r):o(e.dimension,"clamp");if(t.dimension!==e.dimension+1)throw new Error("ndarray-gradient: output dimension must be +1 input dimension");if(t.shape[e.dimension]!==e.dimension)throw new Error("ndarray-gradient: output shape must match input shape");for(var n=0;n<e.dimension;++n)if(t.shape[n]!==e.shape[n])throw new Error("ndarray-gradient: shape mismatch");return 0===e.size?t:e.dimension<=0?(t.set(0),t):i(r)(t,e)}e.exports=a;var o=t("dup"),s=t("cwise-compiler"),l={},u={},c={body:"",args:[],thisVars:[],localVars:[]},h=s({args:["array","array","array"],pre:c,post:c,body:{args:[{name:"out",lvalue:!0,rvalue:!1,count:1},{name:"left",lvalue:!1,rvalue:!0,count:1},{name:"right",lvalue:!1,rvalue:!0,count:1}],body:"out=0.5*(left-right)",thisVars:[],localVars:[]},funcName:"cdiff"}),f=s({args:["array"],pre:c,post:c,body:{args:[{name:"out",lvalue:!0,rvalue:!1,count:1}],body:"out=0",thisVars:[],localVars:[]},funcName:"zero"})},{"cwise-compiler":106,dup:121}],452:[function(t,e,r){"use strict";function n(t,e,r){var n=e.dimension,o=a([],r);return i(t,e,function(t,e){for(var r=0;r<n;++r){t[r]=o[(n+1)*n+r];for(var i=0;i<n;++i)t[r]+=o[(n+1)*i+r]*e[i]}for(var a=o[(n+1)*(n+1)-1],i=0;i<n;++i)a+=o[(n+1)*i+n]*e[i]
40 ;for(var s=1/a,r=0;r<n;++r)t[r]*=s;return t}),t}var i=t("ndarray-warp"),a=t("gl-matrix-invert");e.exports=n},{"gl-matrix-invert":187,"ndarray-warp":459}],453:[function(t,e,r){"use strict";function n(t,e){var r=Math.floor(e),n=e-r,i=0<=r&&r<t.shape[0],a=0<=r+1&&r+1<t.shape[0];return(1-n)*(i?+t.get(r):0)+n*(a?+t.get(r+1):0)}function i(t,e,r){var n=Math.floor(e),i=e-n,a=0<=n&&n<t.shape[0],o=0<=n+1&&n+1<t.shape[0],s=Math.floor(r),l=r-s,u=0<=s&&s<t.shape[1],c=0<=s+1&&s+1<t.shape[1],h=a&&u?t.get(n,s):0,f=a&&c?t.get(n,s+1):0;return(1-l)*((1-i)*h+i*(o&&u?t.get(n+1,s):0))+l*((1-i)*f+i*(o&&c?t.get(n+1,s+1):0))}function a(t,e,r,n){var i=Math.floor(e),a=e-i,o=0<=i&&i<t.shape[0],s=0<=i+1&&i+1<t.shape[0],l=Math.floor(r),u=r-l,c=0<=l&&l<t.shape[1],h=0<=l+1&&l+1<t.shape[1],f=Math.floor(n),d=n-f,p=0<=f&&f<t.shape[2],m=0<=f+1&&f+1<t.shape[2],v=o&&c&&p?t.get(i,l,f):0,g=o&&h&&p?t.get(i,l+1,f):0,y=s&&c&&p?t.get(i+1,l,f):0,b=s&&h&&p?t.get(i+1,l+1,f):0,x=o&&c&&m?t.get(i,l,f+1):0,_=o&&h&&m?t.get(i,l+1,f+1):0;return(1-d)*((1-u)*((1-a)*v+a*y)+u*((1-a)*g+a*b))+d*((1-u)*((1-a)*x+a*(s&&c&&m?t.get(i+1,l,f+1):0))+u*((1-a)*_+a*(s&&h&&m?t.get(i+1,l+1,f+1):0)))}function o(t){var e,r,n=0|t.shape.length,i=new Array(n),a=new Array(n),o=new Array(n),s=new Array(n);for(e=0;e<n;++e)r=+arguments[e+1],i[e]=Math.floor(r),a[e]=r-i[e],o[e]=0<=i[e]&&i[e]<t.shape[e],s[e]=0<=i[e]+1&&i[e]+1<t.shape[e];var l,u,c,h=0;t:for(e=0;e<1<<n;++e){for(u=1,c=t.offset,l=0;l<n;++l)if(e&1<<l){if(!s[l])continue t;u*=a[l],c+=t.stride[l]*(i[l]+1)}else{if(!o[l])continue t;u*=1-a[l],c+=t.stride[l]*i[l]}h+=u*t.data[c]}return h}function s(t,e,r,s){switch(t.shape.length){case 0:return 0;case 1:return n(t,e);case 2:return i(t,e,r);case 3:return a(t,e,r,s);default:return o.apply(void 0,arguments)}}e.exports=s,e.exports.d1=n,e.exports.d2=i,e.exports.d3=a},{}],454:[function(t,e,r){"use strict";function n(t){if(!t)return s;for(var e=0;e<t.args.length;++e){var r=t.args[e];t.args[e]=0===e?{name:r,lvalue:!0,rvalue:!!t.rvalue,count:t.count||1}:{name:r,lvalue:!1,rvalue:!0,count:1}}return t.thisVars||(t.thisVars=[]),t.localVars||(t.localVars=[]),t}function i(t){return o({args:t.args,pre:n(t.pre),body:n(t.body),post:n(t.proc),funcName:t.funcName})}function a(t){for(var e=[],r=0;r<t.args.length;++r)e.push("a"+r);return new Function("P",["return function ",t.funcName,"_ndarrayops(",e.join(","),") {P(",e.join(","),");return a0}"].join(""))(i(t))}var o=t("cwise-compiler"),s={body:"",args:[],thisVars:[],localVars:[]},l={add:"+",sub:"-",mul:"*",div:"/",mod:"%",band:"&",bor:"|",bxor:"^",lshift:"<<",rshift:">>",rrshift:">>>"};!function(){for(var t in l){var e=l[t];r[t]=a({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+e+"c"},funcName:t}),r[t+"eq"]=a({args:["array","array"],body:{args:["a","b"],body:"a"+e+"=b"},rvalue:!0,funcName:t+"eq"}),r[t+"s"]=a({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+e+"s"},funcName:t+"s"}),r[t+"seq"]=a({args:["array","scalar"],body:{args:["a","s"],body:"a"+e+"=s"},rvalue:!0,funcName:t+"seq"})}}();var u={not:"!",bnot:"~",neg:"-",recip:"1.0/"};!function(){for(var t in u){var e=u[t];r[t]=a({args:["array","array"],body:{args:["a","b"],body:"a="+e+"b"},funcName:t}),r[t+"eq"]=a({args:["array"],body:{args:["a"],body:"a="+e+"a"},rvalue:!0,count:2,funcName:t+"eq"})}}();var c={and:"&&",or:"||",eq:"===",neq:"!==",lt:"<",gt:">",leq:"<=",geq:">="};!function(){for(var t in c){var e=c[t];r[t]=a({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+e+"c"},funcName:t}),r[t+"s"]=a({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+e+"s"},funcName:t+"s"}),r[t+"eq"]=a({args:["array","array"],body:{args:["a","b"],body:"a=a"+e+"b"},rvalue:!0,count:2,funcName:t+"eq"}),r[t+"seq"]=a({args:["array","scalar"],body:{args:["a","s"],body:"a=a"+e+"s"},rvalue:!0,count:2,funcName:t+"seq"})}}();var h=["abs","acos","asin","atan","ceil","cos","exp","floor","log","round","sin","sqrt","tan"];!function(){for(var t=0;t<h.length;++t){var e=h[t];r[e]=a({args:["array","array"],pre:{args:[],body:"this_f=Math."+e,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(b)",thisVars:["this_f"]},funcName:e}),r[e+"eq"]=a({args:["array"],pre:{args:[],body:"this_f=Math."+e,thisVars:["this_f"]},body:{args:["a"],body:"a=this_f(a)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:e+"eq"})}}();var f=["max","min","atan2","pow"];!function(){for(var t=0;t<f.length;++t){var e=f[t];r[e]=a({args:["array","array","array"],pre:{args:[],body:"this_f=Math."+e,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(b,c)",thisVars:["this_f"]},funcName:e}),r[e+"s"]=a({args:["array","array","scalar"],pre:{args:[],body:"this_f=Math."+e,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(b,c)",thisVars:["this_f"]},funcName:e+"s"}),r[e+"eq"]=a({args:["array","array"],pre:{args:[],body:"this_f=Math."+e,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(a,b)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:e+"eq"}),r[e+"seq"]=a({args:["array","scalar"],pre:{args:[],body:"this_f=Math."+e,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(a,b)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:e+"seq"})}}();var d=["atan2","pow"];!function(){for(var t=0;t<d.length;++t){var e=d[t];r[e+"op"]=a({args:["array","array","array"],pre:{args:[],body:"this_f=Math."+e,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(c,b)",thisVars:["this_f"]},funcName:e+"op"}),r[e+"ops"]=a({args:["array","array","scalar"],pre:{args:[],body:"this_f=Math."+e,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(c,b)",thisVars:["this_f"]},funcName:e+"ops"}),r[e+"opeq"]=a({args:["array","array"],pre:{args:[],body:"this_f=Math."+e,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(b,a)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:e+"opeq"}),r[e+"opseq"]=a({args:["array","scalar"],pre:{args:[],body:"this_f=Math."+e,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(b,a)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:e+"opseq"})}}(),r.any=o({args:["array"],pre:s,body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:1}],body:"if(a){return true}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return false"},funcName:"any"}),r.all=o({args:["array"],pre:s,body:{args:[{name:"x",lvalue:!1,rvalue:!0,count:1}],body:"if(!x){return false}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return true"},funcName:"all"}),r.sum=o({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:1}],body:"this_s+=a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"sum"}),r.prod=o({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=1"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:1}],body:"this_s*=a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"prod"}),r.norm2squared=o({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:2}],body:"this_s+=a*a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norm2squared"}),r.norm2=o({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:2}],body:"this_s+=a*a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return Math.sqrt(this_s)"},funcName:"norm2"}),r.norminf=o({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:4}],body:"if(-a>this_s){this_s=-a}else if(a>this_s){this_s=a}",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norminf"}),r.norm1=o({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:3}],body:"this_s+=a<0?-a:a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norm1"}),r.sup=o({args:["array"],pre:{body:"this_h=-Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_>this_h)this_h=_inline_1_arg0_",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_h"],localVars:[]},post:{body:"return this_h",args:[],thisVars:["this_h"],localVars:[]}}),r.inf=o({args:["array"],pre:{body:"this_h=Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_<this_h)this_h=_inline_1_arg0_",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_h"],localVars:[]},post:{body:"return this_h",args:[],thisVars:["this_h"],localVars:[]}}),r.argmin=o({args:["index","array","shape"],pre:{body:"{this_v=Infinity;this_i=_inline_0_arg2_.slice(0)}",args:[{name:"_inline_0_arg0_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg1_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg2_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_i","this_v"],localVars:[]},body:{body:"{if(_inline_1_arg1_<this_v){this_v=_inline_1_arg1_;for(var _inline_1_k=0;_inline_1_k<_inline_1_arg0_.length;++_inline_1_k){this_i[_inline_1_k]=_inline_1_arg0_[_inline_1_k]}}}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_i","this_v"],localVars:["_inline_1_k"]},post:{body:"{return this_i}",args:[],thisVars:["this_i"],localVars:[]}}),r.argmax=o({args:["index","array","shape"],pre:{body:"{this_v=-Infinity;this_i=_inline_0_arg2_.slice(0)}",args:[{name:"_inline_0_arg0_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg1_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg2_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_i","this_v"],localVars:[]},body:{body:"{if(_inline_1_arg1_>this_v){this_v=_inline_1_arg1_;for(var _inline_1_k=0;_inline_1_k<_inline_1_arg0_.length;++_inline_1_k){this_i[_inline_1_k]=_inline_1_arg0_[_inline_1_k]}}}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_i","this_v"],localVars:["_inline_1_k"]},post:{body:"{return this_i}",args:[],thisVars:["this_i"],localVars:[]}}),r.random=a({args:["array"],pre:{args:[],body:"this_f=Math.random",thisVars:["this_f"]},body:{args:["a"],body:"a=this_f()",thisVars:["this_f"]},funcName:"random"}),r.assign=a({args:["array","array"],body:{args:["a","b"],body:"a=b"},funcName:"assign"}),r.assigns=a({args:["array","scalar"],body:{args:["a","b"],body:"a=b"},funcName:"assigns"}),r.equals=o({args:["array","array"],pre:s,body:{args:[{name:"x",lvalue:!1,rvalue:!0,count:1},{name:"y",lvalue:!1,rvalue:!0,count:1}],body:"if(x!==y){return false}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return true"},funcName:"equals"})},{"cwise-compiler":106}],455:[function(t,e,r){"use strict";var n=t("ndarray"),i=t("./doConvert.js");e.exports=function(t,e){for(var r=[],a=t,o=1;Array.isArray(a);)r.push(a.length),o*=a.length,a=a[0];return 0===r.length?n():(e||(e=n(new Float64Array(o),r)),i(e,t),e)}},{"./doConvert.js":456,ndarray:460}],456:[function(t,e,r){e.exports=t("cwise-compiler")({args:["array","scalar","index"],pre:{body:"{}",args:[],thisVars:[],localVars:[]},body:{body:"{\nvar _inline_1_v=_inline_1_arg1_,_inline_1_i\nfor(_inline_1_i=0;_inline_1_i<_inline_1_arg2_.length-1;++_inline_1_i) {\n_inline_1_v=_inline_1_v[_inline_1_arg2_[_inline_1_i]]\n}\n_inline_1_arg0_=_inline_1_v[_inline_1_arg2_[_inline_1_arg2_.length-1]]\n}",args:[{name:"_inline_1_arg0_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg2_",lvalue:!1,rvalue:!0,count:4}],thisVars:[],localVars:["_inline_1_i","_inline_1_v"]},post:{body:"{}",args:[],thisVars:[],localVars:[]},funcName:"convert",blockSize:64})},{"cwise-compiler":106}],457:[function(t,e,r){"use strict";function n(t){switch(t){case"uint8":return[l.mallocUint8,l.freeUint8];case"uint16":return[l.mallocUint16,l.freeUint16];case"uint32":return[l.mallocUint32,l.freeUint32];case"int8":return[l.mallocInt8,l.freeInt8];case"int16":return[l.mallocInt16,l.freeInt16];case"int32":return[l.mallocInt32,l.freeInt32];case"float32":return[l.mallocFloat,l.freeFloat];case"float64":return[l.mallocDouble,l.freeDouble];default:return null}}function i(t){for(var e=[],r=0;r<t;++r)e.push("s"+r);for(var r=0;r<t;++r)e.push("n"+r);for(var r=1;r<t;++r)e.push("d"+r);for(var r=1;r<t;++r)e.push("e"+r);for(var r=1;r<t;++r)e.push("f"+r);return e}function a(t,e){function r(t){return"generic"===e?["data.get(",t,")"].join(""):["data[",t,"]"].join("")}function a(t,r){return"generic"===e?["data.set(",t,",",r,")"].join(""):["data[",t,"]=",r].join("")}var o=["'use strict'"],s=["ndarrayInsertionSort",t.join("d"),e].join(""),l=["left","right","data","offset"].concat(i(t.length)),u=n(e),c=["i,j,cptr,ptr=left*s0+offset"];if(t.length>1){for(var h=[],f=1;f<t.length;++f)c.push("i"+f),h.push("n"+f);u?c.push("scratch=malloc("+h.join("*")+")"):c.push("scratch=new Array("+h.join("*")+")"),c.push("dptr","sptr","a","b")}else c.push("scratch");if(o.push(["function ",s,"(",l.join(","),"){var ",c.join(",")].join(""),"for(i=left+1;i<=right;++i){","j=i;ptr+=s0","cptr=ptr"),t.length>1){o.push("dptr=0;sptr=ptr");for(var f=t.length-1;f>=0;--f){var d=t[f];0!==d&&o.push(["for(i",d,"=0;i",d,"<n",d,";++i",d,"){"].join(""))}o.push("scratch[dptr++]=",r("sptr"));for(var f=0;f<t.length;++f){var d=t[f];0!==d&&o.push("sptr+=d"+d,"}")}o.push("__g:while(j-->left){","dptr=0","sptr=cptr-s0");for(var f=1;f<t.length;++f)1===f&&o.push("__l:"),o.push(["for(i",f,"=0;i",f,"<n",f,";++i",f,"){"].join(""));o.push(["a=",r("sptr"),"\nb=scratch[dptr]\nif(a<b){break __g}\nif(a>b){break __l}"].join(""));for(var f=t.length-1;f>=1;--f)o.push("sptr+=e"+f,"dptr+=f"+f,"}");o.push("dptr=cptr;sptr=cptr-s0");for(var f=t.length-1;f>=0;--f){var d=t[f];0!==d&&o.push(["for(i",d,"=0;i",d,"<n",d,";++i",d,"){"].join(""))}o.push(a("dptr",r("sptr")));for(var f=0;f<t.length;++f){var d=t[f];0!==d&&o.push(["dptr+=d",d,";sptr+=d",d].join(""),"}")}o.push("cptr-=s0\n}"),o.push("dptr=cptr;sptr=0");for(var f=t.length-1;f>=0;--f){var d=t[f];0!==d&&o.push(["for(i",d,"=0;i",d,"<n",d,";++i",d,"){"].join(""))}o.push(a("dptr","scratch[sptr++]"));for(var f=0;f<t.length;++f){var d=t[f];0!==d&&o.push("dptr+=d"+d,"}")}}else o.push("scratch="+r("ptr"),"while((j-->left)&&("+r("cptr-s0")+">scratch)){",a("cptr",r("cptr-s0")),"cptr-=s0","}",a("cptr","scratch"));if(o.push("}"),t.length>1&&u&&o.push("free(scratch)"),o.push("} return "+s),u){var p=new Function("malloc","free",o.join("\n"));return p(u[0],u[1])}var p=new Function(o.join("\n"));return p()}function o(t,e,r){function a(t){return["(offset+",t,"*s0)"].join("")}function o(t){return"generic"===e?["data.get(",t,")"].join(""):["data[",t,"]"].join("")}function s(t,r){return"generic"===e?["data.set(",t,",",r,")"].join(""):["data[",t,"]=",r].join("")}function l(e,r,n){if(1===e.length)_.push("ptr0="+a(e[0]));else for(var i=0;i<e.length;++i)_.push(["b_ptr",i,"=s0*",e[i]].join(""));r&&_.push("pivot_ptr=0"),_.push("ptr_shift=offset");for(var i=t.length-1;i>=0;--i){var o=t[i];0!==o&&_.push(["for(i",o,"=0;i",o,"<n",o,";++i",o,"){"].join(""))}if(e.length>1)for(var i=0;i<e.length;++i)_.push(["ptr",i,"=b_ptr",i,"+ptr_shift"].join(""));_.push(n),r&&_.push("++pivot_ptr");for(var i=0;i<t.length;++i){var o=t[i];0!==o&&(e.length>1?_.push("ptr_shift+=d"+o):_.push("ptr0+=d"+o),_.push("}"))}}function c(e,r,n,i){if(1===r.length)_.push("ptr0="+a(r[0]));else{for(var o=0;o<r.length;++o)_.push(["b_ptr",o,"=s0*",r[o]].join(""));_.push("ptr_shift=offset")}n&&_.push("pivot_ptr=0"),e&&_.push(e+":");for(var o=1;o<t.length;++o)_.push(["for(i",o,"=0;i",o,"<n",o,";++i",o,"){"].join(""));if(r.length>1)for(var o=0;o<r.length;++o)_.push(["ptr",o,"=b_ptr",o,"+ptr_shift"].join(""));_.push(i);for(var o=t.length-1;o>=1;--o)n&&_.push("pivot_ptr+=f"+o),r.length>1?_.push("ptr_shift+=e"+o):_.push("ptr0+=e"+o),_.push("}")}function h(){t.length>1&&k&&_.push("free(pivot1)","free(pivot2)")}function f(e,r){var n="el"+e,i="el"+r;if(t.length>1){var s="__l"+ ++A;c(s,[n,i],!1,["comp=",o("ptr0"),"-",o("ptr1"),"\n","if(comp>0){tmp0=",n,";",n,"=",i,";",i,"=tmp0;break ",s,"}\n","if(comp<0){break ",s,"}"].join(""))}else _.push(["if(",o(a(n)),">",o(a(i)),"){tmp0=",n,";",n,"=",i,";",i,"=tmp0}"].join(""))}function d(e,r){t.length>1?l([e,r],!1,s("ptr0",o("ptr1"))):_.push(s(a(e),o(a(r))))}function p(e,r,n){if(t.length>1){var i="__l"+ ++A;c(i,[r],!0,[e,"=",o("ptr0"),"-pivot",n,"[pivot_ptr]\n","if(",e,"!==0){break ",i,"}"].join(""))}else _.push([e,"=",o(a(r)),"-pivot",n].join(""))}function m(e,r){t.length>1?l([e,r],!1,["tmp=",o("ptr0"),"\n",s("ptr0",o("ptr1")),"\n",s("ptr1","tmp")].join("")):_.push(["ptr0=",a(e),"\n","ptr1=",a(r),"\n","tmp=",o("ptr0"),"\n",s("ptr0",o("ptr1")),"\n",s("ptr1","tmp")].join(""))}function v(e,r,n){t.length>1?(l([e,r,n],!1,["tmp=",o("ptr0"),"\n",s("ptr0",o("ptr1")),"\n",s("ptr1",o("ptr2")),"\n",s("ptr2","tmp")].join("")),_.push("++"+r,"--"+n)):_.push(["ptr0=",a(e),"\n","ptr1=",a(r),"\n","ptr2=",a(n),"\n","++",r,"\n","--",n,"\n","tmp=",o("ptr0"),"\n",s("ptr0",o("ptr1")),"\n",s("ptr1",o("ptr2")),"\n",s("ptr2","tmp")].join(""))}function g(t,e){m(t,e),_.push("--"+e)}function y(e,r,n){t.length>1?l([e,r],!0,[s("ptr0",o("ptr1")),"\n",s("ptr1",["pivot",n,"[pivot_ptr]"].join(""))].join("")):_.push(s(a(e),o(a(r))),s(a(r),"pivot"+n))}function b(e,r){_.push(["if((",r,"-",e,")<=",u,"){\n","insertionSort(",e,",",r,",data,offset,",i(t.length).join(","),")\n","}else{\n",w,"(",e,",",r,",data,offset,",i(t.length).join(","),")\n","}"].join(""))}function x(e,r,n){t.length>1?(_.push(["__l",++A,":while(true){"].join("")),l([e],!0,["if(",o("ptr0"),"!==pivot",r,"[pivot_ptr]){break __l",A,"}"].join("")),_.push(n,"}")):_.push(["while(",o(a(e)),"===pivot",r,"){",n,"}"].join(""))}var _=["'use strict'"],w=["ndarrayQuickSort",t.join("d"),e].join(""),M=["left","right","data","offset"].concat(i(t.length)),k=n(e),A=0;_.push(["function ",w,"(",M.join(","),"){"].join(""));var T=["sixth=((right-left+1)/6)|0","index1=left+sixth","index5=right-sixth","index3=(left+right)>>1","index2=index3-sixth","index4=index3+sixth","el1=index1","el2=index2","el3=index3","el4=index4","el5=index5","less=left+1","great=right-1","pivots_are_equal=true","tmp","tmp0","x","y","z","k","ptr0","ptr1","ptr2","comp_pivot1=0","comp_pivot2=0","comp=0"];if(t.length>1){for(var S=[],E=1;E<t.length;++E)S.push("n"+E),T.push("i"+E);for(var E=0;E<8;++E)T.push("b_ptr"+E);T.push("ptr3","ptr4","ptr5","ptr6","ptr7","pivot_ptr","ptr_shift","elementSize="+S.join("*")),k?T.push("pivot1=malloc(elementSize)","pivot2=malloc(elementSize)"):T.push("pivot1=new Array(elementSize),pivot2=new Array(elementSize)")}else T.push("pivot1","pivot2");if(_.push("var "+T.join(",")),f(1,2),f(4,5),f(1,3),f(2,3),f(1,4),f(3,4),f(2,5),f(2,3),f(4,5),t.length>1?l(["el1","el2","el3","el4","el5","index1","index3","index5"],!0,["pivot1[pivot_ptr]=",o("ptr1"),"\n","pivot2[pivot_ptr]=",o("ptr3"),"\n","pivots_are_equal=pivots_are_equal&&(pivot1[pivot_ptr]===pivot2[pivot_ptr])\n","x=",o("ptr0"),"\n","y=",o("ptr2"),"\n","z=",o("ptr4"),"\n",s("ptr5","x"),"\n",s("ptr6","y"),"\n",s("ptr7","z")].join("")):_.push(["pivot1=",o(a("el2")),"\n","pivot2=",o(a("el4")),"\n","pivots_are_equal=pivot1===pivot2\n","x=",o(a("el1")),"\n","y=",o(a("el3")),"\n","z=",o(a("el5")),"\n",s(a("index1"),"x"),"\n",s(a("index3"),"y"),"\n",s(a("index5"),"z")].join("")),d("index2","left"),d("index4","right"),_.push("if(pivots_are_equal){"),_.push("for(k=less;k<=great;++k){"),p("comp","k",1),_.push("if(comp===0){continue}"),_.push("if(comp<0){"),_.push("if(k!==less){"),m("k","less"),_.push("}"),_.push("++less"),_.push("}else{"),_.push("while(true){"),p("comp","great",1),_.push("if(comp>0){"),_.push("great--"),_.push("}else if(comp<0){"),v("k","less","great"),_.push("break"),_.push("}else{"),g("k","great"),_.push("break"),_.push("}"),_.push("}"),_.push("}"),_.push("}"),_.push("}else{"),_.push("for(k=less;k<=great;++k){"),p("comp_pivot1","k",1),_.push("if(comp_pivot1<0){"),_.push("if(k!==less){"),m("k","less"),_.push("}"),_.push("++less"),_.push("}else{"),p("comp_pivot2","k",2),_.push("if(comp_pivot2>0){"),_.push("while(true){"),p("comp","great",2),_.push("if(comp>0){"),_.push("if(--great<k){break}"),_.push("continue"),_.push("}else{"),p("comp","great",1),_.push("if(comp<0){"),v("k","less","great"),_.push("}else{"),g("k","great"),_.push("}"),_.push("break"),_.push("}"),_.push("}"),_.push("}"),_.push("}"),_.push("}"),_.push("}"),y("left","(less-1)",1),y("right","(great+1)",2),b("left","(less-2)"),b("(great+2)","right"),_.push("if(pivots_are_equal){"),h(),_.push("return"),_.push("}"),_.push("if(less<index1&&great>index5){"),x("less",1,"++less"),x("great",2,"--great"),_.push("for(k=less;k<=great;++k){"),p("comp_pivot1","k",1),_.push("if(comp_pivot1===0){"),_.push("if(k!==less){"),m("k","less"),_.push("}"),_.push("++less"),_.push("}else{"),p("comp_pivot2","k",2),_.push("if(comp_pivot2===0){"),_.push("while(true){"),p("comp","great",2),_.push("if(comp===0){"),_.push("if(--great<k){break}"),_.push("continue"),_.push("}else{"),p("comp","great",1),_.push("if(comp<0){"),v("k","less","great"),_.push("}else{"),g("k","great"),_.push("}"),_.push("break"),_.push("}"),_.push("}"),_.push("}"),_.push("}"),_.push("}"),_.push("}"),h(),b("less","great"),_.push("}return "+w),t.length>1&&k){var L=new Function("insertionSort","malloc","free",_.join("\n"));return L(r,k[0],k[1])}var L=new Function("insertionSort",_.join("\n"));return L(r)}function s(t,e){var r=["'use strict'"],n=["ndarraySortWrapper",t.join("d"),e].join(""),s=["array"];r.push(["function ",n,"(",s.join(","),"){"].join(""));for(var l=["data=array.data,offset=array.offset|0,shape=array.shape,stride=array.stride"],c=0;c<t.length;++c)l.push(["s",c,"=stride[",c,"]|0,n",c,"=shape[",c,"]|0"].join(""));for(var h=new Array(t.length),f=[],c=0;c<t.length;++c){var d=t[c];0!==d&&(0===f.length?h[d]="1":h[d]=f.join("*"),f.push("n"+d))}for(var p=-1,m=-1,c=0;c<t.length;++c){var v=t[c];0!==v&&(p>0?l.push(["d",v,"=s",v,"-d",p,"*n",p].join("")):l.push(["d",v,"=s",v].join("")),p=v);var d=t.length-1-c;0!==d&&(m>0?l.push(["e",d,"=s",d,"-e",m,"*n",m,",f",d,"=",h[d],"-f",m,"*n",m].join("")):l.push(["e",d,"=s",d,",f",d,"=",h[d]].join("")),m=d)}r.push("var "+l.join(","));var g=["0","n0-1","data","offset"].concat(i(t.length));r.push(["if(n0<=",u,"){","insertionSort(",g.join(","),")}else{","quickSort(",g.join(","),")}"].join("")),r.push("}return "+n);var y=new Function("insertionSort","quickSort",r.join("\n")),b=a(t,e);return y(b,o(t,e,b))}var l=t("typedarray-pool"),u=32;e.exports=s},{"typedarray-pool":533}],458:[function(t,e,r){"use strict";function n(t){var e=t.order,r=t.dtype,n=[e,r],o=n.join(":"),s=a[o];return s||(a[o]=s=i(e,r)),s(t),t}var i=t("./lib/compile_sort.js"),a={};e.exports=n},{"./lib/compile_sort.js":457}],459:[function(t,e,r){"use strict";var n=t("ndarray-linear-interpolate"),i=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=new Array(_inline_9_arg4_)}",args:[{name:"_inline_9_arg0_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_9_arg1_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_9_arg2_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_9_arg3_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_9_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_10_arg2_(this_warped,_inline_10_arg0_),_inline_10_arg1_=_inline_10_arg3_.apply(void 0,this_warped)}",args:[{name:"_inline_10_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_10_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_10_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_10_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_10_arg4_",lvalue:!1,rvalue:!1,count:0}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warpND",blockSize:64}),a=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=[0]}",args:[],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_13_arg2_(this_warped,_inline_13_arg0_),_inline_13_arg1_=_inline_13_arg3_(_inline_13_arg4_,this_warped[0])}",args:[{name:"_inline_13_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_13_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_13_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_13_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_13_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warp1D",blockSize:64}),o=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=[0,0]}",args:[],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_16_arg2_(this_warped,_inline_16_arg0_),_inline_16_arg1_=_inline_16_arg3_(_inline_16_arg4_,this_warped[0],this_warped[1])}",args:[{name:"_inline_16_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_16_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_16_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_16_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_16_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warp2D",blockSize:64}),s=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=[0,0,0]}",args:[],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_19_arg2_(this_warped,_inline_19_arg0_),_inline_19_arg1_=_inline_19_arg3_(_inline_19_arg4_,this_warped[0],this_warped[1],this_warped[2])}",args:[{name:"_inline_19_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_19_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_19_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_19_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_19_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warp3D",blockSize:64});e.exports=function(t,e,r){switch(e.shape.length){case 1:a(t,r,n.d1,e);break;case 2:o(t,r,n.d2,e);break;case 3:s(t,r,n.d3,e);break;default:i(t,r,n.bind(void 0,e),e.shape.length)}return t}},{"cwise/lib/wrapper":109,"ndarray-linear-interpolate":453}],460:[function(t,e,r){function n(t,e){return t[0]-e[0]}function i(){var t,e=this.stride,r=new Array(e.length);for(t=0;t<r.length;++t)r[t]=[Math.abs(e[t]),t];r.sort(n);var i=new Array(r.length);for(t=0;t<i.length;++t)i[t]=r[t][1];return i}function a(t,e){var r=["View",e,"d",t].join("");e<0&&(r="View_Nil"+t);var n="generic"===t;if(e===-1){var a="function "+r+"(a){this.data=a;};var proto="+r+".prototype;proto.dtype='"+t+"';proto.index=function(){return -1};proto.size=0;proto.dimension=-1;proto.shape=proto.stride=proto.order=[];proto.lo=proto.hi=proto.transpose=proto.step=function(){return new "+r+"(this.data);};proto.get=proto.set=function(){};proto.pick=function(){return null};return function construct_"+r+"(a){return new "+r+"(a);}",o=new Function(a);return o()}if(0===e){var a="function "+r+"(a,d) {this.data = a;this.offset = d};var proto="+r+".prototype;proto.dtype='"+t+"';proto.index=function(){return this.offset};proto.dimension=0;proto.size=1;proto.shape=proto.stride=proto.order=[];proto.lo=proto.hi=proto.transpose=proto.step=function "+r+"_copy() {return new "+r+"(this.data,this.offset)};proto.pick=function "+r+"_pick(){return TrivialArray(this.data);};proto.valueOf=proto.get=function "+r+"_get(){return "+(n?"this.data.get(this.offset)":"this.data[this.offset]")+"};proto.set=function "+r+"_set(v){return "+(n?"this.data.set(this.offset,v)":"this.data[this.offset]=v")+"};return function construct_"+r+"(a,b,c,d){return new "+r+"(a,d)}",o=new Function("TrivialArray",a);return o(h[t][0])}var a=["'use strict'"],s=l(e),u=s.map(function(t){return"i"+t}),c="this.offset+"+s.map(function(t){return"this.stride["+t+"]*i"+t}).join("+"),f=s.map(function(t){return"b"+t}).join(","),d=s.map(function(t){return"c"+t}).join(",");a.push("function "+r+"(a,"+f+","+d+",d){this.data=a","this.shape=["+f+"]","this.stride=["+d+"]","this.offset=d|0}","var proto="+r+".prototype","proto.dtype='"+t+"'","proto.dimension="+e),a.push("Object.defineProperty(proto,'size',{get:function "+r+"_size(){return "+s.map(function(t){return"this.shape["+t+"]"}).join("*"),"}})"),1===e?a.push("proto.order=[0]"):(a.push("Object.defineProperty(proto,'order',{get:"),e<4?(a.push("function "+r+"_order(){"),2===e?a.push("return (Math.abs(this.stride[0])>Math.abs(this.stride[1]))?[1,0]:[0,1]}})"):3===e&&a.push("var s0=Math.abs(this.stride[0]),s1=Math.abs(this.stride[1]),s2=Math.abs(this.stride[2]);if(s0>s1){if(s1>s2){return [2,1,0];}else if(s0>s2){return [1,2,0];}else{return [1,0,2];}}else if(s0>s2){return [2,0,1];}else if(s2>s1){return [0,1,2];}else{return [0,2,1];}}})")):a.push("ORDER})")),a.push("proto.set=function "+r+"_set("+u.join(",")+",v){"),n?a.push("return this.data.set("+c+",v)}"):a.push("return this.data["+c+"]=v}"),a.push("proto.get=function "+r+"_get("+u.join(",")+"){"),n?a.push("return this.data.get("+c+")}"):a.push("return this.data["+c+"]}"),a.push("proto.index=function "+r+"_index(",u.join(),"){return "+c+"}"),a.push("proto.hi=function "+r+"_hi("+u.join(",")+"){return new "+r+"(this.data,"+s.map(function(t){return["(typeof i",t,"!=='number'||i",t,"<0)?this.shape[",t,"]:i",t,"|0"].join("")}).join(",")+","+s.map(function(t){return"this.stride["+t+"]"}).join(",")+",this.offset)}");var p=s.map(function(t){return"a"+t+"=this.shape["+t+"]"}),m=s.map(function(t){return"c"+t+"=this.stride["+t+"]"});a.push("proto.lo=function "+r+"_lo("+u.join(",")+"){var b=this.offset,d=0,"+p.join(",")+","+m.join(","));for(var v=0;v<e;++v)a.push("if(typeof i"+v+"==='number'&&i"+v+">=0){d=i"+v+"|0;b+=c"+v+"*d;a"+v+"-=d}");a.push("return new "+r+"(this.data,"+s.map(function(t){return"a"+t}).join(",")+","+s.map(function(t){return"c"+t}).join(",")+",b)}"),a.push("proto.step=function "+r+"_step("+u.join(",")+"){var "+s.map(function(t){return"a"+t+"=this.shape["+t+"]"}).join(",")+","+s.map(function(t){return"b"+t+"=this.stride["+t+"]"}).join(",")+",c=this.offset,d=0,ceil=Math.ceil");for(var v=0;v<e;++v)a.push("if(typeof i"+v+"==='number'){d=i"+v+"|0;if(d<0){c+=b"+v+"*(a"+v+"-1);a"+v+"=ceil(-a"+v+"/d)}else{a"+v+"=ceil(a"+v+"/d)}b"+v+"*=d}");a.push("return new "+r+"(this.data,"+s.map(function(t){return"a"+t}).join(",")+","+s.map(function(t){return"b"+t}).join(",")+",c)}");for(var g=new Array(e),y=new Array(e),v=0;v<e;++v)g[v]="a[i"+v+"]",y[v]="b[i"+v+"]";a.push("proto.transpose=function "+r+"_transpose("+u+"){"+u.map(function(t,e){return t+"=("+t+"===undefined?"+e+":"+t+"|0)"}).join(";"),"var a=this.shape,b=this.stride;return new "+r+"(this.data,"+g.join(",")+","+y.join(",")+",this.offset)}"),a.push("proto.pick=function "+r+"_pick("+u+"){var a=[],b=[],c=this.offset");for(var v=0;v<e;++v)a.push("if(typeof i"+v+"==='number'&&i"+v+">=0){c=(c+this.stride["+v+"]*i"+v+")|0}else{a.push(this.shape["+v+"]);b.push(this.stride["+v+"])}");a.push("var ctor=CTOR_LIST[a.length+1];return ctor(this.data,a,b,c)}"),a.push("return function construct_"+r+"(data,shape,stride,offset){return new "+r+"(data,"+s.map(function(t){return"shape["+t+"]"}).join(",")+","+s.map(function(t){return"stride["+t+"]"}).join(",")+",offset)}");var o=new Function("CTOR_LIST","ORDER",a.join("\n"));return o(h[t],i)}function o(t){if(u(t))return"buffer";if(c)switch(Object.prototype.toString.call(t)){case"[object Float64Array]":return"float64";case"[object Float32Array]":return"float32";case"[object Int8Array]":return"int8";case"[object Int16Array]":return"int16";case"[object Int32Array]":return"int32";case"[object Uint8Array]":return"uint8";case"[object Uint16Array]":return"uint16";case"[object Uint32Array]":return"uint32";case"[object Uint8ClampedArray]":return"uint8_clamped"}return Array.isArray(t)?"array":"generic"
41 }function s(t,e,r,n){if(void 0===t){var i=h.array[0];return i([])}"number"==typeof t&&(t=[t]),void 0===e&&(e=[t.length]);var s=e.length;if(void 0===r){r=new Array(s);for(var l=s-1,u=1;l>=0;--l)r[l]=u,u*=e[l]}if(void 0===n){n=0;for(var l=0;l<s;++l)r[l]<0&&(n-=(e[l]-1)*r[l])}for(var c=o(t),f=h[c];f.length<=s+1;)f.push(a(c,f.length-1));var i=f[s+1];return i(t,e,r,n)}var l=t("iota-array"),u=t("is-buffer"),c="undefined"!=typeof Float64Array,h={float32:[],float64:[],int8:[],int16:[],int32:[],uint8:[],uint16:[],uint32:[],array:[],uint8_clamped:[],buffer:[],generic:[]};e.exports=s},{"iota-array":287,"is-buffer":288}],461:[function(t,e,r){"use strict";function n(t,e){if(isNaN(t)||isNaN(e))return 0/0;if(t===e)return t;if(0===t)return e<0?-a:a;var r=i.hi(t),n=i.lo(t);return e>t==t>0?n===o?(r+=1,n=0):n+=1:0===n?(n=o,r-=1):n-=1,i.pack(n,r)}var i=t("double-bits"),a=Math.pow(2,-1074),o=-1>>>0;e.exports=n},{"double-bits":120}],462:[function(t,e,r){r.vertexNormals=function(t,e,r){for(var n=e.length,i=new Array(n),a=void 0===r?1e-6:r,o=0;o<n;++o)i[o]=[0,0,0];for(var o=0;o<t.length;++o)for(var s=t[o],l=0,u=s[s.length-1],c=s[0],h=0;h<s.length;++h){l=u,u=c,c=s[(h+1)%s.length];for(var f=e[l],d=e[u],p=e[c],m=new Array(3),v=0,g=new Array(3),y=0,b=0;b<3;++b)m[b]=f[b]-d[b],v+=m[b]*m[b],g[b]=p[b]-d[b],y+=g[b]*g[b];if(v*y>a)for(var x=i[u],_=1/Math.sqrt(v*y),b=0;b<3;++b){var w=(b+1)%3,M=(b+2)%3;x[b]+=_*(g[w]*m[M]-g[M]*m[w])}}for(var o=0;o<n;++o){for(var x=i[o],k=0,b=0;b<3;++b)k+=x[b]*x[b];if(k>a)for(var _=1/Math.sqrt(k),b=0;b<3;++b)x[b]*=_;else for(var b=0;b<3;++b)x[b]=0}return i},r.faceNormals=function(t,e,r){for(var n=t.length,i=new Array(n),a=void 0===r?1e-6:r,o=0;o<n;++o){for(var s=t[o],l=new Array(3),u=0;u<3;++u)l[u]=e[s[u]];for(var c=new Array(3),h=new Array(3),u=0;u<3;++u)c[u]=l[1][u]-l[0][u],h[u]=l[2][u]-l[0][u];for(var f=new Array(3),d=0,u=0;u<3;++u){var p=(u+1)%3,m=(u+2)%3;f[u]=c[p]*h[m]-c[m]*h[p],d+=f[u]*f[u]}d=d>a?1/Math.sqrt(d):0;for(var u=0;u<3;++u)f[u]*=d;i[o]=f}return i}},{}],463:[function(t,e,r){"use strict";function n(t){if(null===t||void 0===t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}var i=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},r=0;r<10;r++)e["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(e).map(function(t){return e[t]}).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(t){n[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var r,s,l=n(t),u=1;u<arguments.length;u++){r=Object(arguments[u]);for(var c in r)a.call(r,c)&&(l[c]=r[c]);if(i){s=i(r);for(var h=0;h<s.length;h++)o.call(r,s[h])&&(l[s[h]]=r[s[h]])}}return l}},{}],464:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o,s,l,u){var c=e+a+u;if(h>0){var h=Math.sqrt(c+1);t[0]=.5*(o-l)/h,t[1]=.5*(s-n)/h,t[2]=.5*(r-a)/h,t[3]=.5*h}else{var f=Math.max(e,a,u),h=Math.sqrt(2*f-c+1);e>=f?(t[0]=.5*h,t[1]=.5*(i+r)/h,t[2]=.5*(s+n)/h,t[3]=.5*(o-l)/h):a>=f?(t[0]=.5*(r+i)/h,t[1]=.5*h,t[2]=.5*(l+o)/h,t[3]=.5*(s-n)/h):(t[0]=.5*(n+s)/h,t[1]=.5*(o+l)/h,t[2]=.5*h,t[3]=.5*(r-i)/h)}return t}e.exports=n},{}],465:[function(t,e,r){"use strict";function n(t,e,r){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2))}function i(t,e,r,n){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2)+Math.pow(n,2))}function a(t,e){var r=e[0],n=e[1],a=e[2],o=e[3],s=i(r,n,a,o);s>1e-6?(t[0]=r/s,t[1]=n/s,t[2]=a/s,t[3]=o/s):(t[0]=t[1]=t[2]=0,t[3]=1)}function o(t,e,r){this.radius=l([r]),this.center=l(e),this.rotation=l(t),this.computedRadius=this.radius.curve(0),this.computedCenter=this.center.curve(0),this.computedRotation=this.rotation.curve(0),this.computedUp=[.1,0,0],this.computedEye=[.1,0,0],this.computedMatrix=[.1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.recalcMatrix(0)}function s(t){t=t||{};var e=t.center||[0,0,0],r=t.rotation||[0,0,0,1],n=t.radius||1;e=[].slice.call(e,0,3),r=[].slice.call(r,0,4),a(r,r);var i=new o(r,e,Math.log(n));return i.setDistanceLimits(t.zoomMin,t.zoomMax),("eye"in t||"up"in t)&&i.lookAt(0,t.eye,t.center,t.up),i}e.exports=s;var l=t("filtered-vector"),u=t("gl-mat4/lookAt"),c=t("gl-mat4/fromQuat"),h=t("gl-mat4/invert"),f=t("./lib/quatFromFrame"),d=o.prototype;d.lastT=function(){return Math.max(this.radius.lastT(),this.center.lastT(),this.rotation.lastT())},d.recalcMatrix=function(t){this.radius.curve(t),this.center.curve(t),this.rotation.curve(t);var e=this.computedRotation;a(e,e);var r=this.computedMatrix;c(r,e);var n=this.computedCenter,i=this.computedEye,o=this.computedUp,s=Math.exp(this.computedRadius[0]);i[0]=n[0]+s*r[2],i[1]=n[1]+s*r[6],i[2]=n[2]+s*r[10],o[0]=r[1],o[1]=r[5],o[2]=r[9];for(var l=0;l<3;++l){for(var u=0,h=0;h<3;++h)u+=r[l+4*h]*i[h];r[12+l]=-u}},d.getMatrix=function(t,e){this.recalcMatrix(t);var r=this.computedMatrix;if(e){for(var n=0;n<16;++n)e[n]=r[n];return e}return r},d.idle=function(t){this.center.idle(t),this.radius.idle(t),this.rotation.idle(t)},d.flush=function(t){this.center.flush(t),this.radius.flush(t),this.rotation.flush(t)},d.pan=function(t,e,r,i){e=e||0,r=r||0,i=i||0,this.recalcMatrix(t);var a=this.computedMatrix,o=a[1],s=a[5],l=a[9],u=n(o,s,l);o/=u,s/=u,l/=u;var c=a[0],h=a[4],f=a[8],d=c*o+h*s+f*l;c-=o*d,h-=s*d,f-=l*d;var p=n(c,h,f);c/=p,h/=p,f/=p;var m=a[2],v=a[6],g=a[10],y=m*o+v*s+g*l,b=m*c+v*h+g*f;m-=y*o+b*c,v-=y*s+b*h,g-=y*l+b*f;var x=n(m,v,g);m/=x,v/=x,g/=x;var _=c*e+o*r,w=h*e+s*r,M=f*e+l*r;this.center.move(t,_,w,M);var k=Math.exp(this.computedRadius[0]);k=Math.max(1e-4,k+i),this.radius.set(t,Math.log(k))},d.rotate=function(t,e,r,a){this.recalcMatrix(t),e=e||0,r=r||0;var o=this.computedMatrix,s=o[0],l=o[4],u=o[8],c=o[1],h=o[5],f=o[9],d=o[2],p=o[6],m=o[10],v=e*s+r*c,g=e*l+r*h,y=e*u+r*f,b=-(p*y-m*g),x=-(m*v-d*y),_=-(d*g-p*v),w=Math.sqrt(Math.max(0,1-Math.pow(b,2)-Math.pow(x,2)-Math.pow(_,2))),M=i(b,x,_,w);M>1e-6?(b/=M,x/=M,_/=M,w/=M):(b=x=_=0,w=1);var k=this.computedRotation,A=k[0],T=k[1],S=k[2],E=k[3],L=A*w+E*b+T*_-S*x,C=T*w+E*x+S*b-A*_,z=S*w+E*_+A*x-T*b,D=E*w-A*b-T*x-S*_;if(a){b=d,x=p,_=m;var I=Math.sin(a)/n(b,x,_);b*=I,x*=I,_*=I,w=Math.cos(e),L=L*w+D*b+C*_-z*x,C=C*w+D*x+z*b-L*_,z=z*w+D*_+L*x-C*b,D=D*w-L*b-C*x-z*_}var P=i(L,C,z,D);P>1e-6?(L/=P,C/=P,z/=P,D/=P):(L=C=z=0,D=1),this.rotation.set(t,L,C,z,D)},d.lookAt=function(t,e,r,n){this.recalcMatrix(t),r=r||this.computedCenter,e=e||this.computedEye,n=n||this.computedUp;var i=this.computedMatrix;u(i,e,r,n);var o=this.computedRotation;f(o,i[0],i[1],i[2],i[4],i[5],i[6],i[8],i[9],i[10]),a(o,o),this.rotation.set(t,o[0],o[1],o[2],o[3]);for(var s=0,l=0;l<3;++l)s+=Math.pow(r[l]-e[l],2);this.radius.set(t,.5*Math.log(Math.max(s,1e-6))),this.center.set(t,r[0],r[1],r[2])},d.translate=function(t,e,r,n){this.center.move(t,e||0,r||0,n||0)},d.setMatrix=function(t,e){var r=this.computedRotation;f(r,e[0],e[1],e[2],e[4],e[5],e[6],e[8],e[9],e[10]),a(r,r),this.rotation.set(t,r[0],r[1],r[2],r[3]);var n=this.computedMatrix;h(n,e);var i=n[15];if(Math.abs(i)>1e-6){var o=n[12]/i,s=n[13]/i,l=n[14]/i;this.recalcMatrix(t);var u=Math.exp(this.computedRadius[0]);this.center.set(t,o-n[2]*u,s-n[6]*u,l-n[10]*u),this.radius.idle(t)}else this.center.idle(t),this.radius.idle(t)},d.setDistance=function(t,e){e>0&&this.radius.set(t,Math.log(e))},d.setDistanceLimits=function(t,e){t=t>0?Math.log(t):-1/0,e=e>0?Math.log(e):1/0,e=Math.max(e,t),this.radius.bounds[0][0]=t,this.radius.bounds[1][0]=e},d.getDistanceLimits=function(t){var e=this.radius.bounds;return t?(t[0]=Math.exp(e[0][0]),t[1]=Math.exp(e[1][0]),t):[Math.exp(e[0][0]),Math.exp(e[1][0])]},d.toJSON=function(){return this.recalcMatrix(this.lastT()),{center:this.computedCenter.slice(),rotation:this.computedRotation.slice(),distance:Math.log(this.computedRadius[0]),zoomMin:this.radius.bounds[0][0],zoomMax:this.radius.bounds[1][0]}},d.fromJSON=function(t){var e=this.lastT(),r=t.center;r&&this.center.set(e,r[0],r[1],r[2]);var n=t.rotation;n&&this.rotation.set(e,n[0],n[1],n[2],n[3]);var i=t.distance;i&&i>0&&this.radius.set(e,Math.log(i)),this.setDistanceLimits(t.zoomMin,t.zoomMax)}},{"./lib/quatFromFrame":464,"filtered-vector":129,"gl-mat4/fromQuat":173,"gl-mat4/invert":176,"gl-mat4/lookAt":177}],466:[function(t,e,r){"use strict";var n=t("repeat-string");e.exports=function(t,e,r){return r=void 0!==r?r+"":" ",n(r,e)+t}},{"repeat-string":492}],467:[function(t,e,r){e.exports=function(t,e){e||(e=[0,""]),t=String(t);var r=parseFloat(t,10);return e[0]=r,e[1]=t.match(/[\d.\-\+]*\s*(.*)/)[1]||"",e}},{}],468:[function(t,e,r){(function(t){function e(t,e){for(var r=0,n=t.length-1;n>=0;n--){var i=t[n];"."===i?t.splice(n,1):".."===i?(t.splice(n,1),r++):r&&(t.splice(n,1),r--)}if(e)for(;r--;r)t.unshift("..");return t}function n(t,e){if(t.filter)return t.filter(e);for(var r=[],n=0;n<t.length;n++)e(t[n],n,t)&&r.push(t[n]);return r}var i=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,a=function(t){return i.exec(t).slice(1)};r.resolve=function(){for(var r="",i=!1,a=arguments.length-1;a>=-1&&!i;a--){var o=a>=0?arguments[a]:t.cwd();if("string"!=typeof o)throw new TypeError("Arguments to path.resolve must be strings");o&&(r=o+"/"+r,i="/"===o.charAt(0))}return r=e(n(r.split("/"),function(t){return!!t}),!i).join("/"),(i?"/":"")+r||"."},r.normalize=function(t){var i=r.isAbsolute(t),a="/"===o(t,-1);return t=e(n(t.split("/"),function(t){return!!t}),!i).join("/"),t||i||(t="."),t&&a&&(t+="/"),(i?"/":"")+t},r.isAbsolute=function(t){return"/"===t.charAt(0)},r.join=function(){var t=Array.prototype.slice.call(arguments,0);return r.normalize(n(t,function(t,e){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))},r.relative=function(t,e){function n(t){for(var e=0;e<t.length&&""===t[e];e++);for(var r=t.length-1;r>=0&&""===t[r];r--);return e>r?[]:t.slice(e,r-e+1)}t=r.resolve(t).substr(1),e=r.resolve(e).substr(1);for(var i=n(t.split("/")),a=n(e.split("/")),o=Math.min(i.length,a.length),s=o,l=0;l<o;l++)if(i[l]!==a[l]){s=l;break}for(var u=[],l=s;l<i.length;l++)u.push("..");return u=u.concat(a.slice(s)),u.join("/")},r.sep="/",r.delimiter=":",r.dirname=function(t){var e=a(t),r=e[0],n=e[1];return r||n?(n&&(n=n.substr(0,n.length-1)),r+n):"."},r.basename=function(t,e){var r=a(t)[2];return e&&r.substr(-1*e.length)===e&&(r=r.substr(0,r.length-e.length)),r},r.extname=function(t){return a(t)[3]};var o="b"==="ab".substr(-1)?function(t,e,r){return t.substr(e,r)}:function(t,e,r){return e<0&&(e=t.length+e),t.substr(e,r)}}).call(this,t("_process"))},{_process:479}],469:[function(t,e,r){"use strict";function n(t){var e;t&&t.length&&(e=t,t=e.length);var r=new Uint8Array(t||0);return e&&r.set(e),r.readUInt32LE=a.readUInt32LE,r.writeUInt32LE=a.writeUInt32LE,r.readInt32LE=a.readInt32LE,r.writeInt32LE=a.writeInt32LE,r.readFloatLE=a.readFloatLE,r.writeFloatLE=a.writeFloatLE,r.readDoubleLE=a.readDoubleLE,r.writeDoubleLE=a.writeDoubleLE,r.toString=a.toString,r.write=a.write,r.slice=a.slice,r.copy=a.copy,r._isBuffer=!0,r}function i(t){for(var e,r,n=t.length,i=[],a=0;a<n;a++){if((e=t.charCodeAt(a))>55295&&e<57344){if(!r){e>56319||a+1===n?i.push(239,191,189):r=e;continue}if(e<56320){i.push(239,191,189),r=e;continue}e=r-55296<<10|e-56320|65536,r=null}else r&&(i.push(239,191,189),r=null);e<128?i.push(e):e<2048?i.push(e>>6|192,63&e|128):e<65536?i.push(e>>12|224,e>>6&63|128,63&e|128):i.push(e>>18|240,e>>12&63|128,e>>6&63|128,63&e|128)}return i}e.exports=n;var a,o,s,l=t("ieee754");a={readUInt32LE:function(t){return(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},writeUInt32LE:function(t,e){this[e]=t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24},readInt32LE:function(t){return(this[t]|this[t+1]<<8|this[t+2]<<16)+(this[t+3]<<24)},readFloatLE:function(t){return l.read(this,t,!0,23,4)},readDoubleLE:function(t){return l.read(this,t,!0,52,8)},writeFloatLE:function(t,e){return l.write(this,t,e,!0,23,4)},writeDoubleLE:function(t,e){return l.write(this,t,e,!0,52,8)},toString:function(t,e,r){var n="",i="";e=e||0,r=Math.min(this.length,r||this.length);for(var a=e;a<r;a++){var o=this[a];o<=127?(n+=decodeURIComponent(i)+String.fromCharCode(o),i=""):i+="%"+o.toString(16)}return n+=decodeURIComponent(i)},write:function(t,e){for(var r=t===o?s:i(t),n=0;n<r.length;n++)this[e+n]=r[n]},slice:function(t,e){return this.subarray(t,e)},copy:function(t,e){e=e||0;for(var r=0;r<this.length;r++)t[e+r]=this[r]}},a.writeInt32LE=a.writeUInt32LE,n.byteLength=function(t){return o=t,s=i(t),s.length},n.isBuffer=function(t){return!(!t||!t._isBuffer)}},{ieee754:283}],470:[function(t,e,r){(function(r){"use strict";function n(t){this.buf=v.isBuffer(t)?t:new v(t||0),this.pos=0,this.length=this.buf.length}function i(t,e){var r,n=e.buf;if(r=n[e.pos++],t+=268435456*(127&r),r<128)return t;if(r=n[e.pos++],t+=34359738368*(127&r),r<128)return t;if(r=n[e.pos++],t+=4398046511104*(127&r),r<128)return t;if(r=n[e.pos++],t+=562949953421312*(127&r),r<128)return t;if(r=n[e.pos++],t+=72057594037927940*(127&r),r<128)return t;if(r=n[e.pos++],t+=0x8000000000000000*(127&r),r<128)return t;throw new Error("Expected varint not more than 10 bytes")}function a(t,e){e.realloc(10);for(var r=e.pos+10;t>=1;){if(e.pos>=r)throw new Error("Given varint doesn't fit into 10 bytes");var n=255&t;e.buf[e.pos++]=n|(t>=128?128:0),t/=128}}function o(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.ceil(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 s(t,e){for(var r=0;r<t.length;r++)e.writeVarint(t[r])}function l(t,e){for(var r=0;r<t.length;r++)e.writeSVarint(t[r])}function u(t,e){for(var r=0;r<t.length;r++)e.writeFloat(t[r])}function c(t,e){for(var r=0;r<t.length;r++)e.writeDouble(t[r])}function h(t,e){for(var r=0;r<t.length;r++)e.writeBoolean(t[r])}function f(t,e){for(var r=0;r<t.length;r++)e.writeFixed32(t[r])}function d(t,e){for(var r=0;r<t.length;r++)e.writeSFixed32(t[r])}function p(t,e){for(var r=0;r<t.length;r++)e.writeFixed64(t[r])}function m(t,e){for(var r=0;r<t.length;r++)e.writeSFixed64(t[r])}e.exports=n;var v=r.Buffer||t("./buffer");n.Varint=0,n.Fixed64=1,n.Bytes=2,n.Fixed32=5;var g=Math.pow(2,63);n.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;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=this.buf.readUInt32LE(this.pos);return this.pos+=4,t},readSFixed32:function(){var t=this.buf.readInt32LE(this.pos);return this.pos+=4,t},readFixed64:function(){var t=this.buf.readUInt32LE(this.pos)+4294967296*this.buf.readUInt32LE(this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=this.buf.readUInt32LE(this.pos)+4294967296*this.buf.readInt32LE(this.pos+4);return this.pos+=8,t},readFloat:function(){var t=this.buf.readFloatLE(this.pos);return this.pos+=4,t},readDouble:function(){var t=this.buf.readDoubleLE(this.pos);return this.pos+=8,t},readVarint:function(){var t,e,r=this.buf;return e=r[this.pos++],t=127&e,e<128?t:(e=r[this.pos++],t|=(127&e)<<7,e<128?t:(e=r[this.pos++],t|=(127&e)<<14,e<128?t:(e=r[this.pos++],t|=(127&e)<<21,e<128?t:i(t,this))))},readVarint64:function(){var t=this.pos,e=this.readVarint();if(e<g)return e;for(var r=this.pos-2;255===this.buf[r];)r--;r<t&&(r=t),e=0;for(var n=0;n<r-t+1;n++){var i=127&~this.buf[t+n];e+=n<4?i<<7*n:i*Math.pow(2,7*n)}return-e-1},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=this.buf.toString("utf8",this.pos,t);return this.pos=t,e},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.slice(this.pos,t);return this.pos=t,e},readPackedVarint:function(){for(var t=this.readVarint()+this.pos,e=[];this.pos<t;)e.push(this.readVarint());return e},readPackedSVarint:function(){for(var t=this.readVarint()+this.pos,e=[];this.pos<t;)e.push(this.readSVarint());return e},readPackedBoolean:function(){for(var t=this.readVarint()+this.pos,e=[];this.pos<t;)e.push(this.readBoolean());return e},readPackedFloat:function(){for(var t=this.readVarint()+this.pos,e=[];this.pos<t;)e.push(this.readFloat());return e},readPackedDouble:function(){for(var t=this.readVarint()+this.pos,e=[];this.pos<t;)e.push(this.readDouble());return e},readPackedFixed32:function(){for(var t=this.readVarint()+this.pos,e=[];this.pos<t;)e.push(this.readFixed32());return e},readPackedSFixed32:function(){for(var t=this.readVarint()+this.pos,e=[];this.pos<t;)e.push(this.readSFixed32());return e},readPackedFixed64:function(){for(var t=this.readVarint()+this.pos,e=[];this.pos<t;)e.push(this.readFixed64());return e},readPackedSFixed64:function(){for(var t=this.readVarint()+this.pos,e=[];this.pos<t;)e.push(this.readSFixed64());return e},skip:function(t){var e=7&t;if(e===n.Varint)for(;this.buf[this.pos++]>127;);else if(e===n.Bytes)this.pos=this.readVarint()+this.pos;else if(e===n.Fixed32)this.pos+=4;else{if(e!==n.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 v(e);this.buf.copy(r),this.buf=r,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.slice(0,this.length)},writeFixed32:function(t){this.realloc(4),this.buf.writeUInt32LE(t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),this.buf.writeInt32LE(t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),this.buf.writeInt32LE(t&-1,this.pos),this.buf.writeUInt32LE(Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),this.buf.writeInt32LE(t&-1,this.pos),this.buf.writeInt32LE(Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeVarint:function(t){if((t=+t)>268435455)return void a(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);var e=v.byteLength(t);this.writeVarint(e),this.realloc(e),this.buf.write(t,this.pos),this.pos+=e},writeFloat:function(t){this.realloc(4),this.buf.writeFloatLE(t,this.pos),this.pos+=4},writeDouble:function(t){this.realloc(8),this.buf.writeDoubleLE(t,this.pos),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r<e;r++)this.buf[this.pos++]=t[r]},writeRawMessage:function(t,e){this.pos++;var r=this.pos;t(e,this);var n=this.pos-r;n>=128&&o(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,n.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){this.writeMessage(t,s,e)},writePackedSVarint:function(t,e){this.writeMessage(t,l,e)},writePackedBoolean:function(t,e){this.writeMessage(t,h,e)},writePackedFloat:function(t,e){this.writeMessage(t,u,e)},writePackedDouble:function(t,e){this.writeMessage(t,c,e)},writePackedFixed32:function(t,e){this.writeMessage(t,f,e)},writePackedSFixed32:function(t,e){this.writeMessage(t,d,e)},writePackedFixed64:function(t,e){this.writeMessage(t,p,e)},writePackedSFixed64:function(t,e){this.writeMessage(t,m,e)},writeBytesField:function(t,e){this.writeTag(t,n.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,n.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,n.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,n.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,n.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,n.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,n.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,n.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,n.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,n.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./buffer":469}],471:[function(t,e,r){"use strict";function n(t){var e=t.length;if(e<i){for(var r=1,n=0;n<e;++n)for(var o=0;o<n;++o)if(t[n]<t[o])r=-r;else if(t[n]===t[o])return 0;return r}for(var s=a.mallocUint8(e),n=0;n<e;++n)s[n]=0;for(var r=1,n=0;n<e;++n)if(!s[n]){var l=1;s[n]=1;for(var o=t[n];o!==n;o=t[o]){if(s[o])return a.freeUint8(s),0;l+=1,s[o]=1}1&l||(r=-r)}return a.freeUint8(s),r}e.exports=n;var i=32,a=t("typedarray-pool")},{"typedarray-pool":533}],472:[function(t,e,r){"use strict";function n(t){var e=t.length;switch(e){case 0:case 1:return 0;case 2:return t[1]}var r,n,i,s=a.mallocUint32(e),l=a.mallocUint32(e),u=0;for(o(t,l),i=0;i<e;++i)s[i]=t[i];for(i=e-1;i>0;--i)n=l[i],r=s[i],s[i]=s[n],s[n]=r,l[i]=l[r],l[r]=n,u=(u+r)*i;return a.freeUint32(l),a.freeUint32(s),u}function i(t,e,r){switch(t){case 0:return r||[];case 1:return r?(r[0]=0,r):[0];case 2:return r?(e?(r[0]=0,r[1]=1):(r[0]=1,r[1]=0),r):e?[0,1]:[1,0]}r=r||new Array(t);var n,i,a,o=1;for(r[0]=0,a=1;a<t;++a)r[a]=a,o=o*a|0;for(a=t-1;a>0;--a)n=e/o|0,e=e-n*o|0,o=o/a|0,i=0|r[a],r[a]=0|r[n],r[n]=0|i;return r}var a=t("typedarray-pool"),o=t("invert-permutation");r.rank=n,r.unrank=i},{"invert-permutation":286,"typedarray-pool":533}],473:[function(t,e,r){"use strict";function n(t,e){function r(t,e){var r=s[e][t[e]];r.splice(r.indexOf(t),1)}function n(t,n,a){for(var o,l,u,c=0;c<2;++c)if(s[c][n].length>0){o=s[c][n][0],u=c;break}l=o[1^u];for(var h=0;h<2;++h)for(var f=s[h][n],d=0;d<f.length;++d){var p=f[d],m=p[1^h],v=i(e[t],e[n],e[l],e[m]);v>0&&(o=p,l=m,u=h)}return a?l:(o&&r(o,u),l)}for(var a=0|e.length,o=t.length,s=[new Array(a),new Array(a)],l=0;l<a;++l)s[0][l]=[],s[1][l]=[];for(var l=0;l<o;++l){var u=t[l];s[0][u[0]].push(u),s[1][u[1]].push(u)}for(var c=[],l=0;l<a;++l)s[0][l].length+s[1][l].length===0&&c.push([l]);for(var l=0;l<a;++l)for(var h=0;h<2;++h){for(var f=[];s[h][l].length>0;){var d=(s[0][l].length,function(t,a){var o=s[a][t][0],l=[t];r(o,a);for(var u=o[1^a];;){for(;u!==t;)l.push(u),u=n(l[l.length-2],u,!1);if(s[0][t].length+s[1][t].length===0)break;var c=l[l.length-1],h=t,f=l[1],d=n(c,h,!0);if(i(e[c],e[h],e[f],e[d])<0)break;l.push(t),u=n(c,h)}return l}(l,h));!function(t,e){return e[1]===e[e.length-1]}(f,d)?(f.length>0&&c.push(f),f=d):f.push.apply(f,d)}f.length>0&&c.push(f)}return c}e.exports=n;var i=t("compare-angle")},{"compare-angle":96}],474:[function(t,e,r){"use strict";function n(t,e){for(var r=i(t,e.length),n=new Array(e.length),a=new Array(e.length),o=[],s=0;s<e.length;++s){var l=r[s].length;a[s]=l,n[s]=!0,l<=1&&o.push(s)}for(;o.length>0;){var u=o.pop();n[u]=!1;for(var c=r[u],s=0;s<c.length;++s){var h=c[s];0==--a[h]&&o.push(h)}}for(var f=new Array(e.length),d=[],s=0;s<e.length;++s)if(n[s]){var u=d.length;f[s]=u,d.push(e[s])}else f[s]=-1;for(var p=[],s=0;s<t.length;++s){var m=t[s];n[m[0]]&&n[m[1]]&&p.push([f[m[0]],f[m[1]]])}return[p,d]}e.exports=n;var i=t("edges-to-adjacency-list")},{"edges-to-adjacency-list":123}],475:[function(t,e,r){"use strict";function n(t,e){for(var r=new Array(t),n=0;n<t;++n)r[n]=e;return r}function i(t){for(var e=new Array(t),r=0;r<t;++r)e[r]=[];return e}function a(t,e){function r(t){for(var r=t.length,n=[0],i=0;i<r;++i){var a=e[t[i]],o=e[t[(i+1)%r]],s=u(-a[0],a[1]),l=u(-a[0],o[1]),h=u(o[0],a[1]),f=u(o[0],o[1]);n=c(n,c(c(s,l),c(h,f)))}return n[n.length-1]>0}function a(t){for(var e=t.length,r=0;r<e;++r)if(!P[t[r]])return!1;return!0}var d=f(t,e);t=d[0],e=d[1];for(var p=e.length,m=(t.length,o(t,e.length)),v=0;v<p;++v)if(m[v].length%2==1)throw new Error("planar-graph-to-polyline: graph must be manifold");var g=s(t,e);g=g.filter(r);for(var y=g.length,b=new Array(y),x=new Array(y),v=0;v<y;++v){b[v]=v;var _=new Array(y),w=g[v].map(function(t){return e[t]}),M=l([w]),k=0;t:for(var A=0;A<y;++A)if(_[A]=0,v!==A){for(var T=g[A],S=T.length,E=0;E<S;++E){var L=M(e[T[E]]);if(0!==L){L<0&&(_[A]=1,k+=1);continue t}}_[A]=1,k+=1}x[v]=[k,v,_]}x.sort(function(t,e){return e[0]-t[0]});for(var v=0;v<y;++v)for(var _=x[v],C=_[1],z=_[2],A=0;A<y;++A)z[A]&&(b[A]=C);for(var D=i(y),v=0;v<y;++v)D[v].push(b[v]),D[b[v]].push(v);for(var I={},P=n(p,!1),v=0;v<y;++v)for(var T=g[v],S=T.length,A=0;A<S;++A){var O=T[A],j=T[(A+1)%S],F=Math.min(O,j)+":"+Math.max(O,j);if(F in I){var R=I[F];D[R].push(v),D[v].push(R),P[O]=P[j]=!0}else I[F]=v}for(var N=[],B=n(y,-1),v=0;v<y;++v)b[v]!==v||a(g[v])?B[v]=-1:(N.push(v),B[v]=0);for(var d=[];N.length>0;){var U=N.pop(),V=D[U];h(V,function(t,e){return t-e});var q,H=V.length,G=B[U];if(0===G){var T=g[U];q=[T]}for(var v=0;v<H;++v){var Y=V[v];if(!(B[Y]>=0)&&(B[Y]=1^G,N.push(Y),0===G)){var T=g[Y];a(T)||(T.reverse(),q.push(T))}}0===G&&d.push(q)}return d}e.exports=a;var o=t("edges-to-adjacency-list"),s=t("planar-dual"),l=t("point-in-big-polygon"),u=t("two-product"),c=t("robust-sum"),h=t("uniq"),f=t("./lib/trim-leaves")},{"./lib/trim-leaves":474,"edges-to-adjacency-list":123,"planar-dual":473,"point-in-big-polygon":477,"robust-sum":505,"two-product":531,uniq:535}],476:[function(t,e,r){"use strict";function n(t,e){this.x=t,this.y=e}e.exports=n,n.prototype={clone:function(){return new n(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,r=t.y-this.y;return e*e+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[0]*this.x+t[1]*this.y,r=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=r,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),r=Math.sin(t),n=e*this.x-r*this.y,i=r*this.x+e*this.y;return this.x=n,this.y=i,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},n.convert=function(t){return t instanceof n?t:Array.isArray(t)?new n(t[0],t[1]):t}},{}],477:[function(t,e,r){function n(){return!0}function i(t){return function(e,r){var i=t[e];return!!i&&!!i.queryPoint(r,n)}}function a(t){for(var e={},r=0;r<t.length;++r){var n=t[r],a=n[0][0],o=n[0][1],s=n[1][1],l=[Math.min(o,s),Math.max(o,s)];a in e?e[a].push(l):e[a]=[l]}for(var u={},c=Object.keys(e),r=0;r<c.length;++r){var h=e[c[r]];u[c[r]]=d(h)}return i(u)}function o(t,e){return function(r){var n=p.le(e,r[0]);if(n<0)return 1;var i=t[n];if(!i){if(!(n>0&&e[n]===r[0]))return 1;i=t[n-1]}for(var a=1;i;){var o=i.key,s=h(r,o[0],o[1]);if(o[0][0]<o[1][0])if(s<0)i=i.left;else{if(!(s>0))return 0;a=-1,i=i.right}else if(s>0)i=i.left;else{if(!(s<0))return 0;a=1,i=i.right}}return a}}function s(t){return 1}function l(t){return function(e){return t(e[0],e[1])?0:1}}function u(t,e){return function(r){return t(r[0],r[1])?0:e(r)}}function c(t){for(var e=t.length,r=[],n=[],i=0;i<e;++i)for(var c=t[i],h=c.length,d=h-1,p=0;p<h;d=p++){var m=c[d],v=c[p];m[0]===v[0]?n.push([m,v]):r.push([m,v])}if(0===r.length)return 0===n.length?s:l(a(n));var g=f(r),y=o(g.slabs,g.coordinates);return 0===n.length?y:u(a(n),y)}e.exports=c;var h=t("robust-orientation")[3],f=t("slab-decomposition"),d=t("interval-tree-1d"),p=t("binary-search-bounds")},{"binary-search-bounds":62,"interval-tree-1d":285,"robust-orientation":500,"slab-decomposition":517}],478:[function(t,e,r){"use strict";function n(t,e,r,n,s){i.length<n.length&&(i=new Float64Array(n.length),a=new Float64Array(n.length),o=new Float64Array(n.length));for(var l=0;l<n.length;++l)i[l]=t[l]-n[l],a[l]=e[l]-t[l],o[l]=r[l]-t[l];for(var u=0,c=0,h=0,f=0,d=0,p=0,l=0;l<n.length;++l){var m=a[l],v=o[l],g=i[l];u+=m*m,c+=m*v,h+=v*v,f+=g*m,d+=g*v,p+=g*g}var y,b=Math.abs(u*h-c*c),x=c*d-h*f,_=c*f-u*d;if(x+_<=b)if(x<0)_<0&&f<0?(_=0,-f>=u?(x=1,y=u+2*f+p):(x=-f/u,y=f*x+p)):(x=0,d>=0?(_=0,y=p):-d>=h?(_=1,y=h+2*d+p):(_=-d/h,y=d*_+p));else if(_<0)_=0,f>=0?(x=0,y=p):-f>=u?(x=1,y=u+2*f+p):(x=-f/u,y=f*x+p);else{var w=1/b;x*=w,_*=w,y=x*(u*x+c*_+2*f)+_*(c*x+h*_+2*d)+p}else{var M,k,A,T;x<0?(M=c+f,k=h+d,k>M?(A=k-M,T=u-2*c+h,A>=T?(x=1,_=0,y=u+2*f+p):(x=A/T,_=1-x,y=x*(u*x+c*_+2*f)+_*(c*x+h*_+2*d)+p)):(x=0,k<=0?(_=1,y=h+2*d+p):d>=0?(_=0,y=p):(_=-d/h,y=d*_+p))):_<0?(M=c+d,k=u+f,k>M?(A=k-M,T=u-2*c+h,A>=T?(_=1,x=0,y=h+2*d+p):(_=A/T,x=1-_,y=x*(u*x+c*_+2*f)+_*(c*x+h*_+2*d)+p)):(_=0,k<=0?(x=1,y=u+2*f+p):f>=0?(x=0,y=p):(x=-f/u,y=f*x+p))):(A=h+d-c-f,A<=0?(x=0,_=1,y=h+2*d+p):(T=u-2*c+h,A>=T?(x=1,_=0,y=u+2*f+p):(x=A/T,_=1-x,y=x*(u*x+c*_+2*f)+_*(c*x+h*_+2*d)+p)))}for(var S=1-x-_,l=0;l<n.length;++l)s[l]=S*t[l]+x*e[l]+_*r[l];return y<0?0:y}var i=new Float64Array(4),a=new Float64Array(4),o=new Float64Array(4);e.exports=n},{}],479:[function(t,e,r){function n(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function a(t){if(h===setTimeout)return setTimeout(t,0);if((h===n||!h)&&setTimeout)return h=setTimeout,setTimeout(t,0);try{return h(t,0)}catch(e){try{return h.call(null,t,0)}catch(e){return h.call(this,t,0)}}}function o(t){if(f===clearTimeout)return clearTimeout(t);if((f===i||!f)&&clearTimeout)return f=clearTimeout,clearTimeout(t);try{return f(t)}catch(e){try{return f.call(null,t)}catch(e){return f.call(this,t)}}}function s(){v&&p&&(v=!1,p.length?m=p.concat(m):g=-1,m.length&&l())}function l(){if(!v){var t=a(s);v=!0;for(var e=m.length;e;){for(p=m,m=[];++g<e;)p&&p[g].run();g=-1,e=m.length}p=null,v=!1,o(t)}}function u(t,e){this.fun=t,this.array=e}function c(){}var h,f,d=e.exports={};!function(){try{h="function"==typeof setTimeout?setTimeout:n}catch(t){h=n}try{f="function"==typeof clearTimeout?clearTimeout:i}catch(t){f=i}}();var p,m=[],v=!1,g=-1;d.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];m.push(new u(t,e)),1!==m.length||v||a(l)},u.prototype.run=function(){this.fun.apply(null,this.array)},d.title="browser",d.browser=!0,d.env={},d.argv=[],d.version="",d.versions={},d.on=c,d.addListener=c,d.once=c,d.off=c,d.removeListener=c,d.removeAllListeners=c,d.emit=c,d.binding=function(t){throw new Error("process.binding is not supported")},d.cwd=function(){return"/"},d.chdir=function(t){throw new Error("process.chdir is not supported")},d.umask=function(){return 0}},{}],480:[function(e,r,n){(function(e){!function(i){function a(t){throw new RangeError(P[t])}function o(t,e){for(var r=t.length,n=[];r--;)n[r]=e(t[r]);return n}function s(t,e){var r=t.split("@"),n="";return r.length>1&&(n=r[0]+"@",t=r[1]),t=t.replace(I,"."),n+o(t.split("."),e).join(".")}function l(t){for(var e,r,n=[],i=0,a=t.length;i<a;)e=t.charCodeAt(i++),e>=55296&&e<=56319&&i<a?(r=t.charCodeAt(i++),
42 56320==(64512&r)?n.push(((1023&e)<<10)+(1023&r)+65536):(n.push(e),i--)):n.push(e);return n}function u(t){return o(t,function(t){var e="";return t>65535&&(t-=65536,e+=F(t>>>10&1023|55296),t=56320|1023&t),e+=F(t)}).join("")}function c(t){return t-48<10?t-22:t-65<26?t-65:t-97<26?t-97:M}function h(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function f(t,e,r){var n=0;for(t=r?j(t/S):t>>1,t+=j(t/e);t>O*A>>1;n+=M)t=j(t/O);return j(n+(O+1)*t/(t+T))}function d(t){var e,r,n,i,o,s,l,h,d,p,m=[],v=t.length,g=0,y=L,b=E;for(r=t.lastIndexOf(C),r<0&&(r=0),n=0;n<r;++n)t.charCodeAt(n)>=128&&a("not-basic"),m.push(t.charCodeAt(n));for(i=r>0?r+1:0;i<v;){for(o=g,s=1,l=M;i>=v&&a("invalid-input"),h=c(t.charCodeAt(i++)),(h>=M||h>j((w-g)/s))&&a("overflow"),g+=h*s,d=l<=b?k:l>=b+A?A:l-b,!(h<d);l+=M)p=M-d,s>j(w/p)&&a("overflow"),s*=p;e=m.length+1,b=f(g-o,e,0==o),j(g/e)>w-y&&a("overflow"),y+=j(g/e),g%=e,m.splice(g++,0,y)}return u(m)}function p(t){var e,r,n,i,o,s,u,c,d,p,m,v,g,y,b,x=[];for(t=l(t),v=t.length,e=L,r=0,o=E,s=0;s<v;++s)(m=t[s])<128&&x.push(F(m));for(n=i=x.length,i&&x.push(C);n<v;){for(u=w,s=0;s<v;++s)(m=t[s])>=e&&m<u&&(u=m);for(g=n+1,u-e>j((w-r)/g)&&a("overflow"),r+=(u-e)*g,e=u,s=0;s<v;++s)if(m=t[s],m<e&&++r>w&&a("overflow"),m==e){for(c=r,d=M;p=d<=o?k:d>=o+A?A:d-o,!(c<p);d+=M)b=c-p,y=M-p,x.push(F(h(p+b%y,0))),c=j(b/y);x.push(F(h(c,0))),o=f(r,g,n==i),r=0,++n}++r,++e}return x.join("")}function m(t){return s(t,function(t){return z.test(t)?d(t.slice(4).toLowerCase()):t})}function v(t){return s(t,function(t){return D.test(t)?"xn--"+p(t):t})}var g="object"==typeof n&&n&&!n.nodeType&&n,y="object"==typeof r&&r&&!r.nodeType&&r,b="object"==typeof e&&e;b.global!==b&&b.window!==b&&b.self!==b||(i=b);var x,_,w=2147483647,M=36,k=1,A=26,T=38,S=700,E=72,L=128,C="-",z=/^xn--/,D=/[^\x20-\x7E]/,I=/[\x2E\u3002\uFF0E\uFF61]/g,P={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},O=M-k,j=Math.floor,F=String.fromCharCode;if(x={version:"1.4.1",ucs2:{decode:l,encode:u},decode:d,encode:p,toASCII:v,toUnicode:m},"function"==typeof t&&"object"==typeof t.amd&&t.amd)t("punycode",function(){return x});else if(g&&y)if(r.exports==g)y.exports=x;else for(_ in x)x.hasOwnProperty(_)&&(g[_]=x[_]);else i.punycode=x}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],481:[function(t,e,r){e.exports=t("gl-quat/slerp")},{"gl-quat/slerp":226}],482:[function(t,e,r){"use strict";function n(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.exports=function(t,e,r,a){e=e||"&",r=r||"=";var o={};if("string"!=typeof t||0===t.length)return o;t=t.split(e);var s=1e3;a&&"number"==typeof a.maxKeys&&(s=a.maxKeys);var l=t.length;s>0&&l>s&&(l=s);for(var u=0;u<l;++u){var c,h,f,d,p=t[u].replace(/\+/g,"%20"),m=p.indexOf(r);m>=0?(c=p.substr(0,m),h=p.substr(m+1)):(c=p,h=""),f=decodeURIComponent(c),d=decodeURIComponent(h),n(o,f)?i(o[f])?o[f].push(d):o[f]=[o[f],d]:o[f]=d}return o};var i=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},{}],483:[function(t,e,r){"use strict";function n(t,e){if(t.map)return t.map(e);for(var r=[],n=0;n<t.length;n++)r.push(e(t[n],n));return r}var i=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}};e.exports=function(t,e,r,s){return e=e||"&",r=r||"=",null===t&&(t=void 0),"object"==typeof t?n(o(t),function(o){var s=encodeURIComponent(i(o))+r;return a(t[o])?n(t[o],function(t){return s+encodeURIComponent(i(t))}).join(e):s+encodeURIComponent(i(t[o]))}).join(e):s?encodeURIComponent(i(s))+r+encodeURIComponent(i(t)):""};var a=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},o=Object.keys||function(t){var e=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.push(r);return e}},{}],484:[function(t,e,r){"use strict";r.decode=r.parse=t("./decode"),r.encode=r.stringify=t("./encode")},{"./decode":482,"./encode":483}],485:[function(t,e,r){"use strict";function n(t,e,r,o,s){for(r=r||0,o=o||t.length-1,s=s||a;o>r;){if(o-r>600){var l=o-r+1,u=e-r+1,c=Math.log(l),h=.5*Math.exp(2*c/3),f=.5*Math.sqrt(c*h*(l-h)/l)*(u-l/2<0?-1:1);n(t,e,Math.max(r,Math.floor(e-u*h/l+f)),Math.min(o,Math.floor(e+(l-u)*h/l+f)),s)}var d=t[e],p=r,m=o;for(i(t,r,e),s(t[o],d)>0&&i(t,r,o);p<m;){for(i(t,p,m),p++,m--;s(t[p],d)<0;)p++;for(;s(t[m],d)>0;)m--}0===s(t[r],d)?i(t,r,m):(m++,i(t,m,o)),m<=e&&(r=m+1),e<=m&&(o=m-1)}}function i(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function a(t,e){return t<e?-1:t>e?1:0}e.exports=n},{}],486:[function(t,e,r){"use strict";function n(t,e){for(var r=t.length,n=new Array(r),a=0;a<r;++a)n[a]=i(t[a],e[a]);return n}var i=t("big-rat/add");e.exports=n},{"big-rat/add":46}],487:[function(t,e,r){"use strict";function n(t){for(var e=new Array(t.length),r=0;r<t.length;++r)e[r]=i(t[r]);return e}e.exports=n;var i=t("big-rat")},{"big-rat":49}],488:[function(t,e,r){"use strict";function n(t,e){for(var r=i(e),n=t.length,o=new Array(n),s=0;s<n;++s)o[s]=a(t[s],r);return o}var i=t("big-rat"),a=t("big-rat/mul");e.exports=n},{"big-rat":49,"big-rat/mul":58}],489:[function(t,e,r){"use strict";function n(t,e){for(var r=t.length,n=new Array(r),a=0;a<r;++a)n[a]=i(t[a],e[a]);return n}var i=t("big-rat/sub");e.exports=n},{"big-rat/sub":60}],490:[function(t,e,r){"use strict";function n(t){t.sort(a);for(var e=t.length,r=0,n=0;n<e;++n){var s=t[n],l=o(s);if(0!==l){if(r>0){var u=t[r-1];if(0===i(s,u)&&o(u)!==l){r-=1;continue}}t[r++]=s}}return t.length=r,t}var i=t("compare-cell"),a=t("compare-oriented-cell"),o=t("cell-orientation");e.exports=n},{"cell-orientation":81,"compare-cell":97,"compare-oriented-cell":98}],491:[function(e,r,n){!function(e,i){"object"==typeof n&&void 0!==r?r.exports=i():"function"==typeof t&&t.amd?t(i):e.createREGL=i()}(this,function(){"use strict";function t(t){return"undefined"!=typeof btoa?btoa(t):"base64:"+t}function e(t){var e=new Error("(regl) "+t);throw console.error(e),e}function r(t,r){t||e(r)}function n(t){return t?": "+t:""}function i(t,r,i){t in r||e("unknown parameter ("+t+")"+n(i)+". possible values: "+Object.keys(r).join())}function a(t,r){Qt(t)||e("invalid parameter type"+n(r)+". must be a typed array")}function o(t,r,i){typeof t!==r&&e("invalid parameter type"+n(i)+". expected "+r+", got "+typeof t)}function s(t,r){t>=0&&(0|t)===t||e("invalid parameter type, ("+t+")"+n(r)+". must be a nonnegative integer")}function l(t,r,i){r.indexOf(t)<0&&e("invalid value"+n(i)+". must be one of: "+r)}function u(t){Object.keys(t).forEach(function(t){te.indexOf(t)<0&&e('invalid regl constructor argument "'+t+'". must be one of '+te)})}function c(t,e){for(t+="";t.length<e;)t=" "+t;return t}function h(){this.name="unknown",this.lines=[],this.index={},this.hasErrors=!1}function f(t,e){this.number=t,this.line=e,this.errors=[]}function d(t,e,r){this.file=t,this.line=e,this.message=r}function p(){var t=new Error,e=(t.stack||t).toString(),r=/compileProcedure.*\n\s*at.*\((.*)\)/.exec(e);if(r)return r[1];var n=/compileProcedure.*\n\s*at\s+(.*)(\n|$)/.exec(e);return n?n[1]:"unknown"}function m(){var t=new Error,e=(t.stack||t).toString(),r=/at REGLCommand.*\n\s+at.*\((.*)\)/.exec(e);if(r)return r[1];var n=/at REGLCommand.*\n\s+at\s+(.*)\n/.exec(e);return n?n[1]:"unknown"}function v(e,r){var n=e.split("\n"),i=1,a=0,o={unknown:new h,0:new h};o.unknown.name=o[0].name=r||p(),o.unknown.lines.push(new f(0,""));for(var s=0;s<n.length;++s){var l=n[s],u=/^\s*\#\s*(\w+)\s+(.+)\s*$/.exec(l);if(u)switch(u[1]){case"line":var c=/(\d+)(\s+\d+)?/.exec(u[2]);c&&(i=0|c[1],c[2]&&((a=0|c[2])in o||(o[a]=new h)));break;case"define":var d=/SHADER_NAME(_B64)?\s+(.*)$/.exec(u[2]);d&&(o[a].name=d[1]?t(d[2]):d[2])}o[a].lines.push(new f(i++,l))}return Object.keys(o).forEach(function(t){var e=o[t];e.lines.forEach(function(t){e.index[t.number]=t})}),o}function g(t){var e=[];return t.split("\n").forEach(function(t){if(!(t.length<5)){var r=/^ERROR\:\s+(\d+)\:(\d+)\:\s*(.*)$/.exec(t);r?e.push(new d(0|r[1],0|r[2],r[3].trim())):t.length>0&&e.push(new d("unknown",0,t))}}),e}function y(t,e){e.forEach(function(e){var r=t[e.file];if(r){var n=r.index[e.line];if(n)return n.errors.push(e),void(r.hasErrors=!0)}t.unknown.hasErrors=!0,t.unknown.lines[0].errors.push(e)})}function b(t,e,n,i,a){if(!t.getShaderParameter(e,t.COMPILE_STATUS)){var o=t.getShaderInfoLog(e),s=i===t.FRAGMENT_SHADER?"fragment":"vertex";T(n,"string",s+" shader source must be a string",a);var l=v(n,a),u=g(o);y(l,u),Object.keys(l).forEach(function(t){function e(t,e){n.push(t),i.push(e||"")}var r=l[t];if(r.hasErrors){var n=[""],i=[""];e("file number "+t+": "+r.name+"\n","color:red;text-decoration:underline;font-weight:bold"),r.lines.forEach(function(t){if(t.errors.length>0){e(c(t.number,4)+"| ","background-color:yellow; font-weight:bold"),e(t.line+"\n","color:red; background-color:yellow; font-weight:bold");var r=0;t.errors.forEach(function(n){var i=n.message,a=/^\s*\'(.*)\'\s*\:\s*(.*)$/.exec(i);if(a){var o=a[1];switch(i=a[2],o){case"assign":o="="}r=Math.max(t.line.indexOf(o,r),0)}else r=0;e(c("| ",6)),e(c("^^^",r+3)+"\n","font-weight:bold"),e(c("| ",6)),e(i+"\n","font-weight:bold")}),e(c("| ",6)+"\n")}else e(c(t.number,4)+"| "),e(t.line+"\n","color:red")}),"undefined"!=typeof document?(i[0]=n.join("%c"),console.log.apply(console,i)):console.log(n.join(""))}}),r.raise("Error compiling "+s+" shader, "+l[0].name)}}function x(t,e,n,i,a){if(!t.getProgramParameter(e,t.LINK_STATUS)){var o=t.getProgramInfoLog(e),s=v(n,a),l=v(i,a),u='Error linking program with vertex shader, "'+l[0].name+'", and fragment shader "'+s[0].name+'"';"undefined"!=typeof document?console.log("%c"+u+"\n%c"+o,"color:red;text-decoration:underline;font-weight:bold","color:red"):console.log(u+"\n"+o),r.raise(u)}}function _(t){t._commandRef=p()}function w(t,e,r,n){function i(t){return t?n.id(t):0}function a(t,e){Object.keys(e).forEach(function(e){t[n.id(e)]=!0})}_(t),t._fragId=i(t.static.frag),t._vertId=i(t.static.vert);var o=t._uniformSet={};a(o,e.static),a(o,e.dynamic);var s=t._attributeSet={};a(s,r.static),a(s,r.dynamic),t._hasCount="count"in t.static||"count"in t.dynamic||"elements"in t.static||"elements"in t.dynamic}function M(t,r){var n=m();e(t+" in command "+(r||p())+("unknown"===n?"":" called from "+n))}function k(t,e,r){t||M(e,r||p())}function A(t,e,r,i){t in e||M("unknown parameter ("+t+")"+n(r)+". possible values: "+Object.keys(e).join(),i||p())}function T(t,e,r,i){typeof t!==e&&M("invalid parameter type"+n(r)+". expected "+e+", got "+typeof t,i||p())}function S(t){t()}function E(t,e,r){t.texture?l(t.texture._texture.internalformat,e,"unsupported texture format for attachment"):l(t.renderbuffer._renderbuffer.format,r,"unsupported renderbuffer format for attachment")}function L(t,e){return t===ue||t===le||t===ce?2:t===he?4:fe[t]*e}function C(t){return!(t&t-1||!t)}function z(t,e,n){var i,a=e.width,o=e.height,s=e.channels;r(a>0&&a<=n.maxTextureSize&&o>0&&o<=n.maxTextureSize,"invalid texture shape"),t.wrapS===ee&&t.wrapT===ee||r(C(a)&&C(o),"incompatible wrap mode for texture, both width and height must be power of 2"),1===e.mipmask?1!==a&&1!==o&&r(t.minFilter!==ne&&t.minFilter!==ae&&t.minFilter!==ie&&t.minFilter!==oe,"min filter requires mipmap"):(r(C(a)&&C(o),"texture must be a square power of 2 to support mipmapping"),r(e.mipmask===(a<<1)-1,"missing or incomplete mipmap data")),e.type===se&&(n.extensions.indexOf("oes_texture_float_linear")<0&&r(t.minFilter===re&&t.magFilter===re,"filter not supported, must enable oes_texture_float_linear"),r(!t.genMipmaps,"mipmap generation not supported with float textures"));var l=e.images;for(i=0;i<16;++i)if(l[i]){var u=a>>i,c=o>>i;r(e.mipmask&1<<i,"missing mipmap data");var h=l[i];if(r(h.width===u&&h.height===c,"invalid shape for mip images"),r(h.format===e.format&&h.internalformat===e.internalformat&&h.type===e.type,"incompatible type for mip image"),h.compressed);else if(h.data){var f=Math.ceil(L(h.type,s)*u/h.unpackAlignment)*h.unpackAlignment;r(h.data.byteLength===f*c,"invalid data for image, buffer size is inconsistent with image format")}else h.element||h.copy}else t.genMipmaps||r(0==(e.mipmask&1<<i),"extra mipmap data");e.compressed&&r(!t.genMipmaps,"mipmap generation for compressed images not supported")}function D(t,e,n,i){var a=t.width,o=t.height,s=t.channels;r(a>0&&a<=i.maxTextureSize&&o>0&&o<=i.maxTextureSize,"invalid texture shape"),r(a===o,"cube map must be square"),r(e.wrapS===ee&&e.wrapT===ee,"wrap mode not supported by cube map");for(var l=0;l<n.length;++l){var u=n[l];r(u.width===a&&u.height===o,"inconsistent cube map face shape"),e.genMipmaps&&(r(!u.compressed,"can not generate mipmap for compressed textures"),r(1===u.mipmask,"can not specify mipmaps and generate mipmaps"));for(var c=u.images,h=0;h<16;++h){var f=c[h];if(f){var d=a>>h,p=o>>h;r(u.mipmask&1<<h,"missing mipmap data"),r(f.width===d&&f.height===p,"invalid shape for mip images"),r(f.format===t.format&&f.internalformat===t.internalformat&&f.type===t.type,"incompatible type for mip image"),f.compressed||(f.data?r(f.data.byteLength===d*p*Math.max(L(f.type,s),f.unpackAlignment),"invalid data for image, buffer size is inconsistent with image format"):f.element||f.copy)}}}}function I(t,e){this.id=pe++,this.type=t,this.data=e}function P(t){return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function O(t){if(0===t.length)return[];var e=t.charAt(0),r=t.charAt(t.length-1);if(t.length>1&&e===r&&('"'===e||"'"===e))return['"'+P(t.substr(1,t.length-2))+'"'];var n=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(t);if(n)return O(t.substr(0,n.index)).concat(O(n[1])).concat(O(t.substr(n.index+n[0].length)));var i=t.split(".");if(1===i.length)return['"'+P(t)+'"'];for(var a=[],o=0;o<i.length;++o)a=a.concat(O(i[o]));return a}function j(t){return"["+O(t).join("][")+"]"}function F(t,e){return new I(t,j(e+""))}function R(t){return"function"==typeof t&&!t._reglType||t instanceof I}function N(t,e){return"function"==typeof t?new I(me,t):t}function B(){var t={"":0},e=[""];return{id:function(r){var n=t[r];return n||(n=t[r]=e.length,e.push(r),n)},str:function(t){return e[t]}}}function U(t,e,r){function n(){var e=window.innerWidth,n=window.innerHeight;if(t!==document.body){var i=t.getBoundingClientRect();e=i.right-i.left,n=i.bottom-i.top}a.width=r*e,a.height=r*n,$t(a.style,{width:e+"px",height:n+"px"})}function i(){window.removeEventListener("resize",n),t.removeChild(a)}var a=document.createElement("canvas");return $t(a.style,{border:0,margin:0,padding:0,top:0,left:0}),t.appendChild(a),t===document.body&&(a.style.position="absolute",$t(t.style,{margin:0,padding:0})),window.addEventListener("resize",n,!1),n(),{canvas:a,onDestroy:i}}function V(t,e){function r(r){try{return t.getContext(r,e)}catch(t){return null}}return r("webgl")||r("experimental-webgl")||r("webgl-experimental")}function q(t){return"string"==typeof t.nodeName&&"function"==typeof t.appendChild&&"function"==typeof t.getBoundingClientRect}function H(t){return"function"==typeof t.drawArrays||"function"==typeof t.drawElements}function G(t){return"string"==typeof t?t.split():(de(Array.isArray(t),"invalid extension array"),t)}function Y(t){return"string"==typeof t?(de("undefined"!=typeof document,"not supported outside of DOM"),document.querySelector(t)):t}function X(t){var e,r,n,i,a=t||{},o={},s=[],l=[],u="undefined"==typeof window?1:window.devicePixelRatio,c=!1,h=function(t){t&&de.raise(t)},f=function(){};if("string"==typeof a?(de("undefined"!=typeof document,"selector queries only supported in DOM enviroments"),e=document.querySelector(a),de(e,"invalid query string for element")):"object"==typeof a?q(a)?e=a:H(a)?(i=a,n=i.canvas):(de.constructor(a),"gl"in a?i=a.gl:"canvas"in a?n=Y(a.canvas):"container"in a&&(r=Y(a.container)),"attributes"in a&&(o=a.attributes,de.type(o,"object","invalid context attributes")),"extensions"in a&&(s=G(a.extensions)),"optionalExtensions"in a&&(l=G(a.optionalExtensions)),"onDone"in a&&(de.type(a.onDone,"function","invalid or missing onDone callback"),h=a.onDone),"profile"in a&&(c=!!a.profile),"pixelRatio"in a&&(u=+a.pixelRatio,de(u>0,"invalid pixel ratio"))):de.raise("invalid arguments to regl"),e&&("canvas"===e.nodeName.toLowerCase()?n=e:r=e),!i){if(!n){de("undefined"!=typeof document,"must manually specify webgl context outside of DOM environments");var d=U(r||document.body,h,u);if(!d)return null;n=d.canvas,f=d.onDestroy}i=V(n,o)}return i?{gl:i,canvas:n,container:r,extensions:s,optionalExtensions:l,pixelRatio:u,profile:c,onDone:h,onDestroy:f}:(f(),h("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function W(t,e){function r(e){de.type(e,"string","extension name must be string");var r,i=e.toLowerCase();try{r=n[i]=t.getExtension(i)}catch(t){}return!!r}for(var n={},i=0;i<e.extensions.length;++i){var a=e.extensions[i];if(!r(a))return e.onDestroy(),e.onDone('"'+a+'" extension is not supported by the current WebGL context, try upgrading your system or a different browser'),null}return e.optionalExtensions.forEach(r),{extensions:n,restore:function(){Object.keys(n).forEach(function(t){if(!r(t))throw new Error("(regl): error restoring extension "+t)})}}}function Z(t){return!!t&&"object"==typeof t&&Array.isArray(t.shape)&&Array.isArray(t.stride)&&"number"==typeof t.offset&&t.shape.length===t.stride.length&&(Array.isArray(t.data)||Qt(t.data))}function J(t,e){for(var r=Array(t),n=0;n<t;++n)r[n]=e(n);return r}function K(t){for(var e=16;e<=1<<28;e*=16)if(t<=e)return e;return 0}function Q(t){var e,r;return e=(t>65535)<<4,t>>>=e,r=(t>255)<<3,t>>>=r,e|=r,r=(t>15)<<2,t>>>=r,e|=r,r=(t>3)<<1,t>>>=r,(e|=r)|t>>1}function $(t){var e=K(t),r=Ee[Q(e)>>2];return r.length>0?r.pop():new ArrayBuffer(e)}function tt(t){Ee[Q(t.byteLength)>>2].push(t)}function et(t,e){var r=null;switch(t){case _e:r=new Int8Array($(e),0,e);break;case we:r=new Uint8Array($(e),0,e);break;case Me:r=new Int16Array($(2*e),0,e);break;case ke:r=new Uint16Array($(2*e),0,e);break;case Ae:r=new Int32Array($(4*e),0,e);break;case Te:r=new Uint32Array($(4*e),0,e);break;case Se:r=new Float32Array($(4*e),0,e);break;default:return null}return r.length!==e?r.subarray(0,e):r}function rt(t){tt(t.buffer)}function nt(t,e,r){for(var n=0;n<e;++n)r[n]=t[n]}function it(t,e,r,n){for(var i=0,a=0;a<e;++a)for(var o=t[a],s=0;s<r;++s)n[i++]=o[s]}function at(t,e,r,n,i,a){for(var o=a,s=0;s<e;++s)for(var l=t[s],u=0;u<r;++u)for(var c=l[u],h=0;h<n;++h)i[o++]=c[h]}function ot(t,e,r,n,i){for(var a=1,o=r+1;o<e.length;++o)a*=e[o];var s=e[r];if(e.length-r==4){var l=e[r+1],u=e[r+2],c=e[r+3];for(o=0;o<s;++o)at(t[o],l,u,c,n,i),i+=a}else for(o=0;o<s;++o)ot(t[o],e,r+1,n,i),i+=a}function st(t,e,r,n){var i=1;if(e.length)for(var a=0;a<e.length;++a)i*=e[a];else i=0;var o=n||Le.allocType(r,i);switch(e.length){case 0:break;case 1:nt(t,e[0],o);break;case 2:it(t,e[0],e[1],o);break;case 3:at(t,e[0],e[1],e[2],o,0);break;default:ot(t,e,0,o,0)}return o}function lt(t){for(var e=[],r=t;r.length;r=r[0])e.push(r.length);return e}function ut(t){return 0|Kt[Object.prototype.toString.call(t)]}function ct(t,e){for(var r=0;r<e.length;++r)t[r]=e[r]}function ht(t,e,r,n,i,a,o){for(var s=0,l=0;l<r;++l)for(var u=0;u<n;++u)t[s++]=e[i*l+a*u+o]}function ft(t,e,r){function n(e){this.id=h++,this.buffer=t.createBuffer(),this.type=e,this.usage=Oe,this.byteLength=0,this.dimension=1,this.dtype=Fe,this.persistentData=null,r.profile&&(this.stats={size:0})}function i(t,e){var r=d.pop();return r||(r=new n(t)),r.bind(),s(r,e,je,0,1,!1),r}function a(t){d.push(t)}function o(e,r,n){e.byteLength=r.byteLength,t.bufferData(e.type,r,n)}function s(t,e,r,n,i,a){var s;if(t.usage=r,Array.isArray(e)){if(t.dtype=n||Re,e.length>0){var l;if(Array.isArray(e[0])){s=Pe(e);for(var u=1,c=1;c<s.length;++c)u*=s[c];t.dimension=u,l=Ie(e,s,t.dtype),o(t,l,r),a?t.persistentData=l:Le.freeType(l)}else if("number"==typeof e[0]){t.dimension=i;var h=Le.allocType(t.dtype,e.length);ct(h,e),o(t,h,r),a?t.persistentData=h:Le.freeType(h)}else Qt(e[0])?(t.dimension=e[0].length,t.dtype=n||ut(e[0])||Re,l=Ie(e,[e.length,e[0].length],t.dtype),o(t,l,r),a?t.persistentData=l:Le.freeType(l)):de.raise("invalid buffer data")}}else if(Qt(e))t.dtype=n||ut(e),t.dimension=i,o(t,e,r),a&&(t.persistentData=new Uint8Array(new Uint8Array(e.buffer)));else if(Z(e)){s=e.shape;var f=e.stride,d=e.offset,p=0,m=0,v=0,g=0;1===s.length?(p=s[0],m=1,v=f[0],g=0):2===s.length?(p=s[0],m=s[1],v=f[0],g=f[1]):de.raise("invalid shape"),t.dtype=n||ut(e.data)||Re,t.dimension=m;var y=Le.allocType(t.dtype,p*m);ht(y,e.data,p,m,v,g,d),o(t,y,r),a?t.persistentData=y:Le.freeType(y)}else de.raise("invalid buffer data")}function l(r){e.bufferCount--;var n=r.buffer;de(n,"buffer must not be deleted already"),t.deleteBuffer(n),r.buffer=null,delete f[r.id]}function u(i,a,o,u){function c(e){var n=Oe,i=null,a=0,o=0,l=1;return Array.isArray(e)||Qt(e)||Z(e)?i=e:"number"==typeof e?a=0|e:e&&(de.type(e,"object","buffer arguments must be an object, a number or an array"),"data"in e&&(de(null===i||Array.isArray(i)||Qt(i)||Z(i),"invalid data for buffer"),i=e.data),"usage"in e&&(de.parameter(e.usage,De,"invalid buffer usage"),n=De[e.usage]),"type"in e&&(de.parameter(e.type,ze,"invalid buffer type"),o=ze[e.type]),"dimension"in e&&(de.type(e.dimension,"number","invalid dimension"),l=0|e.dimension),"length"in e&&(de.nni(a,"buffer length must be a nonnegative integer"),a=0|e.length)),p.bind(),i?s(p,i,n,o,l,u):(t.bufferData(p.type,a,n),p.dtype=o||Fe,p.usage=n,p.dimension=l,p.byteLength=a),r.profile&&(p.stats.size=p.byteLength*Ne[p.dtype]),c}function h(e,r){de(r+e.byteLength<=p.byteLength,"invalid buffer subdata call, buffer is too small. Can't write data of size "+e.byteLength+" starting from offset "+r+" to a buffer of size "+p.byteLength),t.bufferSubData(p.type,r,e)}function d(t,e){var r,n=0|(e||0);if(p.bind(),Array.isArray(t)){if(t.length>0)if("number"==typeof t[0]){var i=Le.allocType(p.dtype,t.length);ct(i,t),h(i,n),Le.freeType(i)}else if(Array.isArray(t[0])||Qt(t[0])){r=Pe(t);var a=Ie(t,r,p.dtype);h(a,n),Le.freeType(a)}else de.raise("invalid buffer data")}else if(Qt(t))h(t,n);else if(Z(t)){r=t.shape;var o=t.stride,s=0,l=0,u=0,f=0;1===r.length?(s=r[0],l=1,u=o[0],f=0):2===r.length?(s=r[0],l=r[1],u=o[0],f=o[1]):de.raise("invalid shape");var d=Array.isArray(t.data)?p.dtype:ut(t.data),m=Le.allocType(d,s*l);ht(m,t.data,s,l,u,f,t.offset),h(m,n),Le.freeType(m)}else de.raise("invalid data for buffer subdata");return c}e.bufferCount++;var p=new n(a);return f[p.id]=p,o||c(i),c._reglType="buffer",c._buffer=p,c.subdata=d,r.profile&&(c.stats=p.stats),c.destroy=function(){l(p)},c}function c(){xe(f).forEach(function(e){e.buffer=t.createBuffer(),t.bindBuffer(e.type,e.buffer),t.bufferData(e.type,e.persistentData||e.byteLength,e.usage)})}var h=0,f={};n.prototype.bind=function(){t.bindBuffer(this.type,this.buffer)},n.prototype.destroy=function(){l(this)};var d=[];return r.profile&&(e.getTotalBufferSize=function(){var t=0;return Object.keys(f).forEach(function(e){t+=f[e].stats.size}),t}),{create:u,createStream:i,destroyStream:a,clear:function(){xe(f).forEach(l),d.forEach(l)},getBuffer:function(t){return t&&t._buffer instanceof n?t._buffer:null},restore:c,_initBuffer:s}}function dt(t,e,r,n){function i(t){this.id=h++,c[this.id]=this,this.buffer=t,this.primType=qe,this.vertCount=0,this.type=0}function a(t){var e=d.pop();return e||(e=new i(r.create(null,Je,!0,!1)._buffer)),s(e,t,Ke,-1,-1,0,0),e}function o(t){d.push(t)}function s(n,i,a,o,s,l,u){if(n.buffer.bind(),i){var c=u;u||Qt(i)&&(!Z(i)||Qt(i.data))||(c=e.oes_element_index_uint?Ze:Xe),r._initBuffer(n.buffer,i,a,c,3)}else t.bufferData(Je,l,a),n.buffer.dtype=h||Ge,n.buffer.usage=a,n.buffer.dimension=3,n.buffer.byteLength=l;var h=u;if(!u){switch(n.buffer.dtype){case Ge:case He:h=Ge;break;case Xe:case Ye:h=Xe;break;case Ze:case We:h=Ze;break;default:de.raise("unsupported type for element array")}n.buffer.dtype=h}n.type=h,de(h!==Ze||!!e.oes_element_index_uint,"32 bit element buffers not supported, enable oes_element_index_uint first");var f=s;f<0&&(f=n.buffer.byteLength,h===Xe?f>>=1:h===Ze&&(f>>=2)),n.vertCount=f;var d=o;if(o<0){d=qe;var p=n.buffer.dimension;1===p&&(d=Ue),2===p&&(d=Ve),3===p&&(d=qe)}n.primType=d}function l(t){n.elementsCount--,de(null!==t.buffer,"must not double destroy elements"),delete c[t.id],t.buffer.destroy(),t.buffer=null}function u(t,e){function a(t){if(t)if("number"==typeof t)o(t),u.primType=qe,u.vertCount=0|t,u.type=Ge;else{var e=null,r=Qe,n=-1,i=-1,l=0,c=0;Array.isArray(t)||Qt(t)||Z(t)?e=t:(de.type(t,"object","invalid arguments for elements"),"data"in t&&(e=t.data,de(Array.isArray(e)||Qt(e)||Z(e),"invalid data for element buffer")),"usage"in t&&(de.parameter(t.usage,De,"invalid element buffer usage"),r=De[t.usage]),"primitive"in t&&(de.parameter(t.primitive,Be,"invalid element buffer primitive"),n=Be[t.primitive]),"count"in t&&(de("number"==typeof t.count&&t.count>=0,"invalid vertex count for elements"),i=0|t.count),"type"in t&&(de.parameter(t.type,f,"invalid buffer type"),c=f[t.type]),"length"in t?l=0|t.length:(l=i,c===Xe||c===Ye?l*=2:c!==Ze&&c!==We||(l*=4))),s(u,e,r,n,i,l,c)}else o(),u.primType=qe,u.vertCount=0,u.type=Ge;return a}var o=r.create(null,Je,!0),u=new i(o._buffer);return n.elementsCount++,a(t),a._reglType="elements",a._elements=u,a.subdata=function(t,e){return o.subdata(t,e),a},a.destroy=function(){l(u)},a}var c={},h=0,f={uint8:Ge,uint16:Xe};e.oes_element_index_uint&&(f.uint32=Ze),i.prototype.bind=function(){this.buffer.bind()};var d=[];return{create:u,createStream:a,destroyStream:o,getElements:function(t){return"function"==typeof t&&t._elements instanceof i?t._elements:null},clear:function(){xe(c).forEach(l)}}}function pt(t){for(var e=Le.allocType(er,t.length),r=0;r<t.length;++r)if(isNaN(t[r]))e[r]=65535;else if(1/0===t[r])e[r]=31744;else if(t[r]===-1/0)e[r]=64512;else{$e[0]=t[r];var n=tr[0],i=n>>>31<<15,a=(n<<1>>>24)-127,o=n>>13&1023;if(a<-24)e[r]=i;else if(a<-14){var s=-14-a;e[r]=i+(o+1024>>s)}else e[r]=a>15?i+31744:i+(a+15<<10)+o}return e}function mt(t){return Array.isArray(t)||Qt(t)}function vt(t){return"[object "+t+"]"}function gt(t){return Array.isArray(t)&&(0===t.length||"number"==typeof t[0])}function yt(t){return!!Array.isArray(t)&&!(0===t.length||!mt(t[0]))}function bt(t){return Object.prototype.toString.call(t)}function xt(t){return bt(t)===dn}function _t(t){return bt(t)===pn}function wt(t){return bt(t)===mn}function Mt(t){return bt(t)===vn}function kt(t){if(!t)return!1;var e=bt(t);return gn.indexOf(e)>=0||(gt(t)||yt(t)||Z(t))}function At(t){return 0|Kt[Object.prototype.toString.call(t)]}function Tt(t,e){var r=e.length;switch(t.type){case Or:case jr:case Fr:case Rr:var n=Le.allocType(t.type,r);n.set(e),t.data=n;break;case wr:t.data=pt(e);break;default:de.raise("unsupported texture type, must specify a typed array")}}function St(t,e){return Le.allocType(t.type===wr?Rr:t.type,e)}function Et(t,e){t.type===wr?(t.data=pt(e),Le.freeType(e)):t.data=e}function Lt(t,e,r,n,i,a){for(var o=t.width,s=t.height,l=t.channels,u=o*s*l,c=St(t,u),h=0,f=0;f<s;++f)for(var d=0;d<o;++d)for(var p=0;p<l;++p)c[h++]=e[r*d+n*f+i*p+a];Et(t,c)}function Ct(t,e,r,n,i,a){var o;if(o=void 0!==bn[t]?bn[t]:fn[t]*yn[e],a&&(o*=6),i){for(var s=0,l=r;l>=1;)s+=o*l*l,l/=2;return s}return o*r*n}function zt(t,e,r,n,i,a,o){function s(){this.internalformat=or,this.format=or,this.type=Or,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=0,this.width=0,this.height=0,this.channels=0}function l(t,e){t.internalformat=e.internalformat,t.format=e.format,t.type=e.type,t.compressed=e.compressed,t.premultiplyAlpha=e.premultiplyAlpha,t.flipY=e.flipY,t.unpackAlignment=e.unpackAlignment,t.colorSpace=e.colorSpace,t.width=e.width,t.height=e.height,t.channels=e.channels}function u(t,n){if("object"==typeof n&&n){if("premultiplyAlpha"in n&&(de.type(n.premultiplyAlpha,"boolean","invalid premultiplyAlpha"),t.premultiplyAlpha=n.premultiplyAlpha),"flipY"in n&&(de.type(n.flipY,"boolean","invalid texture flip"),t.flipY=n.flipY),"alignment"in n&&(de.oneOf(n.alignment,[1,2,4,8],"invalid texture unpack alignment"),t.unpackAlignment=n.alignment),"colorSpace"in n&&(de.parameter(n.colorSpace,R,"invalid colorSpace"),t.colorSpace=R[n.colorSpace]),"type"in n){var i=n.type;de(e.oes_texture_float||!("float"===i||"float32"===i),"you must enable the OES_texture_float extension in order to use floating point textures."),de(e.oes_texture_half_float||!("half float"===i||"float16"===i),"you must enable the OES_texture_half_float extension in order to use 16-bit floating point textures."),de(e.webgl_depth_texture||!("uint16"===i||"uint32"===i||"depth stencil"===i),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),de.parameter(i,N,"invalid texture type"),t.type=N[i]}var a=t.width,o=t.height,s=t.channels,l=!1;"shape"in n?(de(Array.isArray(n.shape)&&n.shape.length>=2,"shape must be an array"),a=n.shape[0],o=n.shape[1],3===n.shape.length&&(s=n.shape[2],de(s>0&&s<=4,"invalid number of channels"),l=!0),de(a>=0&&a<=r.maxTextureSize,"invalid width"),de(o>=0&&o<=r.maxTextureSize,"invalid height")):("radius"in n&&(a=o=n.radius,de(a>=0&&a<=r.maxTextureSize,"invalid radius")),"width"in n&&(a=n.width,de(a>=0&&a<=r.maxTextureSize,"invalid width")),"height"in n&&(o=n.height,de(o>=0&&o<=r.maxTextureSize,"invalid height")),"channels"in n&&(s=n.channels,de(s>0&&s<=4,"invalid number of channels"),l=!0)),t.width=0|a,t.height=0|o,t.channels=0|s;var u=!1;if("format"in n){var c=n.format;de(e.webgl_depth_texture||!("depth"===c||"depth stencil"===c),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),de.parameter(c,B,"invalid texture format");var h=t.internalformat=B[c];t.format=J[h],c in N&&("type"in n||(t.type=N[c])),c in U&&(t.compressed=!0),u=!0}!l&&u?t.channels=fn[t.format]:l&&!u?t.channels!==hn[t.format]&&(t.format=t.internalformat=hn[t.channels]):u&&l&&de(t.channels===fn[t.format],"number of channels inconsistent with specified format")}}function c(e){t.pixelStorei(an,e.flipY),t.pixelStorei(on,e.premultiplyAlpha),t.pixelStorei(sn,e.colorSpace),t.pixelStorei(nn,e.unpackAlignment)}function h(){s.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function f(t,e){var n=null;if(kt(e)?n=e:e&&(de.type(e,"object","invalid pixel data type"),u(t,e),"x"in e&&(t.xOffset=0|e.x),"y"in e&&(t.yOffset=0|e.y),kt(e.data)&&(n=e.data)),de(!t.compressed||n instanceof Uint8Array,"compressed texture data must be stored in a uint8array"),e.copy){de(!n,"can not specify copy and data field for the same texture");var a=i.viewportWidth,o=i.viewportHeight;t.width=t.width||a-t.xOffset,t.height=t.height||o-t.yOffset,t.needsCopy=!0,de(t.xOffset>=0&&t.xOffset<a&&t.yOffset>=0&&t.yOffset<o&&t.width>0&&t.width<=a&&t.height>0&&t.height<=o,"copy texture read out of bounds")}else if(n){if(Qt(n))t.channels=t.channels||4,t.data=n,"type"in e||t.type!==Or||(t.type=At(n));else if(gt(n))t.channels=t.channels||4,Tt(t,n),t.alignment=1,t.needsFree=!0;else if(Z(n)){var s=n.data;Array.isArray(s)||t.type!==Or||(t.type=At(s));var l,c,h,f,d,p,m=n.shape,v=n.stride;3===m.length?(h=m[2],p=v[2]):(de(2===m.length,"invalid ndarray pixel data, must be 2 or 3D"),h=1,p=1),l=m[0],c=m[1],f=v[0],d=v[1],t.alignment=1,t.width=l,t.height=c,t.channels=h,t.format=t.internalformat=hn[h],t.needsFree=!0,Lt(t,s,f,d,p,n.offset)}else if(xt(n)||_t(n))xt(n)?t.element=n:t.element=n.canvas,t.width=t.element.width,t.height=t.element.height,t.channels=4;else if(wt(n))t.element=n,t.width=n.naturalWidth,t.height=n.naturalHeight,t.channels=4;else if(Mt(n))t.element=n,t.width=n.videoWidth,t.height=n.videoHeight,t.channels=4;else if(yt(n)){var g=t.width||n[0].length,y=t.height||n.length,b=t.channels;b=mt(n[0][0])?b||n[0][0].length:b||1;for(var x=Ce.shape(n),_=1,w=0;w<x.length;++w)_*=x[w];var M=St(t,_);Ce.flatten(n,x,"",M),Et(t,M),t.alignment=1,t.width=g,t.height=y,t.channels=b,
43 t.format=t.internalformat=hn[b],t.needsFree=!0}}else t.width=t.width||1,t.height=t.height||1,t.channels=t.channels||4;t.type===Rr?de(r.extensions.indexOf("oes_texture_float")>=0,"oes_texture_float extension not enabled"):t.type===wr&&de(r.extensions.indexOf("oes_texture_half_float")>=0,"oes_texture_half_float extension not enabled")}function d(e,r,i){var a=e.element,o=e.data,s=e.internalformat,l=e.format,u=e.type,h=e.width,f=e.height;c(e),a?t.texImage2D(r,i,l,l,u,a):e.compressed?t.compressedTexImage2D(r,i,s,h,f,0,o):e.needsCopy?(n(),t.copyTexImage2D(r,i,l,e.xOffset,e.yOffset,h,f,0)):t.texImage2D(r,i,l,h,f,0,l,u,o)}function p(e,r,i,a,o){var s=e.element,l=e.data,u=e.internalformat,h=e.format,f=e.type,d=e.width,p=e.height;c(e),s?t.texSubImage2D(r,o,i,a,h,f,s):e.compressed?t.compressedTexSubImage2D(r,o,i,a,u,d,p,l):e.needsCopy?(n(),t.copyTexSubImage2D(r,o,i,a,e.xOffset,e.yOffset,d,p)):t.texSubImage2D(r,o,i,a,d,p,h,f,l)}function m(){return K.pop()||new h}function v(t){t.needsFree&&Le.freeType(t.data),h.call(t),K.push(t)}function g(){s.call(this),this.genMipmaps=!1,this.mipmapHint=$r,this.mipmask=0,this.images=Array(16)}function y(t,e,r){var n=t.images[0]=m();t.mipmask=1,n.width=t.width=e,n.height=t.height=r,n.channels=t.channels=4}function b(t,e){var r=null;if(kt(e))r=t.images[0]=m(),l(r,t),f(r,e),t.mipmask=1;else if(u(t,e),Array.isArray(e.mipmap))for(var n=e.mipmap,i=0;i<n.length;++i)r=t.images[i]=m(),l(r,t),r.width>>=i,r.height>>=i,f(r,n[i]),t.mipmask|=1<<i;else r=t.images[0]=m(),l(r,t),f(r,e),t.mipmask=1;l(t,t.images[0]),(t.compressed&&t.internalformat===Mr||t.internalformat===kr||t.internalformat===Ar||t.internalformat===Tr)&&de(t.width%4==0&&t.height%4==0,"for compressed texture formats, mipmap level 0 must have width and height that are a multiple of 4")}function x(t,e){for(var r=t.images,n=0;n<r.length;++n){if(!r[n])return;d(r[n],e,n)}}function _(){var t=Q.pop()||new g;s.call(t),t.mipmask=0;for(var e=0;e<16;++e)t.images[e]=null;return t}function w(t){for(var e=t.images,r=0;r<e.length;++r)e[r]&&v(e[r]),e[r]=null;Q.push(t)}function M(){this.minFilter=Yr,this.magFilter=Yr,this.wrapS=Vr,this.wrapT=Vr,this.anisotropic=1,this.genMipmaps=!1,this.mipmapHint=$r}function k(t,e){if("min"in e){var n=e.min;de.parameter(n,F),t.minFilter=F[n],cn.indexOf(t.minFilter)>=0&&(t.genMipmaps=!0)}if("mag"in e){var i=e.mag;de.parameter(i,j),t.magFilter=j[i]}var a=t.wrapS,o=t.wrapT;if("wrap"in e){var s=e.wrap;"string"==typeof s?(de.parameter(s,O),a=o=O[s]):Array.isArray(s)&&(de.parameter(s[0],O),de.parameter(s[1],O),a=O[s[0]],o=O[s[1]])}else{if("wrapS"in e){var l=e.wrapS;de.parameter(l,O),a=O[l]}if("wrapT"in e){var u=e.wrapT;de.parameter(u,O),o=O[u]}}if(t.wrapS=a,t.wrapT=o,"anisotropic"in e){var c=e.anisotropic;de("number"==typeof c&&c>=1&&c<=r.maxAnisotropic,"aniso samples must be between 1 and "),t.anisotropic=e.anisotropic}if("mipmap"in e){var h=!1;switch(typeof e.mipmap){case"string":de.parameter(e.mipmap,P,"invalid mipmap hint"),t.mipmapHint=P[e.mipmap],t.genMipmaps=!0,h=!0;break;case"boolean":h=t.genMipmaps=e.mipmap;break;case"object":de(Array.isArray(e.mipmap),"invalid mipmap type"),t.genMipmaps=!1,h=!0;break;default:de.raise("invalid mipmap type")}!h||"min"in e||(t.minFilter=Wr)}}function A(r,n){t.texParameteri(n,Gr,r.minFilter),t.texParameteri(n,Hr,r.magFilter),t.texParameteri(n,Nr,r.wrapS),t.texParameteri(n,Br,r.wrapT),e.ext_texture_filter_anisotropic&&t.texParameteri(n,rn,r.anisotropic),r.genMipmaps&&(t.hint(Qr,r.mipmapHint),t.generateMipmap(n))}function T(e){s.call(this),this.mipmask=0,this.internalformat=or,this.id=$++,this.refCount=1,this.target=e,this.texture=t.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new M,o.profile&&(this.stats={size:0})}function S(e){t.activeTexture(un),t.bindTexture(e.target,e.texture)}function E(){var e=rt[0];e?t.bindTexture(e.target,e.texture):t.bindTexture(nr,null)}function L(e){var r=e.texture;de(r,"must not double destroy texture");var n=e.unit,i=e.target;n>=0&&(t.activeTexture(un+n),t.bindTexture(i,null),rt[n]=null),t.deleteTexture(r),e.texture=null,e.params=null,e.pixels=null,e.refCount=0,delete tt[e.id],a.textureCount--}function C(e,n){function i(t,e){var n=c.texInfo;M.call(n);var a=_();return"number"==typeof t?"number"==typeof e?y(a,0|t,0|e):y(a,0|t,0|t):t?(de.type(t,"object","invalid arguments to regl.texture"),k(n,t),b(a,t)):y(a,1,1),n.genMipmaps&&(a.mipmask=(a.width<<1)-1),c.mipmask=a.mipmask,l(c,a),de.texture2D(n,a,r),c.internalformat=a.internalformat,i.width=a.width,i.height=a.height,S(c),x(a,nr),A(n,nr),E(),w(a),o.profile&&(c.stats.size=Ct(c.internalformat,c.type,a.width,a.height,n.genMipmaps,!1)),i.format=H[c.internalformat],i.type=G[c.type],i.mag=Y[n.magFilter],i.min=X[n.minFilter],i.wrapS=W[n.wrapS],i.wrapT=W[n.wrapT],i}function s(t,e,r,n){de(!!t,"must specify image data");var a=0|e,o=0|r,s=0|n,u=m();return l(u,c),u.width=0,u.height=0,f(u,t),u.width=u.width||(c.width>>s)-a,u.height=u.height||(c.height>>s)-o,de(c.type===u.type&&c.format===u.format&&c.internalformat===u.internalformat,"incompatible format for texture.subimage"),de(a>=0&&o>=0&&a+u.width<=c.width&&o+u.height<=c.height,"texture.subimage write out of bounds"),de(c.mipmask&1<<s,"missing mipmap data"),de(u.data||u.element||u.needsCopy,"missing image data"),S(c),p(u,nr,a,o,s),E(),v(u),i}function u(e,r){var n=0|e,a=0|r||n;if(n===c.width&&a===c.height)return i;i.width=c.width=n,i.height=c.height=a,S(c);for(var s=0;c.mipmask>>s;++s)t.texImage2D(nr,s,c.format,n>>s,a>>s,0,c.format,c.type,null);return E(),o.profile&&(c.stats.size=Ct(c.internalformat,c.type,n,a,!1,!1)),i}var c=new T(nr);return tt[c.id]=c,a.textureCount++,i(e,n),i.subimage=s,i.resize=u,i._reglType="texture2d",i._texture=c,o.profile&&(i.stats=c.stats),i.destroy=function(){c.decRef()},i}function z(e,n,i,s,c,h){function d(t,e,n,i,a,s){var c,h=C.texInfo;for(M.call(h),c=0;c<6;++c)z[c]=_();if("number"!=typeof t&&t)if("object"==typeof t)if(e)b(z[0],t),b(z[1],e),b(z[2],n),b(z[3],i),b(z[4],a),b(z[5],s);else if(k(h,t),u(C,t),"faces"in t){var f=t.faces;for(de(Array.isArray(f)&&6===f.length,"cube faces must be a length 6 array"),c=0;c<6;++c)de("object"==typeof f[c]&&!!f[c],"invalid input for cube map face"),l(z[c],C),b(z[c],f[c])}else for(c=0;c<6;++c)b(z[c],t);else de.raise("invalid arguments to cube map");else{var p=0|t||1;for(c=0;c<6;++c)y(z[c],p,p)}for(l(C,z[0]),h.genMipmaps?C.mipmask=(z[0].width<<1)-1:C.mipmask=z[0].mipmask,de.textureCube(C,h,z,r),C.internalformat=z[0].internalformat,d.width=z[0].width,d.height=z[0].height,S(C),c=0;c<6;++c)x(z[c],ar+c);for(A(h,ir),E(),o.profile&&(C.stats.size=Ct(C.internalformat,C.type,d.width,d.height,h.genMipmaps,!0)),d.format=H[C.internalformat],d.type=G[C.type],d.mag=Y[h.magFilter],d.min=X[h.minFilter],d.wrapS=W[h.wrapS],d.wrapT=W[h.wrapT],c=0;c<6;++c)w(z[c]);return d}function g(t,e,r,n,i){de(!!e,"must specify image data"),de("number"==typeof t&&t===(0|t)&&t>=0&&t<6,"invalid face");var a=0|r,o=0|n,s=0|i,u=m();return l(u,C),u.width=0,u.height=0,f(u,e),u.width=u.width||(C.width>>s)-a,u.height=u.height||(C.height>>s)-o,de(C.type===u.type&&C.format===u.format&&C.internalformat===u.internalformat,"incompatible format for texture.subimage"),de(a>=0&&o>=0&&a+u.width<=C.width&&o+u.height<=C.height,"texture.subimage write out of bounds"),de(C.mipmask&1<<s,"missing mipmap data"),de(u.data||u.element||u.needsCopy,"missing image data"),S(C),p(u,ar+t,a,o,s),E(),v(u),d}function L(e){var r=0|e;if(r!==C.width){d.width=C.width=r,d.height=C.height=r,S(C);for(var n=0;n<6;++n)for(var i=0;C.mipmask>>i;++i)t.texImage2D(ar+n,i,C.format,r>>i,r>>i,0,C.format,C.type,null);return E(),o.profile&&(C.stats.size=Ct(C.internalformat,C.type,d.width,d.height,!1,!0)),d}}var C=new T(ir);tt[C.id]=C,a.cubeCount++;var z=new Array(6);return d(e,n,i,s,c,h),d.subimage=g,d.resize=L,d._reglType="textureCube",d._texture=C,o.profile&&(d.stats=C.stats),d.destroy=function(){C.decRef()},d}function D(){for(var e=0;e<et;++e)t.activeTexture(un+e),t.bindTexture(nr,null),rt[e]=null;xe(tt).forEach(L),a.cubeCount=0,a.textureCount=0}function I(){xe(tt).forEach(function(e){e.texture=t.createTexture(),t.bindTexture(e.target,e.texture);for(var r=0;r<32;++r)if(0!=(e.mipmask&1<<r))if(e.target===nr)t.texImage2D(nr,r,e.internalformat,e.width>>r,e.height>>r,0,e.internalformat,e.type,null);else for(var n=0;n<6;++n)t.texImage2D(ar+n,r,e.internalformat,e.width>>r,e.height>>r,0,e.internalformat,e.type,null);A(e.texInfo,e.target)})}var P={"don't care":$r,"dont care":$r,nice:en,fast:tn},O={repeat:Ur,clamp:Vr,mirror:qr},j={nearest:Yr,linear:Xr},F=$t({mipmap:Kr,"nearest mipmap nearest":Wr,"linear mipmap nearest":Zr,"nearest mipmap linear":Jr,"linear mipmap linear":Kr},j),R={none:0,browser:ln},N={uint8:Or,rgba4:pr,rgb565:vr,"rgb5 a1":mr},B={alpha:sr,luminance:ur,"luminance alpha":cr,rgb:lr,rgba:or,rgba4:hr,"rgb5 a1":fr,rgb565:dr},U={};e.ext_srgb&&(B.srgb=xr,B.srgba=_r),e.oes_texture_float&&(N.float32=N.float=Rr),e.oes_texture_half_float&&(N.float16=N["half float"]=wr),e.webgl_depth_texture&&($t(B,{depth:yr,"depth stencil":br}),$t(N,{uint16:jr,uint32:Fr,"depth stencil":gr})),e.webgl_compressed_texture_s3tc&&$t(U,{"rgb s3tc dxt1":Mr,"rgba s3tc dxt1":kr,"rgba s3tc dxt3":Ar,"rgba s3tc dxt5":Tr}),e.webgl_compressed_texture_atc&&$t(U,{"rgb atc":Sr,"rgba atc explicit alpha":Er,"rgba atc interpolated alpha":Lr}),e.webgl_compressed_texture_pvrtc&&$t(U,{"rgb pvrtc 4bppv1":Cr,"rgb pvrtc 2bppv1":zr,"rgba pvrtc 4bppv1":Dr,"rgba pvrtc 2bppv1":Ir}),e.webgl_compressed_texture_etc1&&(U["rgb etc1"]=Pr);var V=Array.prototype.slice.call(t.getParameter(rr));Object.keys(U).forEach(function(t){var e=U[t];V.indexOf(e)>=0&&(B[t]=e)});var q=Object.keys(B);r.textureFormats=q;var H=[];Object.keys(B).forEach(function(t){var e=B[t];H[e]=t});var G=[];Object.keys(N).forEach(function(t){var e=N[t];G[e]=t});var Y=[];Object.keys(j).forEach(function(t){var e=j[t];Y[e]=t});var X=[];Object.keys(F).forEach(function(t){var e=F[t];X[e]=t});var W=[];Object.keys(O).forEach(function(t){var e=O[t];W[e]=t});var J=q.reduce(function(t,e){var r=B[e];return r===ur||r===sr||r===ur||r===cr||r===yr||r===br?t[r]=r:r===fr||e.indexOf("rgba")>=0?t[r]=or:t[r]=lr,t},{}),K=[],Q=[],$=0,tt={},et=r.maxTextureUnits,rt=Array(et).map(function(){return null});return $t(T.prototype,{bind:function(){var e=this;e.bindCount+=1;var r=e.unit;if(r<0){for(var n=0;n<et;++n){var i=rt[n];if(i){if(i.bindCount>0)continue;i.unit=-1}rt[n]=e,r=n;break}r>=et&&de.raise("insufficient number of texture units"),o.profile&&a.maxTextureUnits<r+1&&(a.maxTextureUnits=r+1),e.unit=r,t.activeTexture(un+r),t.bindTexture(e.target,e.texture)}return r},unbind:function(){this.bindCount-=1},decRef:function(){--this.refCount<=0&&L(this)}}),o.profile&&(a.getTotalTextureSize=function(){var t=0;return Object.keys(tt).forEach(function(e){t+=tt[e].stats.size}),t}),{create2D:C,createCube:z,clear:D,getTexture:function(t){return null},restore:I}}function Dt(t,e,r){return wn[t]*e*r}function It(t,e,r,n,i,a){function o(t,e,r){this.target=t,this.texture=e,this.renderbuffer=r;var n=0,i=0;e?(n=e.width,i=e.height):r&&(n=r.width,i=r.height),this.width=n,this.height=i}function s(t){t&&(t.texture&&t.texture._texture.decRef(),t.renderbuffer&&t.renderbuffer._renderbuffer.decRef())}function l(t,e,r){if(t)if(t.texture){var n=t.texture._texture,i=Math.max(1,n.width),a=Math.max(1,n.height);de(i===e&&a===r,"inconsistent width/height for supplied texture"),n.refCount+=1}else{var o=t.renderbuffer._renderbuffer;de(o.width===e&&o.height===r,"inconsistent width/height for renderbuffer"),o.refCount+=1}}function u(e,r){r&&(r.texture?t.framebufferTexture2D(kn,e,r.target,r.texture._texture.texture,0):t.framebufferRenderbuffer(kn,e,An,r.renderbuffer._renderbuffer.renderbuffer))}function c(t){var e=Tn,r=null,n=null,i=t;"object"==typeof t&&(i=t.data,"target"in t&&(e=0|t.target)),de.type(i,"function","invalid attachment data");var a=i._reglType;return"texture2d"===a?(r=i,de(e===Tn)):"textureCube"===a?(r=i,de(e>=Sn&&e<Sn+6,"invalid cube map target")):"renderbuffer"===a?(n=i,e=An):de.raise("invalid regl object for attachment"),new o(e,r,n)}function h(t,e,r,a,s){if(r){var l=n.create2D({width:t,height:e,format:a,type:s});return l._texture.refCount=0,new o(Tn,l,null)}var u=i.create({width:t,height:e,format:a});return u._renderbuffer.refCount=0,new o(An,null,u)}function f(t){return t&&(t.texture||t.renderbuffer)}function d(t,e,r){t&&(t.texture?t.texture.resize(e,r):t.renderbuffer&&t.renderbuffer.resize(e,r))}function p(){this.id=A++,T[this.id]=this,this.framebuffer=t.createFramebuffer(),this.width=0,this.height=0,this.colorAttachments=[],this.depthAttachment=null,this.stencilAttachment=null,this.depthStencilAttachment=null}function m(t){t.colorAttachments.forEach(s),s(t.depthAttachment),s(t.stencilAttachment),s(t.depthStencilAttachment)}function v(e){var r=e.framebuffer;de(r,"must not double destroy framebuffer"),t.deleteFramebuffer(r),e.framebuffer=null,a.framebufferCount--,delete T[e.id]}function g(e){var n;t.bindFramebuffer(kn,e.framebuffer);var i=e.colorAttachments;for(n=0;n<i.length;++n)u(En+n,i[n]);for(n=i.length;n<r.maxColorAttachments;++n)t.framebufferTexture2D(kn,En+n,Tn,null,0);t.framebufferTexture2D(kn,zn,Tn,null,0),t.framebufferTexture2D(kn,Ln,Tn,null,0),t.framebufferTexture2D(kn,Cn,Tn,null,0),u(Ln,e.depthAttachment),u(Cn,e.stencilAttachment),u(zn,e.depthStencilAttachment);var a=t.checkFramebufferStatus(kn);a!==Dn&&de.raise("framebuffer configuration not supported, status = "+Un[a]),t.bindFramebuffer(kn,_.next),_.cur=_.next,t.getError()}function y(t,n){function i(t,n){var a;de(_.next!==s,"can not update framebuffer which is currently in use");var o=e.webgl_draw_buffers,u=0,d=0,p=!0,v=!0,y=null,b=!0,x="rgba",A="uint8",T=1,S=null,E=null,L=null,C=!1;if("number"==typeof t)u=0|t,d=0|n||u;else if(t){de.type(t,"object","invalid arguments for framebuffer");var z=t;if("shape"in z){var D=z.shape;de(Array.isArray(D)&&D.length>=2,"invalid shape for framebuffer"),u=D[0],d=D[1]}else"radius"in z&&(u=d=z.radius),"width"in z&&(u=z.width),"height"in z&&(d=z.height);("color"in z||"colors"in z)&&(y=z.color||z.colors,Array.isArray(y)&&de(1===y.length||o,"multiple render targets not supported")),y||("colorCount"in z&&(T=0|z.colorCount,de(T>0,"invalid color buffer count")),"colorTexture"in z&&(b=!!z.colorTexture,x="rgba4"),"colorType"in z&&(A=z.colorType,b?(de(e.oes_texture_float||!("float"===A||"float32"===A),"you must enable OES_texture_float in order to use floating point framebuffer objects"),de(e.oes_texture_half_float||!("half float"===A||"float16"===A),"you must enable OES_texture_half_float in order to use 16-bit floating point framebuffer objects")):"half float"===A||"float16"===A?(de(e.ext_color_buffer_half_float,"you must enable EXT_color_buffer_half_float to use 16-bit render buffers"),x="rgba16f"):"float"!==A&&"float32"!==A||(de(e.webgl_color_buffer_float,"you must enable WEBGL_color_buffer_float in order to use 32-bit floating point renderbuffers"),x="rgba32f"),de.oneOf(A,k,"invalid color type")),"colorFormat"in z&&(x=z.colorFormat,w.indexOf(x)>=0?b=!0:M.indexOf(x)>=0?b=!1:b?de.oneOf(z.colorFormat,w,"invalid color format for texture"):de.oneOf(z.colorFormat,M,"invalid color format for renderbuffer"))),("depthTexture"in z||"depthStencilTexture"in z)&&(C=!(!z.depthTexture&&!z.depthStencilTexture),de(!C||e.webgl_depth_texture,"webgl_depth_texture extension not supported")),"depth"in z&&("boolean"==typeof z.depth?p=z.depth:(S=z.depth,v=!1)),"stencil"in z&&("boolean"==typeof z.stencil?v=z.stencil:(E=z.stencil,p=!1)),"depthStencil"in z&&("boolean"==typeof z.depthStencil?p=v=z.depthStencil:(L=z.depthStencil,p=!1,v=!1))}else u=d=1;var I=null,P=null,O=null,j=null;if(Array.isArray(y))I=y.map(c);else if(y)I=[c(y)];else for(I=new Array(T),a=0;a<T;++a)I[a]=h(u,d,b,x,A);de(e.webgl_draw_buffers||I.length<=1,"you must enable the WEBGL_draw_buffers extension in order to use multiple color buffers."),de(I.length<=r.maxColorAttachments,"too many color attachments, not supported"),u=u||I[0].width,d=d||I[0].height,S?P=c(S):p&&!v&&(P=h(u,d,C,"depth","uint32")),E?O=c(E):v&&!p&&(O=h(u,d,!1,"stencil","uint8")),L?j=c(L):!S&&!E&&v&&p&&(j=h(u,d,C,"depth stencil","depth stencil")),de(!!S+!!E+!!L<=1,"invalid framebuffer configuration, can specify exactly one depth/stencil attachment");var F=null;for(a=0;a<I.length;++a)if(l(I[a],u,d),de(!I[a]||I[a].texture&&Pn.indexOf(I[a].texture._texture.format)>=0||I[a].renderbuffer&&Bn.indexOf(I[a].renderbuffer._renderbuffer.format)>=0,"framebuffer color attachment "+a+" is invalid"),I[a]&&I[a].texture){var R=On[I[a].texture._texture.format]*jn[I[a].texture._texture.type];null===F?F=R:de(F===R,"all color attachments much have the same number of bits per pixel.")}return l(P,u,d),de(!P||P.texture&&P.texture._texture.format===In||P.renderbuffer&&P.renderbuffer._renderbuffer.format===Fn,"invalid depth attachment for framebuffer object"),l(O,u,d),de(!O||O.renderbuffer&&O.renderbuffer._renderbuffer.format===Rn,"invalid stencil attachment for framebuffer object"),l(j,u,d),de(!j||j.texture&&j.texture._texture.format===Nn||j.renderbuffer&&j.renderbuffer._renderbuffer.format===Nn,"invalid depth-stencil attachment for framebuffer object"),m(s),s.width=u,s.height=d,s.colorAttachments=I,s.depthAttachment=P,s.stencilAttachment=O,s.depthStencilAttachment=j,i.color=I.map(f),i.depth=f(P),i.stencil=f(O),i.depthStencil=f(j),i.width=s.width,i.height=s.height,g(s),i}function o(t,e){de(_.next!==s,"can not resize a framebuffer which is currently in use");var r=0|t,n=0|e||r;if(r===s.width&&n===s.height)return i;for(var a=s.colorAttachments,o=0;o<a.length;++o)d(a[o],r,n);return d(s.depthAttachment,r,n),d(s.stencilAttachment,r,n),d(s.depthStencilAttachment,r,n),s.width=i.width=r,s.height=i.height=n,g(s),i}var s=new p;return a.framebufferCount++,i(t,n),$t(i,{resize:o,_reglType:"framebuffer",_framebuffer:s,destroy:function(){v(s),m(s)},use:function(t){_.setFBO({framebuffer:i},t)}})}function b(t){function i(t){var r;de(o.indexOf(_.next)<0,"can not update framebuffer which is currently in use");var a=e.webgl_draw_buffers,s={color:null},l=0,u=null,c="rgba",h="uint8",f=1;if("number"==typeof t)l=0|t;else if(t){de.type(t,"object","invalid arguments for framebuffer");var d=t;if("shape"in d){var p=d.shape;de(Array.isArray(p)&&p.length>=2,"invalid shape for framebuffer"),de(p[0]===p[1],"cube framebuffer must be square"),l=p[0]}else"radius"in d&&(l=0|d.radius),"width"in d?(l=0|d.width,"height"in d&&de(d.height===l,"must be square")):"height"in d&&(l=0|d.height);("color"in d||"colors"in d)&&(u=d.color||d.colors,Array.isArray(u)&&de(1===u.length||a,"multiple render targets not supported")),u||("colorCount"in d&&(f=0|d.colorCount,de(f>0,"invalid color buffer count")),"colorType"in d&&(de.oneOf(d.colorType,k,"invalid color type"),h=d.colorType),"colorFormat"in d&&(c=d.colorFormat,de.oneOf(d.colorFormat,w,"invalid color format for texture"))),"depth"in d&&(s.depth=d.depth),"stencil"in d&&(s.stencil=d.stencil),"depthStencil"in d&&(s.depthStencil=d.depthStencil)}else l=1;var m;if(u)if(Array.isArray(u))for(m=[],r=0;r<u.length;++r)m[r]=u[r];else m=[u];else{m=Array(f);var v={radius:l,format:c,type:h};for(r=0;r<f;++r)m[r]=n.createCube(v)}for(s.color=Array(m.length),r=0;r<m.length;++r){var g=m[r];de("function"==typeof g&&"textureCube"===g._reglType,"invalid cube map"),l=l||g.width,de(g.width===l&&g.height===l,"invalid cube map shape"),s.color[r]={target:Sn,data:m[r]}}for(r=0;r<6;++r){for(var b=0;b<m.length;++b)s.color[b].target=Sn+r;r>0&&(s.depth=o[0].depth,s.stencil=o[0].stencil,s.depthStencil=o[0].depthStencil),o[r]?o[r](s):o[r]=y(s)}return $t(i,{width:l,height:l,color:m})}function a(t){var e,n=0|t;if(de(n>0&&n<=r.maxCubeMapSize,"invalid radius for cube fbo"),n===i.width)return i;var a=i.color;for(e=0;e<a.length;++e)a[e].resize(n);for(e=0;e<6;++e)o[e].resize(n);return i.width=i.height=n,i}var o=Array(6);return i(t),$t(i,{faces:o,resize:a,_reglType:"framebufferCube",destroy:function(){o.forEach(function(t){t.destroy()})}})}function x(){xe(T).forEach(function(e){e.framebuffer=t.createFramebuffer(),g(e)})}var _={cur:null,next:null,dirty:!1,setFBO:null},w=["rgba"],M=["rgba4","rgb565","rgb5 a1"];e.ext_srgb&&M.push("srgba"),e.ext_color_buffer_half_float&&M.push("rgba16f","rgb16f"),e.webgl_color_buffer_float&&M.push("rgba32f");var k=["uint8"];e.oes_texture_half_float&&k.push("half float","float16"),e.oes_texture_float&&k.push("float","float32");var A=0,T={};return $t(_,{getFramebuffer:function(t){if("function"==typeof t&&"framebuffer"===t._reglType){var e=t._framebuffer;if(e instanceof p)return e}return null},create:y,createCube:b,clear:function(){xe(T).forEach(v)},restore:x})}function Pt(){this.state=0,this.x=0,this.y=0,this.z=0,this.w=0,this.buffer=null,this.size=0,this.normalized=!1,this.type=Vn,this.offset=0,this.stride=0,this.divisor=0}function Ot(t,e,r,n,i){for(var a=r.maxAttributes,o=new Array(a),s=0;s<a;++s)o[s]=new Pt;return{Record:Pt,scope:{},state:o}}function jt(t,e,r,n){function i(t,e,r,n){this.name=t,this.id=e,this.location=r,this.info=n}function a(t,e){for(var r=0;r<t.length;++r)if(t[r].id===e.id)return void(t[r].location=e.location);t.push(e)}function o(r,n,i){var a=r===qn?c:h,o=a[n];if(!o){var s=e.str(n);o=t.createShader(r),t.shaderSource(o,s),t.compileShader(o),de.shaderError(t,o,s,r,i),a[n]=o}return o}function s(t,e){this.id=p++,this.fragId=t,this.vertId=e,this.program=null,this.uniforms=[],this.attributes=[],n.profile&&(this.stats={uniformsCount:0,attributesCount:0})}function l(r,s){var l,u,c=o(qn,r.fragId),h=o(Hn,r.vertId),f=r.program=t.createProgram();t.attachShader(f,c),t.attachShader(f,h),t.linkProgram(f),de.linkError(t,f,e.str(r.fragId),e.str(r.vertId),s);var d=t.getProgramParameter(f,Gn);n.profile&&(r.stats.uniformsCount=d);var p=r.uniforms;for(l=0;l<d;++l)if(u=t.getActiveUniform(f,l))if(u.size>1)for(var m=0;m<u.size;++m){var v=u.name.replace("[0]","["+m+"]");a(p,new i(v,e.id(v),t.getUniformLocation(f,v),u))}else a(p,new i(u.name,e.id(u.name),t.getUniformLocation(f,u.name),u));var g=t.getProgramParameter(f,Yn);n.profile&&(r.stats.attributesCount=g);var y=r.attributes;for(l=0;l<g;++l)(u=t.getActiveAttrib(f,l))&&a(y,new i(u.name,e.id(u.name),t.getAttribLocation(f,u.name),u))}function u(){c={},h={};for(var t=0;t<d.length;++t)l(d[t])}var c={},h={},f={},d=[],p=0;return n.profile&&(r.getMaxUniformsCount=function(){var t=0;return d.forEach(function(e){e.stats.uniformsCount>t&&(t=e.stats.uniformsCount)}),t},r.getMaxAttributesCount=function(){var t=0;return d.forEach(function(e){e.stats.attributesCount>t&&(t=e.stats.attributesCount)}),t}),{clear:function(){var e=t.deleteShader.bind(t);xe(c).forEach(e),c={},xe(h).forEach(e),h={},d.forEach(function(e){t.deleteProgram(e.program)}),d.length=0,f={},r.shaderCount=0},program:function(t,e,n){de.command(t>=0,"missing vertex shader",n),de.command(e>=0,"missing fragment shader",n);var i=f[e];i||(i=f[e]={});var a=i[t];return a||(a=new s(e,t),r.shaderCount++,l(a,n),i[t]=a,d.push(a)),a},restore:u,shader:o,frag:-1,vert:-1}}function Ft(t,e,r,n,i,a){function o(o){var s;null===e.next?(de(i.preserveDrawingBuffer,'you must create a webgl context with "preserveDrawingBuffer":true in order to read pixels from the drawing buffer'),s=Wn):(de(null!==e.next.colorAttachments[0].texture,"You cannot read from a renderbuffer"),s=e.next.colorAttachments[0].texture._texture.type,a.oes_texture_float?de(s===Wn||s===Jn,"Reading from a framebuffer is only allowed for the types 'uint8' and 'float'"):de(s===Wn,"Reading from a framebuffer is only allowed for the type 'uint8'"));var l=0,u=0,c=n.framebufferWidth,h=n.framebufferHeight,f=null;Qt(o)?f=o:o&&(de.type(o,"object","invalid arguments to regl.read()"),l=0|o.x,u=0|o.y,de(l>=0&&l<n.framebufferWidth,"invalid x offset for regl.read"),de(u>=0&&u<n.framebufferHeight,"invalid y offset for regl.read"),c=0|(o.width||n.framebufferWidth-l),h=0|(o.height||n.framebufferHeight-u),f=o.data||null),f&&(s===Wn?de(f instanceof Uint8Array,"buffer must be 'Uint8Array' when reading from a framebuffer of type 'uint8'"):s===Jn&&de(f instanceof Float32Array,"buffer must be 'Float32Array' when reading from a framebuffer of type 'float'")),de(c>0&&c+l<=n.framebufferWidth,"invalid width for read pixels"),de(h>0&&h+u<=n.framebufferHeight,"invalid height for read pixels"),r();var d=c*h*4;return f||(s===Wn?f=new Uint8Array(d):s===Jn&&(f=f||new Float32Array(d))),de.isTypedArray(f,"data buffer for regl.read() must be a typedarray"),de(f.byteLength>=d,"data buffer for regl.read() too small"),t.pixelStorei(Zn,4),t.readPixels(l,u,c,h,Xn,s,f),f}function s(t){var r;return e.setFBO({framebuffer:t.framebuffer},function(){r=o(t)}),r}function l(t){return t&&"framebuffer"in t?s(t):o(t)}return l}function Rt(t){return Array.prototype.slice.call(t)}function Nt(t){return Rt(t).join("")}function Bt(){function t(t){for(var e=0;e<l.length;++e)if(l[e]===t)return s[e];var r="g"+o++;return s.push(r),l.push(t),r}function e(){function t(){r.push.apply(r,Rt(arguments))}function e(){var t="v"+o++;return n.push(t),arguments.length>0&&(r.push(t,"="),r.push.apply(r,Rt(arguments)),r.push(";")),t}var r=[],n=[];return $t(t,{def:e,toString:function(){return Nt([n.length>0?"var "+n+";":"",Nt(r)])}})}function r(){function t(t,e){n(t,e,"=",r.def(t,e),";")}var r=e(),n=e(),i=r.toString,a=n.toString;return $t(function(){r.apply(r,Rt(arguments))},{def:r.def,entry:r,exit:n,save:t,set:function(e,n,i){t(e,n),r(e,n,"=",i,";")},toString:function(){return i()+a()}})}function n(){var t=Nt(arguments),e=r(),n=r(),i=e.toString,a=n.toString;return $t(e,{then:function(){return e.apply(e,Rt(arguments)),this},else:function(){return n.apply(n,Rt(arguments)),this},toString:function(){var e=a();return e&&(e="else{"+e+"}"),Nt(["if(",t,"){",i(),"}",e])}})}function i(t,e){function n(){var t="a"+i.length;return i.push(t),t}var i=[];e=e||0;for(var a=0;a<e;++a)n();var o=r(),s=o.toString;return c[t]=$t(o,{arg:n,toString:function(){return Nt(["function(",i.join(),"){",s(),"}"])}})}function a(){var t=['"use strict";',u,"return {"];Object.keys(c).forEach(function(e){t.push('"',e,'":',c[e].toString(),",")}),t.push("}");var e=Nt(t).replace(/;/g,";\n").replace(/}/g,"}\n").replace(/{/g,"{\n");return Function.apply(null,s.concat(e)).apply(null,l)}var o=0,s=[],l=[],u=e(),c={};return{global:u,link:t,block:e,proc:i,scope:r,cond:n,compile:a}}function Ut(t){return Array.isArray(t)||Qt(t)||Z(t)}function Vt(t){return t.sort(function(t,e){return t===Di?-1:e===Di?1:t<e?-1:1})}function qt(t,e,r,n){this.thisDep=t,this.contextDep=e,this.propDep=r,this.append=n}function Ht(t){return t&&!(t.thisDep||t.contextDep||t.propDep)}function Gt(t){return new qt(!1,!1,!1,t)}function Yt(t,e){var r=t.type;if(r===ei){var n=t.data.length;return new qt(!0,n>=1,n>=2,e)}if(r===ai){var i=t.data;return new qt(i.thisDep,i.contextDep,i.propDep,e)}return new qt(r===ii,r===ni,r===ri,e)}function Xt(t,e,r,n,i,a,o,s,l,u,c,h,f,d,p){function m(t){return t.replace(".","_")}function v(t,e,r){var n=m(t);et.push(t),tt[n]=$[n]=!!r,rt[n]=e}function g(t,e,r){var n=m(t);et.push(t),Array.isArray(r)?($[n]=r.slice(),tt[n]=r.slice()):$[n]=tt[n]=r,nt[n]=e}function y(){var t=Bt(),r=t.link,n=t.global;t.id=ot++,t.batchId="0";var i=r(it),a=t.shared={props:"a0"};Object.keys(it).forEach(function(t){a[t]=n.def(i,".",t)}),de.optional(function(){t.CHECK=r(de),t.commandStr=de.guessCommand(),t.command=r(t.commandStr),t.assert=function(t,e,n){t("if(!(",e,"))",this.CHECK,".commandRaise(",r(n),",",this.command,");")},at.invalidBlendCombinations=Ua});var o=t.next={},s=t.current={};Object.keys(nt).forEach(function(t){Array.isArray($[t])&&(o[t]=n.def(a.next,".",t),s[t]=n.def(a.current,".",t))});var l=t.constants={};Object.keys(at).forEach(function(t){l[t]=n.def(JSON.stringify(at[t]))}),t.invoke=function(e,n){switch(n.type){case ei:var i=["this",a.context,a.props,t.batchId];return e.def(r(n.data),".call(",i.slice(0,Math.max(n.data.length+1,4)),")");case ri:return e.def(a.props,n.data);case ni:return e.def(a.context,n.data);case ii:return e.def("this",n.data);case ai:return n.data.append(t,e),n.data.ref}},t.attribCache={};var c={};return t.scopeAttrib=function(t){var n=e.id(t);if(n in c)return c[n];var i=u.scope[n];return i||(i=u.scope[n]=new W),c[n]=r(i)},t}function b(t){var e,r=t.static,n=t.dynamic;if(Ii in r){var i=!!r[Ii];e=Gt(function(t,e){return i}),e.enable=i}else if(Ii in n){var a=n[Ii];e=Yt(a,function(t,e){return t.invoke(e,a)})}return e}function x(t,e){var r=t.static,n=t.dynamic;if(Pi in r){var i=r[Pi];return i?(i=s.getFramebuffer(i),de.command(i,"invalid framebuffer object"),Gt(function(t,e){var r=t.link(i),n=t.shared;e.set(n.framebuffer,".next",r);var a=n.context;return e.set(a,"."+Vi,r+".width"),e.set(a,"."+qi,r+".height"),r})):Gt(function(t,e){var r=t.shared;e.set(r.framebuffer,".next","null");var n=r.context;return e.set(n,"."+Vi,n+"."+Yi),e.set(n,"."+qi,n+"."+Xi),"null"})}if(Pi in n){var a=n[Pi];return Yt(a,function(t,e){var r=t.invoke(e,a),n=t.shared,i=n.framebuffer,o=e.def(i,".getFramebuffer(",r,")");de.optional(function(){t.assert(e,"!"+r+"||"+o,"invalid framebuffer object")}),e.set(i,".next",o);var s=n.context;return e.set(s,"."+Vi,o+"?"+o+".width:"+s+"."+Yi),e.set(s,"."+qi,o+"?"+o+".height:"+s+"."+Xi),o})}return null}function _(t,e,r){function n(t){if(t in i){var n=i[t];de.commandType(n,"object","invalid "+t,r.commandStr);var o,s,l=!0,u=0|n.x,c=0|n.y;return"width"in n?(o=0|n.width,de.command(o>=0,"invalid "+t,r.commandStr)):l=!1,"height"in n?(s=0|n.height,de.command(s>=0,"invalid "+t,r.commandStr)):l=!1,new qt(!l&&e&&e.thisDep,!l&&e&&e.contextDep,!l&&e&&e.propDep,function(t,e){var r=t.shared.context,i=o;"width"in n||(i=e.def(r,".",Vi,"-",u));var a=s;return"height"in n||(a=e.def(r,".",qi,"-",c)),[u,c,i,a]})}if(t in a){var h=a[t],f=Yt(h,function(e,r){var n=e.invoke(r,h);de.optional(function(){e.assert(r,n+"&&typeof "+n+'==="object"',"invalid "+t)});var i=e.shared.context,a=r.def(n,".x|0"),o=r.def(n,".y|0"),s=r.def('"width" in ',n,"?",n,".width|0:","(",i,".",Vi,"-",a,")"),l=r.def('"height" in ',n,"?",n,".height|0:","(",i,".",qi,"-",o,")");return de.optional(function(){e.assert(r,s+">=0&&"+l+">=0","invalid "+t)}),[a,o,s,l]});return e&&(f.thisDep=f.thisDep||e.thisDep,f.contextDep=f.contextDep||e.contextDep,f.propDep=f.propDep||e.propDep),f}return e?new qt(e.thisDep,e.contextDep,e.propDep,function(t,e){var r=t.shared.context;return[0,0,e.def(r,".",Vi),e.def(r,".",qi)]}):null}var i=t.static,a=t.dynamic,o=n(Di);if(o){var s=o;o=new qt(o.thisDep,o.contextDep,o.propDep,function(t,e){var r=s.append(t,e),n=t.shared.context;return e.set(n,"."+Hi,r[2]),e.set(n,"."+Gi,r[3]),r})}return{viewport:o,scissor_box:n(zi)}}function w(t){function r(t){if(t in i){var r=e.id(i[t]);de.optional(function(){c.shader(Ha[t],r,de.guessCommand())});var n=Gt(function(){return r});return n.id=r,n}if(t in a){var o=a[t];return Yt(o,function(e,r){var n=e.invoke(r,o),i=r.def(e.shared.strings,".id(",n,")");return de.optional(function(){r(e.shared.shader,".shader(",Ha[t],",",i,",",e.command,");")}),i})}return null}var n,i=t.static,a=t.dynamic,o=r(ji),s=r(Oi),l=null;return Ht(o)&&Ht(s)?(l=c.program(s.id,o.id),n=Gt(function(t,e){return t.link(l)})):n=new qt(o&&o.thisDep||s&&s.thisDep,o&&o.contextDep||s&&s.contextDep,o&&o.propDep||s&&s.propDep,function(t,e){var r,n=t.shared.shader;r=o?o.append(t,e):e.def(n,".",ji);var i;i=s?s.append(t,e):e.def(n,".",Oi);var a=n+".program("+i+","+r;return de.optional(function(){a+=","+t.command}),e.def(a+")")}),{frag:o,vert:s,progVar:n,program:l}}function M(t,e){function r(t,r){if(t in n){var a=0|n[t];return de.command(!r||a>=0,"invalid "+t,e.commandStr),Gt(function(t,e){return r&&(t.OFFSET=a),a})}if(t in i){var s=i[t];return Yt(s,function(e,n){var i=e.invoke(n,s);return r&&(e.OFFSET=i,de.optional(function(){e.assert(n,i+">=0","invalid "+t)})),i})}return r&&o?Gt(function(t,e){return t.OFFSET="0",0}):null}var n=t.static,i=t.dynamic,o=function(){if(Fi in n){var t=n[Fi];Ut(t)?t=a.getElements(a.create(t,!0)):t&&(t=a.getElements(t),de.command(t,"invalid elements",e.commandStr));var r=Gt(function(e,r){if(t){var n=e.link(t)
44 ;return e.ELEMENTS=n,n}return e.ELEMENTS=null,null});return r.value=t,r}if(Fi in i){var o=i[Fi];return Yt(o,function(t,e){var r=t.shared,n=r.isBufferArgs,i=r.elements,a=t.invoke(e,o),s=e.def("null"),l=e.def(n,"(",a,")"),u=t.cond(l).then(s,"=",i,".createStream(",a,");").else(s,"=",i,".getElements(",a,");");return de.optional(function(){t.assert(u.else,"!"+a+"||"+s,"invalid elements")}),e.entry(u),e.exit(t.cond(l).then(i,".destroyStream(",s,");")),t.ELEMENTS=s,s})}return null}(),s=r(Bi,!0);return{elements:o,primitive:function(){if(Ri in n){var t=n[Ri];return de.commandParameter(t,Be,"invalid primitve",e.commandStr),Gt(function(e,r){return Be[t]})}if(Ri in i){var r=i[Ri];return Yt(r,function(t,e){var n=t.constants.primTypes,i=t.invoke(e,r);return de.optional(function(){t.assert(e,i+" in "+n,"invalid primitive, must be one of "+Object.keys(Be))}),e.def(n,"[",i,"]")})}return o?Ht(o)?Gt(o.value?function(t,e){return e.def(t.ELEMENTS,".primType")}:function(){return Aa}):new qt(o.thisDep,o.contextDep,o.propDep,function(t,e){var r=t.ELEMENTS;return e.def(r,"?",r,".primType:",Aa)}):null}(),count:function(){if(Ni in n){var t=0|n[Ni];return de.command("number"==typeof t&&t>=0,"invalid vertex count",e.commandStr),Gt(function(){return t})}if(Ni in i){var r=i[Ni];return Yt(r,function(t,e){var n=t.invoke(e,r);return de.optional(function(){t.assert(e,"typeof "+n+'==="number"&&'+n+">=0&&"+n+"===("+n+"|0)","invalid vertex count")}),n})}if(o){if(Ht(o)){if(o)return s?new qt(s.thisDep,s.contextDep,s.propDep,function(t,e){var r=e.def(t.ELEMENTS,".vertCount-",t.OFFSET);return de.optional(function(){t.assert(e,r+">=0","invalid vertex offset/element buffer too small")}),r}):Gt(function(t,e){return e.def(t.ELEMENTS,".vertCount")});var a=Gt(function(){return-1});return de.optional(function(){a.MISSING=!0}),a}var l=new qt(o.thisDep||s.thisDep,o.contextDep||s.contextDep,o.propDep||s.propDep,function(t,e){var r=t.ELEMENTS;return t.OFFSET?e.def(r,"?",r,".vertCount-",t.OFFSET,":-1"):e.def(r,"?",r,".vertCount:-1")});return de.optional(function(){l.DYNAMIC=!0}),l}return null}(),instances:r(Ui,!1),offset:s}}function k(t,e){var r=t.static,i=t.dynamic,a={};return et.forEach(function(t){function o(e,n){if(t in r){var o=e(r[t]);a[s]=Gt(function(){return o})}else if(t in i){var l=i[t];a[s]=Yt(l,function(t,e){return n(t,e,t.invoke(e,l))})}}var s=m(t);switch(t){case vi:case si:case oi:case Ai:case hi:case Ci:case xi:case wi:case Mi:case pi:return o(function(r){return de.commandType(r,"boolean",t,e.commandStr),r},function(e,r,n){return de.optional(function(){e.assert(r,"typeof "+n+'==="boolean"',"invalid flag "+t,e.commandStr)}),n});case fi:return o(function(r){return de.commandParameter(r,Va,"invalid "+t,e.commandStr),Va[r]},function(e,r,n){var i=e.constants.compareFuncs;return de.optional(function(){e.assert(r,n+" in "+i,"invalid "+t+", must be one of "+Object.keys(Va))}),r.def(i,"[",n,"]")});case di:return o(function(t){return de.command(mt(t)&&2===t.length&&"number"==typeof t[0]&&"number"==typeof t[1]&&t[0]<=t[1],"depth range is 2d array",e.commandStr),t},function(t,e,r){return de.optional(function(){t.assert(e,t.shared.isArrayLike+"("+r+")&&"+r+".length===2&&typeof "+r+'[0]==="number"&&typeof '+r+'[1]==="number"&&'+r+"[0]<="+r+"[1]","depth range must be a 2d array")}),[e.def("+",r,"[0]"),e.def("+",r,"[1]")]});case ci:return o(function(t){de.commandType(t,"object","blend.func",e.commandStr);var r="srcRGB"in t?t.srcRGB:t.src,n="srcAlpha"in t?t.srcAlpha:t.src,i="dstRGB"in t?t.dstRGB:t.dst,a="dstAlpha"in t?t.dstAlpha:t.dst;return de.commandParameter(r,Ba,s+".srcRGB",e.commandStr),de.commandParameter(n,Ba,s+".srcAlpha",e.commandStr),de.commandParameter(i,Ba,s+".dstRGB",e.commandStr),de.commandParameter(a,Ba,s+".dstAlpha",e.commandStr),de.command(Ua.indexOf(r+", "+i)===-1,"unallowed blending combination (srcRGB, dstRGB) = ("+r+", "+i+")",e.commandStr),[Ba[r],Ba[i],Ba[n],Ba[a]]},function(e,r,n){function i(i,o){var s=r.def('"',i,o,'" in ',n,"?",n,".",i,o,":",n,".",i);return de.optional(function(){e.assert(r,s+" in "+a,"invalid "+t+"."+i+o+", must be one of "+Object.keys(Ba))}),s}var a=e.constants.blendFuncs;de.optional(function(){e.assert(r,n+"&&typeof "+n+'==="object"',"invalid blend func, must be an object")});var o=i("src","RGB"),s=i("dst","RGB");de.optional(function(){var t=e.constants.invalidBlendCombinations;e.assert(r,t+".indexOf("+o+'+", "+'+s+") === -1 ","unallowed blending combination for (srcRGB, dstRGB)")});var l=r.def(a,"[",o,"]"),u=r.def(a,"[",i("src","Alpha"),"]");return[l,r.def(a,"[",s,"]"),u,r.def(a,"[",i("dst","Alpha"),"]")]});case ui:return o(function(r){return"string"==typeof r?(de.commandParameter(r,Z,"invalid "+t,e.commandStr),[Z[r],Z[r]]):"object"==typeof r?(de.commandParameter(r.rgb,Z,t+".rgb",e.commandStr),de.commandParameter(r.alpha,Z,t+".alpha",e.commandStr),[Z[r.rgb],Z[r.alpha]]):void de.commandRaise("invalid blend.equation",e.commandStr)},function(e,r,n){var i=e.constants.blendEquations,a=r.def(),o=r.def(),s=e.cond("typeof ",n,'==="string"');return de.optional(function(){function r(t,r,n){e.assert(t,n+" in "+i,"invalid "+r+", must be one of "+Object.keys(Z))}r(s.then,t,n),e.assert(s.else,n+"&&typeof "+n+'==="object"',"invalid "+t),r(s.else,t+".rgb",n+".rgb"),r(s.else,t+".alpha",n+".alpha")}),s.then(a,"=",o,"=",i,"[",n,"];"),s.else(a,"=",i,"[",n,".rgb];",o,"=",i,"[",n,".alpha];"),r(s),[a,o]});case li:return o(function(t){return de.command(mt(t)&&4===t.length,"blend.color must be a 4d array",e.commandStr),J(4,function(e){return+t[e]})},function(t,e,r){return de.optional(function(){t.assert(e,t.shared.isArrayLike+"("+r+")&&"+r+".length===4","blend.color must be a 4d array")}),J(4,function(t){return e.def("+",r,"[",t,"]")})});case Ti:return o(function(t){return de.commandType(t,"number",s,e.commandStr),0|t},function(t,e,r){return de.optional(function(){t.assert(e,"typeof "+r+'==="number"',"invalid stencil.mask")}),e.def(r,"|0")});case Si:return o(function(r){de.commandType(r,"object",s,e.commandStr);var n=r.cmp||"keep",i=r.ref||0,a="mask"in r?r.mask:-1;return de.commandParameter(n,Va,t+".cmp",e.commandStr),de.commandType(i,"number",t+".ref",e.commandStr),de.commandType(a,"number",t+".mask",e.commandStr),[Va[n],i,a]},function(t,e,r){var n=t.constants.compareFuncs;return de.optional(function(){function i(){t.assert(e,Array.prototype.join.call(arguments,""),"invalid stencil.func")}i(r+"&&typeof ",r,'==="object"'),i('!("cmp" in ',r,")||(",r,".cmp in ",n,")")}),[e.def('"cmp" in ',r,"?",n,"[",r,".cmp]",":",Ia),e.def(r,".ref|0"),e.def('"mask" in ',r,"?",r,".mask|0:-1")]});case Ei:case Li:return o(function(r){de.commandType(r,"object",s,e.commandStr);var n=r.fail||"keep",i=r.zfail||"keep",a=r.zpass||"keep";return de.commandParameter(n,qa,t+".fail",e.commandStr),de.commandParameter(i,qa,t+".zfail",e.commandStr),de.commandParameter(a,qa,t+".zpass",e.commandStr),[t===Li?Sa:Ta,qa[n],qa[i],qa[a]]},function(e,r,n){function i(i){return de.optional(function(){e.assert(r,'!("'+i+'" in '+n+")||("+n+"."+i+" in "+a+")","invalid "+t+"."+i+", must be one of "+Object.keys(qa))}),r.def('"',i,'" in ',n,"?",a,"[",n,".",i,"]:",Ia)}var a=e.constants.stencilOps;return de.optional(function(){e.assert(r,n+"&&typeof "+n+'==="object"',"invalid "+t)}),[t===Li?Sa:Ta,i("fail"),i("zfail"),i("zpass")]});case _i:return o(function(t){de.commandType(t,"object",s,e.commandStr);var r=0|t.factor,n=0|t.units;return de.commandType(r,"number",s+".factor",e.commandStr),de.commandType(n,"number",s+".units",e.commandStr),[r,n]},function(e,r,n){return de.optional(function(){e.assert(r,n+"&&typeof "+n+'==="object"',"invalid "+t)}),[r.def(n,".factor|0"),r.def(n,".units|0")]});case gi:return o(function(t){var r=0;return"front"===t?r=Ta:"back"===t&&(r=Sa),de.command(!!r,s,e.commandStr),r},function(t,e,r){return de.optional(function(){t.assert(e,r+'==="front"||'+r+'==="back"',"invalid cull.face")}),e.def(r,'==="front"?',Ta,":",Sa)});case bi:return o(function(t){return de.command("number"==typeof t&&t>=n.lineWidthDims[0]&&t<=n.lineWidthDims[1],"invalid line width, must positive number between "+n.lineWidthDims[0]+" and "+n.lineWidthDims[1],e.commandStr),t},function(t,e,r){return de.optional(function(){t.assert(e,"typeof "+r+'==="number"&&'+r+">="+n.lineWidthDims[0]+"&&"+r+"<="+n.lineWidthDims[1],"invalid line width")}),r});case yi:return o(function(t){return de.commandParameter(t,Ga,s,e.commandStr),Ga[t]},function(t,e,r){return de.optional(function(){t.assert(e,r+'==="cw"||'+r+'==="ccw"',"invalid frontFace, must be one of cw,ccw")}),e.def(r+'==="cw"?'+Ea+":"+La)});case mi:return o(function(t){return de.command(mt(t)&&4===t.length,"color.mask must be length 4 array",e.commandStr),t.map(function(t){return!!t})},function(t,e,r){return de.optional(function(){t.assert(e,t.shared.isArrayLike+"("+r+")&&"+r+".length===4","invalid color.mask")}),J(4,function(t){return"!!"+r+"["+t+"]"})});case ki:return o(function(t){de.command("object"==typeof t&&t,s,e.commandStr);var r="value"in t?t.value:1,n=!!t.invert;return de.command("number"==typeof r&&r>=0&&r<=1,"sample.coverage.value must be a number between 0 and 1",e.commandStr),[r,n]},function(t,e,r){return de.optional(function(){t.assert(e,r+"&&typeof "+r+'==="object"',"invalid sample.coverage")}),[e.def('"value" in ',r,"?+",r,".value:1"),e.def("!!",r,".invert")]})}}),a}function A(t,e){var r=t.static,n=t.dynamic,i={};return Object.keys(r).forEach(function(t){var n,a=r[t];if("number"==typeof a||"boolean"==typeof a)n=Gt(function(){return a});else if("function"==typeof a){var o=a._reglType;"texture2d"===o||"textureCube"===o?n=Gt(function(t){return t.link(a)}):"framebuffer"===o||"framebufferCube"===o?(de.command(a.color.length>0,'missing color attachment for framebuffer sent to uniform "'+t+'"',e.commandStr),n=Gt(function(t){return t.link(a.color[0])})):de.commandRaise('invalid data for uniform "'+t+'"',e.commandStr)}else mt(a)?n=Gt(function(e){return e.global.def("[",J(a.length,function(r){return de.command("number"==typeof a[r]||"boolean"==typeof a[r],"invalid uniform "+t,e.commandStr),a[r]}),"]")}):de.commandRaise('invalid or missing data for uniform "'+t+'"',e.commandStr);n.value=a,i[t]=n}),Object.keys(n).forEach(function(t){var e=n[t];i[t]=Yt(e,function(t,r){return t.invoke(r,e)})}),i}function T(t,r){var n=t.static,a=t.dynamic,o={};return Object.keys(n).forEach(function(t){var a=n[t],s=e.id(t),l=new W;if(Ut(a))l.state=$n,l.buffer=i.getBuffer(i.create(a,Zi,!1,!0)),l.type=0;else{var u=i.getBuffer(a);if(u)l.state=$n,l.buffer=u,l.type=0;else if(de.command("object"==typeof a&&a,"invalid data for attribute "+t,r.commandStr),a.constant){var c=a.constant;l.buffer="null",l.state=ti,"number"==typeof c?l.x=c:(de.command(mt(c)&&c.length>0&&c.length<=4,"invalid constant for attribute "+t,r.commandStr),Kn.forEach(function(t,e){e<c.length&&(l[t]=c[e])}))}else{u=Ut(a.buffer)?i.getBuffer(i.create(a.buffer,Zi,!1,!0)):i.getBuffer(a.buffer),de.command(!!u,'missing buffer for attribute "'+t+'"',r.commandStr);var h=0|a.offset;de.command(h>=0,'invalid offset for attribute "'+t+'"',r.commandStr);var f=0|a.stride;de.command(f>=0&&f<256,'invalid stride for attribute "'+t+'", must be integer betweeen [0, 255]',r.commandStr);var d=0|a.size;de.command(!("size"in a)||d>0&&d<=4,'invalid size for attribute "'+t+'", must be 1,2,3,4',r.commandStr);var p=!!a.normalized,m=0;"type"in a&&(de.commandParameter(a.type,ze,"invalid type for attribute "+t,r.commandStr),m=ze[a.type]);var v=0|a.divisor;"divisor"in a&&(de.command(0===v||K,'cannot specify divisor for attribute "'+t+'", instancing not supported',r.commandStr),de.command(v>=0,'invalid divisor for attribute "'+t+'"',r.commandStr)),de.optional(function(){var e=r.commandStr,n=["buffer","offset","divisor","normalized","type","size","stride"];Object.keys(a).forEach(function(r){de.command(n.indexOf(r)>=0,'unknown parameter "'+r+'" for attribute pointer "'+t+'" (valid parameters are '+n+")",e)})}),l.buffer=u,l.state=$n,l.size=d,l.normalized=p,l.type=m||u.dtype,l.offset=h,l.stride=f,l.divisor=v}}o[t]=Gt(function(t,e){var r=t.attribCache;if(s in r)return r[s];var n={isStream:!1};return Object.keys(l).forEach(function(t){n[t]=l[t]}),l.buffer&&(n.buffer=t.link(l.buffer),n.type=n.type||n.buffer+".dtype"),r[s]=n,n})}),Object.keys(a).forEach(function(t){function e(e,n){function i(t){n(u[t],"=",a,".",t,"|0;")}var a=e.invoke(n,r),o=e.shared,s=o.isBufferArgs,l=o.buffer;de.optional(function(){e.assert(n,a+"&&(typeof "+a+'==="object"||typeof '+a+'==="function")&&('+s+"("+a+")||"+l+".getBuffer("+a+")||"+l+".getBuffer("+a+".buffer)||"+s+"("+a+'.buffer)||("constant" in '+a+"&&(typeof "+a+'.constant==="number"||'+o.isArrayLike+"("+a+".constant))))",'invalid dynamic attribute "'+t+'"')});var u={isStream:n.def(!1)},c=new W;c.state=$n,Object.keys(c).forEach(function(t){u[t]=n.def(""+c[t])});var h=u.buffer,f=u.type;return n("if(",s,"(",a,")){",u.isStream,"=true;",h,"=",l,".createStream(",Zi,",",a,");",f,"=",h,".dtype;","}else{",h,"=",l,".getBuffer(",a,");","if(",h,"){",f,"=",h,".dtype;",'}else if("constant" in ',a,"){",u.state,"=",ti,";","if(typeof "+a+'.constant === "number"){',u[Kn[0]],"=",a,".constant;",Kn.slice(1).map(function(t){return u[t]}).join("="),"=0;","}else{",Kn.map(function(t,e){return u[t]+"="+a+".constant.length>="+e+"?"+a+".constant["+e+"]:0;"}).join(""),"}}else{","if(",s,"(",a,".buffer)){",h,"=",l,".createStream(",Zi,",",a,".buffer);","}else{",h,"=",l,".getBuffer(",a,".buffer);","}",f,'="type" in ',a,"?",o.glTypes,"[",a,".type]:",h,".dtype;",u.normalized,"=!!",a,".normalized;"),i("size"),i("offset"),i("stride"),i("divisor"),n("}}"),n.exit("if(",u.isStream,"){",l,".destroyStream(",h,");","}"),u}var r=a[t];o[t]=Yt(r,e)}),o}function S(t){var e=t.static,r=t.dynamic,n={};return Object.keys(e).forEach(function(t){var r=e[t];n[t]=Gt(function(t,e){return"number"==typeof r||"boolean"==typeof r?""+r:t.link(r)})}),Object.keys(r).forEach(function(t){var e=r[t];n[t]=Yt(e,function(t,r){return t.invoke(r,e)})}),n}function E(t,e,r,n,i){function a(t){var e=u[t];e&&(h[t]=e)}var o=t.static,s=t.dynamic;de.optional(function(){function t(t){Object.keys(t).forEach(function(t){de.command(e.indexOf(t)>=0,'unknown parameter "'+t+'"',i.commandStr)})}var e=[Pi,Oi,ji,Fi,Ri,Bi,Ni,Ui,Ii].concat(et);t(o),t(s)});var l=x(t,i),u=_(t,l,i),c=M(t,i),h=k(t,i),f=w(t,i);a(Di),a(m(zi));var d=Object.keys(h).length>0,p={framebuffer:l,draw:c,shader:f,state:h,dirty:d};return p.profile=b(t,i),p.uniforms=A(r,i),p.attributes=T(e,i),p.context=S(n,i),p}function L(t,e,r){var n=t.shared,i=n.context,a=t.scope();Object.keys(r).forEach(function(n){e.save(i,"."+n);var o=r[n];a(i,".",n,"=",o.append(t,e),";")}),e(a)}function C(t,e,r,n){var i,a=t.shared,o=a.gl,s=a.framebuffer;Q&&(i=e.def(a.extensions,".webgl_draw_buffers"));var l,u=t.constants,c=u.drawBuffer,h=u.backBuffer;l=r?r.append(t,e):e.def(s,".next"),n||e("if(",l,"!==",s,".cur){"),e("if(",l,"){",o,".bindFramebuffer(",Ra,",",l,".framebuffer);"),Q&&e(i,".drawBuffersWEBGL(",c,"[",l,".colorAttachments.length]);"),e("}else{",o,".bindFramebuffer(",Ra,",null);"),Q&&e(i,".drawBuffersWEBGL(",h,");"),e("}",s,".cur=",l,";"),n||e("}")}function z(t,e,r){var n=t.shared,i=n.gl,a=t.current,o=t.next,s=n.current,l=n.next,u=t.cond(s,".dirty");et.forEach(function(e){var n=m(e);if(!(n in r.state)){var c,h;if(n in o){c=o[n],h=a[n];var f=J($[n].length,function(t){return u.def(c,"[",t,"]")});u(t.cond(f.map(function(t,e){return t+"!=="+h+"["+e+"]"}).join("||")).then(i,".",nt[n],"(",f,");",f.map(function(t,e){return h+"["+e+"]="+t}).join(";"),";"))}else{c=u.def(l,".",n);var d=t.cond(c,"!==",s,".",n);u(d),n in rt?d(t.cond(c).then(i,".enable(",rt[n],");").else(i,".disable(",rt[n],");"),s,".",n,"=",c,";"):d(i,".",nt[n],"(",c,");",s,".",n,"=",c,";")}}}),0===Object.keys(r.state).length&&u(s,".dirty=false;"),e(u)}function D(t,e,r,n){var i=t.shared,a=t.current,o=i.current,s=i.gl;Vt(Object.keys(r)).forEach(function(i){var l=r[i];if(!n||n(l)){var u=l.append(t,e);if(rt[i]){var c=rt[i];Ht(l)?u?e(s,".enable(",c,");"):e(s,".disable(",c,");"):e(t.cond(u).then(s,".enable(",c,");").else(s,".disable(",c,");")),e(o,".",i,"=",u,";")}else if(mt(u)){var h=a[i];e(s,".",nt[i],"(",u,");",u.map(function(t,e){return h+"["+e+"]="+t}).join(";"),";")}else e(s,".",nt[i],"(",u,");",o,".",i,"=",u,";")}})}function I(t,e){K&&(t.instancing=e.def(t.shared.extensions,".angle_instanced_arrays"))}function P(t,e,r,n,i){function a(){return"undefined"==typeof performance?"Date.now()":"performance.now()"}function o(t){u=e.def(),t(u,"=",a(),";"),"string"==typeof i?t(p,".count+=",i,";"):t(p,".count++;"),d&&(n?(c=e.def(),t(c,"=",v,".getNumPendingQueries();")):t(v,".beginQuery(",p,");"))}function s(t){t(p,".cpuTime+=",a(),"-",u,";"),d&&(n?t(v,".pushScopeStats(",c,",",v,".getNumPendingQueries(),",p,");"):t(v,".endQuery();"))}function l(t){var r=e.def(m,".profile");e(m,".profile=",t,";"),e.exit(m,".profile=",r,";")}var u,c,h,f=t.shared,p=t.stats,m=f.current,v=f.timer,g=r.profile;if(g){if(Ht(g))return void(g.enable?(o(e),s(e.exit),l("true")):l("false"));h=g.append(t,e),l(h)}else h=e.def(m,".profile");var y=t.block();o(y),e("if(",h,"){",y,"}");var b=t.block();s(b),e.exit("if(",h,"){",b,"}")}function O(t,e,r,n,i){function a(t){switch(t){case ua:case da:case ga:return 2;case ca:case pa:case ya:return 3;case ha:case ma:case ba:return 4;default:return 1}}function o(r,n,i){function a(){e("if(!",c,".buffer){",l,".enableVertexAttribArray(",u,");}");var r,a=i.type;if(r=i.size?e.def(i.size,"||",n):n,e("if(",c,".type!==",a,"||",c,".size!==",r,"||",p.map(function(t){return c+"."+t+"!=="+i[t]}).join("||"),"){",l,".bindBuffer(",Zi,",",f,".buffer);",l,".vertexAttribPointer(",[u,r,a,i.normalized,i.stride,i.offset],");",c,".type=",a,";",c,".size=",r,";",p.map(function(t){return c+"."+t+"="+i[t]+";"}).join(""),"}"),K){var o=i.divisor;e("if(",c,".divisor!==",o,"){",t.instancing,".vertexAttribDivisorANGLE(",[u,o],");",c,".divisor=",o,";}")}}function o(){e("if(",c,".buffer){",l,".disableVertexAttribArray(",u,");","}if(",Kn.map(function(t,e){return c+"."+t+"!=="+d[e]}).join("||"),"){",l,".vertexAttrib4f(",u,",",d,");",Kn.map(function(t,e){return c+"."+t+"="+d[e]+";"}).join(""),"}")}var l=s.gl,u=e.def(r,".location"),c=e.def(s.attributes,"[",u,"]"),h=i.state,f=i.buffer,d=[i.x,i.y,i.z,i.w],p=["buffer","normalized","offset","stride"];h===$n?a():h===ti?o():(e("if(",h,"===",$n,"){"),a(),e("}else{"),o(),e("}"))}var s=t.shared;n.forEach(function(n){var s,l=n.name,u=r.attributes[l];if(u){if(!i(u))return;s=u.append(t,e)}else{if(!i(Ya))return;var c=t.scopeAttrib(l);de.optional(function(){t.assert(e,c+".state","missing attribute "+l)}),s={},Object.keys(new W).forEach(function(t){s[t]=e.def(c,".",t)})}o(t.link(n),a(n.info.type),s)})}function j(t,r,n,i,a){for(var o,s=t.shared,l=s.gl,u=0;u<i.length;++u){var c,h=i[u],f=h.name,d=h.info.type,p=n.uniforms[f],m=t.link(h),v=m+".location";if(p){if(!a(p))continue;if(Ht(p)){var g=p.value;if(de.command(null!==g&&void 0!==g,'missing uniform "'+f+'"',t.commandStr),d===Ma||d===ka){de.command("function"==typeof g&&(d===Ma&&("texture2d"===g._reglType||"framebuffer"===g._reglType)||d===ka&&("textureCube"===g._reglType||"framebufferCube"===g._reglType)),"invalid texture for uniform "+f,t.commandStr);var y=t.link(g._texture||g.color[0]._texture);r(l,".uniform1i(",v,",",y+".bind());"),r.exit(y,".unbind();")}else if(d===xa||d===_a||d===wa){de.optional(function(){de.command(mt(g),"invalid matrix for uniform "+f,t.commandStr),de.command(d===xa&&4===g.length||d===_a&&9===g.length||d===wa&&16===g.length,"invalid length for matrix uniform "+f,t.commandStr)});var b=t.global.def("new Float32Array(["+Array.prototype.slice.call(g)+"])"),x=2;d===_a?x=3:d===wa&&(x=4),r(l,".uniformMatrix",x,"fv(",v,",false,",b,");")}else{switch(d){case la:de.commandType(g,"number","uniform "+f,t.commandStr),o="1f";break;case ua:de.command(mt(g)&&2===g.length,"uniform "+f,t.commandStr),o="2f";break;case ca:de.command(mt(g)&&3===g.length,"uniform "+f,t.commandStr),o="3f";break;case ha:de.command(mt(g)&&4===g.length,"uniform "+f,t.commandStr),o="4f";break;case va:de.commandType(g,"boolean","uniform "+f,t.commandStr),o="1i";break;case fa:de.commandType(g,"number","uniform "+f,t.commandStr),o="1i";break;case ga:case da:de.command(mt(g)&&2===g.length,"uniform "+f,t.commandStr),o="2i";break;case ya:case pa:de.command(mt(g)&&3===g.length,"uniform "+f,t.commandStr),o="3i";break;case ba:case ma:de.command(mt(g)&&4===g.length,"uniform "+f,t.commandStr),o="4i"}r(l,".uniform",o,"(",v,",",mt(g)?Array.prototype.slice.call(g):g,");")}continue}c=p.append(t,r)}else{if(!a(Ya))continue;c=r.def(s.uniforms,"[",e.id(f),"]")}d===Ma?r("if(",c,"&&",c,'._reglType==="framebuffer"){',c,"=",c,".color[0];","}"):d===ka&&r("if(",c,"&&",c,'._reglType==="framebufferCube"){',c,"=",c,".color[0];","}"),de.optional(function(){function e(e,n){t.assert(r,e,'bad data or missing for uniform "'+f+'". '+n)}function n(t){e("typeof "+c+'==="'+t+'"',"invalid type, expected "+t)}function i(r,n){e(s.isArrayLike+"("+c+")&&"+c+".length==="+r,"invalid vector, should have length "+r,t.commandStr)}function a(r){e("typeof "+c+'==="function"&&'+c+'._reglType==="texture'+(r===Ki?"2d":"Cube")+'"',"invalid texture type",t.commandStr)}switch(d){case fa:n("number");break;case da:i(2,"number");break;case pa:i(3,"number");break;case ma:i(4,"number");break;case la:n("number");break;case ua:i(2,"number");break;case ca:i(3,"number");break;case ha:i(4,"number");break;case va:n("boolean");break;case ga:i(2,"boolean");break;case ya:i(3,"boolean");break;case ba:i(4,"boolean");break;case xa:i(4,"number");break;case _a:i(9,"number");break;case wa:i(16,"number");break;case Ma:a(Ki);break;case ka:a(Qi)}});var _=1;switch(d){case Ma:case ka:var w=r.def(c,"._texture");r(l,".uniform1i(",v,",",w,".bind());"),r.exit(w,".unbind();");continue;case fa:case va:o="1i";break;case da:case ga:o="2i",_=2;break;case pa:case ya:o="3i",_=3;break;case ma:case ba:o="4i",_=4;break;case la:o="1f";break;case ua:o="2f",_=2;break;case ca:o="3f",_=3;break;case ha:o="4f",_=4;break;case xa:o="Matrix2fv";break;case _a:o="Matrix3fv";break;case wa:o="Matrix4fv"}if(r(l,".uniform",o,"(",v,","),"M"===o.charAt(0)){var M=Math.pow(d-xa+2,2),k=t.global.def("new Float32Array(",M,")");r("false,(Array.isArray(",c,")||",c," instanceof Float32Array)?",c,":(",J(M,function(t){return k+"["+t+"]="+c+"["+t+"]"}),",",k,")")}else r(_>1?J(_,function(t){return c+"["+t+"]"}):c);r(");")}}function F(t,e,r,n){function i(i){var a=c[i];return a?a.contextDep&&n.contextDynamic||a.propDep?a.append(t,r):a.append(t,e):e.def(u,".",i)}function a(){function t(){r(v,".drawElementsInstancedANGLE(",[f,p,g,d+"<<(("+g+"-"+Qn+")>>1)",m],");")}function e(){r(v,".drawArraysInstancedANGLE(",[f,d,p,m],");")}h?y?t():(r("if(",h,"){"),t(),r("}else{"),e(),r("}")):e()}function o(){function t(){r(l+".drawElements("+[f,p,g,d+"<<(("+g+"-"+Qn+")>>1)"]+");")}function e(){r(l+".drawArrays("+[f,d,p]+");")}h?y?t():(r("if(",h,"){"),t(),r("}else{"),e(),r("}")):e()}var s=t.shared,l=s.gl,u=s.draw,c=n.draw,h=function(){var i,a=c.elements,o=e;return a?((a.contextDep&&n.contextDynamic||a.propDep)&&(o=r),i=a.append(t,o)):i=o.def(u,".",Fi),i&&o("if("+i+")"+l+".bindBuffer("+Ji+","+i+".buffer.buffer);"),i}(),f=i(Ri),d=i(Bi),p=function(){var i,a=c.count,o=e;return a?((a.contextDep&&n.contextDynamic||a.propDep)&&(o=r),i=a.append(t,o),de.optional(function(){a.MISSING&&t.assert(e,"false","missing vertex count"),a.DYNAMIC&&t.assert(o,i+">=0","missing vertex count")})):(i=o.def(u,".",Ni),de.optional(function(){t.assert(o,i+">=0","missing vertex count")})),i}();if("number"==typeof p){if(0===p)return}else r("if(",p,"){"),r.exit("}");var m,v;K&&(m=i(Ui),v=t.instancing);var g=h+".type",y=c.elements&&Ht(c.elements);K&&("number"!=typeof m||m>=0)?"string"==typeof m?(r("if(",m,">0){"),a(),r("}else if(",m,"<0){"),o(),r("}")):a():o()}function R(t,e,r,n,i){var a=y(),o=a.proc("body",i);return de.optional(function(){a.commandStr=e.commandStr,a.command=a.link(e.commandStr)}),K&&(a.instancing=o.def(a.shared.extensions,".angle_instanced_arrays")),t(a,o,r,n),a.compile().body}function N(t,e,r,n){I(t,e),O(t,e,r,n.attributes,function(){return!0}),j(t,e,r,n.uniforms,function(){return!0}),F(t,e,e,r)}function B(t,e){var r=t.proc("draw",1);I(t,r),L(t,r,e.context),C(t,r,e.framebuffer),z(t,r,e),D(t,r,e.state),P(t,r,e,!1,!0);var n=e.shader.progVar.append(t,r);if(r(t.shared.gl,".useProgram(",n,".program);"),e.shader.program)N(t,r,e,e.shader.program);else{var i=t.global.def("{}"),a=r.def(n,".id"),o=r.def(i,"[",a,"]");r(t.cond(o).then(o,".call(this,a0);").else(o,"=",i,"[",a,"]=",t.link(function(r){return R(N,t,e,r,1)}),"(",n,");",o,".call(this,a0);"))}Object.keys(e.state).length>0&&r(t.shared.current,".dirty=true;")}function U(t,e,r,n){function i(){return!0}t.batchId="a1",I(t,e),O(t,e,r,n.attributes,i),j(t,e,r,n.uniforms,i),F(t,e,e,r)}function V(t,e,r,n){function i(t){return t.contextDep&&o||t.propDep}function a(t){return!i(t)}I(t,e);var o=r.contextDep,s=e.def(),l=e.def();t.shared.props=l,t.batchId=s;var u=t.scope(),c=t.scope();if(e(u.entry,"for(",s,"=0;",s,"<","a1",";++",s,"){",l,"=","a0","[",s,"];",c,"}",u.exit),r.needsContext&&L(t,c,r.context),r.needsFramebuffer&&C(t,c,r.framebuffer),D(t,c,r.state,i),r.profile&&i(r.profile)&&P(t,c,r,!1,!0),n)O(t,u,r,n.attributes,a),O(t,c,r,n.attributes,i),j(t,u,r,n.uniforms,a),j(t,c,r,n.uniforms,i),F(t,u,c,r);else{var h=t.global.def("{}"),f=r.shader.progVar.append(t,c),d=c.def(f,".id"),p=c.def(h,"[",d,"]");c(t.shared.gl,".useProgram(",f,".program);","if(!",p,"){",p,"=",h,"[",d,"]=",t.link(function(e){return R(U,t,r,e,2)}),"(",f,");}",p,".call(this,a0[",s,"],",s,");")}}function q(t,e){function r(t){return t.contextDep&&i||t.propDep}var n=t.proc("batch",2);t.batchId="0",I(t,n);var i=!1,a=!0;Object.keys(e.context).forEach(function(t){i=i||e.context[t].propDep}),i||(L(t,n,e.context),a=!1);var o=e.framebuffer,s=!1;o?(o.propDep?i=s=!0:o.contextDep&&i&&(s=!0),s||C(t,n,o)):C(t,n,null),e.state.viewport&&e.state.viewport.propDep&&(i=!0),z(t,n,e),D(t,n,e.state,function(t){return!r(t)}),e.profile&&r(e.profile)||P(t,n,e,!1,"a1"),e.contextDep=i,e.needsContext=a,e.needsFramebuffer=s;var l=e.shader.progVar;if(l.contextDep&&i||l.propDep)V(t,n,e,null);else{var u=l.append(t,n);if(n(t.shared.gl,".useProgram(",u,".program);"),e.shader.program)V(t,n,e,e.shader.program);else{var c=t.global.def("{}"),h=n.def(u,".id"),f=n.def(c,"[",h,"]");n(t.cond(f).then(f,".call(this,a0,a1);").else(f,"=",c,"[",h,"]=",t.link(function(r){return R(V,t,e,r,2)}),"(",u,");",f,".call(this,a0,a1);"))}}Object.keys(e.state).length>0&&n(t.shared.current,".dirty=true;")}function H(t,r){function n(e){var n=r.shader[e];n&&i.set(a.shader,"."+e,n.append(t,i))}var i=t.proc("scope",3);t.batchId="a2";var a=t.shared,o=a.current;L(t,i,r.context),r.framebuffer&&r.framebuffer.append(t,i),Vt(Object.keys(r.state)).forEach(function(e){var n=r.state[e],o=n.append(t,i);mt(o)?o.forEach(function(r,n){i.set(t.next[e],"["+n+"]",r)}):i.set(a.next,"."+e,o)}),P(t,i,r,!0,!0),[Fi,Bi,Ni,Ui,Ri].forEach(function(e){var n=r.draw[e];n&&i.set(a.draw,"."+e,""+n.append(t,i))}),Object.keys(r.uniforms).forEach(function(n){i.set(a.uniforms,"["+e.id(n)+"]",r.uniforms[n].append(t,i))}),Object.keys(r.attributes).forEach(function(e){var n=r.attributes[e].append(t,i),a=t.scopeAttrib(e);Object.keys(new W).forEach(function(t){i.set(a,"."+t,n[t])})}),n(Oi),n(ji),Object.keys(r.state).length>0&&(i(o,".dirty=true;"),i.exit(o,".dirty=true;")),i("a1(",t.shared.context,",a0,",t.batchId,");")}function G(t){if("object"==typeof t&&!mt(t)){for(var e=Object.keys(t),r=0;r<e.length;++r)if(ve.isDynamic(t[e[r]]))return!0;return!1}}function Y(t,e,r){function n(t,e){o.forEach(function(r){var n=i[r];if(ve.isDynamic(n)){var a=t.invoke(e,n);e(c,".",r,"=",a,";")}})}var i=e.static[r];if(i&&G(i)){var a=t.global,o=Object.keys(i),s=!1,l=!1,u=!1,c=t.global.def("{}");o.forEach(function(e){var r=i[e];if(ve.isDynamic(r)){"function"==typeof r&&(r=i[e]=ve.unbox(r));var n=Yt(r,null);s=s||n.thisDep,u=u||n.propDep,l=l||n.contextDep}else{switch(a(c,".",e,"="),typeof r){case"number":a(r);break;case"string":a('"',r,'"');break;case"object":Array.isArray(r)&&a("[",r.join(),"]");break;default:a(t.link(r))}a(";")}}),e.dynamic[r]=new ve.DynamicVariable(ai,{thisDep:s,contextDep:l,propDep:u,ref:c,append:n}),delete e.static[r]}}function X(t,e,r,n,i){var a=y();a.stats=a.link(i),Object.keys(e.static).forEach(function(t){Y(a,e,t)}),Wi.forEach(function(e){Y(a,t,e)});var o=E(t,e,r,n,a);return B(a,o),H(a,o),q(a,o),a.compile()}var W=u.Record,Z={add:32774,subtract:32778,"reverse subtract":32779};r.ext_blend_minmax&&(Z.min=Ca,Z.max=za);var K=r.angle_instanced_arrays,Q=r.webgl_draw_buffers,$={dirty:!0,profile:p.profile},tt={},et=[],rt={},nt={};v(oi,ea),v(si,ta),g(li,"blendColor",[0,0,0,0]),g(ui,"blendEquationSeparate",[ja,ja]),g(ci,"blendFuncSeparate",[Oa,Pa,Oa,Pa]),v(hi,na,!0),g(fi,"depthFunc",Fa),g(di,"depthRange",[0,1]),g(pi,"depthMask",!0),g(mi,mi,[!0,!0,!0,!0]),v(vi,$i),g(gi,"cullFace",Sa),g(yi,yi,La),g(bi,bi,1),v(xi,aa),g(_i,"polygonOffset",[0,0]),v(wi,oa),v(Mi,sa),g(ki,"sampleCoverage",[1,!1]),v(Ai,ra),g(Ti,"stencilMask",-1),g(Si,"stencilFunc",[Da,0,-1]),g(Ei,"stencilOpSeparate",[Ta,Ia,Ia,Ia]),g(Li,"stencilOpSeparate",[Sa,Ia,Ia,Ia]),v(Ci,ia),g(zi,"scissor",[0,0,t.drawingBufferWidth,t.drawingBufferHeight]),g(Di,Di,[0,0,t.drawingBufferWidth,t.drawingBufferHeight]);var it={gl:t,context:f,strings:e,next:tt,current:$,draw:h,elements:a,buffer:i,shader:c,attributes:u.state,uniforms:l,framebuffer:s,extensions:r,timer:d,isBufferArgs:Ut},at={primTypes:Be,compareFuncs:Va,blendFuncs:Ba,blendEquations:Z,stencilOps:qa,glTypes:ze,orientationType:Ga};de.optional(function(){it.isArrayLike=mt}),Q&&(at.backBuffer=[Sa],at.drawBuffer=J(n.maxDrawbuffers,function(t){return 0===t?[0]:J(t,function(t){return Na+t})}));var ot=0;return{next:tt,current:$,procs:function(){var e=y(),r=e.proc("poll"),i=e.proc("refresh"),a=e.block();r(a),i(a);var o=e.shared,s=o.gl,l=o.next,u=o.current;a(u,".dirty=false;"),C(e,r),C(e,i,null,!0);var c,h=t.getExtension("angle_instanced_arrays");h&&(c=e.link(h));for(var f=0;f<n.maxAttributes;++f){var d=i.def(o.attributes,"[",f,"]"),p=e.cond(d,".buffer");p.then(s,".enableVertexAttribArray(",f,");",s,".bindBuffer(",Zi,",",d,".buffer.buffer);",s,".vertexAttribPointer(",f,",",d,".size,",d,".type,",d,".normalized,",d,".stride,",d,".offset);").else(s,".disableVertexAttribArray(",f,");",s,".vertexAttrib4f(",f,",",d,".x,",d,".y,",d,".z,",d,".w);",d,".buffer=null;"),i(p),h&&i(c,".vertexAttribDivisorANGLE(",f,",",d,".divisor);")}return Object.keys(rt).forEach(function(t){var n=rt[t],o=a.def(l,".",t),c=e.block();c("if(",o,"){",s,".enable(",n,")}else{",s,".disable(",n,")}",u,".",t,"=",o,";"),i(c),r("if(",o,"!==",u,".",t,"){",c,"}")}),Object.keys(nt).forEach(function(t){var n,o,c=nt[t],h=$[t],f=e.block();if(f(s,".",c,"("),mt(h)){var d=h.length;n=e.global.def(l,".",t),o=e.global.def(u,".",t),f(J(d,function(t){return n+"["+t+"]"}),");",J(d,function(t){return o+"["+t+"]="+n+"["+t+"];"}).join("")),r("if(",J(d,function(t){return n+"["+t+"]!=="+o+"["+t+"]"}).join("||"),"){",f,"}")}else n=a.def(l,".",t),o=a.def(u,".",t),f(n,");",u,".",t,"=",n,";"),r("if(",n,"!==",o,"){",f,"}");i(f)}),e.compile()}(),compile:X}}function Wt(){return{bufferCount:0,elementsCount:0,framebufferCount:0,shaderCount:0,textureCount:0,cubeCount:0,renderbufferCount:0,maxTextureUnits:0}}function Zt(t,e){for(var r=0;r<t.length;++r)if(t[r]===e)return r;return-1}function Jt(t){function e(){if(0===H.length)return k&&k.update(),void(J=null);J=ge.next(e),f();for(var t=H.length-1;t>=0;--t){var r=H[t];r&&r(E,null,0)}g.flush(),k&&k.update()}function r(){!J&&H.length>0&&(J=ge.next(e))}function n(){J&&(ge.cancel(e),J=null)}function i(t){t.preventDefault(),b=!0,n(),G.forEach(function(t){t()})}function a(t){g.getError(),b=!1,x.restore(),O.restore(),D.restore(),j.restore(),F.restore(),R.restore(),k&&k.restore(),N.procs.refresh(),r(),Y.forEach(function(t){t()})}function o(){H.length=0,n(),q&&(q.removeEventListener(eo,i),q.removeEventListener(ro,a)),O.clear(),R.clear(),F.clear(),j.clear(),I.clear(),
45 D.clear(),k&&k.clear(),Z.forEach(function(t){t()})}function s(t){function e(t){var e={},r={};return Object.keys(t).forEach(function(n){var i=t[n];ve.isDynamic(i)?r[n]=ve.unbox(i,n):e[n]=i}),{dynamic:r,static:e}}function r(t){for(;d.length<t;)d.push(null);return d}function n(t,e){var n;if(b&&de.raise("context lost"),"function"==typeof t)return f.call(this,null,t,0);if("function"==typeof e){if("number"==typeof t){for(n=0;n<t;++n)f.call(this,null,e,n);return}if(Array.isArray(t)){for(n=0;n<t.length;++n)f.call(this,t[n],e,n);return}return f.call(this,t,e,0)}if("number"==typeof t){if(t>0)return h.call(this,r(0|t),0|t)}else{if(!Array.isArray(t))return c.call(this,t);if(t.length)return h.call(this,t,t.length)}}de(!!t,"invalid args to regl({...})"),de.type(t,"object","invalid args to regl({...})");var i=e(t.context||{}),a=e(t.uniforms||{}),o=e(t.attributes||{}),s=e(function(t){function e(t){if(t in r){var e=r[t];delete r[t],Object.keys(e).forEach(function(n){r[t+"."+n]=e[n]})}}var r=$t({},t);return delete r.uniforms,delete r.attributes,delete r.context,"stencil"in r&&r.stencil.op&&(r.stencil.opBack=r.stencil.opFront=r.stencil.op,delete r.stencil.op),e("blend"),e("depth"),e("cull"),e("stencil"),e("polygonOffset"),e("scissor"),e("sample"),r}(t)),l={gpuTime:0,cpuTime:0,count:0},u=N.compile(s,o,a,i,l),c=u.draw,h=u.batch,f=u.scope,d=[];return $t(n,{stats:l})}function l(t,e){var r=0;N.procs.poll();var n=e.color;n&&(g.clearColor(+n[0]||0,+n[1]||0,+n[2]||0,+n[3]||0),r|=Ka),"depth"in e&&(g.clearDepth(+e.depth),r|=Qa),"stencil"in e&&(g.clearStencil(0|e.stencil),r|=$a),de(!!r,"called regl.clear with no buffer specified"),g.clear(r)}function u(t){if(de("object"==typeof t&&t,"regl.clear() takes an object as input"),"framebuffer"in t)if(t.framebuffer&&"framebufferCube"===t.framebuffer_reglType)for(var e=0;e<6;++e)K($t({framebuffer:t.framebuffer.faces[e]},t),l);else K(t,l);else l(null,t)}function c(t){function e(){function e(){var t=Zt(H,e);H[t]=H[H.length-1],H.length-=1,H.length<=0&&n()}var r=Zt(H,t);de(r>=0,"cannot cancel a frame twice"),H[r]=e}return de.type(t,"function","regl.frame() callback must be a function"),H.push(t),r(),{cancel:e}}function h(){var t=V.viewport,e=V.scissor_box;t[0]=t[1]=e[0]=e[1]=0,E.viewportWidth=E.framebufferWidth=E.drawingBufferWidth=t[2]=e[2]=g.drawingBufferWidth,E.viewportHeight=E.framebufferHeight=E.drawingBufferHeight=t[3]=e[3]=g.drawingBufferHeight}function f(){E.tick+=1,E.time=p(),h(),N.procs.poll()}function d(){h(),N.procs.refresh(),k&&k.update()}function p(){return(ye()-A)/1e3}function m(t,e){de.type(e,"function","listener callback must be a function");var r;switch(t){case"frame":return c(e);case"lost":r=G;break;case"restore":r=Y;break;case"destroy":r=Z;break;default:de.raise("invalid event, must be one of frame,lost,restore,destroy")}return r.push(e),{cancel:function(){for(var t=0;t<r.length;++t)if(r[t]===e)return r[t]=r[r.length-1],void r.pop()}}}var v=X(t);if(!v)return null;var g=v.gl,y=g.getContextAttributes(),b=g.isContextLost(),x=W(g,v);if(!x)return null;var _=B(),w=Wt(),M=x.extensions,k=Ja(g,M),A=ye(),T=g.drawingBufferWidth,S=g.drawingBufferHeight,E={tick:0,time:0,viewportWidth:T,viewportHeight:S,framebufferWidth:T,framebufferHeight:S,drawingBufferWidth:T,drawingBufferHeight:S,pixelRatio:v.pixelRatio},L={},C={elements:null,primitive:4,count:-1,offset:0,instances:-1},z=be(g,M),D=ft(g,w,v),I=dt(g,M,D,w),P=Ot(g,M,z,D,_),O=jt(g,_,w,v),j=zt(g,M,z,function(){N.procs.poll()},E,w,v),F=Mn(g,M,z,w,v),R=It(g,M,z,j,F,w),N=Xt(g,_,M,z,D,I,j,R,L,P,O,C,E,k,v),U=Ft(g,R,N.procs.poll,E,y,M),V=N.next,q=g.canvas,H=[],G=[],Y=[],Z=[v.onDestroy],J=null;q&&(q.addEventListener(eo,i,!1),q.addEventListener(ro,a,!1));var K=R.setFBO=s({framebuffer:ve.define.call(null,no,"framebuffer")});d();var Q=$t(s,{clear:u,prop:ve.define.bind(null,no),context:ve.define.bind(null,io),this:ve.define.bind(null,ao),draw:s({}),buffer:function(t){return D.create(t,to,!1,!1)},elements:function(t){return I.create(t,!1)},texture:j.create2D,cube:j.createCube,renderbuffer:F.create,framebuffer:R.create,framebufferCube:R.createCube,attributes:y,frame:c,on:m,limits:z,hasExtension:function(t){return z.extensions.indexOf(t.toLowerCase())>=0},read:U,destroy:o,_gl:g,_refresh:d,poll:function(){f(),k&&k.update()},now:p,stats:w});return v.onDone(null,Q),Q}var Kt={"[object Int8Array]":5120,"[object Int16Array]":5122,"[object Int32Array]":5124,"[object Uint8Array]":5121,"[object Uint8ClampedArray]":5121,"[object Uint16Array]":5123,"[object Uint32Array]":5125,"[object Float32Array]":5126,"[object Float64Array]":5121,"[object ArrayBuffer]":5121},Qt=function(t){return Object.prototype.toString.call(t)in Kt},$t=function(t,e){for(var r=Object.keys(e),n=0;n<r.length;++n)t[r[n]]=e[r[n]];return t},te=["gl","canvas","container","attributes","pixelRatio","extensions","optionalExtensions","profile","onDone"],ee=33071,re=9728,ne=9984,ie=9985,ae=9986,oe=9987,se=5126,le=32819,ue=32820,ce=33635,he=34042,fe={};fe[5120]=fe[5121]=1,fe[5122]=fe[5123]=fe[36193]=fe[ce]=fe[le]=fe[ue]=2,fe[5124]=fe[5125]=fe[se]=fe[he]=4;var de=$t(r,{optional:S,raise:e,commandRaise:M,command:k,parameter:i,commandParameter:A,constructor:u,type:o,commandType:T,isTypedArray:a,nni:s,oneOf:l,shaderError:b,linkError:x,callSite:m,saveCommandRef:_,saveDrawInfo:w,framebufferFormat:E,guessCommand:p,texture2D:z,textureCube:D}),pe=0,me=0,ve={DynamicVariable:I,define:F,isDynamic:R,unbox:N,accessor:j},ge={next:"function"==typeof requestAnimationFrame?function(t){return requestAnimationFrame(t)}:function(t){return setTimeout(t,16)},cancel:"function"==typeof cancelAnimationFrame?function(t){return cancelAnimationFrame(t)}:clearTimeout},ye="undefined"!=typeof performance&&performance.now?function(){return performance.now()}:function(){return+new Date},be=function(t,e){var r=1;e.ext_texture_filter_anisotropic&&(r=t.getParameter(34047));var n=1,i=1;return e.webgl_draw_buffers&&(n=t.getParameter(34852),i=t.getParameter(36063)),{colorBits:[t.getParameter(3410),t.getParameter(3411),t.getParameter(3412),t.getParameter(3413)],depthBits:t.getParameter(3414),stencilBits:t.getParameter(3415),subpixelBits:t.getParameter(3408),extensions:Object.keys(e).filter(function(t){return!!e[t]}),maxAnisotropic:r,maxDrawbuffers:n,maxColorAttachments:i,pointSizeDims:t.getParameter(33901),lineWidthDims:t.getParameter(33902),maxViewportDims:t.getParameter(3386),maxCombinedTextureUnits:t.getParameter(35661),maxCubeMapSize:t.getParameter(34076),maxRenderbufferSize:t.getParameter(34024),maxTextureUnits:t.getParameter(34930),maxTextureSize:t.getParameter(3379),maxAttributes:t.getParameter(34921),maxVertexUniforms:t.getParameter(36347),maxVertexTextureUnits:t.getParameter(35660),maxVaryingVectors:t.getParameter(36348),maxFragmentUniforms:t.getParameter(36349),glsl:t.getParameter(35724),renderer:t.getParameter(7937),vendor:t.getParameter(7936),version:t.getParameter(7938)}},xe=function(t){return Object.keys(t).map(function(e){return t[e]})},_e=5120,we=5121,Me=5122,ke=5123,Ae=5124,Te=5125,Se=5126,Ee=J(8,function(){return[]}),Le={alloc:$,free:tt,allocType:et,freeType:rt},Ce={shape:lt,flatten:st},ze={int8:5120,int16:5122,int32:5124,uint8:5121,uint16:5123,uint32:5125,float:5126,float32:5126},De={dynamic:35048,stream:35040,static:35044},Ie=Ce.flatten,Pe=Ce.shape,Oe=35044,je=35040,Fe=5121,Re=5126,Ne=[];Ne[5120]=1,Ne[5122]=2,Ne[5124]=4,Ne[5121]=1,Ne[5123]=2,Ne[5125]=4,Ne[5126]=4;var Be={points:0,point:0,lines:1,line:1,triangles:4,triangle:4,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},Ue=0,Ve=1,qe=4,He=5120,Ge=5121,Ye=5122,Xe=5123,We=5124,Ze=5125,Je=34963,Ke=35040,Qe=35044,$e=new Float32Array(1),tr=new Uint32Array($e.buffer),er=5123,rr=34467,nr=3553,ir=34067,ar=34069,or=6408,sr=6406,lr=6407,ur=6409,cr=6410,hr=32854,fr=32855,dr=36194,pr=32819,mr=32820,vr=33635,gr=34042,yr=6402,br=34041,xr=35904,_r=35906,wr=36193,Mr=33776,kr=33777,Ar=33778,Tr=33779,Sr=35986,Er=35987,Lr=34798,Cr=35840,zr=35841,Dr=35842,Ir=35843,Pr=36196,Or=5121,jr=5123,Fr=5125,Rr=5126,Nr=10242,Br=10243,Ur=10497,Vr=33071,qr=33648,Hr=10240,Gr=10241,Yr=9728,Xr=9729,Wr=9984,Zr=9985,Jr=9986,Kr=9987,Qr=33170,$r=4352,tn=4353,en=4354,rn=34046,nn=3317,an=37440,on=37441,sn=37443,ln=37444,un=33984,cn=[Wr,Jr,Zr,Kr],hn=[0,ur,cr,lr,or],fn={};fn[ur]=fn[sr]=fn[yr]=1,fn[br]=fn[cr]=2,fn[lr]=fn[xr]=3,fn[or]=fn[_r]=4;var dn=vt("HTMLCanvasElement"),pn=vt("CanvasRenderingContext2D"),mn=vt("HTMLImageElement"),vn=vt("HTMLVideoElement"),gn=Object.keys(Kt).concat([dn,pn,mn,vn]),yn=[];yn[Or]=1,yn[Rr]=4,yn[wr]=2,yn[jr]=2,yn[Fr]=4;var bn=[];bn[hr]=2,bn[fr]=2,bn[dr]=2,bn[br]=4,bn[Mr]=.5,bn[kr]=.5,bn[Ar]=1,bn[Tr]=1,bn[Sr]=.5,bn[Er]=1,bn[Lr]=1,bn[Cr]=.5,bn[zr]=.25,bn[Dr]=.5,bn[Ir]=.25,bn[Pr]=.5;var xn=36161,_n=32854,wn=[];wn[_n]=2,wn[32855]=2,wn[36194]=2,wn[33189]=2,wn[36168]=1,wn[34041]=4,wn[35907]=4,wn[34836]=16,wn[34842]=8,wn[34843]=6;var Mn=function(t,e,r,n,i){function a(t){this.id=h++,this.refCount=1,this.renderbuffer=t,this.format=_n,this.width=0,this.height=0,i.profile&&(this.stats={size:0})}function o(e){var r=e.renderbuffer;de(r,"must not double destroy renderbuffer"),t.bindRenderbuffer(xn,null),t.deleteRenderbuffer(r),e.renderbuffer=null,e.refCount=0,delete f[e.id],n.renderbufferCount--}function s(e,o){function s(e,n){var a=0,o=0,l=_n;if("object"==typeof e&&e){var f=e;if("shape"in f){var d=f.shape;de(Array.isArray(d)&&d.length>=2,"invalid renderbuffer shape"),a=0|d[0],o=0|d[1]}else"radius"in f&&(a=o=0|f.radius),"width"in f&&(a=0|f.width),"height"in f&&(o=0|f.height);"format"in f&&(de.parameter(f.format,u,"invalid renderbuffer format"),l=u[f.format])}else"number"==typeof e?(a=0|e,o="number"==typeof n?0|n:a):e?de.raise("invalid arguments to renderbuffer constructor"):a=o=1;if(de(a>0&&o>0&&a<=r.maxRenderbufferSize&&o<=r.maxRenderbufferSize,"invalid renderbuffer size"),a!==h.width||o!==h.height||l!==h.format)return s.width=h.width=a,s.height=h.height=o,h.format=l,t.bindRenderbuffer(xn,h.renderbuffer),t.renderbufferStorage(xn,l,a,o),i.profile&&(h.stats.size=Dt(h.format,h.width,h.height)),s.format=c[h.format],s}function l(e,n){var a=0|e,o=0|n||a;return a===h.width&&o===h.height?s:(de(a>0&&o>0&&a<=r.maxRenderbufferSize&&o<=r.maxRenderbufferSize,"invalid renderbuffer size"),s.width=h.width=a,s.height=h.height=o,t.bindRenderbuffer(xn,h.renderbuffer),t.renderbufferStorage(xn,h.format,a,o),i.profile&&(h.stats.size=Dt(h.format,h.width,h.height)),s)}var h=new a(t.createRenderbuffer());return f[h.id]=h,n.renderbufferCount++,s(e,o),s.resize=l,s._reglType="renderbuffer",s._renderbuffer=h,i.profile&&(s.stats=h.stats),s.destroy=function(){h.decRef()},s}function l(){xe(f).forEach(function(e){e.renderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(xn,e.renderbuffer),t.renderbufferStorage(xn,e.format,e.width,e.height)}),t.bindRenderbuffer(xn,null)}var u={rgba4:_n,rgb565:36194,"rgb5 a1":32855,depth:33189,stencil:36168,"depth stencil":34041};e.ext_srgb&&(u.srgba=35907),e.ext_color_buffer_half_float&&(u.rgba16f=34842,u.rgb16f=34843),e.webgl_color_buffer_float&&(u.rgba32f=34836);var c=[];Object.keys(u).forEach(function(t){var e=u[t];c[e]=t});var h=0,f={};return a.prototype.decRef=function(){--this.refCount<=0&&o(this)},i.profile&&(n.getTotalRenderbufferSize=function(){var t=0;return Object.keys(f).forEach(function(e){t+=f[e].stats.size}),t}),{create:s,clear:function(){xe(f).forEach(o)},restore:l}},kn=36160,An=36161,Tn=3553,Sn=34069,En=36064,Ln=36096,Cn=36128,zn=33306,Dn=36053,In=6402,Pn=[6408],On=[];On[6408]=4;var jn=[];jn[5121]=1,jn[5126]=4,jn[36193]=2;var Fn=33189,Rn=36168,Nn=34041,Bn=[32854,32855,36194,35907,34842,34843,34836],Un={};Un[Dn]="complete",Un[36054]="incomplete attachment",Un[36057]="incomplete dimensions",Un[36055]="incomplete, missing attachment",Un[36061]="unsupported";var Vn=5126,qn=35632,Hn=35633,Gn=35718,Yn=35721,Xn=6408,Wn=5121,Zn=3333,Jn=5126,Kn="xyzw".split(""),Qn=5121,$n=1,ti=2,ei=0,ri=1,ni=2,ii=3,ai=4,oi="dither",si="blend.enable",li="blend.color",ui="blend.equation",ci="blend.func",hi="depth.enable",fi="depth.func",di="depth.range",pi="depth.mask",mi="colorMask",vi="cull.enable",gi="cull.face",yi="frontFace",bi="lineWidth",xi="polygonOffset.enable",_i="polygonOffset.offset",wi="sample.alpha",Mi="sample.enable",ki="sample.coverage",Ai="stencil.enable",Ti="stencil.mask",Si="stencil.func",Ei="stencil.opFront",Li="stencil.opBack",Ci="scissor.enable",zi="scissor.box",Di="viewport",Ii="profile",Pi="framebuffer",Oi="vert",ji="frag",Fi="elements",Ri="primitive",Ni="count",Bi="offset",Ui="instances",Vi=Pi+"Width",qi=Pi+"Height",Hi=Di+"Width",Gi=Di+"Height",Yi="drawingBufferWidth",Xi="drawingBufferHeight",Wi=[ci,ui,Si,Ei,Li,ki,Di,zi,_i],Zi=34962,Ji=34963,Ki=3553,Qi=34067,$i=2884,ta=3042,ea=3024,ra=2960,na=2929,ia=3089,aa=32823,oa=32926,sa=32928,la=5126,ua=35664,ca=35665,ha=35666,fa=5124,da=35667,pa=35668,ma=35669,va=35670,ga=35671,ya=35672,ba=35673,xa=35674,_a=35675,wa=35676,Ma=35678,ka=35680,Aa=4,Ta=1028,Sa=1029,Ea=2304,La=2305,Ca=32775,za=32776,Da=519,Ia=7680,Pa=0,Oa=1,ja=32774,Fa=513,Ra=36160,Na=36064,Ba={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},Ua=["constant color, constant alpha","one minus constant color, constant alpha","constant color, one minus constant alpha","one minus constant color, one minus constant alpha","constant alpha, constant color","constant alpha, one minus constant color","one minus constant alpha, constant color","one minus constant alpha, one minus constant color"],Va={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},qa={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Ha={frag:35632,vert:35633},Ga={cw:Ea,ccw:La},Ya=new qt(!1,!1,!1,function(){}),Xa=34918,Wa=34919,Za=35007,Ja=function(t,e){function r(){return f.pop()||h.createQueryEXT()}function n(t){f.push(t)}function i(t){var e=r();h.beginQueryEXT(Za,e),d.push(e),u(d.length-1,d.length,t)}function a(){h.endQueryEXT(Za)}function o(){this.startQueryIndex=-1,this.endQueryIndex=-1,this.sum=0,this.stats=null}function s(){return p.pop()||new o}function l(t){p.push(t)}function u(t,e,r){var n=s();n.startQueryIndex=t,n.endQueryIndex=e,n.sum=0,n.stats=r,m.push(n)}function c(){var t,e,r=d.length;if(0!==r){g.length=Math.max(g.length,r+1),v.length=Math.max(v.length,r+1),v[0]=0,g[0]=0;var i=0;for(t=0,e=0;e<d.length;++e){var a=d[e];h.getQueryObjectEXT(a,Wa)?(i+=h.getQueryObjectEXT(a,Xa),n(a)):d[t++]=a,v[e+1]=i,g[e+1]=t}for(d.length=t,t=0,e=0;e<m.length;++e){var o=m[e],s=o.startQueryIndex,u=o.endQueryIndex;o.sum+=v[u]-v[s];var c=g[s],f=g[u];f===c?(o.stats.gpuTime+=o.sum/1e6,l(o)):(o.startQueryIndex=c,o.endQueryIndex=f,m[t++]=o)}m.length=t}}var h=e.ext_disjoint_timer_query;if(!h)return null;var f=[],d=[],p=[],m=[],v=[],g=[];return{beginQuery:i,endQuery:a,pushScopeStats:u,update:c,getNumPendingQueries:function(){return d.length},clear:function(){f.push.apply(f,d);for(var t=0;t<f.length;t++)h.deleteQueryEXT(f[t]);d.length=0,f.length=0},restore:function(){d.length=0,f.length=0}}},Ka=16384,Qa=256,$a=1024,to=34962,eo="webglcontextlost",ro="webglcontextrestored",no=1,io=2,ao=3;return Jt})},{}],492:[function(t,e,r){"use strict";function n(t,e){if("string"!=typeof t)throw new TypeError("expected a string");if(1===e)return t;if(2===e)return t+t;var r=t.length*e;if(i!==t||void 0===i)i=t,a="";else if(a.length>=r)return a.substr(0,r);for(;r>a.length&&e>1;)1&e&&(a+=t),e>>=1,t+=t;return a+=t,a=a.substr(0,r)}var i,a="";e.exports=n},{}],493:[function(e,r,n){!function(e,i){"function"==typeof t&&t.amd?t(i):"object"==typeof n?r.exports=i():e.resolveUrl=i()}(this,function(){function t(){var t=arguments.length;if(0===t)throw new Error("resolveUrl requires at least one argument; got none.");var e=document.createElement("base");if(e.href=arguments[0],1===t)return e.href;var r=document.getElementsByTagName("head")[0];r.insertBefore(e,r.firstChild);for(var n,i=document.createElement("a"),a=1;a<t;a++)i.href=arguments[a],n=i.href,e.href=n;return r.removeChild(e),n}return t})},{}],494:[function(t,e,r){(function(t){e.exports=t.performance&&t.performance.now?function(){return performance.now()}:Date.now||function(){return+new Date}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],495:[function(t,e,r){"use strict";function n(t){for(var e=t.length,r=t[t.length-1],n=e,i=e-2;i>=0;--i){var a=r,o=t[i];r=a+o;var s=r-a,l=o-s;l&&(t[--n]=r,r=l)}for(var u=0,i=n;i<e;++i){var a=t[i],o=r;r=a+o;var s=r-a,l=o-s;l&&(t[u++]=l)}return t[u++]=r,t.length=u,t}e.exports=n},{}],496:[function(t,e,r){"use strict";function n(t,e){for(var r=new Array(t.length-1),n=1;n<t.length;++n)for(var i=r[n-1]=new Array(t.length-1),a=0,o=0;a<t.length;++a)a!==e&&(i[o++]=t[n][a]);return r}function i(t){for(var e=new Array(t),r=0;r<t;++r){e[r]=new Array(t);for(var n=0;n<t;++n)e[r][n]=["m[",r,"][",n,"]"].join("")}return e}function a(t){return 1&t?"-":""}function o(t){if(1===t.length)return t[0];if(2===t.length)return["sum(",t[0],",",t[1],")"].join("");var e=t.length>>1;return["sum(",o(t.slice(0,e)),",",o(t.slice(e)),")"].join("")}function s(t){if(2===t.length)return["sum(prod(",t[0][0],",",t[1][1],"),prod(-",t[0][1],",",t[1][0],"))"].join("");for(var e=[],r=0;r<t.length;++r)e.push(["scale(",s(n(t,r)),",",a(r),t[0][r],")"].join(""));return o(e)}function l(t){return new Function("sum","scale","prod","compress",["function robustDeterminant",t,"(m){return compress(",s(i(t)),")};return robustDeterminant",t].join(""))(c,h,u,f)}var u=t("two-product"),c=t("robust-sum"),h=t("robust-scale"),f=t("robust-compress"),d=6,p=[function(){return[0]},function(t){return[t[0][0]]}];!function(){for(;p.length<d;)p.push(l(p.length));for(var t=[],r=["function robustDeterminant(m){switch(m.length){"],n=0;n<d;++n)t.push("det"+n),r.push("case ",n,":return det",n,"(m);");r.push("}var det=CACHE[m.length];if(!det)det=CACHE[m.length]=gen(m.length);return det(m);}return robustDeterminant"),t.push("CACHE","gen",r.join(""));var i=Function.apply(void 0,t);e.exports=i.apply(void 0,p.concat([p,l]));for(var n=0;n<p.length;++n)e.exports[n]=p[n]}()},{"robust-compress":495,"robust-scale":502,"robust-sum":505,"two-product":531}],497:[function(t,e,r){"use strict";function n(t,e){for(var r=i(t[0],e[0]),n=1;n<t.length;++n)r=a(r,i(t[n],e[n]));return r}var i=t("two-product"),a=t("robust-sum");e.exports=n},{"robust-sum":505,"two-product":531}],498:[function(t,e,r){"use strict";function n(t,e){for(var r=new Array(t.length-1),n=1;n<t.length;++n)for(var i=r[n-1]=new Array(t.length-1),a=0,o=0;a<t.length;++a)a!==e&&(i[o++]=t[n][a]);return r}function i(t){for(var e=new Array(t),r=0;r<t;++r){e[r]=new Array(t);for(var n=0;n<t;++n)e[r][n]=["m",n,"[",t-r-2,"]"].join("")}return e}function a(t){if(1===t.length)return t[0];if(2===t.length)return["sum(",t[0],",",t[1],")"].join("");var e=t.length>>1;return["sum(",a(t.slice(0,e)),",",a(t.slice(e)),")"].join("")}function o(t,e){if("m"===t.charAt(0)){if("w"===e.charAt(0)){var r=t.split("[");return["w",e.substr(1),"m",r[0].substr(1)].join("")}return["prod(",t,",",e,")"].join("")}return o(e,t)}function s(t){return t&!0?"-":""}function l(t){if(2===t.length)return[["diff(",o(t[0][0],t[1][1]),",",o(t[1][0],t[0][1]),")"].join("")];for(var e=[],r=0;r<t.length;++r)e.push(["scale(",a(l(n(t,r))),",",s(r),t[0][r],")"].join(""));return e}function u(t,e){for(var r=[],n=0;n<e-2;++n)r.push(["prod(m",t,"[",n,"],m",t,"[",n,"])"].join(""));return a(r)}function c(t){for(var e=[],r=[],o=i(t),s=0;s<t;++s)o[0][s]="1",o[t-1][s]="w"+s;for(var s=0;s<t;++s)0==(1&s)?e.push.apply(e,l(n(o,s))):r.push.apply(r,l(n(o,s)));for(var c=a(e),h=a(r),f="exactInSphere"+t,d=[],s=0;s<t;++s)d.push("m"+s);for(var p=["function ",f,"(",d.join(),"){"],s=0;s<t;++s){p.push("var w",s,"=",u(s,t),";");for(var b=0;b<t;++b)b!==s&&p.push("var w",s,"m",b,"=scale(w",s,",m",b,"[0]);")}return p.push("var p=",c,",n=",h,",d=diff(p,n);return d[d.length-1];}return ",f),new Function("sum","diff","prod","scale",p.join(""))(v,g,m,y)}function h(){return 0}function f(){return 0}function d(){return 0}function p(t){var e=x[t.length];return e||(e=x[t.length]=c(t.length)),e.apply(void 0,t)}var m=t("two-product"),v=t("robust-sum"),g=t("robust-subtract"),y=t("robust-scale"),b=6,x=[h,f,d];!function(){for(;x.length<=b;)x.push(c(x.length));for(var t=[],r=["slow"],n=0;n<=b;++n)t.push("a"+n),r.push("o"+n);for(var i=["function testInSphere(",t.join(),"){switch(arguments.length){case 0:case 1:return 0;"],n=2;n<=b;++n)i.push("case ",n,":return o",n,"(",t.slice(0,n).join(),");");i.push("}var s=new Array(arguments.length);for(var i=0;i<arguments.length;++i){s[i]=arguments[i]};return slow(s);}return testInSphere"),r.push(i.join(""));var a=Function.apply(void 0,r);e.exports=a.apply(void 0,[p].concat(x));for(var n=0;n<=b;++n)e.exports[n]=x[n]}()},{"robust-scale":502,"robust-subtract":504,"robust-sum":505,"two-product":531}],499:[function(t,e,r){"use strict";function n(t){for(var e="robustLinearSolve"+t+"d",r=["function ",e,"(A,b){return ["],n=0;n<t;++n){r.push("det([");for(var i=0;i<t;++i){i>0&&r.push(","),r.push("[");for(var a=0;a<t;++a)a>0&&r.push(","),a===n?r.push("+b[",i,"]"):r.push("+A[",i,"][",a,"]");r.push("]")}r.push("]),")}r.push("det(A)]}return ",e);var s=new Function("det",r.join(""));return s(t<6?o[t]:o)}function i(){return[0]}function a(t,e){return[[e[0]],[t[0][0]]]}var o=t("robust-determinant"),s=6,l=[i,a];!function(){for(;l.length<s;)l.push(n(l.length));for(var t=[],r=["function dispatchLinearSolve(A,b){switch(A.length){"],i=0;i<s;++i)t.push("s"+i),r.push("case ",i,":return s",i,"(A,b);");r.push("}var s=CACHE[A.length];if(!s)s=CACHE[A.length]=g(A.length);return s(A,b)}return dispatchLinearSolve"),t.push("CACHE","g",r.join(""));var a=Function.apply(void 0,t);e.exports=a.apply(void 0,l.concat([l,n]));for(var i=0;i<s;++i)e.exports[i]=l[i]}()},{"robust-determinant":496}],500:[function(t,e,r){"use strict";function n(t,e){for(var r=new Array(t.length-1),n=1;n<t.length;++n)for(var i=r[n-1]=new Array(t.length-1),a=0,o=0;a<t.length;++a)a!==e&&(i[o++]=t[n][a]);return r}function i(t){for(var e=new Array(t),r=0;r<t;++r){e[r]=new Array(t);for(var n=0;n<t;++n)e[r][n]=["m",n,"[",t-r-1,"]"].join("")}return e}function a(t){return 1&t?"-":""}function o(t){if(1===t.length)return t[0];if(2===t.length)return["sum(",t[0],",",t[1],")"].join("");var e=t.length>>1;return["sum(",o(t.slice(0,e)),",",o(t.slice(e)),")"].join("")}function s(t){if(2===t.length)return[["sum(prod(",t[0][0],",",t[1][1],"),prod(-",t[0][1],",",t[1][0],"))"].join("")];for(var e=[],r=0;r<t.length;++r)e.push(["scale(",o(s(n(t,r))),",",a(r),t[0][r],")"].join(""));return e}function l(t){for(var e=[],r=[],a=i(t),l=[],u=0;u<t;++u)0==(1&u)?e.push.apply(e,s(n(a,u))):r.push.apply(r,s(n(a,u))),l.push("m"+u);var p=o(e),m=o(r),v="orientation"+t+"Exact",g=["function ",v,"(",l.join(),"){var p=",p,",n=",m,",d=sub(p,n);return d[d.length-1];};return ",v].join("");return new Function("sum","prod","scale","sub",g)(h,c,f,d)}function u(t){var e=g[t.length];return e||(e=g[t.length]=l(t.length)),e.apply(void 0,t)}var c=t("two-product"),h=t("robust-sum"),f=t("robust-scale"),d=t("robust-subtract"),p=5,m=l(3),v=l(4),g=[function(){return 0},function(){return 0},function(t,e){return e[0]-t[0]},function(t,e,r){var n,i=(t[1]-r[1])*(e[0]-r[0]),a=(t[0]-r[0])*(e[1]-r[1]),o=i-a;if(i>0){if(a<=0)return o;n=i+a}else{if(!(i<0))return o;if(a>=0)return o;n=-(i+a)}var s=3.3306690738754716e-16*n;return o>=s||o<=-s?o:m(t,e,r)},function(t,e,r,n){var i=t[0]-n[0],a=e[0]-n[0],o=r[0]-n[0],s=t[1]-n[1],l=e[1]-n[1],u=r[1]-n[1],c=t[2]-n[2],h=e[2]-n[2],f=r[2]-n[2],d=a*u,p=o*l,m=o*s,g=i*u,y=i*l,b=a*s,x=c*(d-p)+h*(m-g)+f*(y-b),_=(Math.abs(d)+Math.abs(p))*Math.abs(c)+(Math.abs(m)+Math.abs(g))*Math.abs(h)+(Math.abs(y)+Math.abs(b))*Math.abs(f),w=7.771561172376103e-16*_;return x>w||-x>w?x:v(t,e,r,n)}];!function(){for(;g.length<=p;)g.push(l(g.length));for(var t=[],r=["slow"],n=0;n<=p;++n)t.push("a"+n),r.push("o"+n);for(var i=["function getOrientation(",t.join(),"){switch(arguments.length){case 0:case 1:return 0;"],n=2;n<=p;++n)i.push("case ",n,":return o",n,"(",t.slice(0,n).join(),");");i.push("}var s=new Array(arguments.length);for(var i=0;i<arguments.length;++i){s[i]=arguments[i]};return slow(s);}return getOrientation"),r.push(i.join(""));var a=Function.apply(void 0,r);e.exports=a.apply(void 0,[u].concat(g));for(var n=0;n<=p;++n)e.exports[n]=g[n]}()},{"robust-scale":502,"robust-subtract":504,"robust-sum":505,"two-product":531}],501:[function(t,e,r){"use strict";function n(t,e){if(1===t.length)return a(e,t[0]);if(1===e.length)return a(t,e[0]);if(0===t.length||0===e.length)return[0];var r=[0];if(t.length<e.length)for(var n=0;n<t.length;++n)r=i(r,a(e,t[n]));else for(var n=0;n<e.length;++n)r=i(r,a(t,e[n]));return r}var i=t("robust-sum"),a=t("robust-scale");e.exports=n},{"robust-scale":502,"robust-sum":505}],502:[function(t,e,r){"use strict";function n(t,e){var r=t.length;if(1===r){var n=i(t[0],e);return n[0]?n:[n[1]]}var o=new Array(2*r),s=[.1,.1],l=[.1,.1],u=0;i(t[0],e,s),s[0]&&(o[u++]=s[0]);for(var c=1;c<r;++c){i(t[c],e,l);var h=s[1];a(h,l[0],s),s[0]&&(o[u++]=s[0]);var f=l[1],d=s[1],p=f+d,m=p-f,v=d-m;s[1]=p,v&&(o[u++]=v)}return s[1]&&(o[u++]=s[1]),0===u&&(o[u++]=0),o.length=u,o}var i=t("two-product"),a=t("two-sum");e.exports=n},{"two-product":531,"two-sum":532}],503:[function(t,e,r){"use strict";function n(t,e,r,n){for(var i=0;i<2;++i){var a=t[i],o=e[i],s=Math.min(a,o),l=Math.max(a,o),u=r[i],c=n[i],h=Math.min(u,c);if(Math.max(u,c)<s||l<h)return!1}return!0}function i(t,e,r,i){var o=a(t,r,i),s=a(e,r,i);if(o>0&&s>0||o<0&&s<0)return!1;var l=a(r,t,e),u=a(i,t,e);return!(l>0&&u>0||l<0&&u<0)&&(0!==o||0!==s||0!==l||0!==u||n(t,e,r,i))}e.exports=i;var a=t("robust-orientation")[3]},{"robust-orientation":500}],504:[function(t,e,r){"use strict";function n(t,e){var r=t+e,n=r-t,i=r-n,a=e-n,o=t-i,s=o+a;return s?[s,r]:[r]}function i(t,e){var r=0|t.length,i=0|e.length;if(1===r&&1===i)return n(t[0],-e[0]);var a,o,s=r+i,l=new Array(s),u=0,c=0,h=0,f=Math.abs,d=t[c],p=f(d),m=-e[h],v=f(m);p<v?(o=d,(c+=1)<r&&(d=t[c],p=f(d))):(o=m,(h+=1)<i&&(m=-e[h],v=f(m))),c<r&&p<v||h>=i?(a=d,(c+=1)<r&&(d=t[c],p=f(d))):(a=m,(h+=1)<i&&(m=-e[h],v=f(m)));for(var g,y,b,x,_,w=a+o,M=w-a,k=o-M,A=k,T=w;c<r&&h<i;)p<v?(a=d,(c+=1)<r&&(d=t[c],p=f(d))):(a=m,(h+=1)<i&&(m=-e[h],v=f(m))),o=A,w=a+o,M=w-a,k=o-M,k&&(l[u++]=k),g=T+w,y=g-T,b=g-y,x=w-y,_=T-b,A=_+x,T=g;for(;c<r;)a=d,o=A,w=a+o,M=w-a,k=o-M,k&&(l[u++]=k),g=T+w,y=g-T,b=g-y,x=w-y,_=T-b,A=_+x,T=g,(c+=1)<r&&(d=t[c]);for(;h<i;)a=m,o=A,w=a+o,M=w-a,k=o-M,k&&(l[u++]=k),g=T+w,y=g-T,b=g-y,x=w-y,_=T-b,A=_+x,T=g,(h+=1)<i&&(m=-e[h]);return A&&(l[u++]=A),T&&(l[u++]=T),u||(l[u++]=0),l.length=u,l}e.exports=i},{}],505:[function(t,e,r){"use strict";function n(t,e){var r=t+e,n=r-t,i=r-n,a=e-n,o=t-i,s=o+a;return s?[s,r]:[r]}function i(t,e){var r=0|t.length,i=0|e.length;if(1===r&&1===i)return n(t[0],e[0]);var a,o,s=r+i,l=new Array(s),u=0,c=0,h=0,f=Math.abs,d=t[c],p=f(d),m=e[h],v=f(m);p<v?(o=d,(c+=1)<r&&(d=t[c],p=f(d))):(o=m,(h+=1)<i&&(m=e[h],v=f(m))),c<r&&p<v||h>=i?(a=d,(c+=1)<r&&(d=t[c],p=f(d))):(a=m,(h+=1)<i&&(m=e[h],v=f(m)));for(var g,y,b,x,_,w=a+o,M=w-a,k=o-M,A=k,T=w;c<r&&h<i;)p<v?(a=d,(c+=1)<r&&(d=t[c],p=f(d))):(a=m,(h+=1)<i&&(m=e[h],v=f(m))),o=A,w=a+o,M=w-a,k=o-M,k&&(l[u++]=k),g=T+w,y=g-T,b=g-y,x=w-y,_=T-b,A=_+x,T=g;for(;c<r;)a=d,o=A,w=a+o,M=w-a,k=o-M,k&&(l[u++]=k),g=T+w,y=g-T,b=g-y,x=w-y,_=T-b,A=_+x,T=g,(c+=1)<r&&(d=t[c]);for(;h<i;)a=m,o=A,w=a+o,M=w-a,k=o-M,k&&(l[u++]=k),g=T+w,y=g-T,b=g-y,x=w-y,_=T-b,A=_+x,T=g,(h+=1)<i&&(m=e[h]);return A&&(l[u++]=A),T&&(l[u++]=T),u||(l[u++]=0),l.length=u,l}e.exports=i},{}],506:[function(e,r,n){!function(e,i){"object"==typeof n&&void 0!==r?r.exports=i():"function"==typeof t&&t.amd?t(i):e.ShelfPack=i()}(this,function(){function t(t,e,r){r=r||{},this.w=t||64,this.h=e||64,this.autoResize=!!r.autoResize,this.shelves=[],this.stats={},this.count=function(t){this.stats[t]=1+(0|this.stats[t])}}function e(t,e,r){this.x=0,this.y=t,this.w=this.free=e,this.h=r}return t.prototype.pack=function(t,e){t=[].concat(t),e=e||{};for(var r,n,i,a=[],o=0;o<t.length;o++)if(r=t[o].w||t[o].width,n=t[o].h||t[o].height,r&&n){if(!(i=this.packOne(r,n)))continue;e.inPlace&&(t[o].x=i.x,t[o].y=i.y),a.push(i)}if(this.shelves.length>0){for(var s=0,l=0,u=0;u<this.shelves.length;u++){var c=this.shelves[u];l+=c.h,s=Math.max(c.w-c.free,s)}this.resize(s,l)}return a},t.prototype.packOne=function(t,r){for(var n,i,a=0,o={shelf:-1,waste:1/0},s=0;s<this.shelves.length;s++){if(n=this.shelves[s],a+=n.h,r===n.h&&t<=n.free)return this.count(r),n.alloc(t,r);r>n.h||t>n.free||r<n.h&&t<=n.free&&(i=n.h-r)<o.waste&&(o.waste=i,o.shelf=s)}if(o.shelf!==-1)return n=this.shelves[o.shelf],this.count(r),n.alloc(t,r);if(r<=this.h-a&&t<=this.w)return n=new e(a,this.w,r),this.shelves.push(n),this.count(r),n.alloc(t,r);if(this.autoResize){var l,u,c,h;return l=u=this.h,c=h=this.w,(c<=l||t>c)&&(h=2*Math.max(t,c)),(l<c||r>l)&&(u=2*Math.max(r,l)),this.resize(h,u),this.packOne(t,r)}return null},t.prototype.clear=function(){this.shelves=[],this.stats={}},t.prototype.resize=function(t,e){this.w=t,this.h=e;for(var r=0;r<this.shelves.length;r++)this.shelves[r].resize(t);return!0},e.prototype.alloc=function(t,e){if(t>this.free||e>this.h)return null;var r=this.x;return this.x+=t,this.free-=t,{x:r,y:this.y,w:t,h:e,width:t,height:e}},e.prototype.resize=function(t){return this.free+=t-this.w,this.w=t,!0},t})},{}],507:[function(t,e,r){"use strict";e.exports=function(t){return t<0?-1:t>0?1:0}},{}],508:[function(t,e,r){"use strict";function n(t){return a(i(t))}e.exports=n;var i=t("boundary-cells"),a=t("reduce-simplicial-complex")},{"boundary-cells":65,"reduce-simplicial-complex":490}],509:[function(t,e,r){"use strict";function n(t){for(var e=t.length,r=0,n=0;n<e;++n)r=0|Math.max(r,t[n].length);return r-1}function i(t,e){for(var r=t.length,n=h.mallocUint8(r),i=0;i<r;++i)n[i]=t[i]<e|0;return n}function a(t,e){for(var r=t.length,n=e*(e+1)/2*r|0,i=h.mallocUint32(2*n),a=0,o=0;o<r;++o)for(var s=t[o],e=s.length,l=0;l<e;++l)for(var u=0;u<l;++u){var d=s[u],p=s[l];i[a++]=0|Math.min(d,p),i[a++]=0|Math.max(d,p)}f(c(i,[a/2|0,2]));for(var m=2,o=2;o<a;o+=2)i[o-2]===i[o]&&i[o-1]===i[o+1]||(i[m++]=i[o],i[m++]=i[o+1]);return c(i,[m/2|0,2])}function o(t,e,r,n){for(var i=t.data,a=t.shape[0],o=h.mallocDouble(a),s=0,l=0;l<a;++l){var u=i[2*l],f=i[2*l+1];if(r[u]!==r[f]){var d=e[u],p=e[f];i[2*s]=u,i[2*s+1]=f,o[s++]=(p-n)/(p-d)}}return t.shape[0]=s,c(o,[s])}function s(t,e){var r=h.mallocInt32(2*e),n=t.shape[0],i=t.data;r[0]=0;for(var a=0,o=0;o<n;++o){var s=i[2*o];if(s!==a){for(r[2*a+1]=o;++a<s;)r[2*a]=o,r[2*a+1]=o;r[2*a]=o}}for(r[2*a+1]=n;++a<e;)r[2*a]=r[2*a+1]=n;return r}function l(t){for(var e=0|t.shape[0],r=t.data,n=new Array(e),i=0;i<e;++i)n[i]=[r[2*i],r[2*i+1]];return n}function u(t,e,r,u){if(r=r||0,void 0===u&&(u=n(t)),0===t.length||u<1)return{cells:[],vertexIds:[],vertexWeights:[]};var c=i(e,+r),f=a(t,u),p=o(f,e,c,+r),m=s(f,0|e.length),v=d(u)(t,f.data,m,c),g=l(f),y=[].slice.call(p.data,0,p.shape[0]);return h.free(c),h.free(f.data),h.free(p.data),h.free(m),{cells:v,vertexIds:g,vertexWeights:y}}e.exports=u;var c=t("ndarray"),h=t("typedarray-pool"),f=t("ndarray-sort"),d=t("./lib/codegen")},{"./lib/codegen":510,ndarray:460,"ndarray-sort":458,"typedarray-pool":533}],510:[function(t,e,r){"use strict";function n(t){var e=0,r=new Array(t+1);r[0]=[[]];for(var n=1;n<=t;++n)for(var i=r[n]=o(n),s=0;s<i.length;++s)e=Math.max(e,i[n].length)
46 ;for(var l=["function B(C,E,i,j){","var a=Math.min(i,j)|0,b=Math.max(i,j)|0,l=C[2*a],h=C[2*a+1];","while(l<h){","var m=(l+h)>>1,v=E[2*m+1];","if(v===b){return m}","if(b<v){h=m}else{l=m+1}","}","return l;","};","function getContour",t,"d(F,E,C,S){","var n=F.length,R=[];","for(var i=0;i<n;++i){var c=F[i],l=c.length;"],n=t+1;n>1;--n){n<t+1&&l.push("else "),l.push("if(l===",n,"){");for(var u=[],s=0;s<n;++s)u.push("(S[c["+s+"]]<<"+s+")");l.push("var M=",u.join("+"),";if(M===0||M===",(1<<n)-1,"){continue}switch(M){");for(var i=r[n-1],s=0;s<i.length;++s)l.push("case ",s,":"),function(t){if(!(t.length<=0)){l.push("R.push(");for(var e=0;e<t.length;++e){var r=t[e];e>0&&l.push(","),l.push("[");for(var n=0;n<r.length;++n){var i=r[n];n>0&&l.push(","),l.push("B(C,E,c[",i[0],"],c[",i[1],"])")}l.push("]")}l.push(");")}}(i[s]),l.push("break;");l.push("}}")}return l.push("}return R;};return getContour",t,"d"),new Function("pool",l.join(""))(a)}function i(t){var e=s[t];return e||(e=s[t]=n(t)),e}e.exports=i;var a=t("typedarray-pool"),o=t("marching-simplex-table"),s={}},{"marching-simplex-table":438,"typedarray-pool":533}],511:[function(t,e,r){"use strict";"use restrict";function n(t){for(var e=0,r=Math.max,n=0,i=t.length;n<i;++n)e=r(e,t[n].length);return e-1}function i(t){for(var e=-1,r=Math.max,n=0,i=t.length;n<i;++n)for(var a=t[n],o=0,s=a.length;o<s;++o)e=r(e,a[o]);return e+1}function a(t){for(var e=new Array(t.length),r=0,n=t.length;r<n;++r)e[r]=t[r].slice(0);return e}function o(t,e){var r=t.length,n=t.length-e.length,i=Math.min;if(n)return n;switch(r){case 0:return 0;case 1:return t[0]-e[0];case 2:var a=t[0]+t[1]-e[0]-e[1];return a||i(t[0],t[1])-i(e[0],e[1]);case 3:var o=t[0]+t[1],s=e[0]+e[1];if(a=o+t[2]-(s+e[2]))return a;var l=i(t[0],t[1]),u=i(e[0],e[1]),a=i(l,t[2])-i(u,e[2]);return a||i(l+t[2],o)-i(u+e[2],s);default:var c=t.slice(0);c.sort();var h=e.slice(0);h.sort();for(var f=0;f<r;++f)if(n=c[f]-h[f])return n;return 0}}function s(t,e){return o(t[0],e[0])}function l(t,e){if(e){for(var r=t.length,n=new Array(r),i=0;i<r;++i)n[i]=[t[i],e[i]];n.sort(s);for(var i=0;i<r;++i)t[i]=n[i][0],e[i]=n[i][1];return t}return t.sort(o),t}function u(t){if(0===t.length)return[];for(var e=1,r=t.length,n=1;n<r;++n){var i=t[n];if(o(i,t[n-1])){if(n===e){e++;continue}t[e++]=i}}return t.length=e,t}function c(t,e){for(var r=0,n=t.length-1,i=-1;r<=n;){var a=r+n>>1,s=o(t[a],e);s<=0?(0===s&&(i=a),r=a+1):s>0&&(n=a-1)}return i}function h(t,e){for(var r=new Array(t.length),n=0,i=r.length;n<i;++n)r[n]=[];for(var a=[],n=0,s=e.length;n<s;++n)for(var l=e[n],u=l.length,h=1,f=1<<u;h<f;++h){a.length=b.popCount(h);for(var d=0,p=0;p<u;++p)h&1<<p&&(a[d++]=l[p]);var m=c(t,a);if(!(m<0))for(;;)if(r[m++].push(n),m>=t.length||0!==o(t[m],a))break}return r}function f(t,e){if(!e)return h(u(p(t,0)),t,0);for(var r=new Array(e),n=0;n<e;++n)r[n]=[];for(var n=0,i=t.length;n<i;++n)for(var a=t[n],o=0,s=a.length;o<s;++o)r[a[o]].push(n);return r}function d(t){for(var e=[],r=0,n=t.length;r<n;++r)for(var i=t[r],a=0|i.length,o=1,s=1<<a;o<s;++o){for(var u=[],c=0;c<a;++c)o>>>c&1&&u.push(i[c]);e.push(u)}return l(e)}function p(t,e){if(e<0)return[];for(var r=[],n=(1<<e+1)-1,i=0;i<t.length;++i)for(var a=t[i],o=n;o<1<<a.length;o=b.nextCombination(o)){for(var s=new Array(e+1),u=0,c=0;c<a.length;++c)o&1<<c&&(s[u++]=a[c]);r.push(s)}return l(r)}function m(t){for(var e=[],r=0,n=t.length;r<n;++r)for(var i=t[r],a=0,o=i.length;a<o;++a){for(var s=new Array(i.length-1),u=0,c=0;u<o;++u)u!==a&&(s[c++]=i[u]);e.push(s)}return l(e)}function v(t,e){for(var r=new x(e),n=0;n<t.length;++n)for(var i=t[n],a=0;a<i.length;++a)for(var o=a+1;o<i.length;++o)r.link(i[a],i[o]);for(var s=[],l=r.ranks,n=0;n<l.length;++n)l[n]=-1;for(var n=0;n<t.length;++n){var u=r.find(t[n][0]);l[u]<0?(l[u]=s.length,s.push([t[n].slice(0)])):s[l[u]].push(t[n].slice(0))}return s}function g(t){for(var e=u(l(p(t,0))),r=new x(e.length),n=0;n<t.length;++n)for(var i=t[n],a=0;a<i.length;++a)for(var o=c(e,[i[a]]),s=a+1;s<i.length;++s)r.link(o,c(e,[i[s]]));for(var h=[],f=r.ranks,n=0;n<f.length;++n)f[n]=-1;for(var n=0;n<t.length;++n){var d=r.find(c(e,[t[n][0]]));f[d]<0?(f[d]=h.length,h.push([t[n].slice(0)])):h[f[d]].push(t[n].slice(0))}return h}function y(t,e){return e?v(t,e):g(t)}var b=t("bit-twiddle"),x=t("union-find");r.dimension=n,r.countVertices=i,r.cloneCells=a,r.compareCells=o,r.normalize=l,r.unique=u,r.findCell=c,r.incidence=h,r.dual=f,r.explode=d,r.skeleton=p,r.boundary=m,r.connectedComponents=y},{"bit-twiddle":63,"union-find":534}],512:[function(t,e,r){arguments[4][63][0].apply(r,arguments)},{dup:63}],513:[function(t,e,r){arguments[4][511][0].apply(r,arguments)},{"bit-twiddle":512,dup:511,"union-find":514}],514:[function(t,e,r){"use strict";"use restrict";function n(t){this.roots=new Array(t),this.ranks=new Array(t);for(var e=0;e<t;++e)this.roots[e]=e,this.ranks[e]=0}e.exports=n,n.prototype.length=function(){return this.roots.length},n.prototype.makeSet=function(){var t=this.roots.length;return this.roots.push(t),this.ranks.push(0),t},n.prototype.find=function(t){for(var e=this.roots;e[t]!==t;){var r=e[t];e[t]=e[r],t=r}return t},n.prototype.link=function(t,e){var r=this.find(t),n=this.find(e);if(r!==n){var i=this.ranks,a=this.roots,o=i[r],s=i[n];o<s?a[r]=n:s<o?a[n]=r:(a[n]=r,++i[r])}}},{}],515:[function(t,e,r){"use strict";function n(t,e,r){return Math.abs(a(t,e,r))/Math.sqrt(Math.pow(e[0]-r[0],2)+Math.pow(e[1]-r[1],2))}function i(t,e,r){function i(t){if(b[t])return 1/0;var r=v[t],i=g[t];return r<0||i<0?1/0:n(e[t],e[r],e[i])}function a(t,e){var r=k[t],n=k[e];k[t]=n,k[e]=r,A[r]=e,A[n]=t}function s(t){return y[k[t]]}function l(t){return 1&t?t-1>>1:(t>>1)-1}function u(t){for(var e=s(t);;){var r=e,n=2*t+1,i=2*(t+1),o=t;if(n<T){var l=s(n);l<r&&(o=n,r=l)}if(i<T){s(i)<r&&(o=i)}if(o===t)return t;a(t,o),t=o}}function c(t){for(var e=s(t);t>0;){var r=l(t);if(r>=0){if(e<s(r)){a(t,r),t=r;continue}}return t}}function h(){if(T>0){var t=k[0];return a(0,T-1),T-=1,u(0),t}return-1}function f(t,e){var r=k[t];return y[r]===e?t:(y[r]=-1/0,c(t),h(),y[r]=e,T+=1,c(T-1))}function d(t,e){if(t[e]<0)return e;var r=e,n=e;do{var i=t[n];if(!b[n]||i<0||i===n)break;if(n=i,i=t[n],!b[n]||i<0||i===n)break;n=i,r=t[r]}while(r!==n);for(var a=e;a!==n;a=t[a])t[a]=n;return n}for(var p=e.length,m=t.length,v=new Array(p),g=new Array(p),y=new Array(p),b=new Array(p),x=0;x<p;++x)v[x]=g[x]=-1,y[x]=1/0,b[x]=!1;for(var x=0;x<m;++x){var _=t[x];if(2!==_.length)throw new Error("Input must be a graph");var w=_[1],M=_[0];g[M]!==-1?g[M]=-2:g[M]=w,v[w]!==-1?v[w]=-2:v[w]=M}for(var k=[],A=new Array(p),x=0;x<p;++x){(y[x]=i(x))<1/0?(A[x]=k.length,k.push(x)):A[x]=-1}for(var T=k.length,x=T>>1;x>=0;--x)u(x);for(;;){var S=h();if(S<0||y[S]>r)break;!function(t){if(!b[t]){b[t]=!0;var e=v[t],r=g[t];v[r]>=0&&(v[r]=e),g[e]>=0&&(g[e]=r),A[e]>=0&&f(A[e],i(e)),A[r]>=0&&f(A[r],i(r))}}(S)}for(var E=[],x=0;x<p;++x)b[x]||(A[x]=E.length,E.push(e[x].slice()));var L=(E.length,[]);return t.forEach(function(t){var e=d(v,t[0]),r=d(g,t[1]);if(e>=0&&r>=0&&e!==r){var n=A[e],i=A[r];n!==i&&L.push([n,i])}}),o.unique(o.normalize(L)),{positions:E,edges:L}}e.exports=i;var a=t("robust-orientation"),o=t("simplicial-complex")},{"robust-orientation":500,"simplicial-complex":513}],516:[function(t,e,r){"use strict";function n(t,e){var r,n;if(e[0][0]<e[1][0])r=e[0],n=e[1];else{if(!(e[0][0]>e[1][0])){var i=Math.min(t[0][1],t[1][1]),o=Math.max(t[0][1],t[1][1]),s=Math.min(e[0][1],e[1][1]),l=Math.max(e[0][1],e[1][1]);return o<s?o-s:i>l?i-l:o-l}r=e[1],n=e[0]}var u,c;t[0][1]<t[1][1]?(u=t[0],c=t[1]):(u=t[1],c=t[0]);var h=a(n,r,u);return h||((h=a(n,r,c))||c-n)}function i(t,e){var r,i;if(e[0][0]<e[1][0])r=e[0],i=e[1];else{if(!(e[0][0]>e[1][0]))return n(e,t);r=e[1],i=e[0]}var o,s;if(t[0][0]<t[1][0])o=t[0],s=t[1];else{if(!(t[0][0]>t[1][0]))return-n(t,e);o=t[1],s=t[0]}var l=a(r,i,s),u=a(r,i,o);if(l<0){if(u<=0)return l}else if(l>0){if(u>=0)return l}else if(u)return u;if(l=a(s,o,i),u=a(s,o,r),l<0){if(u<=0)return l}else if(l>0){if(u>=0)return l}else if(u)return u;return i[0]-s[0]}e.exports=i;var a=t("robust-orientation")},{"robust-orientation":500}],517:[function(t,e,r){"use strict";function n(t,e,r){this.slabs=t,this.coordinates=e,this.horizontal=r}function i(t,e){return t.y-e}function a(t,e){for(var r=null;t;){var n,i,o=t.key;o[0][0]<o[1][0]?(n=o[0],i=o[1]):(n=o[1],i=o[0]);var s=h(n,i,e);if(s<0)t=t.left;else if(s>0)if(e[0]!==o[1][0])r=t,t=t.right;else{var l=a(t.right,e);if(l)return l;t=t.left}else{if(e[0]!==o[1][0])return t;var l=a(t.right,e);if(l)return l;t=t.left}}return r}function o(t,e,r,n){this.y=t,this.index=e,this.start=r,this.closed=n}function s(t,e,r,n){this.x=t,this.segment=e,this.create=r,this.index=n}function l(t){for(var e=t.length,r=2*e,i=new Array(r),a=0;a<e;++a){var l=t[a],u=l[0][0]<l[1][0];i[2*a]=new s(l[0][0],l,u,a),i[2*a+1]=new s(l[1][0],l,!u,a)}i.sort(function(t,e){var r=t.x-e.x;return r||((r=t.create-e.create)||Math.min(t.segment[0][1],t.segment[1][1])-Math.min(e.segment[0][1],e.segment[1][1]))});for(var h=c(f),d=[],p=[],m=[],a=0;a<r;){for(var v=i[a].x,g=[];a<r;){var y=i[a];if(y.x!==v)break;a+=1,y.segment[0][0]===y.x&&y.segment[1][0]===y.x?y.create&&(y.segment[0][1]<y.segment[1][1]?(g.push(new o(y.segment[0][1],y.index,!0,!0)),g.push(new o(y.segment[1][1],y.index,!1,!1))):(g.push(new o(y.segment[1][1],y.index,!0,!1)),g.push(new o(y.segment[0][1],y.index,!1,!0)))):h=y.create?h.insert(y.segment,y.index):h.remove(y.segment)}d.push(h.root),p.push(v),m.push(g)}return new n(d,p,m)}e.exports=l;var u=t("binary-search-bounds"),c=t("functional-red-black-tree"),h=t("robust-orientation"),f=t("./lib/order-segments");n.prototype.castUp=function(t){var e=u.le(this.coordinates,t[0]);if(e<0)return-1;var r=(this.slabs[e],a(this.slabs[e],t)),n=-1;if(r&&(n=r.value),this.coordinates[e]===t[0]){var o=null;if(r&&(o=r.key),e>0){var s=a(this.slabs[e-1],t);s&&(o?f(s.key,o)>0&&(o=s.key,n=s.value):(n=s.value,o=s.key))}var l=this.horizontal[e];if(l.length>0){var c=u.ge(l,t[1],i);if(c<l.length){var d=l[c];if(t[1]===d.y){if(d.closed)return d.index;for(;c<l.length-1&&l[c+1].y===t[1];)if(c+=1,d=l[c],d.closed)return d.index;if(d.y===t[1]&&!d.start){if((c+=1)>=l.length)return n;d=l[c]}}if(d.start)if(o){var p=h(o[0],o[1],[t[0],d.y]);o[0][0]>o[1][0]&&(p=-p),p>0&&(n=d.index)}else n=d.index;else d.y!==t[1]&&(n=d.index)}}}return n}},{"./lib/order-segments":516,"binary-search-bounds":62,"functional-red-black-tree":131,"robust-orientation":500}],518:[function(t,e,r){"use strict";function n(t,e){var r=u(l(t,e),[e[e.length-1]]);return r[r.length-1]}function i(t,e,r,n){var i=n-e,a=-e/i;a<0?a=0:a>1&&(a=1);for(var o=1-a,s=t.length,l=new Array(s),u=0;u<s;++u)l[u]=a*t[u]+o*r[u];return l}function a(t,e){for(var r=[],a=[],o=n(t[t.length-1],e),s=t[t.length-1],l=t[0],u=0;u<t.length;++u,s=l){l=t[u];var c=n(l,e);if(o<0&&c>0||o>0&&c<0){var h=i(s,c,l,o);r.push(h),a.push(h.slice())}c<0?a.push(l.slice()):c>0?r.push(l.slice()):(r.push(l.slice()),a.push(l.slice())),o=c}return{positive:r,negative:a}}function o(t,e){for(var r=[],a=n(t[t.length-1],e),o=t[t.length-1],s=t[0],l=0;l<t.length;++l,o=s){s=t[l];var u=n(s,e);(a<0&&u>0||a>0&&u<0)&&r.push(i(o,u,s,a)),u>=0&&r.push(s.slice()),a=u}return r}function s(t,e){for(var r=[],a=n(t[t.length-1],e),o=t[t.length-1],s=t[0],l=0;l<t.length;++l,o=s){s=t[l];var u=n(s,e);(a<0&&u>0||a>0&&u<0)&&r.push(i(o,u,s,a)),u<=0&&r.push(s.slice()),a=u}return r}var l=t("robust-dot-product"),u=t("robust-sum");e.exports=a,e.exports.positive=o,e.exports.negative=s},{"robust-dot-product":497,"robust-sum":505}],519:[function(e,r,n){!function(e){function r(){var t=arguments[0],e=r.cache;return e[t]&&e.hasOwnProperty(t)||(e[t]=r.parse(t)),r.format.call(null,e[t],arguments)}function i(t){return Object.prototype.toString.call(t).slice(8,-1).toLowerCase()}function a(t,e){return Array(e+1).join(t)}var o={not_string:/[^s]/,number:/[diefg]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijosuxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[\+\-]/};r.format=function(t,e){var n,s,l,u,c,h,f,d=1,p=t.length,m="",v=[],g=!0,y="";for(s=0;s<p;s++)if("string"===(m=i(t[s])))v[v.length]=t[s];else if("array"===m){if(u=t[s],u[2])for(n=e[d],l=0;l<u[2].length;l++){if(!n.hasOwnProperty(u[2][l]))throw new Error(r("[sprintf] property '%s' does not exist",u[2][l]));n=n[u[2][l]]}else n=u[1]?e[u[1]]:e[d++];if("function"==i(n)&&(n=n()),o.not_string.test(u[8])&&o.not_json.test(u[8])&&"number"!=i(n)&&isNaN(n))throw new TypeError(r("[sprintf] expecting number but found %s",i(n)));switch(o.number.test(u[8])&&(g=n>=0),u[8]){case"b":n=n.toString(2);break;case"c":n=String.fromCharCode(n);break;case"d":case"i":n=parseInt(n,10);break;case"j":n=JSON.stringify(n,null,u[6]?parseInt(u[6]):0);break;case"e":n=u[7]?n.toExponential(u[7]):n.toExponential();break;case"f":n=u[7]?parseFloat(n).toFixed(u[7]):parseFloat(n);break;case"g":n=u[7]?parseFloat(n).toPrecision(u[7]):parseFloat(n);break;case"o":n=n.toString(8);break;case"s":n=(n=String(n))&&u[7]?n.substring(0,u[7]):n;break;case"u":n>>>=0;break;case"x":n=n.toString(16);break;case"X":n=n.toString(16).toUpperCase()}o.json.test(u[8])?v[v.length]=n:(!o.number.test(u[8])||g&&!u[3]?y="":(y=g?"+":"-",n=n.toString().replace(o.sign,"")),h=u[4]?"0"===u[4]?"0":u[4].charAt(1):" ",f=u[6]-(y+n).length,c=u[6]&&f>0?a(h,f):"",v[v.length]=u[5]?y+n+c:"0"===h?y+c+n:c+y+n)}return v.join("")},r.cache={},r.parse=function(t){for(var e=t,r=[],n=[],i=0;e;){if(null!==(r=o.text.exec(e)))n[n.length]=r[0];else if(null!==(r=o.modulo.exec(e)))n[n.length]="%";else{if(null===(r=o.placeholder.exec(e)))throw new SyntaxError("[sprintf] unexpected placeholder");if(r[2]){i|=1;var a=[],s=r[2],l=[];if(null===(l=o.key.exec(s)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(a[a.length]=l[1];""!==(s=s.substring(l[0].length));)if(null!==(l=o.key_access.exec(s)))a[a.length]=l[1];else{if(null===(l=o.index_access.exec(s)))throw new SyntaxError("[sprintf] failed to parse named argument key");a[a.length]=l[1]}r[2]=a}else i|=2;if(3===i)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");n[n.length]=r}e=e.substring(r[0].length)}return n};var s=function(t,e,n){return n=(e||[]).slice(0),n.splice(0,0,t),r.apply(null,n)};void 0!==n?(n.sprintf=r,n.vsprintf=s):(e.sprintf=r,e.vsprintf=s,"function"==typeof t&&t.amd&&t(function(){return{sprintf:r,vsprintf:s}}))}("undefined"==typeof window?this:window)},{}],520:[function(t,e,r){"use strict";function n(t){for(var e=t.length,r=new Array(e),n=new Array(e),i=new Array(e),a=new Array(e),o=new Array(e),s=new Array(e),l=0;l<e;++l)r[l]=-1,n[l]=0,i[l]=!1,a[l]=0,o[l]=-1,s[l]=[];for(var u=0,c=[],h=[],l=0;l<e;++l)r[l]<0&&function(e){var l=[e],f=[e];for(r[e]=n[e]=u,i[e]=!0,u+=1;f.length>0;){e=f[f.length-1];var d=t[e];if(a[e]<d.length){for(var p=a[e];p<d.length;++p){var m=d[p];if(r[m]<0){r[m]=n[m]=u,i[m]=!0,u+=1,l.push(m),f.push(m);break}i[m]&&(n[e]=0|Math.min(n[e],n[m])),o[m]>=0&&s[e].push(o[m])}a[e]=p}else{if(n[e]===r[e]){for(var v=[],g=[],y=0,p=l.length-1;p>=0;--p){var b=l[p];if(i[b]=!1,v.push(b),g.push(s[b]),y+=s[b].length,o[b]=c.length,b===e){l.length=p;break}}c.push(v);for(var x=new Array(y),p=0;p<g.length;p++)for(var _=0;_<g[p].length;_++)x[--y]=g[p][_];h.push(x)}f.pop()}}}(l);for(var f,l=0;l<h.length;l++){var d=h[l];if(0!==d.length){d.sort(function(t,e){return t-e}),f=[d[0]];for(var p=1;p<d.length;p++)d[p]!==d[p-1]&&f.push(d[p]);h[l]=f}}return{components:c,adjacencyList:h}}e.exports=n},{}],521:[function(t,e,r){"use strict";function n(t){return new i(t)}function i(t){this.options=d(Object.create(this.options),t),this.trees=new Array(this.options.maxZoom+1)}function a(t,e,r,n,i){return{x:t,y:e,zoom:1/0,id:n,properties:i,parentId:-1,numPoints:r}}function o(t,e){var r=t.geometry.coordinates;return{x:u(r[0]),y:c(r[1]),zoom:1/0,id:e,parentId:-1}}function s(t){return{type:"Feature",properties:l(t),geometry:{type:"Point",coordinates:[h(t.x),f(t.y)]}}}function l(t){var e=t.numPoints,r=e>=1e4?Math.round(e/1e3)+"k":e>=1e3?Math.round(e/100)/10+"k":e;return d(d({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:r})}function u(t){return t/360+.5}function c(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 h(t){return 360*(t-.5)}function f(t){var e=(180-360*t)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}function d(t,e){for(var r in e)t[r]=e[r];return t}function p(t){return t.x}function m(t){return t.y}var v=t("kdbush");e.exports=n,i.prototype={options:{minZoom:0,maxZoom:16,radius:40,extent:512,nodeSize:64,log:!1,reduce:null,initial:function(){return{}},map:function(t){return t}},load:function(t){var e=this.options.log;e&&console.time("total time");var r="prepare "+t.length+" points";e&&console.time(r),this.points=t;var n=t.map(o);e&&console.timeEnd(r);for(var i=this.options.maxZoom;i>=this.options.minZoom;i--){var a=+Date.now();this.trees[i+1]=v(n,p,m,this.options.nodeSize,Float32Array),n=this._cluster(n,i),e&&console.log("z%d: %d clusters in %dms",i,n.length,+Date.now()-a)}return this.trees[this.options.minZoom]=v(n,p,m,this.options.nodeSize,Float32Array),e&&console.timeEnd("total time"),this},getClusters:function(t,e){for(var r=this.trees[this._limitZoom(e)],n=r.range(u(t[0]),c(t[3]),u(t[2]),c(t[1])),i=[],a=0;a<n.length;a++){var o=r.points[n[a]];i.push(o.numPoints?s(o):this.points[o.id])}return i},getChildren:function(t,e){for(var r=this.trees[e+1].points[t],n=this.options.radius/(this.options.extent*Math.pow(2,e)),i=this.trees[e+1].within(r.x,r.y,n),a=[],o=0;o<i.length;o++){var l=this.trees[e+1].points[i[o]];l.parentId===t&&a.push(l.numPoints?s(l):this.points[l.id])}return a},getLeaves:function(t,e,r,n){r=r||10,n=n||0;var i=[];return this._appendLeaves(i,t,e,r,n,0),i},getTile:function(t,e,r){var n=this.trees[this._limitZoom(t)],i=Math.pow(2,t),a=this.options.extent,o=this.options.radius,s=o/a,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},getClusterExpansionZoom:function(t,e){for(;e<this.options.maxZoom;){var r=this.getChildren(t,e);if(e++,1!==r.length)break;t=r[0].properties.cluster_id}return e},_appendLeaves:function(t,e,r,n,i,a){for(var o=this.getChildren(e,r),s=0;s<o.length;s++){var l=o[s].properties;if(l.cluster?a+l.point_count<=i?a+=l.point_count:a=this._appendLeaves(t,l.cluster_id,r+1,n,i,a):a<i?a++:t.push(o[s]),t.length===n)break}return a},_addTileFeatures:function(t,e,r,n,i,a){for(var o=0;o<t.length;o++){var s=e[t[o]];a.features.push({type:1,geometry:[[Math.round(this.options.extent*(s.x*i-r)),Math.round(this.options.extent*(s.y*i-n))]],tags:s.numPoints?l(s):this.points[s.id].properties})}},_limitZoom:function(t){return Math.max(this.options.minZoom,Math.min(t,this.options.maxZoom+1))},_cluster:function(t,e){for(var r=[],n=this.options.radius/(this.options.extent*Math.pow(2,e)),i=0;i<t.length;i++){var o=t[i];if(!(o.zoom<=e)){o.zoom=e;var s=this.trees[e+1],l=s.within(o.x,o.y,n),u=o.numPoints||1,c=o.x*u,h=o.y*u,f=null;this.options.reduce&&(f=this.options.initial(),this._accumulate(f,o));for(var d=0;d<l.length;d++){var p=s.points[l[d]];if(e<p.zoom){var m=p.numPoints||1;p.zoom=e,c+=p.x*m,h+=p.y*m,u+=m,p.parentId=i,this.options.reduce&&this._accumulate(f,p)}}1===u?r.push(o):(o.parentId=i,r.push(a(c/u,h/u,u,i,f)))}}return r},_accumulate:function(t,e){var r=e.numPoints?e.properties:this.options.map(this.points[e.id].properties);this.options.reduce(t,r)}}},{kdbush:291}],522:[function(t,e,r){"use strict";function n(t){return t.split("").map(function(t){return t in i?i[t]:""}).join("")}e.exports=n;var i={" ":" ",0:"\u2070",1:"\xb9",2:"\xb2",3:"\xb3",4:"\u2074",5:"\u2075",6:"\u2076",7:"\u2077",8:"\u2078",9:"\u2079","+":"\u207a","-":"\u207b",a:"\u1d43",b:"\u1d47",c:"\u1d9c",d:"\u1d48",e:"\u1d49",f:"\u1da0",g:"\u1d4d",h:"\u02b0",i:"\u2071",j:"\u02b2",k:"\u1d4f",l:"\u02e1",m:"\u1d50",n:"\u207f",o:"\u1d52",p:"\u1d56",r:"\u02b3",s:"\u02e2",t:"\u1d57",u:"\u1d58",v:"\u1d5b",w:"\u02b7",x:"\u02e3",y:"\u02b8",z:"\u1dbb"}},{}],523:[function(t,e,r){"use strict";function n(t,e){var r=t.length,n=["'use strict';"],i="surfaceNets"+t.join("_")+"d"+e;n.push("var contour=genContour({","order:[",t.join(),"],","scalarArguments: 3,","phase:function phaseFunc(p,a,b,c) { return (p > c)|0 },"),"generic"===e&&n.push("getters:[0],");for(var a=[],l=[],u=0;u<r;++u)a.push("d"+u),l.push("d"+u);for(var u=0;u<1<<r;++u)a.push("v"+u),l.push("v"+u);for(var u=0;u<1<<r;++u)a.push("p"+u),l.push("p"+u);a.push("a","b","c"),l.push("a","c"),n.push("vertex:function vertexFunc(",a.join(),"){");for(var c=[],u=0;u<1<<r;++u)c.push("(p"+u+"<<"+u+")");n.push("var m=(",c.join("+"),")|0;if(m===0||m===",(1<<(1<<r))-1,"){return}");var h=[],f=[];1<<(1<<r)<=128?(n.push("switch(m){"),f=n):n.push("switch(m>>>7){");for(var u=0;u<1<<(1<<r);++u){if(1<<(1<<r)>128&&u%128==0){h.length>0&&f.push("}}");var d="vExtra"+h.length;n.push("case ",u>>>7,":",d,"(m&0x7f,",l.join(),");break;"),f=["function ",d,"(m,",l.join(),"){switch(m){"],h.push(f)}f.push("case ",127&u,":");for(var p=new Array(r),m=new Array(r),v=new Array(r),g=new Array(r),y=0,b=0;b<r;++b)p[b]=[],m[b]=[],v[b]=0,g[b]=0;for(var b=0;b<1<<r;++b)for(var x=0;x<r;++x){var _=b^1<<x;if(!(_>b)&&!(u&1<<_)!=!(u&1<<b)){var w=1;u&1<<_?m[x].push("v"+_+"-v"+b):(m[x].push("v"+b+"-v"+_),w=-w),w<0?(p[x].push("-v"+b+"-v"+_),v[x]+=2):(p[x].push("v"+b+"+v"+_),v[x]-=2),y+=1;for(var M=0;M<r;++M)M!==x&&(_&1<<M?g[M]+=1:g[M]-=1)}}for(var k=[],x=0;x<r;++x)if(0===p[x].length)k.push("d"+x+"-0.5");else{var A="";v[x]<0?A=v[x]+"*c":v[x]>0&&(A="+"+v[x]+"*c");var T=p[x].length/y*.5,S=.5+g[x]/y*.5;k.push("d"+x+"-"+S+"-"+T+"*("+p[x].join("+")+A+")/("+m[x].join("+")+")")}f.push("a.push([",k.join(),"]);","break;")}n.push("}},"),h.length>0&&f.push("}}");for(var E=[],u=0;u<1<<r-1;++u)E.push("v"+u);E.push("c0","c1","p0","p1","a","b","c"),n.push("cell:function cellFunc(",E.join(),"){");var L=s(r-1);n.push("if(p0){b.push(",L.map(function(t){return"["+t.map(function(t){return"v"+t})+"]"}).join(),")}else{b.push(",L.map(function(t){var e=t.slice();return e.reverse(),"["+e.map(function(t){return"v"+t})+"]"}).join(),")}}});function ",i,"(array,level){var verts=[],cells=[];contour(array,verts,cells,level);return {positions:verts,cells:cells};} return ",i,";");for(var u=0;u<h.length;++u)n.push(h[u].join(""));return new Function("genContour",n.join(""))(o)}function i(t,e){for(var r=l(t,e),n=r.length,i=new Array(n),a=new Array(n),o=0;o<n;++o)i[o]=[r[o]],a[o]=[o];return{positions:i,cells:a}}function a(t,e){if(t.dimension<=0)return{positions:[],cells:[]};if(1===t.dimension)return i(t,e);var r=t.order.join()+"-"+t.dtype,a=u[r],e=+e||0;return a||(a=u[r]=n(t.order,t.dtype)),a(t,e)}e.exports=a;var o=t("ndarray-extract-contour"),s=t("triangulate-hypercube"),l=t("zero-crossings"),u={}},{"ndarray-extract-contour":449,"triangulate-hypercube":529,"zero-crossings":576}],524:[function(t,e,r){(function(r){"use strict";function n(t){for(var e=t.cells,r=t.positions,n=new Float32Array(6*e.length),i=0,a=0,o=0;o<e.length;++o)for(var s=e[o],l=0;l<3;++l){var u=r[s[l]];n[i++]=u[0],n[i++]=u[1]+1.4,a=Math.max(u[0],a)}return{data:n,shape:a}}function i(t,e,r){var r=r||{},o=s[t];o||(o=s[t]={" ":{data:new Float32Array(0),shape:.2}});var l=o[e];if(!l)if(e.length<=1||!/\d/.test(e))l=o[e]=n(a(e,{triangles:!0,font:t,textAlign:r.textAlign||"left",textBaseline:"alphabetic"}));else{for(var u=e.split(/(\d|\s)/),c=new Array(u.length),h=0,f=0,d=0;d<u.length;++d)c[d]=i(t,u[d]),h+=c[d].data.length,f+=c[d].shape,d>0&&(f+=.02);for(var p=new Float32Array(h),m=0,v=-.5*f,d=0;d<c.length;++d){for(var g=c[d].data,y=0;y<g.length;y+=2)p[m++]=g[y]+v,p[m++]=g[y+1];v+=c[d].shape+.02}l=o[e]={data:p,shape:f}}return l}e.exports=i;var a=t("vectorize-text"),o=window||r.global||{},s=o.__TEXT_CACHE||{};o.__TEXT_CACHE={}}).call(this,t("_process"))},{_process:479,"vectorize-text":546}],525:[function(t,e,r){"use strict";function n(t,e,r,n,i){this.fontSize=t||24,this.buffer=void 0===e?3:e,this.cutoff=n||.25,this.fontFamily=i||"sans-serif",this.radius=r||8;var a=this.size=this.fontSize+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=a,this.ctx=this.canvas.getContext("2d"),this.ctx.font=t+"px "+this.fontFamily,this.ctx.textBaseline="middle",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(a*a),this.gridInner=new Float64Array(a*a),this.f=new Float64Array(a),this.d=new Float64Array(a),this.z=new Float64Array(a+1),this.v=new Int16Array(a),this.middle=Math.round(a/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function i(t,e,r,n,i,o,s){for(var l=0;l<e;l++){for(var u=0;u<r;u++)n[u]=t[u*e+l];for(a(n,i,o,s,r),u=0;u<r;u++)t[u*e+l]=i[u]}for(u=0;u<r;u++){for(l=0;l<e;l++)n[l]=t[u*e+l];for(a(n,i,o,s,e),l=0;l<e;l++)t[u*e+l]=Math.sqrt(i[l])}}function a(t,e,r,n,i){r[0]=0,n[0]=-o,n[1]=+o;for(var a=1,s=0;a<i;a++){for(var l=(t[a]+a*a-(t[r[s]]+r[s]*r[s]))/(2*a-2*r[s]);l<=n[s];)s--,l=(t[a]+a*a-(t[r[s]]+r[s]*r[s]))/(2*a-2*r[s]);s++,r[s]=a,n[s]=l,n[s+1]=+o}for(a=0,s=0;a<i;a++){for(;n[s+1]<a;)s++;e[a]=(a-r[s])*(a-r[s])+t[r[s]]}}e.exports=n;var o=1e20;n.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=e.data,n=0;n<this.size*this.size;n++){var a=r[4*n+3]/255;this.gridOuter[n]=1===a?0:0===a?o:Math.pow(Math.max(0,.5-a),2),this.gridInner[n]=1===a?o:0===a?0:Math.pow(Math.max(0,a-.5),2)}for(i(this.gridOuter,this.size,this.size,this.f,this.d,this.v,this.z),i(this.gridInner,this.size,this.size,this.f,this.d,this.v,this.z),n=0;n<this.size*this.size;n++){var s=this.gridOuter[n]-this.gridInner[n],l=Math.max(0,Math.min(255,Math.round(255-255*(s/this.radius+this.cutoff))));r[4*n+0]=l,r[4*n+1]=l,r[4*n+2]=l,r[4*n+3]=255}return e}},{}],526:[function(e,r,n){!function(e){function n(t,e){if(t=t||"",e=e||{},t instanceof n)return t;if(!(this instanceof n))return new n(t,e);var r=i(t);this._originalInput=t,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=V(100*this._a)/100,this._format=e.format||r.format,this._gradientType=e.gradientType,this._r<1&&(this._r=V(this._r)),this._g<1&&(this._g=V(this._g)),this._b<1&&(this._b=V(this._b)),this._ok=r.ok,this._tc_id=U++}function i(t){var e={r:0,g:0,b:0},r=1,n=null,i=null,o=null,l=!1,c=!1;return"string"==typeof t&&(t=F(t)),"object"==typeof t&&(j(t.r)&&j(t.g)&&j(t.b)?(e=a(t.r,t.g,t.b),l=!0,c="%"===String(t.r).substr(-1)?"prgb":"rgb"):j(t.h)&&j(t.s)&&j(t.v)?(n=I(t.s),i=I(t.v),e=u(t.h,n,i),l=!0,c="hsv"):j(t.h)&&j(t.s)&&j(t.l)&&(n=I(t.s),o=I(t.l),e=s(t.h,n,o),l=!0,c="hsl"),t.hasOwnProperty("a")&&(r=t.a)),r=T(r),{ok:l,format:t.format||c,r:q(255,H(e.r,0)),g:q(255,H(e.g,0)),b:q(255,H(e.b,0)),a:r}}function a(t,e,r){return{r:255*S(t,255),g:255*S(e,255),b:255*S(r,255)}}function o(t,e,r){t=S(t,255),e=S(e,255),r=S(r,255);var n,i,a=H(t,e,r),o=q(t,e,r),s=(a+o)/2;if(a==o)n=i=0;else{var l=a-o;switch(i=s>.5?l/(2-a-o):l/(a+o),a){case t:n=(e-r)/l+(e<r?6:0);break;case e:n=(r-t)/l+2;break;case r:n=(t-e)/l+4}n/=6}return{h:n,s:i,l:s}}function s(t,e,r){function n(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}var i,a,o;if(t=S(t,360),e=S(e,100),r=S(r,100),0===e)i=a=o=r;else{var s=r<.5?r*(1+e):r+e-r*e,l=2*r-s;i=n(l,s,t+1/3),a=n(l,s,t),o=n(l,s,t-1/3)}return{r:255*i,g:255*a,b:255*o}}function l(t,e,r){t=S(t,255),e=S(e,255),r=S(r,255);var n,i,a=H(t,e,r),o=q(t,e,r),s=a,l=a-o;if(i=0===a?0:l/a,a==o)n=0;else{switch(a){case t:n=(e-r)/l+(e<r?6:0);break;case e:n=(r-t)/l+2;break;case r:n=(t-e)/l+4}n/=6}return{h:n,s:i,v:s}}function u(t,r,n){t=6*S(t,360),r=S(r,100),n=S(n,100);var i=e.floor(t),a=t-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]}}function c(t,e,r,n){var i=[D(V(t).toString(16)),D(V(e).toString(16)),D(V(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 h(t,e,r,n,i){var a=[D(V(t).toString(16)),D(V(e).toString(16)),D(V(r).toString(16)),D(P(n))];return i&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)&&a[3].charAt(0)==a[3].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0):a.join("")}function f(t,e,r,n){return[D(P(n)),D(V(t).toString(16)),D(V(e).toString(16)),D(V(r).toString(16))].join("")}function d(t,e){e=0===e?0:e||10;var r=n(t).toHsl();return r.s-=e/100,r.s=E(r.s),n(r)}function p(t,e){e=0===e?0:e||10;var r=n(t).toHsl();return r.s+=e/100,r.s=E(r.s),n(r)}function m(t){return n(t).desaturate(100)}function v(t,e){e=0===e?0:e||10;var r=n(t).toHsl();return r.l+=e/100,r.l=E(r.l),n(r)}function g(t,e){e=0===e?0:e||10;var r=n(t).toRgb();return r.r=H(0,q(255,r.r-V(-e/100*255))),r.g=H(0,q(255,r.g-V(-e/100*255))),r.b=H(0,q(255,r.b-V(-e/100*255))),n(r)}function y(t,e){e=0===e?0:e||10;var r=n(t).toHsl();return r.l-=e/100,r.l=E(r.l),n(r)}function b(t,e){var r=n(t).toHsl(),i=(r.h+e)%360;return r.h=i<0?360+i:i,n(r)}function x(t){var e=n(t).toHsl();return e.h=(e.h+180)%360,n(e)}function _(t){var e=n(t).toHsl(),r=e.h;return[n(t),n({h:(r+120)%360,s:e.s,l:e.l}),n({h:(r+240)%360,s:e.s,l:e.l})]}function w(t){var e=n(t).toHsl(),r=e.h;return[n(t),n({h:(r+90)%360,s:e.s,l:e.l}),n({h:(r+180)%360,s:e.s,l:e.l}),n({h:(r+270)%360,s:e.s,l:e.l})]}function M(t){var e=n(t).toHsl(),r=e.h;return[n(t),n({h:(r+72)%360,s:e.s,l:e.l}),n({h:(r+216)%360,s:e.s,l:e.l})]}function k(t,e,r){e=e||6,r=r||30;var i=n(t).toHsl(),a=360/r,o=[n(t)];for(i.h=(i.h-(a*e>>1)+720)%360;--e;)i.h=(i.h+a)%360,o.push(n(i));return o}function A(t,e){e=e||6;for(var r=n(t).toHsv(),i=r.h,a=r.s,o=r.v,s=[],l=1/e;e--;)s.push(n({h:i,s:a,v:o})),o=(o+l)%1;return s}function T(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function S(t,r){C(t)&&(t="100%");var n=z(t);return t=q(r,H(0,parseFloat(t))),n&&(t=parseInt(t*r,10)/100),e.abs(t-r)<1e-6?1:t%r/parseFloat(r)}function E(t){return q(1,H(0,t))}function L(t){return parseInt(t,16)}function C(t){return"string"==typeof t&&t.indexOf(".")!=-1&&1===parseFloat(t)}function z(t){return"string"==typeof t&&t.indexOf("%")!=-1}function D(t){return 1==t.length?"0"+t:""+t}function I(t){return t<=1&&(t=100*t+"%"),t}function P(t){return e.round(255*parseFloat(t)).toString(16)}function O(t){return L(t)/255}function j(t){return!!W.CSS_UNIT.exec(t)}function F(t){t=t.replace(N,"").replace(B,"").toLowerCase();var e=!1;if(Y[t])t=Y[t],e=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};var r;return(r=W.rgb.exec(t))?{r:r[1],g:r[2],b:r[3]}:(r=W.rgba.exec(t))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=W.hsl.exec(t))?{h:r[1],s:r[2],l:r[3]}:(r=W.hsla.exec(t))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=W.hsv.exec(t))?{h:r[1],s:r[2],v:r[3]}:(r=W.hsva.exec(t))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=W.hex8.exec(t))?{r:L(r[1]),g:L(r[2]),b:L(r[3]),a:O(r[4]),format:e?"name":"hex8"}:(r=W.hex6.exec(t))?{r:L(r[1]),g:L(r[2]),b:L(r[3]),format:e?"name":"hex"}:(r=W.hex4.exec(t))?{r:L(r[1]+""+r[1]),g:L(r[2]+""+r[2]),b:L(r[3]+""+r[3]),a:O(r[4]+""+r[4]),format:e?"name":"hex8"}:!!(r=W.hex3.exec(t))&&{r:L(r[1]+""+r[1]),g:L(r[2]+""+r[2]),b:L(r[3]+""+r[3]),format:e?"name":"hex"}}function R(t){var e,r;return t=t||{level:"AA",size:"small"},e=(t.level||"AA").toUpperCase(),r=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA"),"small"!==r&&"large"!==r&&(r="small"),{level:e,size:r}}var N=/^\s+/,B=/\s+$/,U=0,V=e.round,q=e.min,H=e.max,G=e.random;n.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(){
47 var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var t,r,n,i,a,o,s=this.toRgb();return t=s.r/255,r=s.g/255,n=s.b/255,i=t<=.03928?t/12.92:e.pow((t+.055)/1.055,2.4),a=r<=.03928?r/12.92:e.pow((r+.055)/1.055,2.4),o=n<=.03928?n/12.92:e.pow((n+.055)/1.055,2.4),.2126*i+.7152*a+.0722*o},setAlpha:function(t){return this._a=T(t),this._roundA=V(100*this._a)/100,this},toHsv:function(){var t=l(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=l(this._r,this._g,this._b),e=V(360*t.h),r=V(100*t.s),n=V(100*t.v);return 1==this._a?"hsv("+e+", "+r+"%, "+n+"%)":"hsva("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=o(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=o(this._r,this._g,this._b),e=V(360*t.h),r=V(100*t.s),n=V(100*t.l);return 1==this._a?"hsl("+e+", "+r+"%, "+n+"%)":"hsla("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return c(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return h(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:V(this._r),g:V(this._g),b:V(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+V(this._r)+", "+V(this._g)+", "+V(this._b)+")":"rgba("+V(this._r)+", "+V(this._g)+", "+V(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:V(100*S(this._r,255))+"%",g:V(100*S(this._g,255))+"%",b:V(100*S(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+V(100*S(this._r,255))+"%, "+V(100*S(this._g,255))+"%, "+V(100*S(this._b,255))+"%)":"rgba("+V(100*S(this._r,255))+"%, "+V(100*S(this._g,255))+"%, "+V(100*S(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(X[c(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+f(this._r,this._g,this._b,this._a),r=e,i=this._gradientType?"GradientType = 1, ":"";if(t){var a=n(t);r="#"+f(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+i+"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 n(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(v,arguments)},brighten:function(){return this._applyModification(g,arguments)},darken:function(){return this._applyModification(y,arguments)},desaturate:function(){return this._applyModification(d,arguments)},saturate:function(){return this._applyModification(p,arguments)},greyscale:function(){return this._applyModification(m,arguments)},spin:function(){return this._applyModification(b,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(k,arguments)},complement:function(){return this._applyCombination(x,arguments)},monochromatic:function(){return this._applyCombination(A,arguments)},splitcomplement:function(){return this._applyCombination(M,arguments)},triad:function(){return this._applyCombination(_,arguments)},tetrad:function(){return this._applyCombination(w,arguments)}},n.fromRatio=function(t,e){if("object"==typeof t){var r={};for(var i in t)t.hasOwnProperty(i)&&(r[i]="a"===i?t[i]:I(t[i]));t=r}return n(t,e)},n.equals=function(t,e){return!(!t||!e)&&n(t).toRgbString()==n(e).toRgbString()},n.random=function(){return n.fromRatio({r:G(),g:G(),b:G()})},n.mix=function(t,e,r){r=0===r?0:r||50;var i=n(t).toRgb(),a=n(e).toRgb(),o=r/100;return n({r:(a.r-i.r)*o+i.r,g:(a.g-i.g)*o+i.g,b:(a.b-i.b)*o+i.b,a:(a.a-i.a)*o+i.a})},n.readability=function(t,r){var i=n(t),a=n(r);return(e.max(i.getLuminance(),a.getLuminance())+.05)/(e.min(i.getLuminance(),a.getLuminance())+.05)},n.isReadable=function(t,e,r){var i,a,o=n.readability(t,e);switch(a=!1,i=R(r),i.level+i.size){case"AAsmall":case"AAAlarge":a=o>=4.5;break;case"AAlarge":a=o>=3;break;case"AAAsmall":a=o>=7}return a},n.mostReadable=function(t,e,r){var i,a,o,s,l=null,u=0;r=r||{},a=r.includeFallbackColors,o=r.level,s=r.size;for(var c=0;c<e.length;c++)(i=n.readability(t,e[c]))>u&&(u=i,l=n(e[c]));return n.isReadable(t,l,{level:o,size:s})||!a?l:(r.includeFallbackColors=!1,n.mostReadable(t,["#fff","#000"],r))};var Y=n.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"},X=n.hexNames=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}(Y),W=function(){var t="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)",e="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?",r="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?";return{CSS_UNIT:new RegExp(t),rgb:new RegExp("rgb"+e),rgba:new RegExp("rgba"+r),hsl:new RegExp("hsl"+e),hsla:new RegExp("hsla"+r),hsv:new RegExp("hsv"+e),hsva:new RegExp("hsva"+r),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})$/}}();void 0!==r&&r.exports?r.exports=n:"function"==typeof t&&t.amd?t(function(){return n}):window.tinycolor=n}(Math)},{}],527:[function(t,e,r){"use strict";function n(t,e){var r=o(getComputedStyle(t).getPropertyValue(e));return r[0]*a(r[1],t)}function i(t,e){var r=document.createElement("div");r.style["font-size"]="128"+t,e.appendChild(r);var i=n(r,"font-size")/128;return e.removeChild(r),i}function a(t,e){switch(e=e||document.body,t=(t||"px").trim().toLowerCase(),e!==window&&e!==document||(e=document.body),t){case"%":return e.clientHeight/100;case"ch":case"ex":return i(t,e);case"em":return n(e,"font-size");case"rem":return n(document.body,"font-size");case"vw":return window.innerWidth/100;case"vh":return window.innerHeight/100;case"vmin":return Math.min(window.innerWidth,window.innerHeight)/100;case"vmax":return Math.max(window.innerWidth,window.innerHeight)/100;case"in":return s;case"cm":return s/2.54;case"mm":return s/25.4;case"pt":return s/72;case"pc":return s/6}return 1}var o=t("parse-unit");e.exports=a;var s=96},{"parse-unit":467}],528:[function(e,r,n){!function(e,i){"object"==typeof n&&void 0!==r?i(n):"function"==typeof t&&t.amd?t(["exports"],i):i(e.topojson=e.topojson||{})}(this,function(t){"use strict";function e(t,e){var n=e.id,i=e.bbox,a=null==e.properties?{}:e.properties,o=r(t,e);return null==n&&null==i?{type:"Feature",properties:a,geometry:o}:null==i?{type:"Feature",id:n,properties:a,geometry:o}:{type:"Feature",id:n,bbox:i,properties:a,geometry:o}}function r(t,e){function r(t,e){e.length&&e.pop();for(var r=h[t<0?~t:t],n=0,i=r.length;n<i;++n)e.push(u(r[n].slice(),n));t<0&&c(e,i)}function n(t){return u(t.slice())}function i(t){for(var e=[],n=0,i=t.length;n<i;++n)r(t[n],e);return e.length<2&&e.push(e[0].slice()),e}function a(t){for(var e=i(t);e.length<4;)e.push(e[0].slice());return e}function o(t){return t.map(a)}function s(t){var e,r=t.type;switch(r){case"GeometryCollection":return{type:r,geometries:t.geometries.map(s)};case"Point":e=n(t.coordinates);break;case"MultiPoint":e=t.coordinates.map(n);break;case"LineString":e=i(t.arcs);break;case"MultiLineString":e=t.arcs.map(i);break;case"Polygon":e=o(t.arcs);break;case"MultiPolygon":e=t.arcs.map(o);break;default:return null}return{type:r,coordinates:e}}var u=l(t),h=t.arcs;return s(e)}function n(t,e,r){var n,a,o;if(arguments.length>1)n=i(t,e,r);else for(a=0,n=new Array(o=t.arcs.length);a<o;++a)n[a]=a;return{type:"MultiLineString",arcs:f(t,n)}}function i(t,e,r){function n(t){var e=t<0?~t:t;(c[e]||(c[e]=[])).push({i:t,g:l})}function i(t){t.forEach(n)}function a(t){t.forEach(i)}function o(t){t.forEach(a)}function s(t){switch(l=t,t.type){case"GeometryCollection":t.geometries.forEach(s);break;case"LineString":i(t.arcs);break;case"MultiLineString":case"Polygon":a(t.arcs);break;case"MultiPolygon":o(t.arcs)}}var l,u=[],c=[];return s(e),c.forEach(null==r?function(t){u.push(t[0].i)}:function(t){r(t[0].g,t[t.length-1].g)&&u.push(t[0].i)}),u}function a(t){for(var e,r=-1,n=t.length,i=t[n-1],a=0;++r<n;)e=i,i=t[r],a+=e[0]*i[1]-e[1]*i[0];return Math.abs(a)}function o(t,e){function n(t){switch(t.type){case"GeometryCollection":t.geometries.forEach(n);break;case"Polygon":i(t.arcs);break;case"MultiPolygon":t.arcs.forEach(i)}}function i(t){t.forEach(function(e){e.forEach(function(e){(s[e=e<0?~e:e]||(s[e]=[])).push(t)})}),l.push(t)}function o(e){return a(r(t,{type:"Polygon",arcs:[e]}).coordinates[0])}var s={},l=[],u=[];return e.forEach(n),l.forEach(function(t){if(!t._){var e=[],r=[t];for(t._=1,u.push(e);t=r.pop();)e.push(t),t.forEach(function(t){t.forEach(function(t){s[t<0?~t:t].forEach(function(t){t._||(t._=1,r.push(t))})})})}}),l.forEach(function(t){delete t._}),{type:"MultiPolygon",arcs:u.map(function(e){var r,n=[];if(e.forEach(function(t){t.forEach(function(t){t.forEach(function(t){s[t<0?~t:t].length<2&&n.push(t)})})}),n=f(t,n),(r=n.length)>1)for(var i,a,l=1,u=o(n[0]);l<r;++l)(i=o(n[l]))>u&&(a=n[0],n[0]=n[l],n[l]=a,u=i);return n})}}var s=function(t){return t},l=function(t){if(null==(e=t.transform))return s;var e,r,n,i=e.scale[0],a=e.scale[1],o=e.translate[0],l=e.translate[1];return function(t,e){return e||(r=n=0),t[0]=(r+=t[0])*i+o,t[1]=(n+=t[1])*a+l,t}},u=function(t){function e(t){s[0]=t[0],s[1]=t[1],o(s),s[0]<u&&(u=s[0]),s[0]>h&&(h=s[0]),s[1]<c&&(c=s[1]),s[1]>f&&(f=s[1])}function r(t){switch(t.type){case"GeometryCollection":t.geometries.forEach(r);break;case"Point":e(t.coordinates);break;case"MultiPoint":t.coordinates.forEach(e)}}var n=t.bbox;if(!n){var i,a,o=l(t),s=new Array(2),u=1/0,c=u,h=-u,f=-u;t.arcs.forEach(function(t){for(var e=-1,r=t.length;++e<r;)i=t[e],s[0]=i[0],s[1]=i[1],o(s,e),s[0]<u&&(u=s[0]),s[0]>h&&(h=s[0]),s[1]<c&&(c=s[1]),s[1]>f&&(f=s[1])});for(a in t.objects)r(t.objects[a]);n=t.bbox=[u,c,h,f]}return n},c=function(t,e){for(var r,n=t.length,i=n-e;i<--n;)r=t[i],t[i++]=t[n],t[n]=r},h=function(t,r){return"GeometryCollection"===r.type?{type:"FeatureCollection",features:r.geometries.map(function(r){return e(t,r)})}:e(t,r)},f=function(t,e){function r(e){var r,n=t.arcs[e<0?~e:e],i=n[0];return t.transform?(r=[0,0],n.forEach(function(t){r[0]+=t[0],r[1]+=t[1]})):r=n[n.length-1],e<0?[r,i]:[i,r]}function n(t,e){for(var r in t){var n=t[r];delete e[n.start],delete n.start,delete n.end,n.forEach(function(t){i[t<0?~t:t]=1}),s.push(n)}}var i={},a={},o={},s=[],l=-1;return e.forEach(function(r,n){var i,a=t.arcs[r<0?~r:r];a.length<3&&!a[1][0]&&!a[1][1]&&(i=e[++l],e[l]=r,e[n]=i)}),e.forEach(function(t){var e,n,i=r(t),s=i[0],l=i[1];if(e=o[s])if(delete o[e.end],e.push(t),e.end=l,n=a[l]){delete a[n.start];var u=n===e?e:e.concat(n);a[u.start=e.start]=o[u.end=n.end]=u}else a[e.start]=o[e.end]=e;else if(e=a[l])if(delete a[e.start],e.unshift(t),e.start=s,n=o[s]){delete o[n.end];var c=n===e?e:n.concat(e);a[c.start=n.start]=o[c.end=e.end]=c}else a[e.start]=o[e.end]=e;else e=[t],a[e.start=s]=o[e.end=l]=e}),n(o,a),n(a,o),e.forEach(function(t){i[t<0?~t:t]||s.push([t])}),s},d=function(t){return r(t,n.apply(this,arguments))},p=function(t){return r(t,o.apply(this,arguments))},m=function(t,e){for(var r=0,n=t.length;r<n;){var i=r+n>>>1;t[i]<e?r=i+1:n=i}return r},v=function(t){function e(t,e){t.forEach(function(t){t<0&&(t=~t);var r=i[t];r?r.push(e):i[t]=[e]})}function r(t,r){t.forEach(function(t){e(t,r)})}function n(t,e){"GeometryCollection"===t.type?t.geometries.forEach(function(t){n(t,e)}):t.type in o&&o[t.type](t.arcs,e)}var i={},a=t.map(function(){return[]}),o={LineString:e,MultiLineString:r,Polygon:r,MultiPolygon:function(t,e){t.forEach(function(t){r(t,e)})}};t.forEach(n);for(var s in i)for(var l=i[s],u=l.length,c=0;c<u;++c)for(var h=c+1;h<u;++h){var f,d=l[c],p=l[h];(f=a[d])[s=m(f,p)]!==p&&f.splice(s,0,p),(f=a[p])[s=m(f,d)]!==d&&f.splice(s,0,d)}return a},g=function(t,e){function r(t){t[0]=Math.round((t[0]-o)/s),t[1]=Math.round((t[1]-l)/c)}function n(t){switch(t.type){case"GeometryCollection":t.geometries.forEach(n);break;case"Point":r(t.coordinates);break;case"MultiPoint":t.coordinates.forEach(r)}}if(!((e=Math.floor(e))>=2))throw new Error("n must be \u22652");if(t.transform)throw new Error("already quantized");var i,a=u(t),o=a[0],s=(a[2]-o)/(e-1)||1,l=a[1],c=(a[3]-l)/(e-1)||1;t.arcs.forEach(function(t){for(var e,r,n,i=1,a=1,u=t.length,h=t[0],f=h[0]=Math.round((h[0]-o)/s),d=h[1]=Math.round((h[1]-l)/c);i<u;++i)h=t[i],r=Math.round((h[0]-o)/s),n=Math.round((h[1]-l)/c),r===f&&n===d||(e=t[a++],e[0]=r-f,f=r,e[1]=n-d,d=n);a<2&&(e=t[a++],e[0]=0,e[1]=0),t.length=a});for(i in t.objects)n(t.objects[i]);return t.transform={scale:[s,c],translate:[o,l]},t},y=function(t){if(null==(e=t.transform))return s;var e,r,n,i=e.scale[0],a=e.scale[1],o=e.translate[0],l=e.translate[1];return function(t,e){e||(r=n=0);var s=Math.round((t[0]-o)/i),u=Math.round((t[1]-l)/a);return t[0]=s-r,r=s,t[1]=u-n,n=u,t}};t.bbox=u,t.feature=h,t.mesh=d,t.meshArcs=n,t.merge=p,t.mergeArcs=o,t.neighbors=v,t.quantize=g,t.transform=l,t.untransform=y,Object.defineProperty(t,"__esModule",{value:!0})})},{}],529:[function(t,e,r){"use strict";function n(t){if(t<0)return[];if(0===t)return[[0]];for(var e=0|Math.round(o(t+1)),r=[],n=0;n<e;++n){for(var s=i.unrank(t,n),l=[0],u=0,c=0;c<s.length;++c)u+=1<<s[c],l.push(u);a(s)<1&&(l[0]=u,l[t]=0),r.push(l)}return r}e.exports=n;var i=t("permutation-rank"),a=t("permutation-parity"),o=t("gamma")},{gamma:132,"permutation-parity":471,"permutation-rank":472}],530:[function(t,e,r){"use strict";function n(t,e,r){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2))}function i(t){return Math.min(1,Math.max(-1,t))}function a(t){var e=Math.abs(t[0]),r=Math.abs(t[1]),n=Math.abs(t[2]),i=[0,0,0];e>Math.max(r,n)?i[2]=1:r>Math.max(e,n)?i[0]=1:i[1]=1;for(var a=0,o=0,s=0;s<3;++s)a+=t[s]*t[s],o+=i[s]*t[s];for(var s=0;s<3;++s)i[s]-=o/a*t[s];return f(i,i),i}function o(t,e,r,n,i,a,o,s){this.center=l(r),this.up=l(n),this.right=l(i),this.radius=l([a]),this.angle=l([o,s]),this.angle.bounds=[[-1/0,-Math.PI/2],[1/0,Math.PI/2]],this.setDistanceLimits(t,e),this.computedCenter=this.center.curve(0),this.computedUp=this.up.curve(0),this.computedRight=this.right.curve(0),this.computedRadius=this.radius.curve(0),this.computedAngle=this.angle.curve(0),this.computedToward=[0,0,0],this.computedEye=[0,0,0],this.computedMatrix=new Array(16);for(var u=0;u<16;++u)this.computedMatrix[u]=.5;this.recalcMatrix(0)}function s(t){t=t||{};var e=t.center||[0,0,0],r=t.up||[0,1,0],i=t.right||a(r),s=t.radius||1,l=t.theta||0,u=t.phi||0;if(e=[].slice.call(e,0,3),r=[].slice.call(r,0,3),f(r,r),i=[].slice.call(i,0,3),f(i,i),"eye"in t){var c=t.eye,p=[c[0]-e[0],c[1]-e[1],c[2]-e[2]];h(i,p,r),n(i[0],i[1],i[2])<1e-6?i=a(r):f(i,i),s=n(p[0],p[1],p[2]);var m=d(r,p)/s,v=d(i,p)/s;u=Math.acos(m),l=Math.acos(v)}return s=Math.log(s),new o(t.zoomMin,t.zoomMax,e,r,i,s,l,u)}e.exports=s;var l=t("filtered-vector"),u=t("gl-mat4/invert"),c=t("gl-mat4/rotate"),h=t("gl-vec3/cross"),f=t("gl-vec3/normalize"),d=t("gl-vec3/dot"),p=o.prototype;p.setDistanceLimits=function(t,e){t=t>0?Math.log(t):-1/0,e=e>0?Math.log(e):1/0,e=Math.max(e,t),this.radius.bounds[0][0]=t,this.radius.bounds[1][0]=e},p.getDistanceLimits=function(t){var e=this.radius.bounds[0];return t?(t[0]=Math.exp(e[0][0]),t[1]=Math.exp(e[1][0]),t):[Math.exp(e[0][0]),Math.exp(e[1][0])]},p.recalcMatrix=function(t){this.center.curve(t),this.up.curve(t),this.right.curve(t),this.radius.curve(t),this.angle.curve(t);for(var e=this.computedUp,r=this.computedRight,i=0,a=0,o=0;o<3;++o)a+=e[o]*r[o],i+=e[o]*e[o];for(var s=Math.sqrt(i),l=0,o=0;o<3;++o)r[o]-=e[o]*a/i,l+=r[o]*r[o],e[o]/=s;for(var u=Math.sqrt(l),o=0;o<3;++o)r[o]/=u;var c=this.computedToward;h(c,e,r),f(c,c);for(var d=Math.exp(this.computedRadius[0]),p=this.computedAngle[0],m=this.computedAngle[1],v=Math.cos(p),g=Math.sin(p),y=Math.cos(m),b=Math.sin(m),x=this.computedCenter,_=v*y,w=g*y,M=b,k=-v*b,A=-g*b,T=y,S=this.computedEye,E=this.computedMatrix,o=0;o<3;++o){var L=_*r[o]+w*c[o]+M*e[o];E[4*o+1]=k*r[o]+A*c[o]+T*e[o],E[4*o+2]=L,E[4*o+3]=0}var C=E[1],z=E[5],D=E[9],I=E[2],P=E[6],O=E[10],j=z*O-D*P,F=D*I-C*O,R=C*P-z*I,N=n(j,F,R);j/=N,F/=N,R/=N,E[0]=j,E[4]=F,E[8]=R;for(var o=0;o<3;++o)S[o]=x[o]+E[2+4*o]*d;for(var o=0;o<3;++o){for(var l=0,B=0;B<3;++B)l+=E[o+4*B]*S[B];E[12+o]=-l}E[15]=1},p.getMatrix=function(t,e){this.recalcMatrix(t);var r=this.computedMatrix;if(e){for(var n=0;n<16;++n)e[n]=r[n];return e}return r};var m=[0,0,0];p.rotate=function(t,e,r,n){if(this.angle.move(t,e,r),n){this.recalcMatrix(t);var i=this.computedMatrix;m[0]=i[2],m[1]=i[6],m[2]=i[10];for(var a=this.computedUp,o=this.computedRight,s=this.computedToward,l=0;l<3;++l)i[4*l]=a[l],i[4*l+1]=o[l],i[4*l+2]=s[l];c(i,i,n,m);for(var l=0;l<3;++l)a[l]=i[4*l],o[l]=i[4*l+1];this.up.set(t,a[0],a[1],a[2]),this.right.set(t,o[0],o[1],o[2])}},p.pan=function(t,e,r,i){e=e||0,r=r||0,i=i||0,this.recalcMatrix(t);var a=this.computedMatrix,o=(Math.exp(this.computedRadius[0]),a[1]),s=a[5],l=a[9],u=n(o,s,l);o/=u,s/=u,l/=u;var c=a[0],h=a[4],f=a[8],d=c*o+h*s+f*l;c-=o*d,h-=s*d,f-=l*d;var p=n(c,h,f);c/=p,h/=p,f/=p;var m=c*e+o*r,v=h*e+s*r,g=f*e+l*r;this.center.move(t,m,v,g);var y=Math.exp(this.computedRadius[0]);y=Math.max(1e-4,y+i),this.radius.set(t,Math.log(y))},p.translate=function(t,e,r,n){this.center.move(t,e||0,r||0,n||0)},p.setMatrix=function(t,e,r,a){var o=1;"number"==typeof r&&(o=0|r),(o<0||o>3)&&(o=1);var s=(o+2)%3;e||(this.recalcMatrix(t),e=this.computedMatrix);var l=e[o],c=e[o+4],h=e[o+8];if(a){var f=Math.abs(l),d=Math.abs(c),p=Math.abs(h),m=Math.max(f,d,p);f===m?(l=l<0?-1:1,c=h=0):p===m?(h=h<0?-1:1,l=c=0):(c=c<0?-1:1,l=h=0)}else{var v=n(l,c,h);l/=v,c/=v,h/=v}var g=e[s],y=e[s+4],b=e[s+8],x=g*l+y*c+b*h;g-=l*x,y-=c*x,b-=h*x;var _=n(g,y,b);g/=_,y/=_,b/=_;var w=c*b-h*y,M=h*g-l*b,k=l*y-c*g,A=n(w,M,k);w/=A,M/=A,k/=A,this.center.jump(t,H,G,Y),this.radius.idle(t),this.up.jump(t,l,c,h),this.right.jump(t,g,y,b);var T,S;if(2===o){var E=e[1],L=e[5],C=e[9],z=E*g+L*y+C*b,D=E*w+L*M+C*k;T=j<0?-Math.PI/2:Math.PI/2,S=Math.atan2(D,z)}else{var I=e[2],P=e[6],O=e[10],j=I*l+P*c+O*h,F=I*g+P*y+O*b,R=I*w+P*M+O*k;T=Math.asin(i(j)),S=Math.atan2(R,F)}this.angle.jump(t,S,T),this.recalcMatrix(t);var N=e[2],B=e[6],U=e[10],V=this.computedMatrix;u(V,e);var q=V[15],H=V[12]/q,G=V[13]/q,Y=V[14]/q,X=Math.exp(this.computedRadius[0]);this.center.jump(t,H-N*X,G-B*X,Y-U*X)},p.lastT=function(){return Math.max(this.center.lastT(),this.up.lastT(),this.right.lastT(),this.radius.lastT(),this.angle.lastT())},p.idle=function(t){this.center.idle(t),this.up.idle(t),this.right.idle(t),this.radius.idle(t),this.angle.idle(t)},p.flush=function(t){this.center.flush(t),this.up.flush(t),this.right.flush(t),this.radius.flush(t),this.angle.flush(t)},p.setDistance=function(t,e){e>0&&this.radius.set(t,Math.log(e))},p.lookAt=function(t,e,r,a){this.recalcMatrix(t),e=e||this.computedEye,r=r||this.computedCenter,a=a||this.computedUp;var o=a[0],s=a[1],l=a[2],u=n(o,s,l);if(!(u<1e-6)){o/=u,s/=u,l/=u;var c=e[0]-r[0],h=e[1]-r[1],f=e[2]-r[2],d=n(c,h,f);if(!(d<1e-6)){c/=d,h/=d,f/=d;var p=this.computedRight,m=p[0],v=p[1],g=p[2],y=o*m+s*v+l*g;m-=y*o,v-=y*s,g-=y*l;var b=n(m,v,g);if(!(b<.01&&(m=s*f-l*h,v=l*c-o*f,g=o*h-s*c,(b=n(m,v,g))<1e-6))){m/=b,v/=b,g/=b,this.up.set(t,o,s,l),this.right.set(t,m,v,g),this.center.set(t,r[0],r[1],r[2]),this.radius.set(t,Math.log(d));var x=s*g-l*v,_=l*m-o*g,w=o*v-s*m,M=n(x,_,w);x/=M,_/=M,w/=M;var k=o*c+s*h+l*f,A=m*c+v*h+g*f,T=x*c+_*h+w*f,S=Math.asin(i(k)),E=Math.atan2(T,A),L=this.angle._state,C=L[L.length-1],z=L[L.length-2];C%=2*Math.PI;var D=Math.abs(C+2*Math.PI-E),I=Math.abs(C-E),P=Math.abs(C-2*Math.PI-E);D<I&&(C+=2*Math.PI),P<I&&(C-=2*Math.PI),this.angle.jump(this.angle.lastT(),C,z),this.angle.set(t,E,S)}}}}},{"filtered-vector":129,"gl-mat4/invert":176,"gl-mat4/rotate":180,"gl-vec3/cross":267,"gl-vec3/dot":268,"gl-vec3/normalize":271}],531:[function(t,e,r){"use strict";function n(t,e,r){var n=t*e,a=i*t,o=a-t,s=a-o,l=t-s,u=i*e,c=u-e,h=u-c,f=e-h,d=n-s*h,p=d-l*h,m=p-s*f,v=l*f-m;return r?(r[0]=v,r[1]=n,r):[v,n]}e.exports=n;var i=+(Math.pow(2,27)+1)},{}],532:[function(t,e,r){"use strict";function n(t,e,r){var n=t+e,i=n-t,a=n-i,o=e-i,s=t-a;return r?(r[0]=s+o,r[1]=n,r):[s+o,n]}e.exports=n},{}],533:[function(t,e,r){(function(e,n){"use strict";function i(t){if(t){var e=t.length||t.byteLength,r=y.log2(e);w[r].push(t)}}function a(t){i(t.buffer)}function o(t){var t=y.nextPow2(t),e=y.log2(t),r=w[e];return r.length>0?r.pop():new ArrayBuffer(t)}function s(t){return new Uint8Array(o(t),0,t)}function l(t){return new Uint16Array(o(2*t),0,t)}function u(t){return new Uint32Array(o(4*t),0,t)}function c(t){return new Int8Array(o(t),0,t)}function h(t){return new Int16Array(o(2*t),0,t)}function f(t){return new Int32Array(o(4*t),0,t)}function d(t){return new Float32Array(o(4*t),0,t)}function p(t){return new Float64Array(o(8*t),0,t)}function m(t){return x?new Uint8ClampedArray(o(t),0,t):s(t)}function v(t){return new DataView(o(t),0,t)}function g(t){t=y.nextPow2(t);var e=y.log2(t),r=M[e];return r.length>0?r.pop():new n(t)}var y=t("bit-twiddle"),b=t("dup");e.__TYPEDARRAY_POOL||(e.__TYPEDARRAY_POOL={UINT8:b([32,0]),UINT16:b([32,0]),UINT32:b([32,0]),INT8:b([32,0]),INT16:b([32,0]),INT32:b([32,0]),FLOAT:b([32,0]),DOUBLE:b([32,0]),DATA:b([32,0]),UINT8C:b([32,0]),BUFFER:b([32,0])});var x="undefined"!=typeof Uint8ClampedArray,_=e.__TYPEDARRAY_POOL;_.UINT8C||(_.UINT8C=b([32,0])),_.BUFFER||(_.BUFFER=b([32,0]));var w=_.DATA,M=_.BUFFER;r.free=function(t){if(n.isBuffer(t))M[y.log2(t.length)].push(t);else{if("[object ArrayBuffer]"!==Object.prototype.toString.call(t)&&(t=t.buffer),!t)return;var e=t.length||t.byteLength,r=0|y.log2(e);w[r].push(t)}},r.freeUint8=r.freeUint16=r.freeUint32=r.freeInt8=r.freeInt16=r.freeInt32=r.freeFloat32=r.freeFloat=r.freeFloat64=r.freeDouble=r.freeUint8Clamped=r.freeDataView=a,r.freeArrayBuffer=i,r.freeBuffer=function(t){M[y.log2(t.length)].push(t)},r.malloc=function(t,e){if(void 0===e||"arraybuffer"===e)return o(t);switch(e){case"uint8":return s(t);case"uint16":return l(t);case"uint32":return u(t);case"int8":return c(t);case"int16":return h(t);case"int32":return f(t);case"float":case"float32":return d(t);case"double":case"float64":return p(t);case"uint8_clamped":return m(t);case"buffer":return g(t);case"data":case"dataview":return v(t);default:return null}return null},r.mallocArrayBuffer=o,r.mallocUint8=s,r.mallocUint16=l,r.mallocUint32=u,r.mallocInt8=c,r.mallocInt16=h,r.mallocInt32=f,r.mallocFloat32=r.mallocFloat=d,r.mallocFloat64=r.mallocDouble=p,r.mallocUint8Clamped=m,r.mallocDataView=v,r.mallocBuffer=g,r.clearCache=function(){for(var t=0;t<32;++t)_.UINT8[t].length=0,_.UINT16[t].length=0,_.UINT32[t].length=0,_.INT8[t].length=0,_.INT16[t].length=0,_.INT32[t].length=0,_.FLOAT[t].length=0,_.DOUBLE[t].length=0,_.UINT8C[t].length=0,w[t].length=0,M[t].length=0}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("buffer").Buffer)},{"bit-twiddle":63,buffer:73,dup:121}],534:[function(t,e,r){"use strict";"use restrict";function n(t){this.roots=new Array(t),this.ranks=new Array(t);for(var e=0;e<t;++e)this.roots[e]=e,this.ranks[e]=0}e.exports=n;var i=n.prototype;Object.defineProperty(i,"length",{get:function(){return this.roots.length}}),i.makeSet=function(){var t=this.roots.length;return this.roots.push(t),this.ranks.push(0),t},i.find=function(t){for(var e=t,r=this.roots;r[t]!==t;)t=r[t];for(;r[e]!==t;){var n=r[e];r[e]=t,e=n}return t},i.link=function(t,e){var r=this.find(t),n=this.find(e);if(r!==n){var i=this.ranks,a=this.roots,o=i[r],s=i[n];o<s?a[r]=n:s<o?a[n]=r:(a[n]=r,++i[r])}}},{}],535:[function(t,e,r){"use strict";function n(t,e){for(var r=1,n=t.length,i=t[0],a=t[0],o=1;o<n;++o)if(a=i,i=t[o],e(i,a)){if(o===r){r++;continue}t[r++]=i}return t.length=r,t}function i(t){for(var e=1,r=t.length,n=t[0],i=t[0],a=1;a<r;++a,i=n)if(i=n,(n=t[a])!==i){if(a===e){e++;continue}t[e++]=n}return t.length=e,t}function a(t,e,r){return 0===t.length?t:e?(r||t.sort(e),n(t,e)):(r||t.sort(),i(t))}e.exports=a},{}],536:[function(t,e,r){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}e.exports=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){void 0===e&&(e=1e-6);var r,n,i,a,o;for(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(r=0,n=1,(i=t)<r)return r;if(i>n)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))}},{}],537:[function(t,e,r){"use strict";function n(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function i(t,e,r){if(t&&u.isObject(t)&&t instanceof n)return t;var i=new n;return i.parse(t,e,r),i}function a(t){return u.isString(t)&&(t=i(t)),t instanceof n?t.format():n.prototype.format.call(t)}function o(t,e){return i(t,!1,!0).resolve(e)}function s(t,e){return t?i(t,!1,!0).resolveObject(e):e}var l=t("punycode"),u=t("./util");r.parse=i,r.resolve=o,r.resolveObject=s,r.format=a,r.Url=n;var c=/^([a-z0-9.+-]+:)/i,h=/:[0-9]*$/,f=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,d=["<",">",'"',"`"," ","\r","\n","\t"],p=["{","}","|","\\","^","`"].concat(d),m=["'"].concat(p),v=["%","/","?",";","#"].concat(m),g=["/","?","#"],y={javascript:!0,"javascript:":!0},b={javascript:!0,"javascript:":!0},x={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},_=t("querystring");n.prototype.parse=function(t,e,r){if(!u.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var n=t.indexOf("?"),i=n!==-1&&n<t.indexOf("#")?"?":"#",a=t.split(i);a[0]=a[0].replace(/\\/g,"/"),t=a.join(i);var o=t;if(o=o.trim(),!r&&1===t.split("#").length){var s=f.exec(o);if(s)return this.path=o,this.href=o,this.pathname=s[1],s[2]?(this.search=s[2],this.query=e?_.parse(this.search.substr(1)):this.search.substr(1)):e&&(this.search="",this.query={}),this}var h=c.exec(o);if(h){h=h[0];var d=h.toLowerCase();this.protocol=d,o=o.substr(h.length)}if(r||h||o.match(/^\/\/[^@\/]+@[^@\/]+/)){var p="//"===o.substr(0,2);!p||h&&b[h]||(o=o.substr(2),this.slashes=!0)}if(!b[h]&&(p||h&&!x[h])){for(var w=-1,M=0;M<g.length;M++){var k=o.indexOf(g[M]);k!==-1&&(w===-1||k<w)&&(w=k)}var A,T;T=w===-1?o.lastIndexOf("@"):o.lastIndexOf("@",w),T!==-1&&(A=o.slice(0,T),o=o.slice(T+1),this.auth=decodeURIComponent(A)),w=-1;for(var M=0;M<v.length;M++){var k=o.indexOf(v[M]);k!==-1&&(w===-1||k<w)&&(w=k)}w===-1&&(w=o.length),this.host=o.slice(0,w),o=o.slice(w),this.parseHost(),this.hostname=this.hostname||"";var S="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!S)for(var E=this.hostname.split(/\./),M=0,L=E.length;M<L;M++){var C=E[M];if(C&&!C.match(/^[+a-z0-9A-Z_-]{0,63}$/)){for(var z="",D=0,I=C.length;D<I;D++)C.charCodeAt(D)>127?z+="x":z+=C[D];if(!z.match(/^[+a-z0-9A-Z_-]{0,63}$/)){var P=E.slice(0,M),O=E.slice(M+1),j=C.match(/^([+a-z0-9A-Z_-]{0,63})(.*)$/);j&&(P.push(j[1]),O.unshift(j[2])),O.length&&(o="/"+O.join(".")+o),this.hostname=P.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),S||(this.hostname=l.toASCII(this.hostname));var F=this.port?":"+this.port:"",R=this.hostname||"";this.host=R+F,this.href+=this.host,S&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==o[0]&&(o="/"+o))}if(!y[d])for(var M=0,L=m.length;M<L;M++){var N=m[M];if(o.indexOf(N)!==-1){var B=encodeURIComponent(N);B===N&&(B=escape(N)),o=o.split(N).join(B)}}var U=o.indexOf("#");U!==-1&&(this.hash=o.substr(U),o=o.slice(0,U));var V=o.indexOf("?");if(V!==-1?(this.search=o.substr(V),this.query=o.substr(V+1),e&&(this.query=_.parse(this.query)),o=o.slice(0,V)):e&&(this.search="",this.query={}),o&&(this.pathname=o),x[d]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var F=this.pathname||"",q=this.search||"";this.path=F+q}return this.href=this.format(),this},n.prototype.format=function(){var t=this.auth||"";t&&(t=encodeURIComponent(t),t=t.replace(/%3A/i,":"),t+="@");var e=this.protocol||"",r=this.pathname||"",n=this.hash||"",i=!1,a=""
48 ;this.host?i=t+this.host:this.hostname&&(i=t+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(i+=":"+this.port)),this.query&&u.isObject(this.query)&&Object.keys(this.query).length&&(a=_.stringify(this.query));var o=this.search||a&&"?"+a||"";return e&&":"!==e.substr(-1)&&(e+=":"),this.slashes||(!e||x[e])&&i!==!1?(i="//"+(i||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):i||(i=""),n&&"#"!==n.charAt(0)&&(n="#"+n),o&&"?"!==o.charAt(0)&&(o="?"+o),r=r.replace(/[?#]/g,function(t){return encodeURIComponent(t)}),o=o.replace("#","%23"),e+i+r+o+n},n.prototype.resolve=function(t){return this.resolveObject(i(t,!1,!0)).format()},n.prototype.resolveObject=function(t){if(u.isString(t)){var e=new n;e.parse(t,!1,!0),t=e}for(var r=new n,i=Object.keys(this),a=0;a<i.length;a++){var o=i[a];r[o]=this[o]}if(r.hash=t.hash,""===t.href)return r.href=r.format(),r;if(t.slashes&&!t.protocol){for(var s=Object.keys(t),l=0;l<s.length;l++){var c=s[l];"protocol"!==c&&(r[c]=t[c])}return x[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r}if(t.protocol&&t.protocol!==r.protocol){if(!x[t.protocol]){for(var h=Object.keys(t),f=0;f<h.length;f++){var d=h[f];r[d]=t[d]}return r.href=r.format(),r}if(r.protocol=t.protocol,t.host||b[t.protocol])r.pathname=t.pathname;else{for(var p=(t.pathname||"").split("/");p.length&&!(t.host=p.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),""!==p[0]&&p.unshift(""),p.length<2&&p.unshift(""),r.pathname=p.join("/")}if(r.search=t.search,r.query=t.query,r.host=t.host||"",r.auth=t.auth,r.hostname=t.hostname||t.host,r.port=t.port,r.pathname||r.search){var m=r.pathname||"",v=r.search||"";r.path=m+v}return r.slashes=r.slashes||t.slashes,r.href=r.format(),r}var g=r.pathname&&"/"===r.pathname.charAt(0),y=t.host||t.pathname&&"/"===t.pathname.charAt(0),_=y||g||r.host&&t.pathname,w=_,M=r.pathname&&r.pathname.split("/")||[],p=t.pathname&&t.pathname.split("/")||[],k=r.protocol&&!x[r.protocol];if(k&&(r.hostname="",r.port=null,r.host&&(""===M[0]?M[0]=r.host:M.unshift(r.host)),r.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(""===p[0]?p[0]=t.host:p.unshift(t.host)),t.host=null),_=_&&(""===p[0]||""===M[0])),y)r.host=t.host||""===t.host?t.host:r.host,r.hostname=t.hostname||""===t.hostname?t.hostname:r.hostname,r.search=t.search,r.query=t.query,M=p;else if(p.length)M||(M=[]),M.pop(),M=M.concat(p),r.search=t.search,r.query=t.query;else if(!u.isNullOrUndefined(t.search)){if(k){r.hostname=r.host=M.shift();var A=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@");A&&(r.auth=A.shift(),r.host=r.hostname=A.shift())}return r.search=t.search,r.query=t.query,u.isNull(r.pathname)&&u.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!M.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var T=M.slice(-1)[0],S=(r.host||t.host||M.length>1)&&("."===T||".."===T)||""===T,E=0,L=M.length;L>=0;L--)T=M[L],"."===T?M.splice(L,1):".."===T?(M.splice(L,1),E++):E&&(M.splice(L,1),E--);if(!_&&!w)for(;E--;E)M.unshift("..");!_||""===M[0]||M[0]&&"/"===M[0].charAt(0)||M.unshift(""),S&&"/"!==M.join("/").substr(-1)&&M.push("");var C=""===M[0]||M[0]&&"/"===M[0].charAt(0);if(k){r.hostname=r.host=C?"":M.length?M.shift():"";var A=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@");A&&(r.auth=A.shift(),r.host=r.hostname=A.shift())}return _=_||r.host&&M.length,_&&!C&&M.unshift(""),M.length?r.pathname=M.join("/"):(r.pathname=null,r.path=null),u.isNull(r.pathname)&&u.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},n.prototype.parseHost=function(){var t=this.host,e=h.exec(t);e&&(e=e[0],":"!==e&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},{"./util":538,punycode:480,querystring:484}],538:[function(t,e,r){"use strict";e.exports={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}}},{}],539:[function(t,e,r){"function"==typeof Object.create?e.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},{}],540:[function(t,e,r){e.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},{}],541:[function(t,e,r){(function(e,n){function i(t,e){var n={seen:[],stylize:o};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),m(e)?n.showHidden=e:e&&r._extend(n,e),_(n.showHidden)&&(n.showHidden=!1),_(n.depth)&&(n.depth=2),_(n.colors)&&(n.colors=!1),_(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=a),l(n,t,n.depth)}function a(t,e){var r=i.styles[e];return r?"\x1b["+i.colors[r][0]+"m"+t+"\x1b["+i.colors[r][1]+"m":t}function o(t,e){return t}function s(t){var e={};return t.forEach(function(t,r){e[t]=!0}),e}function l(t,e,n){if(t.customInspect&&e&&T(e.inspect)&&e.inspect!==r.inspect&&(!e.constructor||e.constructor.prototype!==e)){var i=e.inspect(n,t);return b(i)||(i=l(t,i,n)),i}var a=u(t,e);if(a)return a;var o=Object.keys(e),m=s(o);if(t.showHidden&&(o=Object.getOwnPropertyNames(e)),A(e)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return c(e);if(0===o.length){if(T(e)){var v=e.name?": "+e.name:"";return t.stylize("[Function"+v+"]","special")}if(w(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(k(e))return t.stylize(Date.prototype.toString.call(e),"date");if(A(e))return c(e)}var g="",y=!1,x=["{","}"];if(p(e)&&(y=!0,x=["[","]"]),T(e)){g=" [Function"+(e.name?": "+e.name:"")+"]"}if(w(e)&&(g=" "+RegExp.prototype.toString.call(e)),k(e)&&(g=" "+Date.prototype.toUTCString.call(e)),A(e)&&(g=" "+c(e)),0===o.length&&(!y||0==e.length))return x[0]+g+x[1];if(n<0)return w(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special");t.seen.push(e);var _;return _=y?h(t,e,n,m,o):o.map(function(r){return f(t,e,n,m,r,y)}),t.seen.pop(),d(_,g,x)}function u(t,e){if(_(e))return t.stylize("undefined","undefined");if(b(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return y(e)?t.stylize(""+e,"number"):m(e)?t.stylize(""+e,"boolean"):v(e)?t.stylize("null","null"):void 0}function c(t){return"["+Error.prototype.toString.call(t)+"]"}function h(t,e,r,n,i){for(var a=[],o=0,s=e.length;o<s;++o)z(e,String(o))?a.push(f(t,e,r,n,String(o),!0)):a.push("");return i.forEach(function(i){i.match(/^\d+$/)||a.push(f(t,e,r,n,i,!0))}),a}function f(t,e,r,n,i,a){var o,s,u;if(u=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]},u.get?s=u.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):u.set&&(s=t.stylize("[Setter]","special")),z(n,i)||(o="["+i+"]"),s||(t.seen.indexOf(u.value)<0?(s=v(r)?l(t,u.value,null):l(t,u.value,r-1),s.indexOf("\n")>-1&&(s=a?s.split("\n").map(function(t){return" "+t}).join("\n").substr(2):"\n"+s.split("\n").map(function(t){return" "+t}).join("\n"))):s=t.stylize("[Circular]","special")),_(o)){if(a&&i.match(/^\d+$/))return s;o=JSON.stringify(""+i),o.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=t.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=t.stylize(o,"string"))}return o+": "+s}function d(t,e,r){var n=0;return t.reduce(function(t,e){return n++,e.indexOf("\n")>=0&&n++,t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}function p(t){return Array.isArray(t)}function m(t){return"boolean"==typeof t}function v(t){return null===t}function g(t){return null==t}function y(t){return"number"==typeof t}function b(t){return"string"==typeof t}function x(t){return"symbol"==typeof t}function _(t){return void 0===t}function w(t){return M(t)&&"[object RegExp]"===E(t)}function M(t){return"object"==typeof t&&null!==t}function k(t){return M(t)&&"[object Date]"===E(t)}function A(t){return M(t)&&("[object Error]"===E(t)||t instanceof Error)}function T(t){return"function"==typeof t}function S(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t}function E(t){return Object.prototype.toString.call(t)}function L(t){return t<10?"0"+t.toString(10):t.toString(10)}function C(){var t=new Date,e=[L(t.getHours()),L(t.getMinutes()),L(t.getSeconds())].join(":");return[t.getDate(),P[t.getMonth()],e].join(" ")}function z(t,e){return Object.prototype.hasOwnProperty.call(t,e)}r.format=function(t){if(!b(t)){for(var e=[],r=0;r<arguments.length;r++)e.push(i(arguments[r]));return e.join(" ")}for(var r=1,n=arguments,a=n.length,o=String(t).replace(/%[sdj%]/g,function(t){if("%%"===t)return"%";if(r>=a)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}}),s=n[r];r<a;s=n[++r])v(s)||!M(s)?o+=" "+s:o+=" "+i(s);return o},r.deprecate=function(t,i){function a(){if(!o){if(e.throwDeprecation)throw new Error(i);e.traceDeprecation?console.trace(i):console.error(i),o=!0}return t.apply(this,arguments)}if(_(n.process))return function(){return r.deprecate(t,i).apply(this,arguments)};if(e.noDeprecation===!0)return t;var o=!1;return a};var D,I={};r.debuglog=function(t){if(_(D)&&(D=e.env.NODE_DEBUG||""),t=t.toUpperCase(),!I[t])if(new RegExp("\\b"+t+"\\b","i").test(D)){var n=e.pid;I[t]=function(){var e=r.format.apply(r,arguments);console.error("%s %d: %s",t,n,e)}}else I[t]=function(){};return I[t]},r.inspect=i,i.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},i.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},r.isArray=p,r.isBoolean=m,r.isNull=v,r.isNullOrUndefined=g,r.isNumber=y,r.isString=b,r.isSymbol=x,r.isUndefined=_,r.isRegExp=w,r.isObject=M,r.isDate=k,r.isError=A,r.isFunction=T,r.isPrimitive=S,r.isBuffer=t("./support/isBuffer");var P=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];r.log=function(){console.log("%s - %s",C(),r.format.apply(r,arguments))},r.inherits=t("inherits"),r._extend=function(t,e){if(!e||!M(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t}}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./support/isBuffer":540,_process:479,inherits:539}],542:[function(t,e,r){e.exports.VectorTile=t("./lib/vectortile.js"),e.exports.VectorTileFeature=t("./lib/vectortilefeature.js"),e.exports.VectorTileLayer=t("./lib/vectortilelayer.js")},{"./lib/vectortile.js":543,"./lib/vectortilefeature.js":544,"./lib/vectortilelayer.js":545}],543:[function(t,e,r){"use strict";function n(t,e){this.layers=t.readFields(i,{},e)}function i(t,e,r){if(3===t){var n=new a(r,r.readVarint()+r.pos);n.length&&(e[n.name]=n)}}var a=t("./vectortilelayer");e.exports=n},{"./vectortilelayer":545}],544:[function(t,e,r){"use strict";function n(t,e,r,n,a){this.properties={},this.extent=r,this.type=0,this._pbf=t,this._geometry=-1,this._keys=n,this._values=a,t.readFields(i,this,e)}function i(t,e,r){1==t?e.id=r.readVarint():2==t?a(r,e):3==t?e.type=r.readVarint():4==t&&(e._geometry=r.pos)}function a(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}}function o(t){var e=t.length;if(e<=1)return[t];for(var r,n,i=[],a=0;a<e;a++){var o=s(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}function s(t){for(var e,r,n=0,i=0,a=t.length,o=a-1;i<a;o=i++)e=t[i],r=t[o],n+=(r.x-e.x)*(e.y+r.y);return n}var l=t("point-geometry");e.exports=n,n.types=["Unknown","Point","LineString","Polygon"],n.prototype.loadGeometry=function(){var t=this._pbf;t.pos=this._geometry;for(var e,r=t.readVarint()+t.pos,n=1,i=0,a=0,o=0,s=[];t.pos<r;){if(!i){var u=t.readVarint();n=7&u,i=u>>3}if(i--,1===n||2===n)a+=t.readSVarint(),o+=t.readSVarint(),1===n&&(e&&s.push(e),e=[]),e.push(new l(a,o));else{if(7!==n)throw new Error("unknown command "+n);e&&e.push(e[0].clone())}}return e&&s.push(e),s},n.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){var c=t.readVarint();r=7&c,n=c>>3}if(n--,1===r||2===r)i+=t.readSVarint(),a+=t.readSVarint(),i<o&&(o=i),i>s&&(s=i),a<l&&(l=a),a>u&&(u=a);else if(7!==r)throw new Error("unknown command "+r)}return[o,l,s,u]},n.prototype.toGeoJSON=function(t,e,r){function i(t){for(var e=0;e<t.length;e++){var r=t[e],n=180-360*(r.y+c)/l;t[e]=[360*(r.x+u)/l-180,360/Math.PI*Math.atan(Math.exp(n*Math.PI/180))-90]}}var a,s,l=this.extent*Math.pow(2,r),u=this.extent*t,c=this.extent*e,h=this.loadGeometry(),f=n.types[this.type];switch(this.type){case 1:var d=[];for(a=0;a<h.length;a++)d[a]=h[a][0];h=d,i(h);break;case 2:for(a=0;a<h.length;a++)i(h[a]);break;case 3:for(h=o(h),a=0;a<h.length;a++)for(s=0;s<h[a].length;s++)i(h[a][s])}1===h.length?h=h[0]:f="Multi"+f;var p={type:"Feature",geometry:{type:f,coordinates:h},properties:this.properties};return"id"in this&&(p.id=this.id),p}},{"point-geometry":476}],545:[function(t,e,r){"use strict";function n(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(i,this,e),this.length=this._features.length}function i(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(a(r))}function a(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}var o=t("./vectortilefeature.js");e.exports=n,n.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 o(this._pbf,e,this.extent,this._keys,this._values)}},{"./vectortilefeature.js":544}],546:[function(t,e,r){"use strict";function n(t,e){return"object"==typeof e&&null!==e||(e={}),i(t,e.canvas||a,e.context||o,e)}e.exports=n;var i=t("./lib/vtext"),a=null,o=null;"undefined"!=typeof document&&(a=document.createElement("canvas"),a.width=8192,a.height=1024,o=a.getContext("2d"))},{"./lib/vtext":547}],547:[function(t,e,r){"use strict";function n(t,e,r){for(var n=e.textAlign||"start",i=e.textBaseline||"alphabetic",a=[1<<30,1<<30],o=[0,0],s=t.length,l=0;l<s;++l)for(var u=t[l],c=0;c<2;++c)a[c]=0|Math.min(a[c],u[c]),o[c]=0|Math.max(o[c],u[c]);var h=0;switch(n){case"center":h=-.5*(a[0]+o[0]);break;case"right":case"end":h=-o[0];break;case"left":case"start":h=-a[0];break;default:throw new Error("vectorize-text: Unrecognized textAlign: '"+n+"'")}var f=0;switch(i){case"hanging":case"top":f=-a[1];break;case"middle":f=-.5*(a[1]+o[1]);break;case"alphabetic":case"ideographic":f=-3*r;break;case"bottom":f=-o[1];break;default:throw new Error("vectorize-text: Unrecoginized textBaseline: '"+i+"'")}var d=1/r;return"lineHeight"in e?d*=+e.lineHeight:"width"in e?d=e.width/(o[0]-a[0]):"height"in e&&(d=e.height/(o[1]-a[1])),t.map(function(t){return[d*(t[0]+h),d*(t[1]+f)]})}function i(t,e,r,n){var i=0|Math.ceil(e.measureText(r).width+2*n);if(i>8192)throw new Error("vectorize-text: String too long (sorry, this will get fixed later)");var a=3*n;t.height<a&&(t.height=a),e.fillStyle="#000",e.fillRect(0,0,t.width,t.height),e.fillStyle="#fff",e.fillText(r,n,2*n);var o=e.getImageData(0,0,i,a);return c(o.data,[a,i,4]).pick(-1,-1,0).transpose(1,0)}function a(t,e){var r=u(t,128);return e?h(r.cells,r.positions,.25):{edges:r.cells,positions:r.positions}}function o(t,e,r,i){var o=a(t,i),s=n(o.positions,e,r),l=o.edges,u="ccw"===e.orientation;if(f(s,l),e.polygons||e.polygon||e.polyline){for(var c=p(l,s),h=new Array(c.length),m=0;m<c.length;++m){for(var v=c[m],g=new Array(v.length),y=0;y<v.length;++y){for(var b=v[y],x=new Array(b.length),_=0;_<b.length;++_)x[_]=s[b[_]].slice();u&&x.reverse(),g[y]=x}h[m]=g}return h}return e.triangles||e.triangulate||e.triangle?{cells:d(s,l,{delaunay:!1,exterior:!1,interior:!0}),positions:s}:{edges:l,positions:s}}function s(t,e,r){try{return o(t,e,r,!0)}catch(t){}try{return o(t,e,r,!1)}catch(t){}return e.polygons||e.polyline||e.polygon?[]:e.triangles||e.triangulate||e.triangle?{cells:[],positions:[]}:{edges:[],positions:[]}}function l(t,e,r,n){var a=n.size||64,o=n.font||"normal";return r.font=a+"px "+o,r.textAlign="start",r.textBaseline="alphabetic",r.direction="ltr",s(i(e,r,t,a),n,a)}e.exports=l,e.exports.processPixels=s;var u=t("surface-nets"),c=t("ndarray"),h=t("simplify-planar-graph"),f=t("clean-pslg"),d=t("cdt2d"),p=t("planar-graph-to-polyline")},{cdt2d:75,"clean-pslg":85,ndarray:460,"planar-graph-to-polyline":475,"simplify-planar-graph":515,"surface-nets":523}],548:[function(t,e,r){function n(t){var e=[];for(var r in t.layers)e.push(a(t.layers[r]));var n=new c;return h.tile.write({layers:e},n),n.finish()}function i(t){var e={};for(var r in t)e[r]=new f(t[r].features),e[r].name=r;return n({layers:e})}function a(t){for(var e={name:t.name||"",version:t.version||1,extent:t.extent||4096,keys:[],values:[],features:[]},r={},n={},i=0;i<t.length;i++){var a=t.feature(i);a.geometry=l(a.loadGeometry());var o=[];for(var s in a.properties){var c=r[s];void 0===c&&(e.keys.push(s),c=e.keys.length-1,r[s]=c);var h=u(a.properties[s]),f=n[h.key];void 0===f&&(e.values.push(h),f=e.values.length-1,n[h.key]=f),o.push(c),o.push(f)}a.tags=o,e.features.push(a)}return e}function o(t,e){return(e<<3)+(7&t)}function s(t){return t<<1^t>>31}function l(t){for(var e=[],r=0,n=0,i=t.length,a=0;a<i;a++){var l=t[a];e.push(o(1,1));for(var u=0;u<l.length;u++){1===u&&e.push(o(2,l.length-1));var c=l[u].x-r,h=l[u].y-n;e.push(s(c),s(h)),r+=c,n+=h}}return e}function u(t){var e,r=typeof t;return"string"===r?e={string_value:t}:"boolean"===r?e={bool_value:t}:"number"===r?e=t%1!=0?{double_value:t}:t<0?{sint_value:t}:{uint_value:t}:(t=JSON.stringify(t),e={string_value:t}),e.key=r+":"+t,e}var c=t("pbf"),h=t("./vector-tile-pb"),f=t("./lib/geojson_wrapper");e.exports=n,e.exports.fromVectorTileJs=n,e.exports.fromGeojsonVt=i,e.exports.GeoJSONWrapper=f},{"./lib/geojson_wrapper":549,"./vector-tile-pb":550,pbf:470}],549:[function(t,e,r){"use strict";function n(t){this.features=t,this.length=t.length}function i(t){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=4096}var a=t("point-geometry"),o=t("vector-tile").VectorTileFeature;e.exports=n,n.prototype.feature=function(t){return new i(this.features[t])},i.prototype.loadGeometry=function(){var t=this.rawGeometry;this.geometry=[];for(var e=0;e<t.length;e++){for(var r=t[e],n=[],i=0;i<r.length;i++)n.push(new a(r[i][0],r[i][1]));this.geometry.push(n)}return this.geometry},i.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]},i.prototype.toGeoJSON=o.prototype.toGeoJSON},{"point-geometry":476,"vector-tile":542}],550:[function(t,e,r){"use strict";function n(t,e){return t.readFields(i,{layers:[]},e)}function i(t,e,r){3===t&&e.layers.push(f(r,r.readVarint()+r.pos))}function a(t,e){var r;if(void 0!==t.layers)for(r=0;r<t.layers.length;r++)e.writeMessage(3,p,t.layers[r])}function o(t,e){return t.readFields(s,{},e)}function s(t,e,r){1===t?e.string_value=r.readString():2===t?e.float_value=r.readFloat():3===t?e.double_value=r.readDouble():4===t?e.int_value=r.readVarint():5===t?e.uint_value=r.readVarint():6===t?e.sint_value=r.readSVarint():7===t&&(e.bool_value=r.readBoolean())}function l(t,e){void 0!==t.string_value&&e.writeStringField(1,t.string_value),void 0!==t.float_value&&e.writeFloatField(2,t.float_value),void 0!==t.double_value&&e.writeDoubleField(3,t.double_value),void 0!==t.int_value&&e.writeVarintField(4,t.int_value),void 0!==t.uint_value&&e.writeVarintField(5,t.uint_value),void 0!==t.sint_value&&e.writeSVarintField(6,t.sint_value),void 0!==t.bool_value&&e.writeBooleanField(7,t.bool_value)}function u(t,e){var r=t.readFields(c,{},e);return void 0===r.type&&(r.type="Unknown"),r}function c(t,e,r){1===t?e.id=r.readVarint():2===t?e.tags=r.readPackedVarint():3===t?e.type=r.readVarint():4===t&&(e.geometry=r.readPackedVarint())}function h(t,e){void 0!==t.id&&e.writeVarintField(1,t.id),void 0!==t.tags&&e.writePackedVarint(2,t.tags),void 0!==t.type&&e.writeVarintField(3,t.type),void 0!==t.geometry&&e.writePackedVarint(4,t.geometry)}function f(t,e){return t.readFields(d,{features:[],keys:[],values:[]},e)}function d(t,e,r){15===t?e.version=r.readVarint():1===t?e.name=r.readString():2===t?e.features.push(u(r,r.readVarint()+r.pos)):3===t?e.keys.push(r.readString()):4===t?e.values.push(o(r,r.readVarint()+r.pos)):5===t&&(e.extent=r.readVarint())}function p(t,e){void 0!==t.version&&e.writeVarintField(15,t.version),void 0!==t.name&&e.writeStringField(1,t.name);var r;if(void 0!==t.features)for(r=0;r<t.features.length;r++)e.writeMessage(2,h,t.features[r]);if(void 0!==t.keys)for(r=0;r<t.keys.length;r++)e.writeStringField(3,t.keys[r]);if(void 0!==t.values)for(r=0;r<t.values.length;r++)e.writeMessage(4,l,t.values[r]);void 0!==t.extent&&e.writeVarintField(5,t.extent)}var m=r.tile={read:n,write:a};m.GeomType={Unknown:0,Point:1,LineString:2,Polygon:3},m.value={read:o,write:l},m.feature={read:u,write:h},m.layer={read:f,write:p}},{}],551:[function(t,e,r){!function(){"use strict";function t(e){e.permitHostObjects___&&e.permitHostObjects___(t)}function r(t){return!(t.substr(0,d.length)==d&&"___"===t.substr(t.length-3))}function n(t){if(t!==Object(t))throw new TypeError("Not an object: "+t);var e=t[p];if(e&&e.key===t)return e;if(f(t)){e={key:t};try{return h(t,p,{value:e,writable:!1,enumerable:!1,configurable:!1}),e}catch(t){return}}}function i(t){return t.prototype=null,Object.freeze(t)}function a(){y||"undefined"==typeof console||(y=!0,console.warn("WeakMap should be invoked as new WeakMap(), not WeakMap(). This will be an error in the future."))}if("undefined"==typeof ses||!ses.ok||ses.ok()){"undefined"!=typeof ses&&(ses.weakMapPermitHostObjects=t);var o=!1;if("function"==typeof WeakMap){var s=WeakMap;if("undefined"!=typeof navigator&&/Firefox/.test(navigator.userAgent));else{var l=new s,u=Object.freeze({});if(l.set(u,1),1===l.get(u))return void(e.exports=WeakMap);o=!0}}var c=(Object.prototype.hasOwnProperty,Object.getOwnPropertyNames),h=Object.defineProperty,f=Object.isExtensible,d="weakmap:",p=d+"ident:"+Math.random()+"___";if("undefined"!=typeof crypto&&"function"==typeof crypto.getRandomValues&&"function"==typeof ArrayBuffer&&"function"==typeof Uint8Array){var m=new ArrayBuffer(25),v=new Uint8Array(m);crypto.getRandomValues(v),p=d+"rand:"+Array.prototype.map.call(v,function(t){return(t%36).toString(36)}).join("")+"___"}if(h(Object,"getOwnPropertyNames",{value:function(t){return c(t).filter(r)}}),"getPropertyNames"in Object){var g=Object.getPropertyNames;h(Object,"getPropertyNames",{value:function(t){return g(t).filter(r)}})}!function(){var t=Object.freeze;h(Object,"freeze",{value:function(e){return n(e),t(e)}});var e=Object.seal;h(Object,"seal",{value:function(t){return n(t),e(t)}});var r=Object.preventExtensions;h(Object,"preventExtensions",{value:function(t){return n(t),r(t)}})}();var y=!1,b=0,x=function(){function t(t,e){var r,i=n(t);return i?u in i?i[u]:e:(r=s.indexOf(t),r>=0?l[r]:e)}function e(t){var e=n(t);return e?u in e:s.indexOf(t)>=0}function r(t,e){var r,i=n(t);return i?i[u]=e:(r=s.indexOf(t),r>=0?l[r]=e:(r=s.length,l[r]=e,s[r]=t)),this}function o(t){var e,r,i=n(t);return i?u in i&&delete i[u]:!((e=s.indexOf(t))<0)&&(r=s.length-1,s[e]=void 0,l[e]=l[r],s[e]=s[r],s.length=r,l.length=r,!0)}this instanceof x||a();var s=[],l=[],u=b++;return Object.create(x.prototype,{get___:{value:i(t)},has___:{value:i(e)},set___:{value:i(r)},delete___:{value:i(o)}})};x.prototype=Object.create(Object.prototype,{get:{value:function(t,e){return this.get___(t,e)},writable:!0,configurable:!0},has:{value:function(t){return this.has___(t)},writable:!0,configurable:!0},set:{value:function(t,e){return this.set___(t,e)},writable:!0,configurable:!0},delete:{value:function(t){return this.delete___(t)},writable:!0,configurable:!0}}),"function"==typeof s?function(){function r(){function e(t,e){return c?u.has(t)?u.get(t):c.get___(t,e):u.get(t,e)}function r(t){return u.has(t)||!!c&&c.has___(t)}function n(t){var e=!!u.delete(t);return c?c.delete___(t)||e:e}this instanceof x||a();var l,u=new s,c=void 0,h=!1;return l=o?function(t,e){return u.set(t,e),u.has(t)||(c||(c=new x),c.set(t,e)),this}:function(t,e){if(h)try{u.set(t,e)}catch(r){c||(c=new x),c.set___(t,e)}else u.set(t,e);return this},Object.create(x.prototype,{get___:{value:i(e)},has___:{value:i(r)},set___:{value:i(l)},delete___:{value:i(n)},permitHostObjects___:{value:i(function(e){if(e!==t)throw new Error("bogus call to permitHostObjects___");h=!0})}})}o&&"undefined"!=typeof Proxy&&(Proxy=void 0),r.prototype=x.prototype,e.exports=r,Object.defineProperty(WeakMap.prototype,"constructor",{value:WeakMap,enumerable:!1,configurable:!0,writable:!0})}():("undefined"!=typeof Proxy&&(Proxy=void 0),e.exports=x)}}()},{}],552:[function(t,e,r){function n(){var t={};return function(e){if(("object"!=typeof e||null===e)&&"function"!=typeof e)throw new Error("Weakmap-shim: Key must be object");var r=e.valueOf(t);return r&&r.identity===t?r:i(e,t)}}var i=t("./hidden-store.js");e.exports=n},{"./hidden-store.js":553}],553:[function(t,e,r){function n(t,e){var r={identity:e},n=t.valueOf;return Object.defineProperty(t,"valueOf",{value:function(t){return t!==e?n.apply(this,arguments):r},writable:!0}),r}e.exports=n},{}],554:[function(t,e,r){function n(){var t=i();return{get:function(e,r){var n=t(e);return n.hasOwnProperty("value")?n.value:r},set:function(e,r){return t(e).value=r,this},has:function(e){return"value"in t(e)},delete:function(e){return delete t(e).value}}}var i=t("./create-store.js");e.exports=n},{"./create-store.js":552}],555:[function(t,e,r){var n=t("get-canvas-context");e.exports=function(t){return n("webgl",t)}},{"get-canvas-context":143}],556:[function(t,e,r){var n=arguments[3],i=arguments[4],a=arguments[5],o=JSON.stringify;e.exports=function(t,e){function r(t){v[t]=!0;for(var e in i[t][1]){var n=i[t][1][e];v[n]||r(n)}}for(var s,l=Object.keys(a),u=0,c=l.length;u<c;u++){var h=l[u],f=a[h].exports;if(f===t||f&&f.default===t){s=h;break}}if(!s){s=Math.floor(Math.pow(16,8)*Math.random()).toString(16);for(var d={},u=0,c=l.length;u<c;u++){var h=l[u];d[h]=h}i[s]=[Function(["require","module","exports"],"("+t+")(self)"),d]}var p=Math.floor(Math.pow(16,8)*Math.random()).toString(16),m={};m[s]=s,i[p]=[Function(["require"],"var f = require("+ o(s) +");(f.default ? f.default : f)(self);"),m];var v={};r(p);var g="("+n+")({"+Object.keys(v).map(function(t){return o(t)+":["+i[t][0]+","+o(i[t][1])+"]"}).join(",")+"},{},["+o(p)+"])",y=window.URL||window.webkitURL||window.mozURL||window.msURL,b=new Blob([g],{type:"text/javascript"});if(e&&e.bare)return b;var x=y.createObjectURL(b),_=new Worker(x);return _.objectURL=x,_}},{}],557:[function(t,e,r){e.exports.RADIUS=6378137,e.exports.FLATTENING=1/298.257223563,e.exports.POLAR_RADIUS=6356752.3142},{}],558:[function(e,r,n){!function(e,i){"object"==typeof n&&void 0!==r?i(n):"function"==typeof t&&t.amd?t(["exports"],i):i(e.WhooTS=e.WhooTS||{})}(this,function(t){function e(t,e,n,i,a,o){return o=o||{},t+"?"+["bbox="+r(n,i,a),"format="+(o.format||"image/png"),"service="+(o.service||"WMS"),"version="+(o.version||"1.1.1"),"request="+(o.request||"GetMap"),"srs="+(o.srs||"EPSG:3857"),"width="+(o.width||256),"height="+(o.height||256),"layers="+e].join("&")}function r(t,e,r){e=Math.pow(2,r)-e-1;var i=n(256*t,256*e,r),a=n(256*(t+1),256*(e+1),r);return i[0]+","+i[1]+","+a[0]+","+a[1]}function n(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]}t.getURL=e,t.getTileBBox=r,t.getMercCoords=n,Object.defineProperty(t,"__esModule",{value:!0})})},{}],559:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function i(t,e,r,n){var i,a;if("object"==typeof t)i=t,a=e||{};else{if(!("number"==typeof t&&t>=1888&&t<=2111))throw new Error("Solar year outside range 1888-2111");if(!("number"==typeof e&&e>=1&&e<=12))throw new Error("Solar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=31))throw new Error("Solar day outside range 1 - 31");i={year:t,month:e,day:r},a=n||{}}var o=p[i.year-p[0]],s=i.year<<9|i.month<<5|i.day;a.year=s>=o?i.year:i.year-1,o=p[a.year-p[0]];var l,u=o>>9&4095,c=o>>5&15,h=31&o,f=new Date(u,c-1,h),m=new Date(i.year,i.month-1,i.day);l=Math.round((m-f)/864e5);var v,g=d[a.year-d[0]];for(v=0;v<13;v++){var y=g&1<<12-v?30:29;if(l<y)break;l-=y}var b=g>>13;return!b||v<b?(a.isIntercalary=!1,a.month=1+v):v===b?(a.isIntercalary=!0,a.month=v):(a.isIntercalary=!1,a.month=v),a.day=1+l,a}function a(t,e,r,n,i){var a,o;if("object"==typeof t)o=t,a=e||{};else{if(!("number"==typeof t&&t>=1888&&t<=2111))throw new Error("Lunar year outside range 1888-2111");if(!("number"==typeof e&&e>=1&&e<=12))throw new Error("Lunar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=30))throw new Error("Lunar day outside range 1 - 30");var s;"object"==typeof n?(s=!1,a=n):(s=!!n,a=i||{}),o={year:t,month:e,day:r,isIntercalary:s}}var l;l=o.day-1;var u,c=d[o.year-d[0]],h=c>>13;u=h?o.month>h?o.month:o.isIntercalary?o.month:o.month-1:o.month-1;for(var f=0;f<u;f++){l+=c&1<<12-f?30:29}var m=p[o.year-p[0]],v=m>>9&4095,g=m>>5&15,y=31&m,b=new Date(v,g-1,y+l);return a.year=b.getFullYear(),a.month=1+b.getMonth(),a.day=b.getDate(),a}var o=t("../main"),s=t("object-assign"),l=o.instance();n.prototype=new o.baseCalendar,s(n.prototype,{name:"Chinese",jdEpoch:1721425.5,hasYearZero:!1,minMonth:0,firstMonth:0,minDay:1,regionalOptions:{"":{name:"Chinese",epochs:["BEC","EC"],monthNumbers:function(t,e){if("string"==typeof t){var r=t.match(c);return r?r[0]:""}var n=this._validateYear(t),i=t.month(),a=""+this.toChineseMonth(n,i);return e&&a.length<2&&(a="0"+a),this.isIntercalaryMonth(n,i)&&(a+="i"),a},monthNames:function(t){if("string"==typeof t){var e=t.match(h);return e?e[0]:""}var r=this._validateYear(t),n=t.month(),i=this.toChineseMonth(r,n),a=["\u4e00\u6708","\u4e8c\u6708","\u4e09\u6708","\u56db\u6708","\u4e94\u6708","\u516d\u6708","\u4e03\u6708","\u516b\u6708","\u4e5d\u6708","\u5341\u6708","\u5341\u4e00\u6708","\u5341\u4e8c\u6708"][i-1];return this.isIntercalaryMonth(r,n)&&(a="\u95f0"+a),a},monthNamesShort:function(t){if("string"==typeof t){var e=t.match(f);return e?e[0]:""}var r=this._validateYear(t),n=t.month(),i=this.toChineseMonth(r,n),a=["\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d","\u4e03","\u516b","\u4e5d","\u5341","\u5341\u4e00","\u5341\u4e8c"][i-1];return this.isIntercalaryMonth(r,n)&&(a="\u95f0"+a),a},parseMonth:function(t,e){t=this._validateYear(t);var r,n=parseInt(e);if(isNaN(n))"\u95f0"===e[0]&&(r=!0,e=e.substring(1)),"\u6708"===e[e.length-1]&&(e=e.substring(0,e.length-1)),n=1+["\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d","\u4e03","\u516b","\u4e5d","\u5341","\u5341\u4e00","\u5341\u4e8c"].indexOf(e);else{var i=e[e.length-1]
49 ;r="i"===i||"I"===i}return this.toMonthIndex(t,n,r)},dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},_validateYear:function(t,e){if(t.year&&(t=t.year()),"number"!=typeof t||t<1888||t>2111)throw e.replace(/\{0\}/,this.local.name);return t},toMonthIndex:function(t,e,r){var n=this.intercalaryMonth(t);if(r&&e!==n||e<1||e>12)throw o.local.invalidMonth.replace(/\{0\}/,this.local.name);return n?!r&&e<=n?e-1:e:e-1},toChineseMonth:function(t,e){t.year&&(t=t.year(),e=t.month());var r=this.intercalaryMonth(t),n=r?12:11;if(e<0||e>n)throw o.local.invalidMonth.replace(/\{0\}/,this.local.name);return r?e<r?e+1:e:e+1},intercalaryMonth:function(t){return t=this._validateYear(t),d[t-d[0]]>>13},isIntercalaryMonth:function(t,e){t.year&&(t=t.year(),e=t.month());var r=this.intercalaryMonth(t);return!!r&&r===e},leapYear:function(t){return 0!==this.intercalaryMonth(t)},weekOfYear:function(t,e,r){var n,i=this._validateYear(t,o.local.invalidyear),a=p[i-p[0]],s=a>>9&4095,u=a>>5&15,c=31&a;n=l.newDate(s,u,c),n.add(4-(n.dayOfWeek()||7),"d");var h=this.toJD(t,e,r)-n.toJD();return 1+Math.floor(h/7)},monthsInYear:function(t){return this.leapYear(t)?13:12},daysInMonth:function(t,e){t.year&&(e=t.month(),t=t.year()),t=this._validateYear(t);var r=d[t-d[0]];if(e>(r>>13?12:11))throw o.local.invalidMonth.replace(/\{0\}/,this.local.name);return r&1<<12-e?30:29},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,s,r,o.local.invalidDate);t=this._validateYear(n.year()),e=n.month(),r=n.day();var i=this.isIntercalaryMonth(t,e),s=this.toChineseMonth(t,e),u=a(t,s,r,i);return l.toJD(u.year,u.month,u.day)},fromJD:function(t){var e=l.fromJD(t),r=i(e.year(),e.month(),e.day()),n=this.toMonthIndex(r.year,r.month,r.isIntercalary);return this.newDate(r.year,n,r.day)},fromString:function(t){var e=t.match(u),r=this._validateYear(+e[1]),n=+e[2],i=!!e[3],a=this.toMonthIndex(r,n,i),o=+e[4];return this.newDate(r,a,o)},add:function(t,e,r){var i=t.year(),a=t.month(),o=this.isIntercalaryMonth(i,a),s=this.toChineseMonth(i,a),l=Object.getPrototypeOf(n.prototype).add.call(this,t,e,r);if("y"===r){var u=l.year(),c=l.month(),h=this.isIntercalaryMonth(u,s),f=o&&h?this.toMonthIndex(u,s,!0):this.toMonthIndex(u,s,!1);f!==c&&l.month(f)}return l}});var u=/^\s*(-?\d\d\d\d|\d\d)[-\/](\d?\d)([iI]?)[-\/](\d?\d)/m,c=/^\d?\d[iI]?/m,h=/^\u95f0?\u5341?[\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d]?\u6708/m,f=/^\u95f0?\u5341?[\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d]?/m;o.calendars.chinese=n;var d=[1887,5780,5802,19157,2742,50359,1198,2646,46378,7466,3412,30122,5482,67949,2396,5294,43597,6732,6954,36181,2772,4954,18781,2396,54427,5274,6730,47781,5800,6868,21210,4790,59703,2350,5270,46667,3402,3496,38325,1388,4782,18735,2350,52374,6804,7498,44457,2906,1388,29294,4700,63789,6442,6804,56138,5802,2772,38235,1210,4698,22827,5418,63125,3476,5802,43701,2484,5302,27223,2646,70954,7466,3412,54698,5482,2412,38062,5294,2636,32038,6954,60245,2772,4826,43357,2394,5274,39501,6730,72357,5800,5844,53978,4790,2358,38039,5270,87627,3402,3496,54708,5484,4782,43311,2350,3222,27978,7498,68965,2904,5484,45677,4700,6444,39573,6804,6986,19285,2772,62811,1210,4698,47403,5418,5780,38570,5546,76469,2420,5302,51799,2646,5414,36501,3412,5546,18869,2412,54446,5276,6732,48422,6822,2900,28010,4826,92509,2394,5274,55883,6730,6820,47956,5812,2778,18779,2358,62615,5270,5450,46757,3492,5556,27318,4718,67887,2350,3222,52554,7498,3428,38252,5468,4700,31022,6444,64149,6804,6986,43861,2772,5338,35421,2650,70955,5418,5780,54954,5546,2740,38074,5302,2646,29991,3366,61011,3412,5546,43445,2412,5294,35406,6732,72998,6820,6996,52586,2778,2396,38045,5274,6698,23333,6820,64338,5812,2746,43355,2358,5270,39499,5450,79525,3492,5548],p=[1887,966732,967231,967733,968265,968766,969297,969798,970298,970829,971330,971830,972362,972863,973395,973896,974397,974928,975428,975929,976461,976962,977462,977994,978494,979026,979526,980026,980558,981059,981559,982091,982593,983124,983624,984124,984656,985157,985656,986189,986690,987191,987722,988222,988753,989254,989754,990286,990788,991288,991819,992319,992851,993352,993851,994383,994885,995385,995917,996418,996918,997450,997949,998481,998982,999483,1000014,1000515,1001016,1001548,1002047,1002578,1003080,1003580,1004111,1004613,1005113,1005645,1006146,1006645,1007177,1007678,1008209,1008710,1009211,1009743,1010243,1010743,1011275,1011775,1012306,1012807,1013308,1013840,1014341,1014841,1015373,1015874,1016404,1016905,1017405,1017937,1018438,1018939,1019471,1019972,1020471,1021002,1021503,1022035,1022535,1023036,1023568,1024069,1024568,1025100,1025601,1026102,1026633,1027133,1027666,1028167,1028666,1029198,1029699,1030199,1030730,1031231,1031763,1032264,1032764,1033296,1033797,1034297,1034828,1035329,1035830,1036362,1036861,1037393,1037894,1038394,1038925,1039427,1039927,1040459,1040959,1041491,1041992,1042492,1043023,1043524,1044024,1044556,1045057,1045558,1046090,1046590,1047121,1047622,1048122,1048654,1049154,1049655,1050187,1050689,1051219,1051720,1052220,1052751,1053252,1053752,1054284,1054786,1055285,1055817,1056317,1056849,1057349,1057850,1058382,1058883,1059383,1059915,1060415,1060947,1061447,1061947,1062479,1062981,1063480,1064012,1064514,1065014,1065545,1066045,1066577,1067078,1067578,1068110,1068611,1069112,1069642,1070142,1070674,1071175,1071675,1072207,1072709,1073209,1073740,1074241,1074741,1075273,1075773,1076305,1076807,1077308,1077839,1078340,1078840,1079372,1079871,1080403,1080904]},{"../main":573,"object-assign":463}],560:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main"),a=t("object-assign");n.prototype=new i.baseCalendar,a(n.prototype,{name:"Coptic",jdEpoch:1825029.5,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Coptic",epochs:["BAM","AM"],monthNames:["Thout","Paopi","Hathor","Koiak","Tobi","Meshir","Paremhat","Paremoude","Pashons","Paoni","Epip","Mesori","Pi Kogi Enavot"],monthNamesShort:["Tho","Pao","Hath","Koi","Tob","Mesh","Pat","Pad","Pash","Pao","Epi","Meso","PiK"],dayNames:["Tkyriaka","Pesnau","Pshoment","Peftoou","Ptiou","Psoou","Psabbaton"],dayNamesShort:["Tky","Pes","Psh","Pef","Pti","Pso","Psa"],dayNamesMin:["Tk","Pes","Psh","Pef","Pt","Pso","Psa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear),t=e.year()+(e.year()<0?1:0);return t%4==3||t%4==-1},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,i.local.invalidYear||i.regionalOptions[""].invalidYear),13},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(13===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);return t=n.year(),t<0&&t++,n.day()+30*(n.month()-1)+365*(t-1)+Math.floor(t/4)+this.jdEpoch-1},fromJD:function(t){var e=Math.floor(t)+.5-this.jdEpoch,r=Math.floor((e-Math.floor((e+366)/1461))/365)+1;r<=0&&r--,e=Math.floor(t)+.5-this.newDate(r,1,1).toJD();var n=Math.floor(e/30)+1,i=e-30*(n-1)+1;return this.newDate(r,n,i)}}),i.calendars.coptic=n},{"../main":573,"object-assign":463}],561:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main"),a=t("object-assign");n.prototype=new i.baseCalendar,a(n.prototype,{name:"Discworld",jdEpoch:1721425.5,daysPerMonth:[16,32,32,32,32,32,32,32,32,32,32,32,32],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Discworld",epochs:["BUC","UC"],monthNames:["Ick","Offle","February","March","April","May","June","Grune","August","Spune","Sektober","Ember","December"],monthNamesShort:["Ick","Off","Feb","Mar","Apr","May","Jun","Gru","Aug","Spu","Sek","Emb","Dec"],dayNames:["Sunday","Octeday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Oct","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Oc","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:2,isRTL:!1}},leapYear:function(t){return this._validate(t,this.minMonth,this.minDay,i.local.invalidYear),!1},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,i.local.invalidYear),13},daysInYear:function(t){return this._validate(t,this.minMonth,this.minDay,i.local.invalidYear),400},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/8)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]},daysInWeek:function(){return 8},dayOfWeek:function(t,e,r){return(this._validate(t,e,r,i.local.invalidDate).day()+1)%8},weekDay:function(t,e,r){var n=this.dayOfWeek(t,e,r);return n>=2&&n<=6},extraInfo:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);return{century:o[Math.floor((n.year()-1)/100)+1]||""}},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);return t=n.year()+(n.year()<0?1:0),e=n.month(),(r=n.day())+(e>1?16:0)+(e>2?32*(e-2):0)+400*(t-1)+this.jdEpoch-1},fromJD:function(t){t=Math.floor(t+.5)-Math.floor(this.jdEpoch)-1;var e=Math.floor(t/400)+1;t-=400*(e-1),t+=t>15?16:0;var r=Math.floor(t/32)+1,n=t-32*(r-1)+1;return this.newDate(e<=0?e-1:e,r,n)}});var o={20:"Fruitbat",21:"Anchovy"};i.calendars.discworld=n},{"../main":573,"object-assign":463}],562:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main"),a=t("object-assign");n.prototype=new i.baseCalendar,a(n.prototype,{name:"Ethiopian",jdEpoch:1724220.5,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Ethiopian",epochs:["BEE","EE"],monthNames:["Meskerem","Tikemet","Hidar","Tahesas","Tir","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehase","Pagume"],monthNamesShort:["Mes","Tik","Hid","Tah","Tir","Yek","Meg","Mia","Gen","Sen","Ham","Neh","Pag"],dayNames:["Ehud","Segno","Maksegno","Irob","Hamus","Arb","Kidame"],dayNamesShort:["Ehu","Seg","Mak","Iro","Ham","Arb","Kid"],dayNamesMin:["Eh","Se","Ma","Ir","Ha","Ar","Ki"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear),t=e.year()+(e.year()<0?1:0);return t%4==3||t%4==-1},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,i.local.invalidYear||i.regionalOptions[""].invalidYear),13},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(13===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);return t=n.year(),t<0&&t++,n.day()+30*(n.month()-1)+365*(t-1)+Math.floor(t/4)+this.jdEpoch-1},fromJD:function(t){var e=Math.floor(t)+.5-this.jdEpoch,r=Math.floor((e-Math.floor((e+366)/1461))/365)+1;r<=0&&r--,e=Math.floor(t)+.5-this.newDate(r,1,1).toJD();var n=Math.floor(e/30)+1,i=e-30*(n-1)+1;return this.newDate(r,n,i)}}),i.calendars.ethiopian=n},{"../main":573,"object-assign":463}],563:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function i(t,e){return t-e*Math.floor(t/e)}var a=t("../main"),o=t("object-assign");n.prototype=new a.baseCalendar,o(n.prototype,{name:"Hebrew",jdEpoch:347995.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29,29],hasYearZero:!1,minMonth:1,firstMonth:7,minDay:1,regionalOptions:{"":{name:"Hebrew",epochs:["BAM","AM"],monthNames:["Nisan","Iyar","Sivan","Tammuz","Av","Elul","Tishrei","Cheshvan","Kislev","Tevet","Shevat","Adar","Adar II"],monthNamesShort:["Nis","Iya","Siv","Tam","Av","Elu","Tis","Che","Kis","Tev","She","Ada","Ad2"],dayNames:["Yom Rishon","Yom Sheni","Yom Shlishi","Yom Revi'i","Yom Chamishi","Yom Shishi","Yom Shabbat"],dayNamesShort:["Ris","She","Shl","Rev","Cha","Shi","Sha"],dayNamesMin:["Ri","She","Shl","Re","Ch","Shi","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,a.local.invalidYear);return this._leapYear(e.year())},_leapYear:function(t){return t=t<0?t+1:t,i(7*t+1,19)<7},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,a.local.invalidYear),this._leapYear(t.year?t.year():t)?13:12},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){return t=this._validate(t,this.minMonth,this.minDay,a.local.invalidYear).year(),this.toJD(t===-1?1:t+1,7,1)-this.toJD(t,7,1)},daysInMonth:function(t,e){return t.year&&(e=t.month(),t=t.year()),this._validate(t,e,this.minDay,a.local.invalidMonth),12===e&&this.leapYear(t)?30:8===e&&5===i(this.daysInYear(t),10)?30:9===e&&3===i(this.daysInYear(t),10)?29:this.daysPerMonth[e-1]},weekDay:function(t,e,r){return 6!==this.dayOfWeek(t,e,r)},extraInfo:function(t,e,r){var n=this._validate(t,e,r,a.local.invalidDate);return{yearType:(this.leapYear(n)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(n)%10-3]}},toJD:function(t,e,r){var n=this._validate(t,e,r,a.local.invalidDate);t=n.year(),e=n.month(),r=n.day();var i=t<=0?t+1:t,o=this.jdEpoch+this._delay1(i)+this._delay2(i)+r+1;if(e<7){for(var s=7;s<=this.monthsInYear(t);s++)o+=this.daysInMonth(t,s);for(var s=1;s<e;s++)o+=this.daysInMonth(t,s)}else for(var s=7;s<e;s++)o+=this.daysInMonth(t,s);return o},_delay1:function(t){var e=Math.floor((235*t-234)/19),r=12084+13753*e,n=29*e+Math.floor(r/25920);return i(3*(n+1),7)<3&&n++,n},_delay2:function(t){var e=this._delay1(t-1),r=this._delay1(t);return this._delay1(t+1)-r==356?2:r-e==382?1:0},fromJD:function(t){t=Math.floor(t)+.5;for(var e=Math.floor(98496*(t-this.jdEpoch)/35975351)-1;t>=this.toJD(e===-1?1:e+1,7,1);)e++;for(var r=t<this.toJD(e,1,1)?7:1;t>this.toJD(e,r,this.daysInMonth(e,r));)r++;var n=t-this.toJD(e,r,1)+1;return this.newDate(e,r,n)}}),a.calendars.hebrew=n},{"../main":573,"object-assign":463}],564:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main"),a=t("object-assign");n.prototype=new i.baseCalendar,a(n.prototype,{name:"Islamic",jdEpoch:1948439.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Islamic",epochs:["BH","AH"],monthNames:["Muharram","Safar","Rabi' al-awwal","Rabi' al-thani","Jumada al-awwal","Jumada al-thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-ahad","Yawm al-ithnayn","Yawm ath-thulaathaa'","Yawm al-arbi'aa'","Yawm al-kham\u012bs","Yawm al-jum'a","Yawm as-sabt"],dayNamesShort:["Aha","Ith","Thu","Arb","Kha","Jum","Sab"],dayNamesMin:["Ah","It","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(t){return(11*this._validate(t,this.minMonth,this.minDay,i.local.invalidYear).year()+14)%30<11},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){return this.leapYear(t)?355:354},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);return t=n.year(),e=n.month(),r=n.day(),t=t<=0?t+1:t,r+Math.ceil(29.5*(e-1))+354*(t-1)+Math.floor((3+11*t)/30)+this.jdEpoch-1},fromJD:function(t){t=Math.floor(t)+.5;var e=Math.floor((30*(t-this.jdEpoch)+10646)/10631);e=e<=0?e-1:e;var r=Math.min(12,Math.ceil((t-29-this.toJD(e,1,1))/29.5)+1),n=t-this.toJD(e,r,1)+1;return this.newDate(e,r,n)}}),i.calendars.islamic=n},{"../main":573,"object-assign":463}],565:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main"),a=t("object-assign");n.prototype=new i.baseCalendar,a(n.prototype,{name:"Julian",jdEpoch:1721423.5,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Julian",epochs:["BC","AD"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"mm/dd/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear),t=e.year()<0?e.year()+1:e.year();return t%4==0},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(4-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);return t=n.year(),e=n.month(),r=n.day(),t<0&&t++,e<=2&&(t--,e+=12),Math.floor(365.25*(t+4716))+Math.floor(30.6001*(e+1))+r-1524.5},fromJD:function(t){var e=Math.floor(t+.5),r=e+1524,n=Math.floor((r-122.1)/365.25),i=Math.floor(365.25*n),a=Math.floor((r-i)/30.6001),o=a-Math.floor(a<14?1:13),s=n-Math.floor(o>2?4716:4715),l=r-i-Math.floor(30.6001*a);return s<=0&&s--,this.newDate(s,o,l)}}),i.calendars.julian=n},{"../main":573,"object-assign":463}],566:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function i(t,e){return t-e*Math.floor(t/e)}function a(t,e){return i(t-1,e)+1}var o=t("../main"),s=t("object-assign");n.prototype=new o.baseCalendar,s(n.prototype,{name:"Mayan",jdEpoch:584282.5,hasYearZero:!0,minMonth:0,firstMonth:0,minDay:0,regionalOptions:{"":{name:"Mayan",epochs:["",""],monthNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],monthNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],dayNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesMin:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],digits:null,dateFormat:"YYYY.m.d",firstDay:0,isRTL:!1,haabMonths:["Pop","Uo","Zip","Zotz","Tzec","Xul","Yaxkin","Mol","Chen","Yax","Zac","Ceh","Mac","Kankin","Muan","Pax","Kayab","Cumku","Uayeb"],tzolkinMonths:["Imix","Ik","Akbal","Kan","Chicchan","Cimi","Manik","Lamat","Muluc","Oc","Chuen","Eb","Ben","Ix","Men","Cib","Caban","Etznab","Cauac","Ahau"]}},leapYear:function(t){return this._validate(t,this.minMonth,this.minDay,o.local.invalidYear),!1},formatYear:function(t){t=this._validate(t,this.minMonth,this.minDay,o.local.invalidYear).year();var e=Math.floor(t/400);return t%=400,t+=t<0?400:0,e+"."+Math.floor(t/20)+"."+t%20},forYear:function(t){if(t=t.split("."),t.length<3)throw"Invalid Mayan year";for(var e=0,r=0;r<t.length;r++){var n=parseInt(t[r],10);if(Math.abs(n)>19||r>0&&n<0)throw"Invalid Mayan year";e=20*e+n}return e},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,o.local.invalidYear),18},weekOfYear:function(t,e,r){return this._validate(t,e,r,o.local.invalidDate),0},daysInYear:function(t){return this._validate(t,this.minMonth,this.minDay,o.local.invalidYear),360},daysInMonth:function(t,e){return this._validate(t,e,this.minDay,o.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(t,e,r){return this._validate(t,e,r,o.local.invalidDate).day()},weekDay:function(t,e,r){return this._validate(t,e,r,o.local.invalidDate),!0},extraInfo:function(t,e,r){var n=this._validate(t,e,r,o.local.invalidDate),i=n.toJD(),a=this._toHaab(i),s=this._toTzolkin(i);return{haabMonthName:this.local.haabMonths[a[0]-1],haabMonth:a[0],haabDay:a[1],tzolkinDayName:this.local.tzolkinMonths[s[0]-1],tzolkinDay:s[0],tzolkinTrecena:s[1]}},_toHaab:function(t){t-=this.jdEpoch;var e=i(t+8+340,365);return[Math.floor(e/20)+1,i(e,20)]},_toTzolkin:function(t){return t-=this.jdEpoch,[a(t+20,20),a(t+4,13)]},toJD:function(t,e,r){var n=this._validate(t,e,r,o.local.invalidDate);return n.day()+20*n.month()+360*n.year()+this.jdEpoch},fromJD:function(t){t=Math.floor(t)+.5-this.jdEpoch;var e=Math.floor(t/360);t%=360,t+=t<0?360:0;var r=Math.floor(t/20),n=t%20;return this.newDate(e,r,n)}}),o.calendars.mayan=n},{"../main":573,"object-assign":463}],567:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main"),a=t("object-assign");n.prototype=new i.baseCalendar;var o=i.instance("gregorian");a(n.prototype,{name:"Nanakshahi",jdEpoch:2257673.5,daysPerMonth:[31,31,31,31,31,30,30,30,30,30,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Nanakshahi",epochs:["BN","AN"],monthNames:["Chet","Vaisakh","Jeth","Harh","Sawan","Bhadon","Assu","Katak","Maghar","Poh","Magh","Phagun"],monthNamesShort:["Che","Vai","Jet","Har","Saw","Bha","Ass","Kat","Mgr","Poh","Mgh","Pha"],dayNames:["Somvaar","Mangalvar","Budhvaar","Veervaar","Shukarvaar","Sanicharvaar","Etvaar"],dayNamesShort:["Som","Mangal","Budh","Veer","Shukar","Sanichar","Et"],dayNamesMin:["So","Ma","Bu","Ve","Sh","Sa","Et"],digits:null,dateFormat:"dd-mm-yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear||i.regionalOptions[""].invalidYear);return o.leapYear(e.year()+(e.year()<1?1:0)+1469)},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(1-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidMonth),t=n.year();t<0&&t++;for(var a=n.day(),s=1;s<n.month();s++)a+=this.daysPerMonth[s-1];return a+o.toJD(t+1468,3,13)},fromJD:function(t){t=Math.floor(t+.5);for(var e=Math.floor((t-(this.jdEpoch-1))/366);t>=this.toJD(e+1,1,1);)e++;for(var r=t-Math.floor(this.toJD(e,1,1)+.5)+1,n=1;r>this.daysInMonth(e,n);)r-=this.daysInMonth(e,n),n++;return this.newDate(e,n,r)}}),i.calendars.nanakshahi=n},{"../main":573,"object-assign":463}],568:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main"),a=t("object-assign");n.prototype=new i.baseCalendar,a(n.prototype,{name:"Nepali",jdEpoch:1700709.5,daysPerMonth:[31,31,32,32,31,30,30,29,30,29,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,daysPerYear:365,regionalOptions:{"":{name:"Nepali",epochs:["BBS","ABS"],monthNames:["Baisakh","Jestha","Ashadh","Shrawan","Bhadra","Ashwin","Kartik","Mangsir","Paush","Mangh","Falgun","Chaitra"],monthNamesShort:["Bai","Je","As","Shra","Bha","Ash","Kar","Mang","Pau","Ma","Fal","Chai"],dayNames:["Aaitabaar","Sombaar","Manglbaar","Budhabaar","Bihibaar","Shukrabaar","Shanibaar"],dayNamesShort:["Aaita","Som","Mangl","Budha","Bihi","Shukra","Shani"],dayNamesMin:["Aai","So","Man","Bu","Bi","Shu","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:1,isRTL:!1}},leapYear:function(t){return this.daysInYear(t)!==this.daysPerYear},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){if(t=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear).year(),void 0===this.NEPALI_CALENDAR_DATA[t])return this.daysPerYear;for(var e=0,r=this.minMonth;r<=12;r++)e+=this.NEPALI_CALENDAR_DATA[t][r];return e},daysInMonth:function(t,e){return t.year&&(e=t.month(),t=t.year()),this._validate(t,e,this.minDay,i.local.invalidMonth),void 0===this.NEPALI_CALENDAR_DATA[t]?this.daysPerMonth[e-1]:this.NEPALI_CALENDAR_DATA[t][e]},weekDay:function(t,e,r){return 6!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);t=n.year(),e=n.month(),r=n.day();var a=i.instance(),o=0,s=e,l=t;this._createMissingCalendarData(t);var u=t-(s>9||9===s&&r>=this.NEPALI_CALENDAR_DATA[l][0]?56:57);for(9!==e&&(o=r,s--);9!==s;)s<=0&&(s=12,l--),o+=this.NEPALI_CALENDAR_DATA[l][s],s--;return 9===e?(o+=r-this.NEPALI_CALENDAR_DATA[l][0])<0&&(o+=a.daysInYear(u)):o+=this.NEPALI_CALENDAR_DATA[l][9]-this.NEPALI_CALENDAR_DATA[l][0],a.newDate(u,1,1).add(o,"d").toJD()},fromJD:function(t){var e=i.instance(),r=e.fromJD(t),n=r.year(),a=r.dayOfYear(),o=n+56;this._createMissingCalendarData(o);for(var s=9,l=this.NEPALI_CALENDAR_DATA[o][0],u=this.NEPALI_CALENDAR_DATA[o][s]-l+1;a>u;)s++,s>12&&(s=1,o++),u+=this.NEPALI_CALENDAR_DATA[o][s];var c=this.NEPALI_CALENDAR_DATA[o][s]-(u-a);return this.newDate(o,s,c)},_createMissingCalendarData:function(t){var e=this.daysPerMonth.slice(0);e.unshift(17);for(var r=t-1;r<t+2;r++)void 0===this.NEPALI_CALENDAR_DATA[r]&&(this.NEPALI_CALENDAR_DATA[r]=e)},NEPALI_CALENDAR_DATA:{1970:[18,31,31,32,31,31,31,30,29,30,29,30,30],1971:[18,31,31,32,31,32,30,30,29,30,29,30,30],1972:[17,31,32,31,32,31,30,30,30,29,29,30,30],1973:[19,30,32,31,32,31,30,30,30,29,30,29,31],1974:[19,31,31,32,30,31,31,30,29,30,29,30,30],1975:[18,31,31,32,32,30,31,30,29,30,29,30,30],1976:[17,31,32,31,32,31,30,30,30,29,29,30,31],1977:[18,31,32,31,32,31,31,29,30,29,30,29,31],1978:[18,31,31,32,31,31,31,30,29,30,29,30,30],1979:[18,31,31,32,32,31,30,30,29,30,29,30,30],1980:[17,31,32,31,32,31,30,30,30,29,29,30,31],1981:[18,31,31,31,32,31,31,29,30,30,29,30,30],1982:[18,31,31,32,31,31,31,30,29,30,29,30,30],1983:[18,31,31,32,32,31,30,30,29,30,29,30,30],1984:[17,31,32,31,32,31,30,30,30,29,29,30,31],1985:[18,31,31,31,32,31,31,29,30,30,29,30,30],1986:[18,31,31,32,31,31,31,30,29,30,29,30,30],1987:[18,31,32,31,32,31,30,30,29,30,29,30,30],1988:[17,31,32,31,32,31,30,30,30,29,29,30,31],1989:[18,31,31,31,32,31,31,30,29,30,29,30,30],1990:[18,31,31,32,31,31,31,30,29,30,29,30,30],1991:[18,31,32,31,32,31,30,30,29,30,29,30,30],1992:[17,31,32,31,32,31,30,30,30,29,30,29,31],1993:[18,31,31,31,32,31,31,30,29,30,29,30,30],1994:[18,31,31,32,31,31,31,30,29,30,29,30,30],1995:[17,31,32,31,32,31,30,30,30,29,29,30,30],1996:[17,31,32,31,32,31,30,30,30,29,30,29,31],1997:[18,31,31,32,31,31,31,30,29,30,29,30,30],1998:[18,31,31,32,31,31,31,30,29,30,29,30,30],1999:[17,31,32,31,32,31,30,30,30,29,29,30,31],2e3:[17,30,32,31,32,31,30,30,30,29,30,29,31],2001:[18,31,31,32,31,31,31,30,29,30,29,30,30],2002:[18,31,31,32,32,31,30,30,29,30,29,30,30],2003:[17,31,32,31,32,31,30,30,30,29,29,30,31],2004:[17,30,32,31,32,31,30,30,30,29,30,29,31],2005:[18,31,31,32,31,31,31,30,29,30,29,30,30],2006:[18,31,31,32,32,31,30,30,29,30,29,30,30],2007:[17,31,32,31,32,31,30,30,30,29,29,30,31],2008:[17,31,31,31,32,31,31,29,30,30,29,29,31],2009:[18,31,31,32,31,31,31,30,29,30,29,30,30],2010:[18,31,31,32,32,31,30,30,29,30,29,30,30],2011:[17,31,32,31,32,31,30,30,30,29,29,30,31],2012:[17,31,31,31,32,31,31,29,30,30,29,30,30],2013:[18,31,31,32,31,31,31,30,29,30,29,30,30],2014:[18,31,31,32,32,31,30,30,29,30,29,30,30],2015:[17,31,32,31,32,31,30,30,30,29,29,30,31],2016:[17,31,31,31,32,31,31,29,30,30,29,30,30],2017:[18,31,31,32,31,31,31,30,29,30,29,30,30],2018:[18,31,32,31,32,31,30,30,29,30,29,30,30],2019:[17,31,32,31,32,31,30,30,30,29,30,29,31],2020:[17,31,31,31,32,31,31,30,29,30,29,30,30],2021:[18,31,31,32,31,31,31,30,29,30,29,30,30],2022:[17,31,32,31,32,31,30,30,30,29,29,30,30],2023:[17,31,32,31,32,31,30,30,30,29,30,29,31],2024:[17,31,31,31,32,31,31,30,29,30,29,30,30],2025:[18,31,31,32,31,31,31,30,29,30,29,30,30],2026:[17,31,32,31,32,31,30,30,30,29,29,30,31],2027:[17,30,32,31,32,31,30,30,30,29,30,29,31],2028:[17,31,31,32,31,31,31,30,29,30,29,30,30],2029:[18,31,31,32,31,32,30,30,29,30,29,30,30],2030:[17,31,32,31,32,31,30,30,30,30,30,30,31],2031:[17,31,32,31,32,31,31,31,31,31,31,31,31],2032:[17,32,32,32,32,32,32,32,32,32,32,32,32],2033:[18,31,31,32,32,31,30,30,29,30,29,30,30],2034:[17,31,32,31,32,31,30,30,30,29,29,30,31],2035:[17,30,32,31,32,31,31,29,30,30,29,29,31],2036:[17,31,31,32,31,31,31,30,29,30,29,30,30],2037:[18,31,31,32,32,31,30,30,29,30,29,30,30],2038:[17,31,32,31,32,31,30,30,30,29,29,30,31],2039:[17,31,31,31,32,31,31,29,30,30,29,30,30],2040:[17,31,31,32,31,31,31,30,29,30,29,30,30],2041:[18,31,31,32,32,31,30,30,29,30,29,30,30],2042:[17,31,32,31,32,31,30,30,30,29,29,30,31],2043:[17,31,31,31,32,31,31,29,30,30,29,30,30],2044:[17,31,31,32,31,31,31,30,29,30,29,30,30],2045:[18,31,32,31,32,31,30,30,29,30,29,30,30],2046:[17,31,32,31,32,31,30,30,30,29,29,30,31],2047:[17,31,31,31,32,31,31,30,29,30,29,30,30],2048:[17,31,31,32,31,31,31,30,29,30,29,30,30],2049:[17,31,32,31,32,31,30,30,30,29,29,30,30],2050:[17,31,32,31,32,31,30,30,30,29,30,29,31],2051:[17,31,31,31,32,31,31,30,29,30,29,30,30],2052:[17,31,31,32,31,31,31,30,29,30,29,30,30],2053:[17,31,32,31,32,31,30,30,30,29,29,30,30],2054:[17,31,32,31,32,31,30,30,30,29,30,29,31],2055:[17,31,31,32,31,31,31,30,29,30,30,29,30],2056:[17,31,31,32,31,32,30,30,29,30,29,30,30],2057:[17,31,32,31,32,31,30,30,30,29,29,30,31],2058:[17,30,32,31,32,31,30,30,30,29,30,29,31],2059:[17,31,31,32,31,31,31,30,29,30,29,30,30],2060:[17,31,31,32,32,31,30,30,29,30,29,30,30],2061:[17,31,32,31,32,31,30,30,30,29,29,30,31],2062:[17,30,32,31,32,31,31,29,30,29,30,29,31],2063:[17,31,31,32,31,31,31,30,29,30,29,30,30],2064:[17,31,31,32,32,31,30,30,29,30,29,30,30],2065:[17,31,32,31,32,31,30,30,30,29,29,30,31],2066:[17,31,31,31,32,31,31,29,30,30,29,29,31],2067:[17,31,31,32,31,31,31,30,29,30,29,30,30],2068:[17,31,31,32,32,31,30,30,29,30,29,30,30],2069:[17,31,32,31,32,31,30,30,30,29,29,30,31],2070:[17,31,31,31,32,31,31,29,30,30,29,30,30],2071:[17,31,31,32,31,31,31,30,29,30,29,30,30],2072:[17,31,32,31,32,31,30,30,29,30,29,30,30],2073:[17,31,32,31,32,31,30,30,30,29,29,30,31],2074:[17,31,31,31,32,31,31,30,29,30,29,30,30],2075:[17,31,31,32,31,31,31,30,29,30,29,30,30],2076:[16,31,32,31,32,31,30,30,30,29,29,30,30],2077:[17,31,32,31,32,31,30,30,30,29,30,29,31],2078:[17,31,31,31,32,31,31,30,29,30,29,30,30],2079:[17,31,31,32,31,31,31,30,29,30,29,30,30],2080:[16,31,32,31,32,31,30,30,30,29,29,30,30],2081:[17,31,31,32,32,31,30,30,30,29,30,30,30],2082:[17,31,32,31,32,31,30,30,30,29,30,30,30],2083:[17,31,31,32,31,31,30,30,30,29,30,30,30],2084:[17,31,31,32,31,31,30,30,30,29,30,30,30],2085:[17,31,32,31,32,31,31,30,30,29,30,30,30],2086:[17,31,32,31,32,31,30,30,30,29,30,30,30],2087:[16,31,31,32,31,31,31,30,30,29,30,30,30],2088:[16,30,31,32,32,30,31,30,30,29,30,30,30],2089:[17,31,32,31,32,31,30,30,30,29,30,30,30],2090:[17,31,32,31,32,31,30,30,30,29,30,30,30],2091:[16,31,31,32,31,31,31,30,30,29,30,30,30],2092:[16,31,31,32,32,31,30,30,30,29,30,30,30],2093:[17,31,32,31,32,31,30,30,30,29,30,30,30],2094:[17,31,31,32,31,31,30,30,30,29,30,30,30],2095:[17,31,31,32,31,31,31,30,29,30,30,30,30],2096:[17,30,31,32,32,31,30,30,29,30,29,30,30],2097:[17,31,32,31,32,31,30,30,30,29,30,30,30],2098:[17,31,31,32,31,31,31,29,30,29,30,30,31],
50 2099:[17,31,31,32,31,31,31,30,29,29,30,30,30],2100:[17,31,32,31,32,30,31,30,29,30,29,30,30]}}),i.calendars.nepali=n},{"../main":573,"object-assign":463}],569:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function i(t,e){return t-e*Math.floor(t/e)}var a=t("../main"),o=t("object-assign");n.prototype=new a.baseCalendar,o(n.prototype,{name:"Persian",jdEpoch:1948320.5,daysPerMonth:[31,31,31,31,31,31,30,30,30,30,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Persian",epochs:["BP","AP"],monthNames:["Farvardin","Ordibehesht","Khordad","Tir","Mordad","Shahrivar","Mehr","Aban","Azar","Day","Bahman","Esfand"],monthNamesShort:["Far","Ord","Kho","Tir","Mor","Sha","Meh","Aba","Aza","Day","Bah","Esf"],dayNames:["Yekshambe","Doshambe","Seshambe","Ch\xe6harshambe","Panjshambe","Jom'e","Shambe"],dayNamesShort:["Yek","Do","Se","Ch\xe6","Panj","Jom","Sha"],dayNamesMin:["Ye","Do","Se","Ch","Pa","Jo","Sh"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,a.local.invalidYear);return 682*((e.year()-(e.year()>0?474:473))%2820+474+38)%2816<682},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-(n.dayOfWeek()+1)%7,"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,a.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var n=this._validate(t,e,r,a.local.invalidDate);t=n.year(),e=n.month(),r=n.day();var o=t-(t>=0?474:473),s=474+i(o,2820);return r+(e<=7?31*(e-1):30*(e-1)+6)+Math.floor((682*s-110)/2816)+365*(s-1)+1029983*Math.floor(o/2820)+this.jdEpoch-1},fromJD:function(t){t=Math.floor(t)+.5;var e=t-this.toJD(475,1,1),r=Math.floor(e/1029983),n=i(e,1029983),a=2820;if(1029982!==n){var o=Math.floor(n/366),s=i(n,366);a=Math.floor((2134*o+2816*s+2815)/1028522)+o+1}var l=a+2820*r+474;l=l<=0?l-1:l;var u=t-this.toJD(l,1,1)+1,c=u<=186?Math.ceil(u/31):Math.ceil((u-6)/30),h=t-this.toJD(l,c,1)+1;return this.newDate(l,c,h)}}),a.calendars.persian=n,a.calendars.jalali=n},{"../main":573,"object-assign":463}],570:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main"),a=t("object-assign"),o=i.instance();n.prototype=new i.baseCalendar,a(n.prototype,{name:"Taiwan",jdEpoch:2419402.5,yearsOffset:1911,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Taiwan",epochs:["BROC","ROC"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear),t=this._t2gYear(e.year());return o.leapYear(t)},weekOfYear:function(t,e,r){var n=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear),t=this._t2gYear(n.year());return o.weekOfYear(t,n.month(),n.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate),t=this._t2gYear(n.year());return o.toJD(t,n.month(),n.day())},fromJD:function(t){var e=o.fromJD(t),r=this._g2tYear(e.year());return this.newDate(r,e.month(),e.day())},_t2gYear:function(t){return t+this.yearsOffset+(t>=-this.yearsOffset&&t<=-1?1:0)},_g2tYear:function(t){return t-this.yearsOffset-(t>=1&&t<=this.yearsOffset?1:0)}}),i.calendars.taiwan=n},{"../main":573,"object-assign":463}],571:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main"),a=t("object-assign"),o=i.instance();n.prototype=new i.baseCalendar,a(n.prototype,{name:"Thai",jdEpoch:1523098.5,yearsOffset:543,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Thai",epochs:["BBE","BE"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear),t=this._t2gYear(e.year());return o.leapYear(t)},weekOfYear:function(t,e,r){var n=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear),t=this._t2gYear(n.year());return o.weekOfYear(t,n.month(),n.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate),t=this._t2gYear(n.year());return o.toJD(t,n.month(),n.day())},fromJD:function(t){var e=o.fromJD(t),r=this._g2tYear(e.year());return this.newDate(r,e.month(),e.day())},_t2gYear:function(t){return t-this.yearsOffset-(t>=1&&t<=this.yearsOffset?1:0)},_g2tYear:function(t){return t+this.yearsOffset+(t>=-this.yearsOffset&&t<=-1?1:0)}}),i.calendars.thai=n},{"../main":573,"object-assign":463}],572:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main"),a=t("object-assign");n.prototype=new i.baseCalendar,a(n.prototype,{name:"UmmAlQura",hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Umm al-Qura",epochs:["BH","AH"],monthNames:["Al-Muharram","Safar","Rabi' al-awwal","Rabi' Al-Thani","Jumada Al-Awwal","Jumada Al-Thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-Ahad","Yawm al-Ithnain","Yawm al-Thal\u0101th\u0101\u2019","Yawm al-Arba\u2018\u0101\u2019","Yawm al-Kham\u012bs","Yawm al-Jum\u2018a","Yawm al-Sabt"],dayNamesMin:["Ah","Ith","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!0}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear);return 355===this.daysInYear(e.year())},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){for(var e=0,r=1;r<=12;r++)e+=this.daysInMonth(t,r);return e},daysInMonth:function(t,e){for(var r=this._validate(t,e,this.minDay,i.local.invalidMonth),n=r.toJD()-24e5+.5,a=0,s=0;s<o.length;s++){if(o[s]>n)return o[a]-o[a-1];a++}return 30},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate),a=12*(n.year()-1)+n.month()-15292;return n.day()+o[a-1]-1+24e5-.5},fromJD:function(t){for(var e=t-24e5+.5,r=0,n=0;n<o.length&&!(o[n]>e);n++)r++;var i=r+15292,a=Math.floor((i-1)/12),s=a+1,l=i-12*a,u=e-o[r-1]+1;return this.newDate(s,l,u)},isValid:function(t,e,r){var n=i.baseCalendar.prototype.isValid.apply(this,arguments);return n&&(t=null!=t.year?t.year:t,n=t>=1276&&t<=1500),n},_validate:function(t,e,r,n){var a=i.baseCalendar.prototype._validate.apply(this,arguments);if(a.year<1276||a.year>1500)throw n.replace(/\{0\}/,this.local.name);return a}}),i.calendars.ummalqura=n;var o=[20,50,79,109,138,168,197,227,256,286,315,345,374,404,433,463,492,522,551,581,611,641,670,700,729,759,788,818,847,877,906,936,965,995,1024,1054,1083,1113,1142,1172,1201,1231,1260,1290,1320,1350,1379,1409,1438,1468,1497,1527,1556,1586,1615,1645,1674,1704,1733,1763,1792,1822,1851,1881,1910,1940,1969,1999,2028,2058,2087,2117,2146,2176,2205,2235,2264,2294,2323,2353,2383,2413,2442,2472,2501,2531,2560,2590,2619,2649,2678,2708,2737,2767,2796,2826,2855,2885,2914,2944,2973,3003,3032,3062,3091,3121,3150,3180,3209,3239,3268,3298,3327,3357,3386,3416,3446,3476,3505,3535,3564,3594,3623,3653,3682,3712,3741,3771,3800,3830,3859,3889,3918,3948,3977,4007,4036,4066,4095,4125,4155,4185,4214,4244,4273,4303,4332,4362,4391,4421,4450,4480,4509,4539,4568,4598,4627,4657,4686,4716,4745,4775,4804,4834,4863,4893,4922,4952,4981,5011,5040,5070,5099,5129,5158,5188,5218,5248,5277,5307,5336,5366,5395,5425,5454,5484,5513,5543,5572,5602,5631,5661,5690,5720,5749,5779,5808,5838,5867,5897,5926,5956,5985,6015,6044,6074,6103,6133,6162,6192,6221,6251,6281,6311,6340,6370,6399,6429,6458,6488,6517,6547,6576,6606,6635,6665,6694,6724,6753,6783,6812,6842,6871,6901,6930,6960,6989,7019,7048,7078,7107,7137,7166,7196,7225,7255,7284,7314,7344,7374,7403,7433,7462,7492,7521,7551,7580,7610,7639,7669,7698,7728,7757,7787,7816,7846,7875,7905,7934,7964,7993,8023,8053,8083,8112,8142,8171,8201,8230,8260,8289,8319,8348,8378,8407,8437,8466,8496,8525,8555,8584,8614,8643,8673,8702,8732,8761,8791,8821,8850,8880,8909,8938,8968,8997,9027,9056,9086,9115,9145,9175,9205,9234,9264,9293,9322,9352,9381,9410,9440,9470,9499,9529,9559,9589,9618,9648,9677,9706,9736,9765,9794,9824,9853,9883,9913,9943,9972,10002,10032,10061,10090,10120,10149,10178,10208,10237,10267,10297,10326,10356,10386,10415,10445,10474,10504,10533,10562,10592,10621,10651,10680,10710,10740,10770,10799,10829,10858,10888,10917,10947,10976,11005,11035,11064,11094,11124,11153,11183,11213,11242,11272,11301,11331,11360,11389,11419,11448,11478,11507,11537,11567,11596,11626,11655,11685,11715,11744,11774,11803,11832,11862,11891,11921,11950,11980,12010,12039,12069,12099,12128,12158,12187,12216,12246,12275,12304,12334,12364,12393,12423,12453,12483,12512,12542,12571,12600,12630,12659,12688,12718,12747,12777,12807,12837,12866,12896,12926,12955,12984,13014,13043,13072,13102,13131,13161,13191,13220,13250,13280,13310,13339,13368,13398,13427,13456,13486,13515,13545,13574,13604,13634,13664,13693,13723,13752,13782,13811,13840,13870,13899,13929,13958,13988,14018,14047,14077,14107,14136,14166,14195,14224,14254,14283,14313,14342,14372,14401,14431,14461,14490,14520,14550,14579,14609,14638,14667,14697,14726,14756,14785,14815,14844,14874,14904,14933,14963,14993,15021,15051,15081,15110,15140,15169,15199,15228,15258,15287,15317,15347,15377,15406,15436,15465,15494,15524,15553,15582,15612,15641,15671,15701,15731,15760,15790,15820,15849,15878,15908,15937,15966,15996,16025,16055,16085,16114,16144,16174,16204,16233,16262,16292,16321,16350,16380,16409,16439,16468,16498,16528,16558,16587,16617,16646,16676,16705,16734,16764,16793,16823,16852,16882,16912,16941,16971,17001,17030,17060,17089,17118,17148,17177,17207,17236,17266,17295,17325,17355,17384,17414,17444,17473,17502,17532,17561,17591,17620,17650,17679,17709,17738,17768,17798,17827,17857,17886,17916,17945,17975,18004,18034,18063,18093,18122,18152,18181,18211,18241,18270,18300,18330,18359,18388,18418,18447,18476,18506,18535,18565,18595,18625,18654,18684,18714,18743,18772,18802,18831,18860,18890,18919,18949,18979,19008,19038,19068,19098,19127,19156,19186,19215,19244,19274,19303,19333,19362,19392,19422,19452,19481,19511,19540,19570,19599,19628,19658,19687,19717,19746,19776,19806,19836,19865,19895,19924,19954,19983,20012,20042,20071,20101,20130,20160,20190,20219,20249,20279,20308,20338,20367,20396,20426,20455,20485,20514,20544,20573,20603,20633,20662,20692,20721,20751,20780,20810,20839,20869,20898,20928,20957,20987,21016,21046,21076,21105,21135,21164,21194,21223,21253,21282,21312,21341,21371,21400,21430,21459,21489,21519,21548,21578,21607,21637,21666,21696,21725,21754,21784,21813,21843,21873,21902,21932,21962,21991,22021,22050,22080,22109,22138,22168,22197,22227,22256,22286,22316,22346,22375,22405,22434,22464,22493,22522,22552,22581,22611,22640,22670,22700,22730,22759,22789,22818,22848,22877,22906,22936,22965,22994,23024,23054,23083,23113,23143,23173,23202,23232,23261,23290,23320,23349,23379,23408,23438,23467,23497,23527,23556,23586,23616,23645,23674,23704,23733,23763,23792,23822,23851,23881,23910,23940,23970,23999,24029,24058,24088,24117,24147,24176,24206,24235,24265,24294,24324,24353,24383,24413,24442,24472,24501,24531,24560,24590,24619,24648,24678,24707,24737,24767,24796,24826,24856,24885,24915,24944,24974,25003,25032,25062,25091,25121,25150,25180,25210,25240,25269,25299,25328,25358,25387,25416,25446,25475,25505,25534,25564,25594,25624,25653,25683,25712,25742,25771,25800,25830,25859,25888,25918,25948,25977,26007,26037,26067,26096,26126,26155,26184,26214,26243,26272,26302,26332,26361,26391,26421,26451,26480,26510,26539,26568,26598,26627,26656,26686,26715,26745,26775,26805,26834,26864,26893,26923,26952,26982,27011,27041,27070,27099,27129,27159,27188,27218,27248,27277,27307,27336,27366,27395,27425,27454,27484,27513,27542,27572,27602,27631,27661,27691,27720,27750,27779,27809,27838,27868,27897,27926,27956,27985,28015,28045,28074,28104,28134,28163,28193,28222,28252,28281,28310,28340,28369,28399,28428,28458,28488,28517,28547,28577,28607,28636,28665,28695,28724,28754,28783,28813,28843,28872,28901,28931,28960,28990,29019,29049,29078,29108,29137,29167,29196,29226,29255,29285,29315,29345,29375,29404,29434,29463,29492,29522,29551,29580,29610,29640,29669,29699,29729,29759,29788,29818,29847,29876,29906,29935,29964,29994,30023,30053,30082,30112,30141,30171,30200,30230,30259,30289,30318,30348,30378,30408,30437,30467,30496,30526,30555,30585,30614,30644,30673,30703,30732,30762,30791,30821,30850,30880,30909,30939,30968,30998,31027,31057,31086,31116,31145,31175,31204,31234,31263,31293,31322,31352,31381,31411,31441,31471,31500,31530,31559,31589,31618,31648,31676,31706,31736,31766,31795,31825,31854,31884,31913,31943,31972,32002,32031,32061,32090,32120,32150,32180,32209,32239,32268,32298,32327,32357,32386,32416,32445,32475,32504,32534,32563,32593,32622,32652,32681,32711,32740,32770,32799,32829,32858,32888,32917,32947,32976,33006,33035,33065,33094,33124,33153,33183,33213,33243,33272,33302,33331,33361,33390,33420,33450,33479,33509,33539,33568,33598,33627,33657,33686,33716,33745,33775,33804,33834,33863,33893,33922,33952,33981,34011,34040,34069,34099,34128,34158,34187,34217,34247,34277,34306,34336,34365,34395,34424,34454,34483,34512,34542,34571,34601,34631,34660,34690,34719,34749,34778,34808,34837,34867,34896,34926,34955,34985,35015,35044,35074,35103,35133,35162,35192,35222,35251,35280,35310,35340,35370,35399,35429,35458,35488,35517,35547,35576,35605,35635,35665,35694,35723,35753,35782,35811,35841,35871,35901,35930,35960,35989,36019,36048,36078,36107,36136,36166,36195,36225,36254,36284,36314,36343,36373,36403,36433,36462,36492,36521,36551,36580,36610,36639,36669,36698,36728,36757,36786,36816,36845,36875,36904,36934,36963,36993,37022,37052,37081,37111,37141,37170,37200,37229,37259,37288,37318,37347,37377,37406,37436,37465,37495,37524,37554,37584,37613,37643,37672,37701,37731,37760,37790,37819,37849,37878,37908,37938,37967,37997,38027,38056,38085,38115,38144,38174,38203,38233,38262,38292,38322,38351,38381,38410,38440,38469,38499,38528,38558,38587,38617,38646,38676,38705,38735,38764,38794,38823,38853,38882,38912,38941,38971,39001,39030,39059,39089,39118,39148,39178,39208,39237,39267,39297,39326,39355,39385,39414,39444,39473,39503,39532,39562,39592,39621,39650,39680,39709,39739,39768,39798,39827,39857,39886,39916,39946,39975,40005,40035,40064,40094,40123,40153,40182,40212,40241,40271,40300,40330,40359,40389,40418,40448,40477,40507,40536,40566,40595,40625,40655,40685,40714,40744,40773,40803,40832,40862,40892,40921,40951,40980,41009,41039,41068,41098,41127,41157,41186,41216,41245,41275,41304,41334,41364,41393,41422,41452,41481,41511,41540,41570,41599,41629,41658,41688,41718,41748,41777,41807,41836,41865,41894,41924,41953,41983,42012,42042,42072,42102,42131,42161,42190,42220,42249,42279,42308,42337,42367,42397,42426,42456,42485,42515,42545,42574,42604,42633,42662,42692,42721,42751,42780,42810,42839,42869,42899,42929,42958,42988,43017,43046,43076,43105,43135,43164,43194,43223,43253,43283,43312,43342,43371,43401,43430,43460,43489,43519,43548,43578,43607,43637,43666,43696,43726,43755,43785,43814,43844,43873,43903,43932,43962,43991,44021,44050,44080,44109,44139,44169,44198,44228,44258,44287,44317,44346,44375,44405,44434,44464,44493,44523,44553,44582,44612,44641,44671,44700,44730,44759,44788,44818,44847,44877,44906,44936,44966,44996,45025,45055,45084,45114,45143,45172,45202,45231,45261,45290,45320,45350,45380,45409,45439,45468,45498,45527,45556,45586,45615,45644,45674,45704,45733,45763,45793,45823,45852,45882,45911,45940,45970,45999,46028,46058,46088,46117,46147,46177,46206,46236,46265,46295,46324,46354,46383,46413,46442,46472,46501,46531,46560,46590,46620,46649,46679,46708,46738,46767,46797,46826,46856,46885,46915,46944,46974,47003,47033,47063,47092,47122,47151,47181,47210,47240,47269,47298,47328,47357,47387,47417,47446,47476,47506,47535,47565,47594,47624,47653,47682,47712,47741,47771,47800,47830,47860,47890,47919,47949,47978,48008,48037,48066,48096,48125,48155,48184,48214,48244,48273,48303,48333,48362,48392,48421,48450,48480,48509,48538,48568,48598,48627,48657,48687,48717,48746,48776,48805,48834,48864,48893,48922,48952,48982,49011,49041,49071,49100,49130,49160,49189,49218,49248,49277,49306,49336,49365,49395,49425,49455,49484,49514,49543,49573,49602,49632,49661,49690,49720,49749,49779,49809,49838,49868,49898,49927,49957,49986,50016,50045,50075,50104,50133,50163,50192,50222,50252,50281,50311,50340,50370,50400,50429,50459,50488,50518,50547,50576,50606,50635,50665,50694,50724,50754,50784,50813,50843,50872,50902,50931,50960,50990,51019,51049,51078,51108,51138,51167,51197,51227,51256,51286,51315,51345,51374,51403,51433,51462,51492,51522,51552,51582,51611,51641,51670,51699,51729,51758,51787,51816,51846,51876,51906,51936,51965,51995,52025,52054,52083,52113,52142,52171,52200,52230,52260,52290,52319,52349,52379,52408,52438,52467,52497,52526,52555,52585,52614,52644,52673,52703,52733,52762,52792,52822,52851,52881,52910,52939,52969,52998,53028,53057,53087,53116,53146,53176,53205,53235,53264,53294,53324,53353,53383,53412,53441,53471,53500,53530,53559,53589,53619,53648,53678,53708,53737,53767,53796,53825,53855,53884,53913,53943,53973,54003,54032,54062,54092,54121,54151,54180,54209,54239,54268,54297,54327,54357,54387,54416,54446,54476,54505,54535,54564,54593,54623,54652,54681,54711,54741,54770,54800,54830,54859,54889,54919,54948,54977,55007,55036,55066,55095,55125,55154,55184,55213,55243,55273,55302,55332,55361,55391,55420,55450,55479,55508,55538,55567,55597,55627,55657,55686,55716,55745,55775,55804,55834,55863,55892,55922,55951,55981,56011,56040,56070,56100,56129,56159,56188,56218,56247,56276,56306,56335,56365,56394,56424,56454,56483,56513,56543,56572,56601,56631,56660,56690,56719,56749,56778,56808,56837,56867,56897,56926,56956,56985,57015,57044,57074,57103,57133,57162,57192,57221,57251,57280,57310,57340,57369,57399,57429,57458,57487,57517,57546,57576,57605,57634,57664,57694,57723,57753,57783,57813,57842,57871,57901,57930,57959,57989,58018,58048,58077,58107,58137,58167,58196,58226,58255,58285,58314,58343,58373,58402,58432,58461,58491,58521,58551,58580,58610,58639,58669,58698,58727,58757,58786,58816,58845,58875,58905,58934,58964,58994,59023,59053,59082,59111,59141,59170,59200,59229,59259,59288,59318,59348,59377,59407,59436,59466,59495,59525,59554,59584,59613,59643,59672,59702,59731,59761,59791,59820,59850,59879,59909,59939,59968,59997,60027,60056,60086,60115,60145,60174,60204,60234,60264,60293,60323,60352,60381,60411,60440,60469,60499,60528,60558,60588,60618,60648,60677,60707,60736,60765,60795,60824,60853,60883,60912,60942,60972,61002,61031,61061,61090,61120,61149,61179,61208,61237,61267,61296,61326,61356,61385,61415,61445,61474,61504,61533,61563,61592,61621,61651,61680,61710,61739,61769,61799,61828,61858,61888,61917,61947,61976,62006,62035,62064,62094,62123,62153,62182,62212,62242,62271,62301,62331,62360,62390,62419,62448,62478,62507,62537,62566,62596,62625,62655,62685,62715,62744,62774,62803,62832,62862,62891,62921,62950,62980,63009,63039,63069,63099,63128,63157,63187,63216,63246,63275,63305,63334,63363,63393,63423,63453,63482,63512,63541,63571,63600,63630,63659,63689,63718,63747,63777,63807,63836,63866,63895,63925,63955,63984,64014,64043,64073,64102,64131,64161,64190,64220,64249,64279,64309,64339,64368,64398,64427,64457,64486,64515,64545,64574,64603,64633,64663,64692,64722,64752,64782,64811,64841,64870,64899,64929,64958,64987,65017,65047,65076,65106,65136,65166,65195,65225,65254,65283,65313,65342,65371,65401,65431,65460,65490,65520,65549,65579,65608,65638,65667,65697,65726,65755,65785,65815,65844,65874,65903,65933,65963,65992,66022,66051,66081,66110,66140,66169,66199,66228,66258,66287,66317,66346,66376,66405,66435,66465,66494,66524,66553,66583,66612,66641,66671,66700,66730,66760,66789,66819,66849,66878,66908,66937,66967,66996,67025,67055,67084,67114,67143,67173,67203,67233,67262,67292,67321,67351,67380,67409,67439,67468,67497,67527,67557,67587,67617,67646,67676,67705,67735,67764,67793,67823,67852,67882,67911,67941,67971,68e3,68030,68060,68089,68119,68148,68177,68207,68236,68266,68295,68325,68354,68384,68414,68443,68473,68502,68532,68561,68591,68620,68650,68679,68708,68738,68768,68797,68827,68857,68886,68916,68946,68975,69004,69034,69063,69092,69122,69152,69181,69211,69240,69270,69300,69330,69359,69388,69418,69447,69476,69506,69535,69565,69595,69624,69654,69684,69713,69743,69772,69802,69831,69861,69890,69919,69949,69978,70008,70038,70067,70097,70126,70156,70186,70215,70245,70274,70303,70333,70362,70392,70421,70451,70481,70510,70540,70570,70599,70629,70658,70687,70717,70746,70776,70805,70835,70864,70894,70924,70954,70983,71013,71042,71071,71101,71130,71159,71189,71218,71248,71278,71308,71337,71367,71397,71426,71455,71485,71514,71543,71573,71602,71632,71662,71691,71721,71751,71781,71810,71839,71869,71898,71927,71957,71986,72016,72046,72075,72105,72135,72164,72194,72223,72253,72282,72311,72341,72370,72400,72429,72459,72489,72518,72548,72577,72607,72637,72666,72695,72725,72754,72784,72813,72843,72872,72902,72931,72961,72991,73020,73050,73080,73109,73139,73168,73197,73227,73256,73286,73315,73345,73375,73404,73434,73464,73493,73523,73552,73581,73611,73640,73669,73699,73729,73758,73788,73818,73848,73877,73907,73936,73965,73995,74024,74053,74083,74113,74142,74172,74202,74231,74261,74291,74320,74349,74379,74408,74437,74467,74497,74526,74556,74586,74615,74645,74675,74704,74733,74763,74792,74822,74851,74881,74910,74940,74969,74999,75029,75058,75088,75117,75147,75176,75206,75235,75264,75294,75323,75353,75383,75412,75442,75472,75501,75531,75560,75590,75619,75648,75678,75707,75737,75766,75796,75826,75856,75885,75915,75944,75974,76003,76032,76062,76091,76121,76150,76180,76210,76239,76269,76299,76328,76358,76387,76416,76446,76475,76505,76534,76564,76593,76623,76653,76682,76712,76741,76771,76801,76830,76859,76889,76918,76948,76977,77007,77036,77066,77096,77125,77155,77185,77214,77243,77273,77302,77332,77361,77390,77420,77450,77479,77509,77539,77569,77598,77627,77657,77686,77715,77745,77774,77804,77833,77863,77893,77923,77952,77982,78011,78041,78070,78099,78129,78158,78188,78217,78247,78277,78307,78336,78366,78395,78425,78454,78483,78513,78542,78572,78601,78631,78661,78690,78720,78750,78779,78808,78838,78867,78897,78926,78956,78985,79015,79044,79074,79104,79133,79163,79192,79222,79251,79281,79310,79340,79369,79399,79428,79458,79487,79517,79546,79576,79606,79635,79665,79695,79724,79753,79783,79812,79841,79871,79900,79930,79960,79990]},{"../main":573,"object-assign":463}],573:[function(t,e,r){function n(){this.regionalOptions=[],this.regionalOptions[""]={invalidCalendar:"Calendar {0} not found",invalidDate:"Invalid {0} date",invalidMonth:"Invalid {0} month",invalidYear:"Invalid {0} year",differentCalendars:"Cannot mix {0} and {1} dates"},this.local=this.regionalOptions[""],this.calendars={},this._localCals={}}function i(t,e,r,n){if(this._calendar=t,this._year=e,this._month=r,this._day=n,0===this._calendar._validateLevel&&!this._calendar.isValid(this._year,this._month,this._day))throw(u.local.invalidDate||u.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function a(t,e){return t=""+t,"000000".substring(0,e-t.length)+t}function o(){this.shortYearCutoff="+10"}function s(t){this.local=this.regionalOptions[t]||this.regionalOptions[""]}var l=t("object-assign");l(n.prototype,{instance:function(t,e){t=(t||"gregorian").toLowerCase(),e=e||"";var r=this._localCals[t+"-"+e];if(!r&&this.calendars[t]&&(r=new this.calendars[t](e),this._localCals[t+"-"+e]=r),!r)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,t);return r},newDate:function(t,e,r,n,i){return n=(null!=t&&t.year?t.calendar():"string"==typeof n?this.instance(n,i):n)||this.instance(),n.newDate(t,e,r)},substituteDigits:function(t){return function(e){return(e+"").replace(/[0-9]/g,function(e){return t[e]})}},substituteChineseDigits:function(t,e){return function(r){for(var n="",i=0;r>0;){var a=r%10;n=(0===a?"":t[a]+e[i])+n,i++,r=Math.floor(r/10)}return 0===n.indexOf(t[1]+e[1])&&(n=n.substr(1)),n||t[0]}}}),l(i.prototype,{newDate:function(t,e,r){return this._calendar.newDate(null==t?this:t,e,r)},year:function(t){return 0===arguments.length?this._year:this.set(t,"y")},month:function(t){return 0===arguments.length?this._month:this.set(t,"m")},day:function(t){return 0===arguments.length?this._day:this.set(t,"d")},date:function(t,e,r){if(!this._calendar.isValid(t,e,r))throw(u.local.invalidDate||u.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=t,this._month=e,this._day=r,this},leapYear:function(){return this._calendar.leapYear(this)},epoch:function(){return this._calendar.epoch(this)},formatYear:function(){return this._calendar.formatYear(this)},monthOfYear:function(){return this._calendar.monthOfYear(this)},weekOfYear:function(){return this._calendar.weekOfYear(this)},daysInYear:function(){return this._calendar.daysInYear(this)},dayOfYear:function(){return this._calendar.dayOfYear(this)},daysInMonth:function(){return this._calendar.daysInMonth(this)},dayOfWeek:function(){return this._calendar.dayOfWeek(this)},weekDay:function(){return this._calendar.weekDay(this)},extraInfo:function(){return this._calendar.extraInfo(this)},add:function(t,e){return this._calendar.add(this,t,e)},set:function(t,e){return this._calendar.set(this,t,e)},compareTo:function(t){if(this._calendar.name!==t._calendar.name)throw(u.local.differentCalendars||u.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,t._calendar.local.name);var e=this._year!==t._year?this._year-t._year:this._month!==t._month?this.monthOfYear()-t.monthOfYear():this._day-t._day;return 0===e?0:e<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(t){return this._calendar.fromJD(t)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(t){return this._calendar.fromJSDate(t)},toString:function(){return(this.year()<0?"-":"")+a(Math.abs(this.year()),4)+"-"+a(this.month(),2)+"-"+a(this.day(),2)}}),l(o.prototype,{_validateLevel:0,newDate:function(t,e,r){return null==t?this.today():(t.year&&(this._validate(t,e,r,u.local.invalidDate||u.regionalOptions[""].invalidDate),r=t.day(),e=t.month(),t=t.year()),new i(this,t,e,r))},today:function(){return this.fromJSDate(new Date)},epoch:function(t){return this._validate(t,this.minMonth,this.minDay,u.local.invalidYear||u.regionalOptions[""].invalidYear).year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,u.local.invalidYear||u.regionalOptions[""].invalidYear);return(e.year()<0?"-":"")+a(Math.abs(e.year()),4)},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,u.local.invalidYear||u.regionalOptions[""].invalidYear),12},monthOfYear:function(t,e){var r=this._validate(t,e,this.minDay,u.local.invalidMonth||u.regionalOptions[""].invalidMonth);return(r.month()+this.monthsInYear(r)-this.firstMonth)%this.monthsInYear(r)+this.minMonth},fromMonthOfYear:function(t,e){var r=(e+this.firstMonth-2*this.minMonth)%this.monthsInYear(t)+this.minMonth;return this._validate(t,r,this.minDay,u.local.invalidMonth||u.regionalOptions[""].invalidMonth),r},daysInYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,u.local.invalidYear||u.regionalOptions[""].invalidYear);return this.leapYear(e)?366:365},dayOfYear:function(t,e,r){var n=this._validate(t,e,r,u.local.invalidDate||u.regionalOptions[""].invalidDate);return n.toJD()-this.newDate(n.year(),this.fromMonthOfYear(n.year(),this.minMonth),this.minDay).toJD()+1},daysInWeek:function(){return 7},dayOfWeek:function(t,e,r){var n=this._validate(t,e,r,u.local.invalidDate||u.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(n))+2)%this.daysInWeek()},extraInfo:function(t,e,r){return this._validate(t,e,r,u.local.invalidDate||u.regionalOptions[""].invalidDate),{}},add:function(t,e,r){return this._validate(t,this.minMonth,this.minDay,u.local.invalidDate||u.regionalOptions[""].invalidDate),this._correctAdd(t,this._add(t,e,r),e,r)},_add:function(t,e,r){if(this._validateLevel++,"d"===r||"w"===r){var n=t.toJD()+e*("w"===r?this.daysInWeek():1),i=t.calendar().fromJD(n);return this._validateLevel--,[i.year(),i.month(),i.day()]}try{var a=t.year()+("y"===r?e:0),o=t.monthOfYear()+("m"===r?e:0),i=t.day();"y"===r?(t.month()!==this.fromMonthOfYear(a,o)&&(o=this.newDate(a,t.month(),this.minDay).monthOfYear()),o=Math.min(o,this.monthsInYear(a)),i=Math.min(i,this.daysInMonth(a,this.fromMonthOfYear(a,o)))):"m"===r&&(!function(t){for(;o<t.minMonth;)a--,o+=t.monthsInYear(a);for(var e=t.monthsInYear(a);o>e-1+t.minMonth;)a++,o-=e,e=t.monthsInYear(a)}(this),i=Math.min(i,this.daysInMonth(a,this.fromMonthOfYear(a,o))));var s=[a,this.fromMonthOfYear(a,o),i];return this._validateLevel--,s}catch(t){throw this._validateLevel--,t}},_correctAdd:function(t,e,r,n){if(!(this.hasYearZero||"y"!==n&&"m"!==n||0!==e[0]&&t.year()>0==e[0]>0)){var i={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[n],a=r<0?-1:1;e=this._add(t,r*i[0]+a*i[1],i[2])}return t.date(e[0],e[1],e[2])},set:function(t,e,r){this._validate(t,this.minMonth,this.minDay,u.local.invalidDate||u.regionalOptions[""].invalidDate);var n="y"===r?e:t.year(),i="m"===r?e:t.month(),a="d"===r?e:t.day();return"y"!==r&&"m"!==r||(a=Math.min(a,this.daysInMonth(n,i))),t.date(n,i,a)},isValid:function(t,e,r){this._validateLevel++;var n=this.hasYearZero||0!==t;if(n){var i=this.newDate(t,e,this.minDay);n=e>=this.minMonth&&e-this.minMonth<this.monthsInYear(i)&&r>=this.minDay&&r-this.minDay<this.daysInMonth(i)}return this._validateLevel--,n},toJSDate:function(t,e,r){var n=this._validate(t,e,r,u.local.invalidDate||u.regionalOptions[""].invalidDate);return u.instance().fromJD(this.toJD(n)).toJSDate()},fromJSDate:function(t){return this.fromJD(u.instance().fromJSDate(t).toJD())},_validate:function(t,e,r,n){if(t.year){if(0===this._validateLevel&&this.name!==t.calendar().name)throw(u.local.differentCalendars||u.regionalOptions[""].differentCalendars).replace(/\{0\}/,this.local.name).replace(/\{1\}/,t.calendar().local.name);return t}try{if(1===++this._validateLevel&&!this.isValid(t,e,r))throw n.replace(/\{0\}/,this.local.name);var i=this.newDate(t,e,r);return this._validateLevel--,i}catch(t){throw this._validateLevel--,t}}}),s.prototype=new o,l(s.prototype,{name:"Gregorian",
51 jdEpoch:1721425.5,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Gregorian",epochs:["BCE","CE"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"mm/dd/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,u.local.invalidYear||u.regionalOptions[""].invalidYear),t=e.year()+(e.year()<0?1:0);return t%4==0&&(t%100!=0||t%400==0)},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(4-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,u.local.invalidMonth||u.regionalOptions[""].invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,e,r,u.local.invalidDate||u.regionalOptions[""].invalidDate);t=n.year(),e=n.month(),r=n.day(),t<0&&t++,e<3&&(e+=12,t--);var i=Math.floor(t/100),a=2-i+Math.floor(i/4);return Math.floor(365.25*(t+4716))+Math.floor(30.6001*(e+1))+r+a-1524.5},fromJD:function(t){var e=Math.floor(t+.5),r=Math.floor((e-1867216.25)/36524.25);r=e+1+r-Math.floor(r/4);var n=r+1524,i=Math.floor((n-122.1)/365.25),a=Math.floor(365.25*i),o=Math.floor((n-a)/30.6001),s=n-a-Math.floor(30.6001*o),l=o-(o>13.5?13:1),u=i-(l>2.5?4716:4715);return u<=0&&u--,this.newDate(u,l,s)},toJSDate:function(t,e,r){var n=this._validate(t,e,r,u.local.invalidDate||u.regionalOptions[""].invalidDate),i=new Date(n.year(),n.month()-1,n.day());return i.setHours(0),i.setMinutes(0),i.setSeconds(0),i.setMilliseconds(0),i.setHours(i.getHours()>12?i.getHours()+2:0),i},fromJSDate:function(t){return this.newDate(t.getFullYear(),t.getMonth()+1,t.getDate())}});var u=e.exports=new n;u.cdate=i,u.baseCalendar=o,u.calendars.gregorian=s},{"object-assign":463}],574:[function(t,e,r){var n=t("object-assign"),i=t("./main");n(i.regionalOptions[""],{invalidArguments:"Invalid arguments",invalidFormat:"Cannot format a date from another calendar",missingNumberAt:"Missing number at position {0}",unknownNameAt:"Unknown name at position {0}",unexpectedLiteralAt:"Unexpected literal at position {0}",unexpectedText:"Additional text found at end"}),i.local=i.regionalOptions[""],n(i.cdate.prototype,{formatDate:function(t,e){return"string"!=typeof t&&(e=t,t=""),this._calendar.formatDate(t||"",this,e)}}),n(i.baseCalendar.prototype,{UNIX_EPOCH:i.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:86400,TICKS_EPOCH:i.instance().jdEpoch,TICKS_PER_DAY:864e9,ATOM:"yyyy-mm-dd",COOKIE:"D, dd M yyyy",FULL:"DD, MM d, yyyy",ISO_8601:"yyyy-mm-dd",JULIAN:"J",RFC_822:"D, d M yy",RFC_850:"DD, dd-M-yy",RFC_1036:"D, d M yy",RFC_1123:"D, d M yyyy",RFC_2822:"D, d M yyyy",RSS:"D, d M yy",TICKS:"!",TIMESTAMP:"@",W3C:"yyyy-mm-dd",formatDate:function(t,e,r){if("string"!=typeof t&&(r=e,e=t,t=""),!e)return"";if(e.calendar()!==this)throw i.local.invalidFormat||i.regionalOptions[""].invalidFormat;t=t||this.local.dateFormat,r=r||{};for(var n=r.dayNamesShort||this.local.dayNamesShort,a=r.dayNames||this.local.dayNames,o=r.monthNumbers||this.local.monthNumbers,s=r.monthNamesShort||this.local.monthNamesShort,l=r.monthNames||this.local.monthNames,u=(r.calculateWeek||this.local.calculateWeek,function(e,r){for(var n=1;v+n<t.length&&t.charAt(v+n)===e;)n++;return v+=n-1,Math.floor(n/(r||1))>1}),c=function(t,e,r,n){var i=""+e;if(u(t,n))for(;i.length<r;)i="0"+i;return i},h=this,f=this.local.digits,d=function(t){return r.localNumbers&&f?f(t):t},p="",m=!1,v=0;v<t.length;v++)if(m)"'"!==t.charAt(v)||u("'")?p+=t.charAt(v):m=!1;else switch(t.charAt(v)){case"d":p+=d(c("d",e.day(),2));break;case"D":p+=function(t,e,r,n){return u(t)?n[e]:r[e]}("D",e.dayOfWeek(),n,a);break;case"o":p+=c("o",e.dayOfYear(),3);break;case"w":p+=c("w",e.weekOfYear(),2);break;case"m":p+=function(t){return"function"==typeof o?o.call(h,t,u("m")):d(c("m",t.month(),2))}(e);break;case"M":p+=function(t,e){return e?"function"==typeof l?l.call(h,t):l[t.month()-h.minMonth]:"function"==typeof s?s.call(h,t):s[t.month()-h.minMonth]}(e,u("M"));break;case"y":p+=u("y",2)?e.year():(e.year()%100<10?"0":"")+e.year()%100;break;case"Y":u("Y",2),p+=e.formatYear();break;case"J":p+=e.toJD();break;case"@":p+=(e.toJD()-this.UNIX_EPOCH)*this.SECS_PER_DAY;break;case"!":p+=(e.toJD()-this.TICKS_EPOCH)*this.TICKS_PER_DAY;break;case"'":u("'")?p+="'":m=!0;break;default:p+=t.charAt(v)}return p},parseDate:function(t,e,r){if(null==e)throw i.local.invalidArguments||i.regionalOptions[""].invalidArguments;if(""===(e="object"==typeof e?e.toString():e+""))return null;t=t||this.local.dateFormat,r=r||{};var n=r.shortYearCutoff||this.shortYearCutoff;n="string"!=typeof n?n:this.today().year()%100+parseInt(n,10);for(var a=r.dayNamesShort||this.local.dayNamesShort,o=r.dayNames||this.local.dayNames,s=r.parseMonth||this.local.parseMonth,l=r.monthNumbers||this.local.monthNumbers,u=r.monthNamesShort||this.local.monthNamesShort,c=r.monthNames||this.local.monthNames,h=-1,f=-1,d=-1,p=-1,m=-1,v=!1,g=!1,y=function(e,r){for(var n=1;k+n<t.length&&t.charAt(k+n)===e;)n++;return k+=n-1,Math.floor(n/(r||1))>1},b=function(t,r){var n=y(t,r),a=[2,3,n?4:2,n?4:2,10,11,20]["oyYJ@!".indexOf(t)+1],o=new RegExp("^-?\\d{1,"+a+"}"),s=e.substring(M).match(o);if(!s)throw(i.local.missingNumberAt||i.regionalOptions[""].missingNumberAt).replace(/\{0\}/,M);return M+=s[0].length,parseInt(s[0],10)},x=this,_=function(t,r,n,a){for(var o=y(t,a)?n:r,s=0;s<o.length;s++)if(e.substr(M,o[s].length).toLowerCase()===o[s].toLowerCase())return M+=o[s].length,s+x.minMonth;throw(i.local.unknownNameAt||i.regionalOptions[""].unknownNameAt).replace(/\{0\}/,M)},w=function(){if(e.charAt(M)!==t.charAt(k))throw(i.local.unexpectedLiteralAt||i.regionalOptions[""].unexpectedLiteralAt).replace(/\{0\}/,M);M++},M=0,k=0;k<t.length;k++)if(g)"'"!==t.charAt(k)||y("'")?w():g=!1;else switch(t.charAt(k)){case"d":p=b("d");break;case"D":_("D",a,o);break;case"o":m=b("o");break;case"w":b("w");break;case"m":d=function(){if("function"==typeof l){y("m");var t=l.call(x,e.substring(M));return M+=t.length,t}return b("m")}();break;case"M":d=function(){if("function"==typeof c){var t=y("M")?c.call(x,e.substring(M)):u.call(x,e.substring(M));return M+=t.length,t}return _("M",u,c)}();break;case"y":var A=k;v=!y("y",2),k=A,f=b("y",2);break;case"Y":f=b("Y",2);break;case"J":h=b("J")+.5,"."===e.charAt(M)&&(M++,b("J"));break;case"@":h=b("@")/this.SECS_PER_DAY+this.UNIX_EPOCH;break;case"!":h=b("!")/this.TICKS_PER_DAY+this.TICKS_EPOCH;break;case"*":M=e.length;break;case"'":y("'")?w():g=!0;break;default:w()}if(M<e.length)throw i.local.unexpectedText||i.regionalOptions[""].unexpectedText;if(f===-1?f=this.today().year():f<100&&v&&(f+=n===-1?1900:this.today().year()-this.today().year()%100-(f<=n?0:100)),"string"==typeof d&&(d=s.call(this,f,d)),m>-1){d=1,p=m;for(var T=this.daysInMonth(f,d);p>T;T=this.daysInMonth(f,d))d++,p-=T}return h>-1?this.fromJD(h):this.newDate(f,d,p)},determineDate:function(t,e,r,n,i){r&&"object"!=typeof r&&(i=n,n=r,r=null),"string"!=typeof n&&(i=n,n="");var a=this;return e=e?e.newDate():null,t=null==t?e:"string"==typeof t?function(t){try{return a.parseDate(n,t,i)}catch(t){}t=t.toLowerCase();for(var e=(t.match(/^c/)&&r?r.newDate():null)||a.today(),o=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,s=o.exec(t);s;)e.add(parseInt(s[1],10),s[2]||"d"),s=o.exec(t);return e}(t):"number"==typeof t?isNaN(t)||1/0===t||t===-1/0?e:a.today().add(t,"d"):a.newDate(t)}})},{"./main":573,"object-assign":463}],575:[function(t,e,r){e.exports=t("cwise-compiler")({args:["array",{offset:[1],array:0},"scalar","scalar","index"],pre:{body:"{}",args:[],thisVars:[],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},body:{body:"{\n var _inline_1_da = _inline_1_arg0_ - _inline_1_arg3_\n var _inline_1_db = _inline_1_arg1_ - _inline_1_arg3_\n if((_inline_1_da >= 0) !== (_inline_1_db >= 0)) {\n _inline_1_arg2_.push(_inline_1_arg4_[0] + 0.5 + 0.5 * (_inline_1_da + _inline_1_db) / (_inline_1_da - _inline_1_db))\n }\n }",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg3_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:[],localVars:["_inline_1_da","_inline_1_db"]},funcName:"zeroCrossings"})},{"cwise-compiler":106}],576:[function(t,e,r){"use strict";function n(t,e){var r=[];return e=+e||0,i(t.hi(t.shape[0]-1),r,e),r}e.exports=n;var i=t("./lib/zc-core")},{"./lib/zc-core":575}],577:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../color"),a=t("../../plots/cartesian/axes"),o=t("./attributes");e.exports=function(t,e,r,s,l){function u(r,i){return n.coerce(t,e,o,r,i)}s=s||{},l=l||{};var c=u("visible",!l.itemIsNotPlainObject),h=u("clicktoshow");if(!c&&!h)return e;u("opacity");var f=u("bgcolor"),d=u("bordercolor"),p=i.opacity(d);u("borderpad");var m=u("borderwidth"),v=u("showarrow");u("text",v?" ":"new text"),u("textangle"),n.coerceFont(u,"font",r.font),u("width"),u("align"),u("height")&&u("valign");for(var g=["x","y"],y=[-10,-30],b={_fullLayout:r},x=0;x<2;x++){var _=g[x],w=a.coerceRef(t,e,b,_,"","paper");if(a.coercePosition(e,b,u,w,_,.5),v){var M="a"+_,k=a.coerceRef(t,e,b,M,"pixel");"pixel"!==k&&k!==w&&(k=e[M]="pixel");var A="pixel"===k?y[x]:.4;a.coercePosition(e,b,u,k,M,A)}u(_+"anchor"),u(_+"shift")}if(n.noneOrAll(t,e,["x","y"]),v&&(u("arrowcolor",p?e.bordercolor:i.defaultLine),u("arrowhead"),u("arrowsize"),u("arrowwidth",2*(p&&m||1)),u("standoff"),n.noneOrAll(t,e,["ax","ay"])),h){var T=u("xclick"),S=u("yclick");e._xclick=void 0===T?e.x:T,e._yclick=void 0===S?e.y:S}var E=u("hovertext"),L=r.hoverlabel||{};if(E){var C=u("hoverlabel.bgcolor",L.bgcolor||(i.opacity(f)?i.rgb(f):i.defaultLine)),z=u("hoverlabel.bordercolor",L.bordercolor||i.contrast(C));n.coerceFont(u,"hoverlabel.font",{family:L.font.family,size:L.font.size,color:L.font.color||z})}return u("captureevents",!!E),e}},{"../../lib":709,"../../plots/cartesian/axes":748,"../color":590,"./attributes":579}],578:[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},{path:"M2,2V-2H-2V2Z",backoff:0}]},{}],579:[function(t,e,r){"use strict";var n=t("./arrow_paths"),i=t("../../plots/font_attributes"),a=t("../../plots/cartesian/constants"),o=t("../../lib/extend").extendFlat;e.exports={_isLinkedToArray:"annotation",visible:{valType:"boolean",dflt:!0},text:{valType:"string"},textangle:{valType:"angle",dflt:0},font:o({},i,{}),width:{valType:"number",min:1,dflt:null},height:{valType:"number",min:1,dflt:null},opacity:{valType:"number",min:0,max:1,dflt:1},align:{valType:"enumerated",values:["left","center","right"],dflt:"center"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)"},borderpad:{valType:"number",min:0,dflt:1},borderwidth:{valType:"number",min:0,dflt:1},showarrow:{valType:"boolean",dflt:!0},arrowcolor:{valType:"color"},arrowhead:{valType:"integer",min:0,max:n.length,dflt:1},arrowsize:{valType:"number",min:.3,dflt:1},arrowwidth:{valType:"number",min:.1},standoff:{valType:"number",min:0,dflt:0},ax:{valType:"any"},ay:{valType:"any"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",a.idRegex.x.toString()]},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",a.idRegex.y.toString()]},xref:{valType:"enumerated",values:["paper",a.idRegex.x.toString()]},x:{valType:"any"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto"},xshift:{valType:"number",dflt:0},yref:{valType:"enumerated",values:["paper",a.idRegex.y.toString()]},y:{valType:"any"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto"},yshift:{valType:"number",dflt:0},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1},xclick:{valType:"any"},yclick:{valType:"any"},hovertext:{valType:"string"},hoverlabel:{bgcolor:{valType:"color"},bordercolor:{valType:"color"},font:o({},i,{})},captureevents:{valType:"boolean"},_deprecated:{ref:{valType:"string"}}}},{"../../lib/extend":701,"../../plots/cartesian/constants":753,"../../plots/font_attributes":772,"./arrow_paths":578}],580:[function(t,e,r){"use strict";function n(t){var e=t._fullLayout;i.filterVisible(e.annotations).forEach(function(e){var r,n,i=a.getFromId(t,e.xref),o=a.getFromId(t,e.yref),s=3*e.arrowsize*e.arrowwidth||0;i&&i.autorange&&(r=s+e.xshift,n=s-e.xshift,e.axref===e.xref?(a.expand(i,[i.r2c(e.x)],{ppadplus:r,ppadminus:n}),a.expand(i,[i.r2c(e.ax)],{ppadplus:e._xpadplus,ppadminus:e._xpadminus})):a.expand(i,[i.r2c(e.x)],{ppadplus:Math.max(e._xpadplus,r),ppadminus:Math.max(e._xpadminus,n)})),o&&o.autorange&&(r=s-e.yshift,n=s+e.yshift,e.ayref===e.yref?(a.expand(o,[o.r2c(e.y)],{ppadplus:r,ppadminus:n}),a.expand(o,[o.r2c(e.ay)],{ppadplus:e._ypadplus,ppadminus:e._ypadminus})):a.expand(o,[o.r2c(e.y)],{ppadplus:Math.max(e._ypadplus,r),ppadminus:Math.max(e._ypadminus,n)}))})}var i=t("../../lib"),a=t("../../plots/cartesian/axes"),o=t("./draw").draw;e.exports=function(t){var e=t._fullLayout,r=i.filterVisible(e.annotations);if(r.length&&t._fullData.length){var s={};r.forEach(function(t){s[t.xref]=!0,s[t.yref]=!0});if(a.list(t).filter(function(t){return t.autorange&&s[t._id]}).length)return i.syncOrAsync([o,n],t)}}},{"../../lib":709,"../../plots/cartesian/axes":748,"./draw":584}],581:[function(t,e,r){"use strict";function n(t,e){var r=a(t,e);return r.on.length>0||r.explicitOff.length>0}function i(t,e){var r,n=a(t,e),i=n.on,s=n.off.concat(n.explicitOff),l={};if(i.length||s.length){for(r=0;r<i.length;r++)l["annotations["+i[r]+"].visible"]=!0;for(r=0;r<s.length;r++)l["annotations["+s[r]+"].visible"]=!1;return o.update(t,{},l)}}function a(t,e){var r,n,i,a,o,s,l=t._fullLayout.annotations,u=[],c=[],h=[],f=(e||[]).length;for(r=0;r<l.length;r++)if(i=l[r],a=i.clicktoshow){for(n=0;n<f;n++)if(o=e[n],o.xaxis._id===i.xref&&o.yaxis._id===i.yref&&o.xaxis.d2r(o.x)===i._xclick&&o.yaxis.d2r(o.y)===i._yclick){s=i.visible?"onout"===a?c:h:u,s.push(r);break}n===f&&i.visible&&"onout"===a&&c.push(r)}return{on:u,off:c,explicitOff:h}}var o=t("../../plotly");e.exports={hasClickToShow:n,onClick:i}},{"../../plotly":743}],582:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib/to_log_range");e.exports=function(t,e,r,a){function o(t){var r=u[t],o=null;o=s?i(r,e.range):Math.pow(10,r),n(o)||(o=null),a(c+t,o)}e=e||{};var s="log"===r&&"linear"===e.type,l="linear"===r&&"log"===e.type;if(s||l)for(var u,c,h=t._fullLayout.annotations,f=e._id.charAt(0),d=0;d<h.length;d++)u=h[d],c="annotations["+d+"].",u[f+"ref"]===e._id&&o(f),u["a"+f+"ref"]===e._id&&o("a"+f)}},{"../../lib/to_log_range":729,"fast-isnumeric":127}],583:[function(t,e,r){"use strict";var n=t("../../plots/array_container_defaults"),i=t("./annotation_defaults");e.exports=function(t,e){n(t,e,{name:"annotations",handleItemDefaults:i})}},{"../../plots/array_container_defaults":745,"./annotation_defaults":577}],584:[function(t,e,r){"use strict";function n(t){var e=t._fullLayout;e._infolayer.selectAll(".annotation").remove();for(var r=0;r<e.annotations.length;r++)e.annotations[r].visible&&i(t,r);return l.previousPromises(t)}function i(t,e){function r(t){return t.call(f.font,O).attr({"text-anchor":{left:"start",right:"end"}[x.align]||"middle"}),p.convertToTspans(t,n),t}function n(){function r(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]}var n=j.selectAll("a");if(1===n.size()&&n.text()===j.text()){E.insert("a",":first-child").attr({"xlink:xlink:href":n.attr("xlink:href"),"xlink:xlink:show":n.attr("xlink:show")}).style({cursor:"pointer"}).node().appendChild(D.node())}j.selectAll("tspan.line").attr({y:0,x:0});var i=E.select(".annotation-math-group"),d=!i.empty(),p=f.bBox((d?i:j).node()),b=p.width,C=p.height,O=x.width||b,F=x.height||C,R=Math.round(O+2*z),N=Math.round(F+2*z);x._w=O,x._h=F;var B=!1;if(["x","y"].forEach(function(e){var n,i,a,o,s,h=x[e+"ref"]||e,f=x["a"+e+"ref"],d=c.getFromId(t,h),p=(A+("x"===e?0:-90))*Math.PI/180,m=R*Math.cos(p),v=N*Math.sin(p),g=Math.abs(m)+Math.abs(v),b=x[e+"anchor"],_=x[e+"shift"]*("x"===e?1:-1),w=k[e];if(d){var M=d.r2fraction(x[e]);if((t._dragging||!d.autorange)&&(M<0||M>1)&&(f===h?((M=d.r2fraction(x["a"+e]))<0||M>1)&&(B=!0):B=!0,B))return;n=d._offset+d.r2p(x[e]),o=.5}else"x"===e?(a=x[e],n=y.l+y.w*a):(a=1-x[e],n=y.t+y.h*a),o=x.showarrow?.5:a;if(x.showarrow){w.head=n;var T=x["a"+e];s=m*r(.5,x.xanchor)-v*r(.5,x.yanchor),f===h?(w.tail=d._offset+d.r2p(T),i=s):(w.tail=n+T,i=s+T),w.text=w.tail+s;var S=l["x"===e?"width":"height"];if("paper"===h&&(w.head=u.constrain(w.head,1,S-1)),"pixel"===f){var E=-Math.max(w.tail-3,w.text),L=Math.min(w.tail+3,w.text)-S;E>0?(w.tail+=E,w.text+=E):L>0&&(w.tail-=L,w.text-=L)}w.tail+=_,w.head+=_}else s=g*r(o,b),i=s,w.text=n+s;w.text+=_,s+=_,i+=_,x["_"+e+"padplus"]=g/2+i,x["_"+e+"padminus"]=g/2-i,x["_"+e+"size"]=g,x["_"+e+"shift"]=s}),B)return void E.remove();var U=0,V=0;if("left"!==x.align&&(U=(O-b)*("center"===x.align?.5:1)),"top"!==x.valign&&(V=(F-C)*("middle"===x.valign?.5:1)),d)i.select("svg").attr({x:z+U-1,y:z+V}).call(f.setClipUrl,I?_:null);else{var q=z+V-p.top,H=z+U-p.left;j.attr({x:H,y:q}).call(f.setClipUrl,I?_:null),j.selectAll("tspan.line").attr({y:q,x:H})}P.select("rect").call(f.setRect,z,z,O,F),D.call(f.setRect,L/2,L/2,R-L,N-L),E.call(f.setTranslate,Math.round(k.x.text-R/2),Math.round(k.y.text-N/2)),S.attr({transform:"rotate("+A+","+k.x.text+","+k.y.text+")"});var G="annotations["+e+"]",Y=function(r,n){o.select(t).selectAll('.annotation-arrow-g[data-index="'+e+'"]').remove();var i=k.x.head,l=k.y.head,c=k.x.tail+r,d=k.y.tail+n,p=k.x.text+r,m=k.y.text+n,b=u.rotationXYMatrix(A,p,m),_=u.apply2DTransform(b),L=u.apply2DTransform2(b),C=+D.attr("width"),z=+D.attr("height"),I=p-.5*C,P=I+C,O=m-.5*z,j=O+z,F=[[I,O,I,j],[I,j,P,j],[P,j,P,O],[P,O,I,O]].map(L);if(!F.reduce(function(t,e){return t^!!a(i,l,i+1e6,l+1e6,e[0],e[1],e[2],e[3])},!1)){F.forEach(function(t){var e=a(c,d,i,l,t[0],t[1],t[2],t[3]);e&&(c=e.x,d=e.y)});var R=x.arrowwidth,N=x.arrowcolor,B=T.append("g").style({opacity:h.opacity(N)}).classed("annotation-arrow-g",!0).attr("data-index",String(e)),U=B.append("path").attr("d","M"+c+","+d+"L"+i+","+l).style("stroke-width",R+"px").call(h.stroke,h.rgb(N));if(g(U,x.arrowhead,"end",x.arrowsize,x.standoff),t._context.editable&&U.node().parentNode){var V=i,q=l;if(x.standoff){var H=Math.sqrt(Math.pow(i-c,2)+Math.pow(l-d,2));V+=x.standoff*(c-i)/H,q+=x.standoff*(d-l)/H}var Y,X,W,Z=B.append("path").classed("annotation",!0).classed("anndrag",!0).attr({"data-index":String(e),d:"M3,3H-3V-3H3ZM0,0L"+(c-V)+","+(d-q),transform:"translate("+V+","+q+")"}).style("stroke-width",R+6+"px").call(h.stroke,"rgba(0,0,0,0)").call(h.fill,"rgba(0,0,0,0)");v.init({element:Z.node(),prepFn:function(){var t=f.getTranslate(E);X=t.x,W=t.y,Y={},w&&w.autorange&&(Y[w._name+".autorange"]=!0),M&&M.autorange&&(Y[M._name+".autorange"]=!0)},moveFn:function(t,e){var r=_(X,W),n=r[0]+t,i=r[1]+e;E.call(f.setTranslate,n,i),Y[G+".x"]=w?w.p2r(w.r2p(x.x)+t):x.x+t/y.w,Y[G+".y"]=M?M.p2r(M.r2p(x.y)+e):x.y-e/y.h,x.axref===x.xref&&(Y[G+".ax"]=w.p2r(w.r2p(x.ax)+t)),x.ayref===x.yref&&(Y[G+".ay"]=M.p2r(M.r2p(x.ay)+e)),B.attr("transform","translate("+t+","+e+")"),S.attr({transform:"rotate("+A+","+n+","+i+")"})},doneFn:function(e){if(e){s.relayout(t,Y);var r=document.querySelector(".js-notes-box-panel");r&&r.redraw(r.selectedObj)}}})}}};if(x.showarrow&&Y(0,0),t._context.editable){var X,W;v.init({element:E.node(),prepFn:function(){W=S.attr("transform"),X={}},moveFn:function(t,e){var r="pointer";if(x.showarrow)x.axref===x.xref?X[G+".ax"]=w.p2r(w.r2p(x.ax)+t):X[G+".ax"]=x.ax+t,x.ayref===x.yref?X[G+".ay"]=M.p2r(M.r2p(x.ay)+e):X[G+".ay"]=x.ay+e,Y(t,e);else{if(w)X[G+".x"]=x.x+t/w._m;else{var n=x._xsize/y.w,i=x.x+(x._xshift-x.xshift)/y.w-n/2;X[G+".x"]=v.align(i+t/y.w,n,0,1,x.xanchor)}if(M)X[G+".y"]=x.y+e/M._m;else{var a=x._ysize/y.h,o=x.y-(x._yshift+x.yshift)/y.h-a/2;X[G+".y"]=v.align(o-e/y.h,a,0,1,x.yanchor)}w&&M||(r=v.getCursor(w?.5:X[G+".x"],M?.5:X[G+".y"],x.xanchor,x.yanchor))}S.attr({transform:"translate("+t+","+e+")"+W}),m(E,r)},doneFn:function(e){if(m(E),e){s.relayout(t,X);var r=document.querySelector(".js-notes-box-panel");r&&r.redraw(r.selectedObj)}}})}}var i=t.layout,l=t._fullLayout,y=t._fullLayout._size;l._infolayer.selectAll('.annotation[data-index="'+e+'"]').remove();var b=(i.annotations||[])[e],x=l.annotations[e],_="clip"+l._uid+"_ann"+e;if(!b||x.visible===!1)return void o.selectAll("#"+_).remove();var w=c.getFromId(t,x.xref),M=c.getFromId(t,x.yref),k={x:{},y:{}},A=+x.textangle||0,T=l._infolayer.append("g").classed("annotation",!0).attr("data-index",String(e)).style("opacity",x.opacity),S=T.append("g").classed("annotation-text-g",!0).attr("data-index",String(e)),E=S.append("g").style("pointer-events",x.captureevents?"all":null).call(m,"default").on("click",function(){t._dragging=!1,t.emit("plotly_clickannotation",{index:e,annotation:b,fullAnnotation:x,event:o.event})});x.hovertext&&E.on("mouseover",function(){var e=x.hoverlabel,r=e.font,n=this.getBoundingClientRect(),i=t.getBoundingClientRect();d.loneHover({x0:n.left-i.left,x1:n.right-i.left,y:(n.top+n.bottom)/2-i.top,text:x.hovertext,color:e.bgcolor,borderColor:e.bordercolor,fontFamily:r.family,fontSize:r.size,fontColor:r.color},{container:l._hoverlayer.node(),outerContainer:l._paper.node()})}).on("mouseout",function(){d.loneUnhover(l._hoverlayer.node())});var L=x.borderwidth,C=x.borderpad,z=L+C,D=E.append("rect").attr("class","bg").style("stroke-width",L+"px").call(h.stroke,x.bordercolor).call(h.fill,x.bgcolor),I=x.width||x.height,P=l._defs.select(".clips").selectAll("#"+_).data(I?[0]:[]);P.enter().append("clipPath").classed("annclip",!0).attr("id",_).append("rect"),P.exit().remove();var O=x.font,j=E.append("text").classed("annotation",!0).attr("data-unformatted",x.text).text(x.text);t._context.editable?j.call(p.makeEditable,E).call(r).on("edit",function(n){x.text=n,this.attr({"data-unformatted":x.text}),this.call(r);var i={};i["annotations["+e+"].text"]=x.text,w&&w.autorange&&(i[w._name+".autorange"]=!0),M&&M.autorange&&(i[M._name+".autorange"]=!0),s.relayout(t,i)}):j.call(r)}function a(t,e,r,n,i,a,o,s){var l=r-t,u=i-t,c=o-i,h=n-e,f=a-e,d=s-a,p=l*d-c*h;if(0===p)return null;var m=(u*d-c*f)/p,v=(u*h-l*f)/p;return v<0||v>1||m<0||m>1?null:{x:t+l*m,y:e+h*m}}var o=t("d3"),s=t("../../plotly"),l=t("../../plots/plots"),u=t("../../lib"),c=t("../../plots/cartesian/axes"),h=t("../color"),f=t("../drawing"),d=t("../fx"),p=t("../../lib/svg_text_utils"),m=t("../../lib/setcursor"),v=t("../dragelement"),g=t("./draw_arrow_head");e.exports={draw:n,drawOne:i}},{"../../lib":709,"../../lib/setcursor":724,"../../lib/svg_text_utils":728,"../../plotly":743,"../../plots/cartesian/axes":748,"../../plots/plots":811,"../color":590,"../dragelement":611,"../drawing":614,"../fx":631,"./draw_arrow_head":585,d3:118}],585:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("../color"),o=t("../drawing"),s=t("./arrow_paths");e.exports=function(t,e,r,l,u){function c(){t.style("stroke-dasharray","0px,100px")}function h(r,i){d.path&&(e>5&&(i=0),n.select(f.parentElement).append("path").attr({class:t.attr("class"),d:d.path,transform:"translate("+r.x+","+r.y+")rotate("+180*i/Math.PI+")scale("+y+")"}).style({fill:b,opacity:x,"stroke-width":0}))}i(l)||(l=1);var f=t.node(),d=s[e||0];"string"==typeof r&&r||(r="end");var p,m,v,g,y=(o.getPx(t,"stroke-width")||1)*l,b=t.style("stroke")||a.defaultLine,x=t.style("stroke-opacity")||1,_=r.indexOf("start")>=0,w=r.indexOf("end")>=0,M=d.backoff*y+u;if("line"===f.nodeName){p={x:+t.attr("x1"),y:+t.attr("y1")},m={x:+t.attr("x2"),y:+t.attr("y2")};var k=p.x-m.x,A=p.y-m.y;if(v=Math.atan2(A,k),g=v+Math.PI,M){if(M*M>k*k+A*A)return void c();var T=M*Math.cos(v),S=M*Math.sin(v);_&&(p.x-=T,p.y-=S,t.attr({x1:p.x,y1:p.y})),w&&(m.x+=T,m.y+=S,t.attr({x2:m.x,y2:m.y}))}}else if("path"===f.nodeName){var E=f.getTotalLength(),L="";if(E<M)return void c();if(_){var C=f.getPointAtLength(0),z=f.getPointAtLength(.1);v=Math.atan2(C.y-z.y,C.x-z.x),p=f.getPointAtLength(Math.min(M,E)),M&&(L="0px,"+M+"px,")}if(w){var D=f.getPointAtLength(E),I=f.getPointAtLength(E-.1);if(g=Math.atan2(D.y-I.y,D.x-I.x),m=f.getPointAtLength(Math.max(0,E-M)),M){var P=L?2*M:M;L+=E-P+"px,"+E+"px"}}else L&&(L+=E+"px");L&&t.style("stroke-dasharray",L)}_&&h(p,v),w&&h(m,g)}},{"../color":590,"../drawing":614,"./arrow_paths":578,d3:118,"fast-isnumeric":127}],586:[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"),calcAutorange:t("./calc_autorange"),draw:n.draw,drawOne:n.drawOne,hasClickToShow:i.hasClickToShow,onClick:i.onClick,convertCoords:t("./convert_coords")}},{"./attributes":579,"./calc_autorange":580,"./click":581,"./convert_coords":582,"./defaults":583,"./draw":584}],587:[function(t,e,r){"use strict";e.exports=t("world-calendars/dist/main"),t("world-calendars/dist/plus"),t("world-calendars/dist/calendars/chinese"),t("world-calendars/dist/calendars/coptic"),t("world-calendars/dist/calendars/discworld"),t("world-calendars/dist/calendars/ethiopian"),t("world-calendars/dist/calendars/hebrew"),t("world-calendars/dist/calendars/islamic"),t("world-calendars/dist/calendars/julian"),t("world-calendars/dist/calendars/mayan"),t("world-calendars/dist/calendars/nanakshahi"),t("world-calendars/dist/calendars/nepali"),t("world-calendars/dist/calendars/persian"),t("world-calendars/dist/calendars/taiwan"),t("world-calendars/dist/calendars/thai"),t("world-calendars/dist/calendars/ummalqura")},{"world-calendars/dist/calendars/chinese":559,"world-calendars/dist/calendars/coptic":560,"world-calendars/dist/calendars/discworld":561,"world-calendars/dist/calendars/ethiopian":562,"world-calendars/dist/calendars/hebrew":563,"world-calendars/dist/calendars/islamic":564,"world-calendars/dist/calendars/julian":565,"world-calendars/dist/calendars/mayan":566,"world-calendars/dist/calendars/nanakshahi":567,"world-calendars/dist/calendars/nepali":568,"world-calendars/dist/calendars/persian":569,"world-calendars/dist/calendars/taiwan":570,"world-calendars/dist/calendars/thai":571,"world-calendars/dist/calendars/ummalqura":572,"world-calendars/dist/main":573,"world-calendars/dist/plus":574}],588:[function(t,e,r){"use strict";function n(t,e,r){for(var n,a,o,s,l,u=Math.floor((e+.05)/h)+c,f=i(r).fromJD(u),d=0;(d=t.indexOf("%",d))!==-1;)n=t.charAt(d+1),"0"===n||"-"===n||"_"===n?(o=3,a=t.charAt(d+2),"_"===n&&(n="-")):(a=n,n="0",o=2),s=b[a],s?(l=s===y?y:f.formatDate(s[n]),t=t.substr(0,d)+l+t.substr(d+o),d+=l.length):d+=o;return t}function i(t){var e=x[t];return e||(e=x[t]=s.instance(t))}function a(t){return l.extendFlat({},f,{description:t})}function o(t){return"Sets the calendar system to use with `"+t+"` date data."}var s=t("./calendars"),l=t("../../lib"),u=t("../../constants/numerical"),c=u.EPOCHJD,h=u.ONEDAY,f={valType:"enumerated",values:Object.keys(s.calendars),dflt:"gregorian"},d=function(t,e,r,n){var i={};return i[r]=f,l.coerce(t,e,i,r,n)},p=function(t,e,r,n){for(var i=0;i<r.length;i++)d(t,e,r[i]+"calendar",n.calendar)},m={chinese:"2000-01-01",coptic:"2000-01-01",discworld:"2000-01-01",ethiopian:"2000-01-01",hebrew:"5000-01-01",islamic:"1000-01-01",julian:"2000-01-01",mayan:"5000-01-01",nanakshahi:"1000-01-01",nepali:"2000-01-01",persian:"1000-01-01",jalali:"1000-01-01",taiwan:"1000-01-01",thai:"2000-01-01",ummalqura:"1400-01-01"},v={chinese:"2000-01-02",coptic:"2000-01-03",discworld:"2000-01-03",ethiopian:"2000-01-05",hebrew:"5000-01-01",islamic:"1000-01-02",julian:"2000-01-03",mayan:"5000-01-01",nanakshahi:"1000-01-05",nepali:"2000-01-05",persian:"1000-01-01",jalali:"1000-01-01",taiwan:"1000-01-04",thai:"2000-01-04",ummalqura:"1400-01-06"},g={chinese:["2000-01-01","2001-01-01"],coptic:["1700-01-01","1701-01-01"],discworld:["1800-01-01","1801-01-01"],ethiopian:["2000-01-01","2001-01-01"],hebrew:["5700-01-01","5701-01-01"],islamic:["1400-01-01","1401-01-01"],julian:["2000-01-01","2001-01-01"],mayan:["5200-01-01","5201-01-01"],nanakshahi:["0500-01-01","0501-01-01"],nepali:["2000-01-01","2001-01-01"],persian:["1400-01-01","1401-01-01"],jalali:["1400-01-01","1401-01-01"],taiwan:["0100-01-01","0101-01-01"],thai:["2500-01-01","2501-01-01"],ummalqura:["1400-01-01","1401-01-01"]},y="##",b={d:{0:"dd","-":"d"},e:{0:"d","-":"d"},a:{0:"D","-":"D"},A:{0:"DD","-":"DD"},j:{0:"oo","-":"o"},W:{0:"ww","-":"w"},m:{0:"mm","-":"m"},b:{0:"M","-":"M"},B:{0:"MM","-":"MM"},y:{0:"yy","-":"yy"},Y:{0:"yyyy","-":"yyyy"},U:y,w:y,c:{0:"D M d %X yyyy","-":"D M d %X yyyy"},x:{0:"mm/dd/yyyy","-":"mm/dd/yyyy"}},x={},_={xcalendar:a(o("x"))},w=l.extendFlat({},_,{ycalendar:a(o("y"))}),M=l.extendFlat({},w,{zcalendar:a(o("z"))}),k=a(["Sets the calendar system to use for `range` and `tick0`","if this is a date axis. This does not set the calendar for","interpreting data on this axis, that's specified in the trace","or via the global `layout.calendar`"].join(" "));e.exports={moduleType:"component",name:"calendars",schema:{traces:{scatter:w,bar:w,heatmap:w,contour:w,histogram:w,histogram2d:w,histogram2dcontour:w,scatter3d:M,surface:M,mesh3d:M,scattergl:w,ohlc:_,candlestick:_},layout:{calendar:a(["Sets the default calendar system to use for interpreting and","displaying dates throughout the plot."].join(" ")),"xaxis.calendar":k,"yaxis.calendar":k,"scene.xaxis.calendar":k,"scene.yaxis.calendar":k,"scene.zaxis.calendar":k},transforms:{filter:{valuecalendar:a(["Sets the calendar system to use for `value`, if it is a date."].join(" ")),targetcalendar:a(["Sets the calendar system to use for `target`, if it is an","array of dates. If `target` is a string (eg *x*) we use the","corresponding trace attribute (eg `xcalendar`) if it exists,","even if `targetcalendar` is provided."].join(" "))}}},layoutAttributes:f,handleDefaults:d,handleTraceDefaults:p,CANONICAL_SUNDAY:v,CANONICAL_TICK:m,DFLTRANGE:g,getCal:i,worldCalFmt:n}},{"../../constants/numerical":690,"../../lib":709,"./calendars":587}],589:[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},{}],590:[function(t,e,r){"use strict";function n(t){if(a(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*/),i="a"===e.charAt(3)&&4===n.length;if(!i&&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 i?"rgba("+s+", "+n[3]+")":"rgb("+s+")"}var i=t("tinycolor2"),a=t("fast-isnumeric"),o=e.exports={},s=t("./attributes");o.defaults=s.defaults;var l=o.defaultLine=s.defaultLine;o.lightLine=s.lightLine;var u=o.background=s.background;o.tinyRGB=function(t){var e=t.toRgb()
52 ;return"rgb("+Math.round(e.r)+", "+Math.round(e.g)+", "+Math.round(e.b)+")"},o.rgb=function(t){return o.tinyRGB(i(t))},o.opacity=function(t){return t?i(t).getAlpha():0},o.addOpacity=function(t,e){var r=i(t).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+e+")"},o.combine=function(t,e){var r=i(t).toRgb();if(1===r.a)return i(t).toRgbString();var n=i(e||u).toRgb(),a=1===n.a?n:{r:255*(1-n.a)+n.r*n.a,g:255*(1-n.a)+n.g*n.a,b:255*(1-n.a)+n.b*n.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 i(o).toRgbString()},o.contrast=function(t,e,r){var n=i(t);return 1!==n.getAlpha()&&(n=i(o.combine(t,u))),(n.isDark()?e?n.lighten(e):u:r?n.darken(r):l).toString()},o.stroke=function(t,e){var r=i(e);t.style({stroke:o.tinyRGB(r),"stroke-opacity":r.getAlpha()})},o.fill=function(t,e){var r=i(e);t.style({fill:o.tinyRGB(r),"fill-opacity":r.getAlpha()})},o.clean=function(t){if(t&&"object"==typeof t){var e,r,i,a,s=Object.keys(t);for(e=0;e<s.length;e++)if(i=s[e],a=t[i],"color"===i.substr(i.length-5))if(Array.isArray(a))for(r=0;r<a.length;r++)a[r]=n(a[r]);else t[i]=n(a);else if("colorscale"===i.substr(i.length-10)&&Array.isArray(a))for(r=0;r<a.length;r++)Array.isArray(a[r])&&(a[r][1]=n(a[r][1]));else if(Array.isArray(a)){var l=a[0];if(!Array.isArray(l)&&l&&"object"==typeof l)for(r=0;r<a.length;r++)o.clean(a[r])}else a&&"object"==typeof a&&o.clean(a)}}},{"./attributes":589,"fast-isnumeric":127,tinycolor2:526}],591:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/layout_attributes"),i=t("../../plots/font_attributes"),a=t("../../lib/extend").extendFlat;e.exports={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:n.tickfont,tickangle:n.tickangle,tickformat:n.tickformat,tickprefix:n.tickprefix,showtickprefix:n.showtickprefix,ticksuffix:n.ticksuffix,showticksuffix:n.showticksuffix,separatethousands:n.separatethousands,exponentformat:n.exponentformat,showexponent:n.showexponent,title:{valType:"string",dflt:"Click to enter colorscale title"},titlefont:a({},i,{}),titleside:{valType:"enumerated",values:["right","top","bottom"],dflt:"top"}}},{"../../lib/extend":701,"../../plots/cartesian/layout_attributes":759,"../../plots/font_attributes":772}],592:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/tick_value_defaults"),a=t("../../plots/cartesian/tick_mark_defaults"),o=t("../../plots/cartesian/tick_label_defaults"),s=t("./attributes");e.exports=function(t,e,r){function l(t,e){return n.coerce(c,u,s,t,e)}var u=e.colorbar={},c=t.colorbar||{};l("thickness","fraction"===l("thicknessmode")?30/(r.width-r.margin.l-r.margin.r):30),l("len","fraction"===l("lenmode")?1:r.height-r.margin.t-r.margin.b),l("x"),l("xanchor"),l("xpad"),l("y"),l("yanchor"),l("ypad"),n.noneOrAll(c,u,["x","y"]),l("outlinecolor"),l("outlinewidth"),l("bordercolor"),l("borderwidth"),l("bgcolor"),i(c,u,l,"linear"),o(c,u,l,"linear",{outerTicks:!1,font:r.font,noHover:!0}),a(c,u,l,"linear",{outerTicks:!1,font:r.font,noHover:!0}),l("title"),n.coerceFont(l,"titlefont",r.font),l("titleside")}},{"../../lib":709,"../../plots/cartesian/tick_label_defaults":766,"../../plots/cartesian/tick_mark_defaults":767,"../../plots/cartesian/tick_value_defaults":768,"./attributes":591}],593:[function(t,e,r){"use strict";var n=t("d3"),i=t("tinycolor2"),a=t("../../plotly"),o=t("../../plots/plots"),s=t("../../registry"),l=t("../../plots/cartesian/axes"),u=t("../dragelement"),c=t("../../lib"),h=t("../../lib/extend").extendFlat,f=t("../../lib/setcursor"),d=t("../drawing"),p=t("../color"),m=t("../titles"),v=t("../../plots/cartesian/axis_defaults"),g=t("../../plots/cartesian/position_defaults"),y=t("../../plots/cartesian/layout_attributes"),b=t("./attributes");e.exports=function(t,e){function r(){function b(t,e){return c.coerce(Q,$,y,t,e)}function w(){if(["top","bottom"].indexOf(_.titleside)!==-1){var e=at.select(".cbtitle"),r=e.select("text"),a=[-_.outlinewidth/2,_.outlinewidth/2],o=e.select(".h"+$._id+"title-math-group").node(),s=15.6;if(r.node()&&(s=1.3*parseInt(r.style("font-size"),10)),o?(st=d.bBox(o).height)>s&&(a[1]-=(st-s)/2):r.node()&&!r.classed("js-placeholder")&&(st=d.bBox(e.node()).height),st){if(st+=5,"top"===_.titleside)$.domain[1]-=st/T.h,a[1]*=-1;else{$.domain[0]+=st/T.h;var u=Math.max(1,r.selectAll("tspan.line").size());a[1]+=(1-u)*s}e.attr("transform","translate("+a+")"),$.setScale()}}at.selectAll(".cbfills,.cblines,.cbaxis").attr("transform","translate(0,"+Math.round(T.h*(1-$.domain[1]))+")");var h=at.select(".cbfills").selectAll("rect.cbfill").data(C);h.enter().append("rect").classed("cbfill",!0).style("stroke","none"),h.exit().remove(),h.each(function(t,e){var r=[0===e?E[0]:(C[e]+C[e-1])/2,e===C.length-1?E[1]:(C[e]+C[e+1])/2].map($.c2p).map(Math.round);e!==C.length-1&&(r[1]+=r[1]>r[0]?1:-1);var a=D(t).replace("e-",""),o=i(a).toHexString();n.select(this).attr({x:X,width:Math.max(B,2),y:n.min(r),height:Math.max(n.max(r)-n.min(r),2),fill:o})});var f=at.select(".cblines").selectAll("path.cbline").data(_.line.color&&_.line.width?L:[]);return f.enter().append("path").classed("cbline",!0),f.exit().remove(),f.each(function(t){n.select(this).attr("d","M"+X+","+(Math.round($.c2p(t))+_.line.width/2%1)+"h"+B).call(d.lineGroupStyle,_.line.width,z(t),_.line.dash)}),$._axislayer.selectAll("g."+$._id+"tick,path").remove(),$._pos=X+B+(_.outlinewidth||0)/2-("outside"===_.ticks?1:0),$.side="right",c.syncOrAsync([function(){return l.doTicks(t,$,!0)},function(){if(["top","bottom"].indexOf(_.titleside)===-1){var e=$.titlefont.size,r=$._offset+$._length/2,i=T.l+($.position||0)*T.w+("right"===$.side?10+e*($.showticklabels?1:.5):-10-e*($.showticklabels?.5:0));M("h"+$._id+"title",{avoid:{selection:n.select(t).selectAll("g."+$._id+"tick"),side:_.titleside,offsetLeft:T.l,offsetTop:T.t,maxShift:A.width},attributes:{x:i,y:r,"text-anchor":"middle"},transform:{rotate:"-90",offset:0}})}}])}function M(e,r){var n,i=x();n=s.traceIs(i,"markerColorscale")?"marker.colorbar.title":"colorbar.title";var a={propContainer:$,propName:n,traceIndex:i.index,dfltName:"colorscale",containerGroup:at.select(".cbtitle")},o="h"===e.charAt(0)?e.substr(1):"h"+e;at.selectAll("."+o+",."+o+"-math-group").remove(),m.draw(t,e,h(a,r||{}))}function k(){var r=B+_.outlinewidth/2+d.bBox($._axislayer.node()).width;if(F=ot.select("text"),F.node()&&!F.classed("js-placeholder")){var n,i=ot.select(".h"+$._id+"title-math-group").node();n=i&&["top","bottom"].indexOf(_.titleside)!==-1?d.bBox(i).width:d.bBox(ot.node()).right-X-T.l,r=Math.max(r,n)}var a=2*_.xpad+r+_.borderwidth+_.outlinewidth/2,s=J-K;at.select(".cbbg").attr({x:X-_.xpad-(_.borderwidth+_.outlinewidth)/2,y:K-G,width:Math.max(a,2),height:Math.max(s+2*G,2)}).call(p.fill,_.bgcolor).call(p.stroke,_.bordercolor).style({"stroke-width":_.borderwidth}),at.selectAll(".cboutline").attr({x:X,y:K+_.ypad+("top"===_.titleside?st:0),width:Math.max(B,2),height:Math.max(s-2*_.ypad-st,2)}).call(p.stroke,_.outlinecolor).style({fill:"None","stroke-width":_.outlinewidth});var l=({center:.5,right:1}[_.xanchor]||0)*a;at.attr("transform","translate("+(T.l-l)+","+T.t+")"),o.autoMargin(t,e,{x:_.x,y:_.y,l:a*({right:1,center:.5}[_.xanchor]||0),r:a*({left:1,center:.5}[_.xanchor]||0),t:s*({bottom:1,middle:.5}[_.yanchor]||0),b:s*({top:1,middle:.5}[_.yanchor]||0)})}var A=t._fullLayout,T=A._size;if("function"!=typeof _.fillcolor&&"function"!=typeof _.line.color)return void A._infolayer.selectAll("g."+e).remove();var S,E=n.extent(("function"==typeof _.fillcolor?_.fillcolor:_.line.color).domain()),L=[],C=[],z="function"==typeof _.line.color?_.line.color:function(){return _.line.color},D="function"==typeof _.fillcolor?_.fillcolor:function(){return _.fillcolor},I=_.levels.end+_.levels.size/100,P=_.levels.size,O=1.001*E[0]-.001*E[1],j=1.001*E[1]-.001*E[0];for(S=_.levels.start;(S-I)*P<0;S+=P)S>O&&S<j&&L.push(S);if("function"==typeof _.fillcolor)if(_.filllevels)for(I=_.filllevels.end+_.filllevels.size/100,P=_.filllevels.size,S=_.filllevels.start;(S-I)*P<0;S+=P)S>E[0]&&S<E[1]&&C.push(S);else C=L.map(function(t){return t-_.levels.size/2}),C.push(C[C.length-1]+_.levels.size);else _.fillcolor&&"string"==typeof _.fillcolor&&(C=[0]);_.levels.size<0&&(L.reverse(),C.reverse());var F,R=A.height-A.margin.t-A.margin.b,N=A.width-A.margin.l-A.margin.r,B=Math.round(_.thickness*("fraction"===_.thicknessmode?N:1)),U=B/T.w,V=Math.round(_.len*("fraction"===_.lenmode?R:1)),q=V/T.h,H=_.xpad/T.w,G=(_.borderwidth+_.outlinewidth)/2,Y=_.ypad/T.h,X=Math.round(_.x*T.w+_.xpad),W=_.x-U*({middle:.5,right:1}[_.xanchor]||0),Z=_.y+q*(({top:-.5,bottom:.5}[_.yanchor]||0)-.5),J=Math.round(T.h*(1-Z)),K=J-V,Q={type:"linear",range:E,tickmode:_.tickmode,nticks:_.nticks,tick0:_.tick0,dtick:_.dtick,tickvals:_.tickvals,ticktext:_.ticktext,ticks:_.ticks,ticklen:_.ticklen,tickwidth:_.tickwidth,tickcolor:_.tickcolor,showticklabels:_.showticklabels,tickfont:_.tickfont,tickangle:_.tickangle,tickformat:_.tickformat,exponentformat:_.exponentformat,separatethousands:_.separatethousands,showexponent:_.showexponent,showtickprefix:_.showtickprefix,tickprefix:_.tickprefix,showticksuffix:_.showticksuffix,ticksuffix:_.ticksuffix,title:_.title,titlefont:_.titlefont,anchor:"free",position:1},$={type:"linear",_id:"y"+e},tt={letter:"y",font:A.font,noHover:!0,calendar:A.calendar};if(v(Q,$,b,tt,A),g(Q,$,b,tt),$.position=_.x+H+U,r.axis=$,["top","bottom"].indexOf(_.titleside)!==-1&&($.titleside=_.titleside,$.titlex=_.x+H,$.titley=Z+("top"===_.titleside?q-Y:Y)),_.line.color&&"auto"===_.tickmode){$.tickmode="linear",$.tick0=_.levels.start;var et=_.levels.size,rt=c.constrain((J-K)/50,4,15)+1,nt=(E[1]-E[0])/((_.nticks||rt)*et);if(nt>1){var it=Math.pow(10,Math.floor(Math.log(nt)/Math.LN10));et*=it*c.roundUp(nt/it,[2,5,10]),(Math.abs(_.levels.start)/_.levels.size+1e-6)%1<2e-6&&($.tick0=0)}$.dtick=et}$.domain=[Z+Y,Z+q-Y],$.setScale();var at=A._infolayer.selectAll("g."+e).data([0]);at.enter().append("g").classed(e,!0).each(function(){var t=n.select(this);t.append("rect").classed("cbbg",!0),t.append("g").classed("cbfills",!0),t.append("g").classed("cblines",!0),t.append("g").classed("cbaxis",!0).classed("crisp",!0),t.append("g").classed("cbtitleunshift",!0).append("g").classed("cbtitle",!0),t.append("rect").classed("cboutline",!0),t.select(".cbtitle").datum(0)}),at.attr("transform","translate("+Math.round(T.l)+","+Math.round(T.t)+")");var ot=at.select(".cbtitleunshift").attr("transform","translate(-"+Math.round(T.l)+",-"+Math.round(T.t)+")");$._axislayer=at.select(".cbaxis");var st=0;if(["top","bottom"].indexOf(_.titleside)!==-1){var lt,ut=T.l+(_.x+H)*T.w,ct=$.titlefont.size;lt="top"===_.titleside?(1-(Z+q-Y))*T.h+T.t+3+.75*ct:(1-(Z+Y))*T.h+T.t-3-.25*ct,M($._id+"title",{attributes:{x:ut,y:lt,"text-anchor":"start"}})}var ht=c.syncOrAsync([o.previousPromises,w,o.previousPromises,k],t);if(ht&&ht.then&&(t._promises||[]).push(ht),t._context.editable){var ft,dt,pt;u.init({element:at.node(),prepFn:function(){ft=at.attr("transform"),f(at)},moveFn:function(t,e){at.attr("transform",ft+" translate("+t+","+e+")"),dt=u.align(W+t/T.w,U,0,1,_.xanchor),pt=u.align(Z-e/T.h,q,0,1,_.yanchor);var r=u.getCursor(dt,pt,_.xanchor,_.yanchor);f(at,r)},doneFn:function(e){f(at),e&&void 0!==dt&&void 0!==pt&&a.restyle(t,{"colorbar.x":dt,"colorbar.y":pt},x().index)}})}return ht}function x(){var r,n,i=e.substr(2);for(r=0;r<t._fullData.length;r++)if(n=t._fullData[r],n.uid===i)return n}var _={};return Object.keys(b).forEach(function(t){_[t]=null}),_.fillcolor=null,_.line={color:null,width:null,dash:null},_.levels={start:null,end:null,size:null},_.filllevels=null,Object.keys(_).forEach(function(t){r[t]=function(e){return arguments.length?(_[t]=c.isPlainObject(_[t])?c.extendFlat(_[t],e):e,r):_[t]}}),r.options=function(t){return Object.keys(t).forEach(function(e){"function"==typeof r[e]&&r[e](t[e])}),r},r._opts=_,r}},{"../../lib":709,"../../lib/extend":701,"../../lib/setcursor":724,"../../plotly":743,"../../plots/cartesian/axes":748,"../../plots/cartesian/axis_defaults":750,"../../plots/cartesian/layout_attributes":759,"../../plots/cartesian/position_defaults":762,"../../plots/plots":811,"../../registry":826,"../color":590,"../dragelement":611,"../drawing":614,"../titles":679,"./attributes":591,d3:118,tinycolor2:526}],594:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t){return n.isPlainObject(t.colorbar)}},{"../../lib":709}],595:[function(t,e,r){"use strict";e.exports={zauto:{valType:"boolean",dflt:!0},zmin:{valType:"number",dflt:null},zmax:{valType:"number",dflt:null},colorscale:{valType:"colorscale"},autocolorscale:{valType:"boolean",dflt:!0},reversescale:{valType:"boolean",dflt:!1},showscale:{valType:"boolean",dflt:!0}}},{}],596:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./scales"),a=t("./flip_scale");e.exports=function(t,e,r,o){var s,l;r?(s=n.nestedProperty(t,r).get(),l=n.nestedProperty(t._input,r).get()):(s=t,l=t._input);var u=o+"auto",c=o+"min",h=o+"max",f=s[u],d=s[c],p=s[h],m=s.colorscale;f===!1&&void 0!==d||(d=n.aggNums(Math.min,null,e)),f===!1&&void 0!==p||(p=n.aggNums(Math.max,null,e)),d===p&&(d-=.5,p+=.5),s[c]=d,s[h]=p,l[c]=d,l[h]=p,l[u]=f!==!1||void 0===d&&void 0===p,s.autocolorscale&&(m=d*p<0?i.RdBu:d>=0?i.Reds:i.Blues,l.colorscale=m,s.reversescale&&(m=a(m)),s.colorscale=m)}},{"../../lib":709,"./flip_scale":601,"./scales":608}],597:[function(t,e,r){"use strict";var n=t("./attributes"),i=t("../../lib/extend").extendDeep;t("./scales.js");e.exports=function(t){return{color:{valType:"color",arrayOk:!0},colorscale:i({},n.colorscale,{}),cauto:i({},n.zauto,{}),cmax:i({},n.zmax,{}),cmin:i({},n.zmin,{}),autocolorscale:i({},n.autocolorscale,{}),reversescale:i({},n.reversescale,{})}}},{"../../lib/extend":701,"./attributes":595,"./scales.js":608}],598:[function(t,e,r){"use strict";var n=t("./scales");e.exports=n.RdBu},{"./scales":608}],599:[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("./is_valid_scale"),l=t("./flip_scale");e.exports=function(t,e,r,u,c){var h=c.prefix,f=c.cLetter,d=h.slice(0,h.length-1),p=h?i.nestedProperty(t,d).get()||{}:t,m=h?i.nestedProperty(e,d).get()||{}:e,v=p[f+"min"],g=p[f+"max"],y=p.colorscale;u(h+f+"auto",!(n(v)&&n(g)&&v<g)),u(h+f+"min"),u(h+f+"max");var b;void 0!==y&&(b=!s(y)),u(h+"autocolorscale",b);var x=u(h+"colorscale");if(u(h+"reversescale")&&(m.colorscale=l(x)),"marker.line."!==h){var _;h&&(_=a(p)),u(h+"showscale",_)&&o(p,m,r)}}},{"../../lib":709,"../colorbar/defaults":592,"../colorbar/has_colorbar":594,"./flip_scale":601,"./is_valid_scale":605,"fast-isnumeric":127}],600:[function(t,e,r){"use strict";e.exports=function(t,e,r){for(var n=t.length,i=new Array(n),a=new Array(n),o=0;o<n;o++){var s=t[o];i[o]=e+s[0]*(r-e),a[o]=s[1]}return{domain:i,range:a}}},{}],601:[function(t,e,r){"use strict";e.exports=function(t){for(var e,r=t.length,n=new Array(r),i=r-1,a=0;i>=0;i--,a++)e=t[i],n[a]=[1-e[0],e[1]];return n}},{}],602:[function(t,e,r){"use strict";var n=t("./scales"),i=t("./default_scale"),a=t("./is_valid_scale_array");e.exports=function(t,e){function r(){try{t=n[t]||JSON.parse(t)}catch(r){t=e}}return e||(e=i),t?("string"==typeof t&&(r(),"string"==typeof t&&r()),a(t)?t:e):e}},{"./default_scale":598,"./is_valid_scale_array":606,"./scales":608}],603:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("./is_valid_scale");e.exports=function(t,e){var r=e?i.nestedProperty(t,e).get()||{}:t,o=r.color,s=!1;if(Array.isArray(o))for(var l=0;l<o.length;l++)if(n(o[l])){s=!0;break}return i.isPlainObject(r)&&(s||r.showscale===!0||n(r.cmin)&&n(r.cmax)||a(r.colorscale)||i.isPlainObject(r.colorbar))}},{"../../lib":709,"./is_valid_scale":605,"fast-isnumeric":127}],604:[function(t,e,r){"use strict";r.scales=t("./scales"),r.defaultScale=t("./default_scale"),r.attributes=t("./attributes"),r.handleDefaults=t("./defaults"),r.calc=t("./calc"),r.hasColorscale=t("./has_colorscale"),r.isValidScale=t("./is_valid_scale"),r.getScale=t("./get_scale"),r.flipScale=t("./flip_scale"),r.extractScale=t("./extract_scale"),r.makeColorScaleFunc=t("./make_color_scale_func")},{"./attributes":595,"./calc":596,"./default_scale":598,"./defaults":599,"./extract_scale":600,"./flip_scale":601,"./get_scale":602,"./has_colorscale":603,"./is_valid_scale":605,"./make_color_scale_func":607,"./scales":608}],605:[function(t,e,r){"use strict";var n=t("./scales"),i=t("./is_valid_scale_array");e.exports=function(t){return void 0!==n[t]||i(t)}},{"./is_valid_scale_array":606,"./scales":608}],606:[function(t,e,r){"use strict";var n=t("tinycolor2");e.exports=function(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}},{tinycolor2:526}],607:[function(t,e,r){"use strict";function n(t){var e={r:t[0],g:t[1],b:t[2],a:t[3]};return a(e).toRgbString()}var i=t("d3"),a=t("tinycolor2"),o=t("fast-isnumeric"),s=t("../color");e.exports=function(t,e){e=e||{};for(var r=t.domain,l=t.range,u=l.length,c=new Array(u),h=0;h<u;h++){var f=a(l[h]).toRgb();c[h]=[f.r,f.g,f.b,f.a]}var d,p=i.scale.linear().domain(r).range(c).clamp(!0),m=e.noNumericCheck,v=e.returnArray;return d=m&&v?p:m?function(t){return n(p(t))}:v?function(t){return o(t)?p(t):a(t).isValid()?t:s.defaultLine}:function(t){return o(t)?n(p(t)):a(t).isValid()?t:s.defaultLine},d.domain=p.domain,d.range=function(){return l},d}},{"../color":590,d3:118,"fast-isnumeric":127,tinycolor2:526}],608:[function(t,e,r){"use strict";e.exports={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"]]}},{}],609:[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}},{}],610:[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":709}],611:[function(t,e,r){"use strict";function n(){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 i(t){t._dragging=!1,t._replotPending&&a.plot(t)}var a=t("../../plotly"),o=t("../../lib"),s=t("../../plots/cartesian/constants"),l=t("../../constants/interactions"),u=e.exports={};u.align=t("./align"),u.getCursor=t("./cursor");var c=t("./unhover");u.unhover=c.wrapped,u.unhoverRaw=c.raw,u.init=function(t){function e(e){return t.element.onmousemove=m,v._dragged=!1,v._dragging=!0,c=e.clientX,h=e.clientY,p=e.target,f=(new Date).getTime(),f-v._mouseDownTime<y?g+=1:(g=1,v._mouseDownTime=f),t.prepFn&&t.prepFn(e,c,h),d=n(),d.onmousemove=r,d.onmouseup=a,d.onmouseout=a,d.style.cursor=window.getComputedStyle(t.element).cursor,o.pauseEvent(e)}function r(e){var r=e.clientX-c,n=e.clientY-h,i=t.minDrag||s.MINDRAG;return Math.abs(r)<i&&(r=0),Math.abs(n)<i&&(n=0),(r||n)&&(v._dragged=!0,u.unhover(v)),t.moveFn&&t.moveFn(r,n,v._dragged),o.pauseEvent(e)}function a(e){if(m=t.element.onmousemove,t.setCursor&&(t.element.onmousemove=t.setCursor),d.onmousemove=null,d.onmouseup=null,d.onmouseout=null,o.removeElement(d),!v._dragging)return void(v._dragged=!1);if(v._dragging=!1,(new Date).getTime()-v._mouseDownTime>y&&(g=Math.max(g-1,1)),t.doneFn&&t.doneFn(v._dragged,g,e),!v._dragged){var r;try{r=new MouseEvent("click",e)}catch(t){r=document.createEvent("MouseEvents"),r.initMouseEvent("click",e.bubbles,e.cancelable,e.view,e.detail,e.screenX,e.screenY,e.clientX,e.clientY,e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget)}p.dispatchEvent(r)}return i(v),v._dragged=!1,o.pauseEvent(e)}var c,h,f,d,p,m,v=o.getPlotDiv(t.element)||{},g=1,y=l.DBLCLICKDELAY;v._mouseDownTime||(v._mouseDownTime=0),m=t.element.onmousemove,t.setCursor&&(t.element.onmousemove=t.setCursor),t.element.onmousedown=e,t.element.style.pointerEvents="all"},u.coverSlip=n},{"../../constants/interactions":689,"../../lib":709,"../../plotly":743,"../../plots/cartesian/constants":753,"./align":609,"./cursor":610,"./unhover":612}],612:[function(t,e,r){"use strict";var n=t("../../lib/events"),i=e.exports={};i.wrapped=function(t,e,r){"string"==typeof t&&(t=document.getElementById(t)),t._hoverTimer&&(clearTimeout(t._hoverTimer),t._hoverTimer=void 0),i.raw(t,e,r)},i.raw=function(t,e){var r=t._fullLayout,i=t._hoverdata;e||(e={}),e.target&&n.triggerHandler(t,"plotly_beforehover",e)===!1||(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/events":700}],613:[function(t,e,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid"}},{}],614:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o,s){if(l.traceIs(r,"symbols")){var c=m(r);e.attr("d",function(t){var e;e="various"===t.ms||"various"===a.size?3:p.isBubble(r)?c(t.ms):(a.size||6)/2,t.mrc=e;var n=v.symbolNumber(t.mx||a.symbol)||0,i=n%100;return t.om=n%200>=100,v.symbolFuncs[i](e)+(n>=200?b:"")}).style("opacity",function(t){return(t.mo+1||a.opacity+1)-1})}var h,f,d,g=!1;if(t.so?(d=o.outlierwidth,f=o.outliercolor,h=a.outliercolor):(d=(t.mlw+1||o.width+1||(t.trace?t.trace.marker.line.width:0)+1)-1,f="mlc"in t?t.mlcc=i(t.mlc):Array.isArray(o.color)?u.defaultLine:o.color,Array.isArray(a.color)&&(h=u.defaultLine,g=!0),h="mc"in t?t.mcc=n(t.mc):a.color||"rgba(0,0,0,0)"),t.om)e.call(u.stroke,h).style({"stroke-width":(d||1)+"px",fill:"none"});else{e.style("stroke-width",d+"px");var y=a.gradient,x=t.mgt;if(x?g=!0:x=y&&y.type,x&&"none"!==x){var _=t.mgc;_?g=!0:_=y.color;var w="g"+s._fullLayout._uid+"-"+r.uid;g&&(w+="-"+t.i),e.call(v.gradient,s,w,x,h,_)}else e.call(u.fill,h);d&&e.call(u.stroke,f)}}function i(t,e,r,n){var i=t[0]-e[0],o=t[1]-e[1],s=r[0]-e[0],l=r[1]-e[1],u=Math.pow(i*i+o*o,M/2),c=Math.pow(s*s+l*l,M/2),h=(c*c*i-u*u*s)*n,f=(c*c*o-u*u*l)*n,d=3*c*(u+c),p=3*u*(u+c);return[[a.round(e[0]+(d&&h/d),2),a.round(e[1]+(d&&f/d),2)],[a.round(e[0]-(p&&h/p),2),a.round(e[1]-(p&&f/p),2)]]}var a=t("d3"),o=t("fast-isnumeric"),s=t("tinycolor2"),l=t("../../registry"),u=t("../color"),c=t("../colorscale"),h=t("../../lib"),f=t("../../lib/svg_text_utils"),d=t("../../constants/xmlns_namespaces"),p=t("../../traces/scatter/subtypes"),m=t("../../traces/scatter/make_bubble_size_func"),v=e.exports={};v.font=function(t,e,r,n){e&&e.family&&(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(u.fill,n)},v.setPosition=function(t,e,r){t.attr("x",e).attr("y",r)},v.setSize=function(t,e,r){t.attr("width",e).attr("height",r)},v.setRect=function(t,e,r,n,i){t.call(v.setPosition,e,r).call(v.setSize,n,i)},v.translatePoint=function(t,e,r,n){var i=t.xp||r.c2p(t.x),a=t.yp||n.c2p(t.y);return o(i)&&o(a)&&e.node()?("text"===e.node().nodeName?e.attr("x",i).attr("y",a):e.attr("transform","translate("+i+","+a+")"),!0):(e.remove(),!1)},v.translatePoints=function(t,e,r,n){t.each(function(t){var i=a.select(this);v.translatePoint(t,i,e,r,n)})},v.getPx=function(t,e){return Number(t.style(e).replace(/px$/,""))},v.crispRound=function(t,e,r){return e&&o(e)?t._context.staticPlot?e:e<1?1:Math.round(e):r||0},v.singleLineStyle=function(t,e,r,n,i){e.style("fill","none");var a=(((t||[])[0]||{}).trace||{}).line||{},o=r||a.width||0,s=i||a.dash||"";u.stroke(e,n||a.color),v.dashLine(e,s,o)},v.lineGroupStyle=function(t,e,r,n){t.style("fill","none").each(function(t){var i=(((t||[])[0]||{}).trace||{}).line||{},o=e||i.width||0,s=n||i.dash||"";a.select(this).call(u.stroke,r||i.color).call(v.dashLine,s,o)})},v.dashLine=function(t,e,r){r=+r||0,e=v.dashStyle(e,r),t.style({"stroke-dasharray":e,"stroke-width":r+"px"})},v.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},v.fillGroupStyle=function(t){t.style("stroke-width",0).each(function(e){var r=a.select(this);try{r.call(u.fill,e[0].trace.fillcolor)}catch(e){h.error(e,t),r.remove()}})};var g=t("./symbol_defs");v.symbolNames=[],v.symbolFuncs=[],v.symbolNeedLines={},v.symbolNoDot={},v.symbolList=[],Object.keys(g).forEach(function(t){var e=g[t];v.symbolList=v.symbolList.concat([e.n,t,e.n+100,t+"-open"]),v.symbolNames[e.n]=t,v.symbolFuncs[e.n]=e.f,e.needLine&&(v.symbolNeedLines[e.n]=!0),e.noDot?v.symbolNoDot[e.n]=!0:v.symbolList=v.symbolList.concat([e.n+200,t+"-dot",e.n+300,t+"-open-dot"])});var y=v.symbolNames.length,b="M0,0.5L0.5,0L0,-0.5L-0.5,0Z";v.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=v.symbolNames.indexOf(t),t>=0&&(t+=e)}return t%100>=y||t>=400?0:Math.floor(Math.max(t,0))};var x={x1:1,x2:0,y1:0,y2:0},_={x1:0,x2:0,y1:1,y2:0};v.gradient=function(t,e,r,n,i,o){var l=e._fullLayout._defs.select(".gradients").selectAll("#"+r).data([n+i+o],h.identity);l.exit().remove(),l.enter().append("radial"===n?"radialGradient":"linearGradient").each(function(){var t=a.select(this);"horizontal"===n?t.attr(x):"vertical"===n&&t.attr(_),t.attr("id",r);var e=s(i),l=s(o);t.append("stop").attr({offset:"0%","stop-color":u.tinyRGB(l),"stop-opacity":l.getAlpha()}),t.append("stop").attr({offset:"100%","stop-color":u.tinyRGB(e),"stop-opacity":e.getAlpha()})}),t.style({fill:"url(#"+r+")","fill-opacity":null})},v.initGradients=function(t){var e=t._fullLayout._defs.selectAll(".gradients").data([0]);e.enter().append("g").classed("gradients",!0),e.selectAll("linearGradient,radialGradient").remove()},v.singlePointStyle=function(t,e,r,i,a,o){var s=r.marker;n(t,e,r,i,a,s,s.line,o)},v.pointStyle=function(t,e){if(t.size()){var r=e.marker,n=v.tryColorscale(r,""),i=v.tryColorscale(r,"line"),o=h.getPlotDiv(t.node());t.each(function(t){v.singlePointStyle(t,a.select(this),e,n,i,o)})}},v.tryColorscale=function(t,e){var r=e?h.nestedProperty(t,e).get():t,n=r.colorscale,i=r.color;return n&&Array.isArray(i)?c.makeColorScaleFunc(c.extractScale(n,r.cmin,r.cmax)):h.identity};var w={start:1,end:-1,middle:0,bottom:1,top:-1};v.textPointStyle=function(t,e){t.each(function(t){var r=a.select(this),n=t.tx||e.text;if(!n||Array.isArray(n))return void r.remove();var i=t.tp||e.textposition,s=i.indexOf("top")!==-1?"top":i.indexOf("bottom")!==-1?"bottom":"middle",l=i.indexOf("left")!==-1?"end":i.indexOf("right")!==-1?"start":"middle",u=t.ts||e.textfont.size,c=t.mrc?t.mrc/.8+1:0;u=o(u)&&u>0?u:0,r.call(v.font,t.tf||e.textfont.family,u,t.tc||e.textfont.color).attr("text-anchor",l).text(n).call(f.convertToTspans);var h=a.select(this.parentNode),d=r.selectAll("tspan.line"),p=1.3*((d[0].length||1)-1)+1,m=w[l]*c,g=.75*u+w[s]*c+(w[s]-1)*p*u/2;h.attr("transform","translate("+m+","+g+")"),p>1&&d.attr({x:r.attr("x"),y:r.attr("y")})})};var M=.5;v.smoothopen=function(t,e){if(t.length<3)return"M"+t.join("L");var r,n="M"+t[0],a=[];for(r=1;r<t.length-1;r++)a.push(i(t[r-1],t[r],t[r+1],e));for(n+="Q"+a[0][0]+" "+t[1],r=2;r<t.length-1;r++)n+="C"+a[r-2][1]+" "+a[r-1][0]+" "+t[r];return n+="Q"+a[t.length-3][1]+" "+t[t.length-1]},v.smoothclosed=function(t,e){if(t.length<3)return"M"+t.join("L")+"Z";var r,n="M"+t[0],a=t.length-1,o=[i(t[a],t[0],t[1],e)];for(r=1;r<a;r++)o.push(i(t[r-1],t[r],t[r+1],e));for(o.push(i(t[a-1],t[a],t[0],e)),r=1;r<=a;r++)n+="C"+o[r-1][1]+" "+o[r][0]+" "+t[r];return n+="C"+o[a][1]+" "+o[0][0]+" "+t[0]+"Z"};var k={hv:function(t,e){return"H"+a.round(e[0],2)+"V"+a.round(e[1],2)},vh:function(t,e){return"V"+a.round(e[1],2)+"H"+a.round(e[0],2)},hvh:function(t,e){return"H"+a.round((t[0]+e[0])/2,2)+"V"+a.round(e[1],2)+"H"+a.round(e[0],2)},vhv:function(t,e){return"V"+a.round((t[1]+e[1])/2,2)+"H"+a.round(e[0],2)+"V"+a.round(e[1],2)}},A=function(t,e){return"L"+a.round(e[0],2)+","+a.round(e[1],2)};v.steps=function(t){
53 var e=k[t]||A;return function(t){for(var r="M"+a.round(t[0][0],2)+","+a.round(t[0][1],2),n=1;n<t.length;n++)r+=e(t[n-1],t[n]);return r}},v.makeTester=function(){var t=a.select("body").selectAll("#js-plotly-tester").data([0]);t.enter().append("svg").attr("id","js-plotly-tester").attr(d.svgAttrs).style({position:"absolute",left:"-10000px",top:"-10000px",width:"9000px",height:"9000px","z-index":"1"});var e=t.selectAll(".js-reference-point").data([0]);e.enter().append("path").classed("js-reference-point",!0).attr("d","M0,0H1V1H0Z").style({"stroke-width":0,fill:"black"}),t.node()._cache||(t.node()._cache={}),v.tester=t,v.testref=e};var T=[];v.bBox=function(t){var e=t.attributes["data-bb"];if(e&&e.value)return h.extendFlat({},T[e.value]);var r=v.tester,n=r.node(),i=t.cloneNode(!0);n.appendChild(i),a.select(i).attr({x:0,y:0,transform:""});var o=i.getBoundingClientRect(),s=v.testref.node().getBoundingClientRect();n.removeChild(i);var l={height:o.height,width:o.width,left:o.left-s.left,top:o.top-s.top,right:o.right-s.left,bottom:o.bottom-s.top};return T.length>=1e4&&(a.selectAll("[data-bb]").attr("data-bb",null),T=[]),t.setAttribute("data-bb",T.length),T.push(l),h.extendFlat({},l)},v.setClipUrl=function(t,e){if(!e)return void t.attr("clip-path",null);var r="#"+e,n=a.select("base");n.size()&&n.attr("href")&&(r=window.location.href.split("#")[0]+r),t.attr("clip-path","url("+r+")")},v.getTranslate=function(t){var e=t.attr?"attr":"getAttribute",r=t[e]("transform")||"",n=r.replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,function(t,e,r){return[e,r].join(" ")}).split(" ");return{x:+n[0]||0,y:+n[1]||0}},v.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+=" translate("+e+", "+r+")",a=a.trim(),t[i]("transform",a),a},v.getScale=function(t){var e=t.attr?"attr":"getAttribute",r=t[e]("transform")||"",n=r.replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,function(t,e,r){return[e,r].join(" ")}).split(" ");return{x:+n[0]||1,y:+n[1]||1}},v.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+=" scale("+e+", "+r+")",a=a.trim(),t[i]("transform",a),a},v.setPointGroupScale=function(t,e,r){var n,i,a;return e=e||1,r=r||1,i=1===e&&1===r?"":" scale("+e+","+r+")",a=/\s*sc.*/,t.each(function(){n=(this.getAttribute("transform")||"").replace(a,""),n+=i,n=n.trim(),this.setAttribute("transform",n)}),i};v.setTextPointsScale=function(t,e,r){t.each(function(){var t,n=a.select(this),i=n.select("text"),o=parseFloat(i.attr("x")||0),s=parseFloat(i.attr("y")||0),l=(n.attr("transform")||"").match(/translate\([^)]*\)\s*$/);t=1===e&&1===r?[]:["translate("+o+","+s+")","scale("+e+","+r+")","translate("+-o+","+-s+")"],l&&t.push(l),n.attr("transform",t.join(" "))})},v.measureText=function(t,e,r){var n=t.append("text").text(e).call(v.font,r),i=v.bBox(n.node());return n.remove(),i}},{"../../constants/xmlns_namespaces":692,"../../lib":709,"../../lib/svg_text_utils":728,"../../registry":826,"../../traces/scatter/make_bubble_size_func":1023,"../../traces/scatter/subtypes":1028,"../color":590,"../colorscale":604,"./symbol_defs":615,d3:118,"fast-isnumeric":127,tinycolor2:526}],615:[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(t*-.309,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(e*-.309,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},"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},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},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},"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},"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},"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},"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},"line-ew":{n:41,f:function(t){var e=n.round(1.4*t,2);return"M"+e+",0H-"+e},needLine:!0,noDot:!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},"line-ne":{n:43,f:function(t){var e=n.round(t,2);return"M"+e+",-"+e+"L-"+e+","+e},needLine:!0,noDot:!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}}},{d3:118}],616:[function(t,e,r){"use strict";e.exports={visible:{valType:"boolean"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"]},symmetric:{valType:"boolean"},array:{valType:"data_array"},arrayminus:{valType:"data_array"},value:{valType:"number",min:0,dflt:10},valueminus:{valType:"number",min:0,dflt:10},traceref:{valType:"integer",min:0,dflt:0},tracerefminus:{valType:"integer",min:0,dflt:0},copy_ystyle:{valType:"boolean"},copy_zstyle:{valType:"boolean"},color:{valType:"color"},thickness:{valType:"number",min:0,dflt:2},width:{valType:"number",min:0},_deprecated:{opacity:{valType:"number"}}}},{}],617:[function(t,e,r){"use strict";function n(t,e,r,n){var a=e["error_"+n]||{},l=a.visible&&["linear","log"].indexOf(r.type)!==-1,u=[];if(l){for(var c=s(a),h=0;h<t.length;h++){var f=t[h],d=f[n];if(i(r.c2l(d))){var p=c(d,h);if(i(p[0])&&i(p[1])){var m=f[n+"s"]=d-p[0],v=f[n+"h"]=d+p[1];u.push(m,v)}}}o.expand(r,u,{padded:!0})}}var i=t("fast-isnumeric"),a=t("../../registry"),o=t("../../plots/cartesian/axes"),s=t("./compute_error");e.exports=function(t){for(var e=t.calcdata,r=0;r<e.length;r++){var i=e[r],s=i[0].trace;if(a.traceIs(s,"errorBarsOK")){var l=o.getFromId(t,s.xaxis),u=o.getFromId(t,s.yaxis);n(i,s,l,"x"),n(i,s,u,"y")}}}},{"../../plots/cartesian/axes":748,"../../registry":826,"./compute_error":618,"fast-isnumeric":127}],618:[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,a=t.arrayminus;return r||void 0===a?function(t,e){var r=+i[e];return[r,r]}:function(t,e){return[+a[e],+i[e]]}}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)]}}},{}],619:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../registry"),a=t("../../lib"),o=t("./attributes");e.exports=function(t,e,r,s){function l(t,e){return a.coerce(h,c,o,t,e)}var u="error_"+s.axis,c=e[u]={},h=t[u]||{};if(l("visible",void 0!==h.array||void 0!==h.value||"sqrt"===h.type)!==!1){var f=l("type","array"in h?"data":"percent"),d=!0;"sqrt"!==f&&(d=l("symmetric",!(("data"===f?"arrayminus":"valueminus")in h))),"data"===f?(l("array")||(c.array=[]),l("traceref"),d||(l("arrayminus")||(c.arrayminus=[]),l("tracerefminus"))):"percent"!==f&&"constant"!==f||(l("value"),d||l("valueminus"));var p="copy_"+s.inherit+"style";s.inherit&&(e["error_"+s.inherit]||{}).visible&&l(p,!(h.color||n(h.thickness)||n(h.width))),s.inherit&&c[p]||(l("color",r),l("thickness"),l("width",i.traceIs(e,"gl3d")?0:4))}}},{"../../lib":709,"../../registry":826,"./attributes":616,"fast-isnumeric":127}],620:[function(t,e,r){"use strict";var n=e.exports={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.calc=t("./calc"),n.calcFromTrace=function(t,e){for(var r=t.x||[],i=t.y||[],a=r.length||i.length,o=new Array(a),s=0;s<a;s++)o[s]={x:r[s],y:i[s]};return o[0].trace=t,n.calc({calcdata:[o],_fullLayout:e}),o},n.plot=t("./plot"),n.style=t("./style"),n.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))}},{"./attributes":616,"./calc":617,"./defaults":619,"./plot":621,"./style":622}],621:[function(t,e,r){"use strict";function n(t,e,r){var n={x:e.c2p(t.x),y:r.c2p(t.y)};return void 0!==t.yh&&(n.yh=r.c2p(t.yh),n.ys=r.c2p(t.ys),a(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),a(n.xs)||(n.noXS=!0,n.xs=e.c2p(t.xs,!0))),n}var i=t("d3"),a=t("fast-isnumeric"),o=t("../../traces/scatter/subtypes");e.exports=function(t,e,r){var s,l=e.xaxis,u=e.yaxis,c=r&&r.duration>0;t.each(function(t){var e,h=t[0].trace,f=h.error_x||{},d=h.error_y||{};h.ids&&(e=function(t){return t.id});var p=o.hasMarkers(h)&&h.marker.maxdisplayed>0;if(d.visible||f.visible){var m=i.select(this).selectAll("g.errorbar").data(t,e);m.exit().remove(),m.style("opacity",1);var v=m.enter().append("g").classed("errorbar",!0);c&&v.style("opacity",0).transition().duration(r.duration).style("opacity",1),m.each(function(t){var e=i.select(this),o=n(t,l,u);if(!p||t.vis){var h;if(d.visible&&a(o.x)&&a(o.yh)&&a(o.ys)){var m=d.width;h="M"+(o.x-m)+","+o.yh+"h"+2*m+"m-"+m+",0V"+o.ys,o.noYS||(h+="m-"+m+",0h"+2*m);var v=e.select("path.yerror");s=!v.size(),s?v=e.append("path").classed("yerror",!0):c&&(v=v.transition().duration(r.duration).ease(r.easing)),v.attr("d",h)}if(f.visible&&a(o.y)&&a(o.xh)&&a(o.xs)){var g=(f.copy_ystyle?d:f).width;h="M"+o.xh+","+(o.y-g)+"v"+2*g+"m0,-"+g+"H"+o.xs,o.noXS||(h+="m0,-"+g+"v"+2*g);var y=e.select("path.xerror");s=!y.size(),s?y=e.append("path").classed("xerror",!0):c&&(y=y.transition().duration(r.duration).ease(r.easing)),y.attr("d",h)}}})}})}},{"../../traces/scatter/subtypes":1028,d3:118,"fast-isnumeric":127}],622:[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":590,d3:118}],623:[function(t,e,r){"use strict";var n=t("../../lib/extend").extendFlat,i=t("../../plots/font_attributes");e.exports={hoverlabel:{bgcolor:{valType:"color",arrayOk:!0},bordercolor:{valType:"color",arrayOk:!0},font:{family:n({},i.family,{arrayOk:!0}),size:n({},i.size,{arrayOk:!0}),color:n({},i.color,{arrayOk:!0})}}}},{"../../lib/extend":701,"../../plots/font_attributes":772}],624:[function(t,e,r){"use strict";function n(t,e,r){Array.isArray(t)&&(e[0][r]=t)}var i=t("../../lib"),a=t("../../registry");e.exports=function(t){for(var e=t.calcdata,r=0;r<e.length;r++){var o=e[r],s=o[0].trace;if(s.hoverlabel){var l=a.traceIs(s,"2dMap")?n:i.mergeArray;l(s.hoverlabel.bgcolor,o,"hbg"),l(s.hoverlabel.bordercolor,o,"hbc"),l(s.hoverlabel.font.size,o,"hts"),l(s.hoverlabel.font.color,o,"htc"),l(s.hoverlabel.font.family,o,"htf")}}}},{"../../lib":709,"../../registry":826}],625:[function(t,e,r){"use strict";var n=t("../../registry");e.exports=function(t,e){function r(){t.emit("plotly_click",{points:t._hoverdata,event:e})}var i=n.getComponentMethod("annotations","onClick")(t,t._hoverdata);t._hoverdata&&e&&e.target&&(i&&i.then?i.then(r):r(),e.stopImmediatePropagation&&e.stopImmediatePropagation())}},{"../../registry":826}],626:[function(t,e,r){"use strict";e.exports={MAXDIST:20,YANGLE:60,HOVERARROWSIZE:6,HOVERTEXTPAD:3,HOVERFONTSIZE:13,HOVERFONT:"Arial, sans-serif",HOVERMINTIME:50}},{}],627:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes"),a=t("./hoverlabel_defaults");e.exports=function(t,e,r,o){function s(r,a){return n.coerce(t,e,i,r,a)}a(t,e,s,o.hoverlabel)}},{"../../lib":709,"./attributes":623,"./hoverlabel_defaults":630}],628:[function(t,e,r){"use strict";function n(t,e){return function(r){var n=t(r),i=e(r);return Math.sqrt(n*n+i*i)}}var i=t("./constants");r.getSubplot=function(t){return t.subplot||t.xaxis+t.yaxis||t.geo},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,r,i){return"closest"===t?i||n(e,r):"x"===t?e:r},r.getClosest=function(t,e,r){if(r.index!==!1)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){return t*e<0||0===t?i.MAXDIST*(.6-.3/Math.max(3,Math.abs(t-e))):1/0}},{"./constants":626}],629:[function(t,e,r){"use strict";function n(t,e,r){if("pie"===r||"sankey"===r)return void t.emit("plotly_hover",{event:e.originalEvent,points:[e]});r||(r="xy");var n=Array.isArray(r)?r:[r],f=t._fullLayout,m=f._plots||[],g=m[r];if(g){var k=g.overlays.map(function(t){return t.id});n=n.concat(k)}for(var A=n.length,T=new Array(A),S=new Array(A),E=0;E<A;E++){var L=n[E],C=m[L];if(C)T[E]=x.getFromId(t,C.xaxis._id),S[E]=x.getFromId(t,C.yaxis._id);else{var z=f[L]._subplot;T[E]=z.xaxis,S[E]=z.yaxis}}var D=e.hovermode||f.hovermode;if(["x","y","closest"].indexOf(D)===-1||!t.calcdata||t.querySelector(".zoombox")||t._dragging)return b.unhoverRaw(t,e);var I,P,O,j,F,R,N,B,U,V,q,H,G,Y=[],X=[];if(Array.isArray(e))for(D="array",O=0;O<e.length;O++)F=t.calcdata[e[O].curveNumber||0],"skip"!==F[0].trace.hoverinfo&&X.push(F);else{for(j=0;j<t.calcdata.length;j++)F=t.calcdata[j],R=F[0].trace,"skip"!==R.hoverinfo&&n.indexOf(w.getSubplot(R))!==-1&&X.push(F);var W,Z,J=!e.target;if(J)W="xpx"in e?e.xpx:T[0]._length/2,Z="ypx"in e?e.ypx:S[0]._length/2;else{if(p.triggerHandler(t,"plotly_beforehover",e)===!1)return;var K=e.target.getBoundingClientRect();if(W=e.clientX-K.left,Z=e.clientY-K.top,W<0||W>K.width||Z<0||Z>K.height)return b.unhoverRaw(t,e)}if(I="xval"in e?w.flat(n,e.xval):w.p2c(T,W),P="yval"in e?w.flat(n,e.yval):w.p2c(S,Z),!h(I[0])||!h(P[0]))return d.warn("Fx.hover failed",e,t),b.unhoverRaw(t,e)}var Q=1/0;for(j=0;j<X.length;j++)if((F=X[j])&&F[0]&&F[0].trace&&F[0].trace.visible===!0&&(R=F[0].trace,["carpet","contourcarpet"].indexOf(R._module.name)===-1)){if(N=w.getSubplot(R),B=n.indexOf(N),U=D,H={cd:F,trace:R,xa:T[B],ya:S[B],name:t.data.length>1||R.hoverinfo.indexOf("name")!==-1?R.name:void 0,index:!1,distance:Math.min(Q,M.MAXDIST),color:y.defaultLine,x0:void 0,x1:void 0,y0:void 0,y1:void 0,xLabelVal:void 0,yLabelVal:void 0,zLabelVal:void 0,text:void 0},f[N]&&(H.subplot=f[N]._subplot),G=Y.length,"array"===U){var $=e[j];"pointNumber"in $?(H.index=$.pointNumber,U="closest"):(U="","xval"in $&&(V=$.xval,U="x"),"yval"in $&&(q=$.yval,U=U?"closest":"y"))}else V=I[B],q=P[B];if(R._module&&R._module.hoverPoints){var tt=R._module.hoverPoints(H,V,q,U);if(tt)for(var et,rt=0;rt<tt.length;rt++)et=tt[rt],h(et.x0)&&h(et.y0)&&Y.push(s(et,D))}else d.log("Unrecognized trace type in hover:",R);"closest"===D&&Y.length>G&&(Y.splice(0,G),Q=Y[0].distance)}if(0===Y.length)return b.unhoverRaw(t,e);Y.sort(function(t,e){return t.distance-e.distance});var nt=t._hoverdata,it=[];for(O=0;O<Y.length;O++){var at=Y[O],ot={data:at.trace._input,fullData:at.trace,curveNumber:at.trace.index,pointNumber:at.index};at.trace._module.eventData?ot=at.trace._module.eventData(ot,at):(ot.x=at.xVal,ot.y=at.yVal,ot.xaxis=at.xa,ot.yaxis=at.ya,void 0!==at.zLabelVal&&(ot.z=at.zLabelVal)),it.push(ot)}if(t._hoverdata=it,u(t,e,nt)&&f._hasCartesian){l(Y,{hovermode:D,fullLayout:f,container:f._hoverlayer,outerContainer:f._paperdiv})}var st="y"===D&&X.length>1,lt=y.combine(f.plot_bgcolor||y.background,f.paper_bgcolor),ut={hovermode:D,rotateLabels:st,bgColor:lt,container:f._hoverlayer,outerContainer:f._paperdiv,commonLabelOpts:f.hoverlabel},ct=i(Y,ut);if(a(Y,st?"xa":"ya"),o(ct,st),e.target&&e.target.tagName){var ht=_.getComponentMethod("annotations","hasClickToShow")(t,it);v(c.select(e.target),ht?"pointer":"")}e.target&&u(t,e,nt)&&(nt&&t.emit("plotly_unhover",{event:e,points:nt}),t.emit("plotly_hover",{event:e,points:t._hoverdata,xaxes:T,yaxes:S,xvals:I,yvals:P}))}function i(t,e){var r,n,i=e.hovermode,a=e.rotateLabels,o=e.bgColor,s=e.container,l=e.outerContainer,u=e.commonLabelOpts||{},h=e.fontFamily||M.HOVERFONT,f=e.fontSize||M.HOVERFONTSIZE,d=t[0],p=d.xa,v=d.ya,b="y"===i?"yLabel":"xLabel",x=d[b],_=(String(x)||"").split(" ")[0],w=l.node().getBoundingClientRect(),A=w.top,T=w.width,S=w.height,E=d.distance<=M.MAXDIST&&("x"===i||"y"===i);for(r=0;r<t.length;r++){n=t[r].trace.hoverinfo;var z=n.split("+");if(z.indexOf("all")===-1&&z.indexOf(i)===-1){E=!1;break}}var D=s.selectAll("g.axistext").data(E?[0]:[]);D.enter().append("g").classed("axistext",!0),D.exit().remove(),D.each(function(){var e=c.select(this),r=e.selectAll("path").data([0]),n=e.selectAll("text").data([0]);r.enter().append("path").style({fill:u.bgcolor||y.defaultLine,stroke:u.bordercolor||y.background,"stroke-width":"1px"}),n.enter().append("text").call(g.font,u.font.family||h,u.font.size||f,u.font.color||y.background).attr("data-notex",1),n.text(x).call(m.convertToTspans).call(g.setPosition,0,0).selectAll("tspan.line").call(g.setPosition,0,0),e.attr("transform","");var a=n.node().getBoundingClientRect();if("x"===i){n.attr("text-anchor","middle").call(g.setPosition,0,"top"===p.side?A-a.bottom-L-C:A-a.top+L+C).selectAll("tspan.line").attr({x:n.attr("x"),y:n.attr("y")});var o="top"===p.side?"-":"";r.attr("d","M0,0L"+L+","+o+L+"H"+(C+a.width/2)+"v"+o+(2*C+a.height)+"H-"+(C+a.width/2)+"V"+o+L+"H-"+L+"Z"),e.attr("transform","translate("+(p._offset+(d.x0+d.x1)/2)+","+(v._offset+("top"===p.side?0:v._length))+")")}else{n.attr("text-anchor","right"===v.side?"start":"end").call(g.setPosition,("right"===v.side?1:-1)*(C+L),A-a.top-a.height/2).selectAll("tspan.line").attr({x:n.attr("x"),y:n.attr("y")});var s="right"===v.side?"":"-";r.attr("d","M0,0L"+s+L+","+L+"V"+(C+a.height/2)+"h"+s+(2*C+a.width)+"V-"+(C+a.height/2)+"H"+s+L+"V-"+L+"Z"),e.attr("transform","translate("+(p._offset+("right"===v.side?p._length:0))+","+(v._offset+(d.y0+d.y1)/2)+")")}t=t.filter(function(t){return void 0!==t.zLabelVal||(t[b]||"").split(" ")[0]===_})});var I=s.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 I.enter().append("g").classed("hovertext",!0).each(function(){var t=c.select(this);t.append("rect").call(y.fill,y.addOpacity(o,.8)),t.append("text").classed("name",!0),t.append("path").style("stroke-width","1px"),t.append("text").classed("nums",!0).call(g.font,h,f)}),I.exit().remove(),I.each(function(t){var e=c.select(this).attr("transform",""),r="",n="",s=y.opacity(t.color)?t.color:y.defaultLine,l=y.combine(s,o),u=t.borderColor||y.contrast(l);void 0!==t.nameOverride&&(t.name=t.nameOverride),t.name&&(r=m.plainText(t.name||""),r.length>15&&(r=r.substr(0,12)+"...")),void 0!==t.extraText&&(n+=t.extraText),void 0!==t.zLabel?(void 0!==t.xLabel&&(n+="x: "+t.xLabel+"<br>"),void 0!==t.yLabel&&(n+="y: "+t.yLabel+"<br>"),n+=(n?"z: ":"")+t.zLabel):E&&t[i+"Label"]===x?n=t[("x"===i?"y":"x")+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&(n=t.yLabel):n=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",t.text&&!Array.isArray(t.text)&&(n+=(n?"<br>":"")+t.text),""===n&&(""===r&&e.remove(),n=r);var d=e.select("text.nums").call(g.font,t.fontFamily||h,t.fontSize||f,t.fontColor||u).call(g.setPosition,0,0).text(n).attr("data-notex",1).call(m.convertToTspans);d.selectAll("tspan.line").call(g.setPosition,0,0);var p=e.select("text.name"),v=0;r&&r!==n?(p.call(g.font,t.fontFamily||h,t.fontSize||f,l).text(r).call(g.setPosition,0,0).attr("data-notex",1).call(m.convertToTspans),p.selectAll("tspan.line").call(g.setPosition,0,0),v=p.node().getBoundingClientRect().width+2*C):(p.remove(),e.select("rect").remove()),e.select("path").style({fill:l,stroke:u});var b,_,w=d.node().getBoundingClientRect(),M=t.xa._offset+(t.x0+t.x1)/2,z=t.ya._offset+(t.y0+t.y1)/2,D=Math.abs(t.x1-t.x0),I=Math.abs(t.y1-t.y0),P=w.width+L+C+v;t.ty0=A-w.top,t.bx=w.width+2*C,t.by=w.height+2*C,t.anchor="start",t.txwidth=w.width,t.tx2width=v,t.offset=0,a?(t.pos=M,b=z+I/2+P<=S,_=z-I/2-P>=0,"top"!==t.idealAlign&&b||!_?b?(z+=I/2,t.anchor="start"):t.anchor="middle":(z-=I/2,t.anchor="end")):(t.pos=z,b=M+D/2+P<=T,_=M-D/2-P>=0,"left"!==t.idealAlign&&b||!_?b?(M+=D/2,t.anchor="start"):t.anchor="middle":(M-=D/2,t.anchor="end")),d.attr("text-anchor",t.anchor),v&&p.attr("text-anchor",t.anchor),e.attr("transform","translate("+M+","+z+")"+(a?"rotate("+k+")":""))}),I}function a(t,e){function r(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],l.pos+l.dp+l.size>e.pmax&&u++;for(o=t.length-1;o>=0&&!(u<=0);o--)l=t[o],l.pos>e.pmax-1&&(l.del=!0,u--);for(o=0;o<t.length&&!(u<=0);o++)if(l=t[o],l.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],l.pos+l.dp+l.size>e.pmax&&(l.del=!0,u--)}}}for(var n,i,a,o,s,l,u,c=0,h=t.map(function(t,r){var n=t[e];return[{i:r,dp:0,pos:t.pos,posref:t.posref,size:t.by*("x"===n._id.charAt(0)?T:1)/2,pmin:n._offset,pmax:n._offset+n._length}]}).sort(function(t,e){return t[0].posref-e[0].posref});!n&&c<=t.length;){for(c++,n=!0,o=0;o<h.length-1;){var f=h[o],d=h[o+1],p=f[f.length-1],m=d[0];if((i=p.pos+p.dp+p.size-m.pos-m.dp+m.size)>.01&&p.pmin===m.pmin&&p.pmax===m.pmax){for(s=d.length-1;s>=0;s--)d[s].dp+=i;for(f.push.apply(f,d),h.splice(o+1,1),u=0,s=f.length-1;s>=0;s--)u+=f[s].dp;for(a=u/f.length,s=f.length-1;s>=0;s--)f[s].dp-=a;n=!1}else o++}h.forEach(r)}for(o=h.length-1;o>=0;o--){var v=h[o];for(s=v.length-1;s>=0;s--){var g=v[s],y=t[g.i];y.offset=g.dp,y.del=g.del}}}function o(t,e){t.each(function(t){var r=c.select(this);if(t.del)return void r.remove();var n="end"===t.anchor?-1:1,i=r.select("text.nums"),a={start:1,end:-1,middle:0}[t.anchor],o=a*(L+C),s=o+a*(t.txwidth+C),l=0,u=t.offset;"middle"===t.anchor&&(o-=t.tx2width/2,s-=t.tx2width/2),e&&(u*=-E,l=t.offset*S),r.select("path").attr("d","middle"===t.anchor?"M-"+t.bx/2+",-"+t.by/2+"h"+t.bx+"v"+t.by+"h-"+t.bx+"Z":"M0,0L"+(n*L+l)+","+(L+u)+"v"+(t.by/2-L)+"h"+n*t.bx+"v-"+t.by+"H"+(n*L+l)+"V"+(u-L)+"Z"),i.call(g.setPosition,o+l,u+t.ty0-t.by/2+C).selectAll("tspan.line").attr({x:i.attr("x"),y:i.attr("y")}),t.tx2width&&(r.select("text.name, text.name tspan.line").call(g.setPosition,s+a*C+l,u+t.ty0-t.by/2+C),r.select("rect").call(g.setRect,s+(a-1)*t.tx2width/2+l,u-t.by/2-1,t.tx2width,t.by+2))})}function s(t,e){function r(e,r,o){var s;if(a[r])s=a[r];else if(i[r]){var l=i[r];Array.isArray(l)&&Array.isArray(l[t.index[0]])&&(s=l[t.index[0]][t.index[1]])}else s=d.nestedProperty(n,o).get();s&&(t[e]=s)}var n=t.trace||{},i=t.cd[0],a=t.cd[t.index]||{};t.posref="y"===e?(t.x0+t.x1)/2:(t.y0+t.y1)/2,t.x0=d.constrain(t.x0,0,t.xa._length),t.x1=d.constrain(t.x1,0,t.xa._length),t.y0=d.constrain(t.y0,0,t.ya._length),t.y1=d.constrain(t.y1,0,t.ya._length);var o;if(void 0!==t.xLabelVal){o="log"===t.xa.type&&t.xLabelVal<=0;var s=x.tickText(t.xa,t.xa.c2l(o?-t.xLabelVal:t.xLabelVal),"hover");o?0===t.xLabelVal?t.xLabel="0":t.xLabel="-"+s.text:t.xLabel=s.text,t.xVal=t.xa.c2d(t.xLabelVal)}if(void 0!==t.yLabelVal){o="log"===t.ya.type&&t.yLabelVal<=0;var l=x.tickText(t.ya,t.ya.c2l(o?-t.yLabelVal:t.yLabelVal),"hover");o?0===t.yLabelVal?t.yLabel="0":t.yLabel="-"+l.text:t.yLabel=l.text,t.yVal=t.ya.c2d(t.yLabelVal)}if(void 0!==t.zLabelVal&&(t.zLabel=String(t.zLabelVal)),!(isNaN(t.xerr)||"log"===t.xa.type&&t.xerr<=0)){var u=x.tickText(t.xa,t.xa.c2l(t.xerr),"hover").text;void 0!==t.xerrneg?t.xLabel+=" +"+u+" / -"+x.tickText(t.xa,t.xa.c2l(t.xerrneg),"hover").text:t.xLabel+=" \xb1 "+u,"x"===e&&(t.distance+=1)}if(!(isNaN(t.yerr)||"log"===t.ya.type&&t.yerr<=0)){var c=x.tickText(t.ya,t.ya.c2l(t.yerr),"hover").text;void 0!==t.yerrneg?t.yLabel+=" +"+c+" / -"+x.tickText(t.ya,t.ya.c2l(t.yerrneg),"hover").text:t.yLabel+=" \xb1 "+c,"y"===e&&(t.distance+=1)}var h=t.trace.hoverinfo;return"all"!==h&&(h=h.split("+"),h.indexOf("x")===-1&&(t.xLabel=void 0),h.indexOf("y")===-1&&(t.yLabel=void 0),h.indexOf("z")===-1&&(t.zLabel=void 0),h.indexOf("text")===-1&&(t.text=void 0),h.indexOf("name")===-1&&(t.name=void 0)),r("color","hbg","hoverlabel.bgcolor"),r("borderColor","hbc","hoverlabel.bordercolor"),r("fontFamily","htf","hoverlabel.font.family"),r("fontSize","hts","hoverlabel.font.size"),r("fontColor","htc","hoverlabel.font.color"),t}function l(t,e){var r=e.hovermode,n=e.container,i=t[0],a=i.xa,o=i.ya,s=a.showspikes,l=o.showspikes;if(n.selectAll(".spikeline").remove(),"closest"===r&&(s||l)){var u=e.fullLayout,c=a._offset+(i.x0+i.x1)/2,h=o._offset+(i.y0+i.y1)/2,d=y.combine(u.plot_bgcolor,u.paper_bgcolor),p=f.readability(i.color,d)<1.5?y.contrast(d):i.color;if(l){var m=o.spikemode,v=o.spikethickness,b=o.spikecolor||p,x=o._boundingBox,_=(x.left+x.right)/2<c?x.right:x.left;if(m.indexOf("toaxis")!==-1||m.indexOf("across")!==-1){var w=_,M=c;m.indexOf("across")!==-1&&(w=o._counterSpan[0],M=o._counterSpan[1]),n.append("line").attr({x1:w,x2:M,y1:h,y2:h,"stroke-width":v+2,stroke:d}).classed("spikeline",!0).classed("crisp",!0),n.append("line").attr({x1:w,x2:M,y1:h,y2:h,"stroke-width":v,stroke:b,"stroke-dasharray":g.dashStyle(o.spikedash,v)}).classed("spikeline",!0).classed("crisp",!0)}m.indexOf("marker")!==-1&&n.append("circle").attr({cx:_+("right"!==o.side?v:-v),cy:h,r:v,fill:b}).classed("spikeline",!0)}if(s){var k=a.spikemode,A=a.spikethickness,T=a.spikecolor||p,S=a._boundingBox,E=(S.top+S.bottom)/2<h?S.bottom:S.top;if(k.indexOf("toaxis")!==-1||k.indexOf("across")!==-1){var L=E,C=h;k.indexOf("across")!==-1&&(L=a._counterSpan[0],C=a._counterSpan[1]),n.append("line").attr({x1:c,x2:c,y1:L,y2:C,"stroke-width":A+2,stroke:d}).classed("spikeline",!0).classed("crisp",!0),n.append("line").attr({x1:c,x2:c,y1:L,y2:C,"stroke-width":A,stroke:T,"stroke-dasharray":g.dashStyle(a.spikedash,A)}).classed("spikeline",!0).classed("crisp",!0)}k.indexOf("marker")!==-1&&n.append("circle").attr({cx:c,cy:E-("top"!==a.side?A:-A),r:A,fill:T}).classed("spikeline",!0)}}}function u(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))return!0}return!1}
54 var c=t("d3"),h=t("fast-isnumeric"),f=t("tinycolor2"),d=t("../../lib"),p=t("../../lib/events"),m=t("../../lib/svg_text_utils"),v=t("../../lib/override_cursor"),g=t("../drawing"),y=t("../color"),b=t("../dragelement"),x=t("../../plots/cartesian/axes"),_=t("../../registry"),w=t("./helpers"),M=t("./constants"),k=M.YANGLE,A=Math.PI*k/180,T=1/Math.sin(A),S=Math.cos(A),E=Math.sin(A),L=M.HOVERARROWSIZE,C=M.HOVERTEXTPAD;r.hover=function(t,e,r){if("string"==typeof t&&(t=document.getElementById(t)),void 0===t._lastHoverTime&&(t._lastHoverTime=0),void 0!==t._hoverTimer&&(clearTimeout(t._hoverTimer),t._hoverTimer=void 0),Date.now()>t._lastHoverTime+M.HOVERMINTIME)return n(t,e,r),void(t._lastHoverTime=Date.now());t._hoverTimer=setTimeout(function(){n(t,e,r),t._lastHoverTime=Date.now(),t._hoverTimer=void 0},M.HOVERMINTIME)},r.loneHover=function(t,e){var r={color:t.color||y.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,trace:{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0},n=c.select(e.container),a=e.outerContainer?c.select(e.outerContainer):n,s={hovermode:"closest",rotateLabels:!1,bgColor:e.bgColor||y.background,container:n,outerContainer:a},l=i([r],s);return o(l,s.rotateLabels),l.node()}},{"../../lib":709,"../../lib/events":700,"../../lib/override_cursor":718,"../../lib/svg_text_utils":728,"../../plots/cartesian/axes":748,"../../registry":826,"../color":590,"../dragelement":611,"../drawing":614,"./constants":626,"./helpers":628,d3:118,"fast-isnumeric":127,tinycolor2:526}],630:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e,r,i){i=i||{},r("hoverlabel.bgcolor",i.bgcolor),r("hoverlabel.bordercolor",i.bordercolor),n.coerceFont(r,"hoverlabel.font",i.font)}},{"../../lib":709}],631:[function(t,e,r){"use strict";function n(t){var e=o.isD3Selection(t)?t:a.select(t);e.selectAll("g.hovertext").remove(),e.selectAll(".spikeline").remove()}function i(t,e,r){var n=t.hoverlabel||{},i=o.nestedProperty(n,r).get();return Array.isArray(i)?Array.isArray(e)&&Array.isArray(i[e[0]])?i[e[0]][e[1]]:i[e]:i}var a=t("d3"),o=t("../../lib"),s=t("../dragelement"),l=t("./helpers"),u=t("./layout_attributes");e.exports={moduleType:"component",name:"fx",constants:t("./constants"),schema:{layout:u},attributes:t("./attributes"),layoutAttributes:u,supplyLayoutGlobalDefaults:t("./layout_global_defaults"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),getDistanceFunction:l.getDistanceFunction,getClosest:l.getClosest,inbox:l.inbox,castHoverOption:i,hover:t("./hover").hover,unhover:s.unhover,loneHover:t("./hover").loneHover,loneUnhover:n,click:t("./click")}},{"../../lib":709,"../dragelement":611,"./attributes":623,"./calc":624,"./click":625,"./constants":626,"./defaults":627,"./helpers":628,"./hover":629,"./layout_attributes":632,"./layout_defaults":633,"./layout_global_defaults":634,d3:118}],632:[function(t,e,r){"use strict";var n=t("../../lib/extend").extendFlat,i=t("../../plots/font_attributes"),a=t("./constants");e.exports={dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","orbit","turntable"],dflt:"zoom"},hovermode:{valType:"enumerated",values:["x","y","closest",!1]},hoverlabel:{bgcolor:{valType:"color"},bordercolor:{valType:"color"},font:{family:n({},i.family,{dflt:a.HOVERFONT}),size:n({},i.size,{dflt:a.HOVERFONTSIZE}),color:n({},i.color)}}}},{"../../lib/extend":701,"../../plots/font_attributes":772,"./constants":626}],633:[function(t,e,r){"use strict";function n(t){for(var e=!0,r=0;r<t.length;r++){if("h"!==t[r].orientation){e=!1;break}}return e}var i=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e,r){function o(r,n){return i.coerce(t,e,a,r,n)}o("dragmode");var s;e._has("cartesian")?(e._isHoriz=n(r),s=e._isHoriz?"y":"x"):s="closest",o("hovermode",s)}},{"../../lib":709,"./layout_attributes":632}],634:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./hoverlabel_defaults"),a=t("./layout_attributes");e.exports=function(t,e){function r(r,i){return n.coerce(t,e,a,r,i)}i(t,e,r)}},{"../../lib":709,"./hoverlabel_defaults":630,"./layout_attributes":632}],635:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/constants");e.exports={_isLinkedToArray:"image",visible:{valType:"boolean",dflt:!0},source:{valType:"string"},layer:{valType:"enumerated",values:["below","above"],dflt:"above"},sizex:{valType:"number",dflt:0},sizey:{valType:"number",dflt:0},sizing:{valType:"enumerated",values:["fill","contain","stretch"],dflt:"contain"},opacity:{valType:"number",min:0,max:1,dflt:1},x:{valType:"any",dflt:0},y:{valType:"any",dflt:0},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left"},yanchor:{valType:"enumerated",values:["top","middle","bottom"],dflt:"top"},xref:{valType:"enumerated",values:["paper",n.idRegex.x.toString()],dflt:"paper"},yref:{valType:"enumerated",values:["paper",n.idRegex.y.toString()],dflt:"paper"}}},{"../../plots/cartesian/constants":753}],636:[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,h=e._id.charAt(0),f=0;f<c.length;f++)if(l=c[f],u="images["+f+"].",l[h+"ref"]===e._id){var d=l[h],p=l["size"+h],m=null,v=null;if(o){m=i(d,e.range);var g=p/Math.pow(10,m)/2;v=2*Math.log(g+Math.sqrt(1+g*g))/Math.LN10}else m=Math.pow(10,d),v=m*(Math.pow(10,p/2)-Math.pow(10,-p/2));n(m)?n(v)||(v=null):(m=null,v=null),a(u+h,m),a(u+"size"+h,v)}}},{"../../lib/to_log_range":729,"fast-isnumeric":127}],637:[function(t,e,r){"use strict";function n(t,e,r){function n(r,n){return i.coerce(t,e,s,r,n)}if(!n("visible",!!n("source")))return e;n("layer"),n("xanchor"),n("yanchor"),n("sizex"),n("sizey"),n("sizing"),n("opacity");for(var o={_fullLayout:r},l=["x","y"],u=0;u<2;u++){var c=l[u],h=a.coerceRef(t,e,o,c,"paper");a.coercePosition(e,o,n,h,c,0)}return e}var i=t("../../lib"),a=t("../../plots/cartesian/axes"),o=t("../../plots/array_container_defaults"),s=t("./attributes");e.exports=function(t,e){o(t,e,{name:"images",handleItemDefaults:n})}},{"../../lib":709,"../../plots/array_container_defaults":745,"../../plots/cartesian/axes":748,"./attributes":635}],638:[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){function e(e){var r=n.select(this);if(!this.img||this.img.src!==e.source){r.attr("xmlns",o.svg);var i=new Promise(function(t){function n(){r.remove(),t()}var i=new Image;this.img=i,i.setAttribute("crossOrigin","anonymous"),i.onerror=n,i.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",n),i.src=e.source}.bind(this));t._promises.push(i)}}function r(e){var r=n.select(this),o=a.getFromId(t,e.xref),s=a.getFromId(t,e.yref),l=u._size,c=o?Math.abs(o.l2p(e.sizex)-o.l2p(0)):e.sizex*l.w,h=s?Math.abs(s.l2p(e.sizey)-s.l2p(0)):e.sizey*l.h,f=c*m.x[e.xanchor].offset,d=h*m.y[e.yanchor].offset,p=m.x[e.xanchor].sizing+m.y[e.yanchor].sizing,v=(o?o.r2p(e.x)+o._offset:e.x*l.w+l.l)+f,g=(s?s.r2p(e.y)+s._offset:l.h-e.y*l.h+l.t)+d;switch(e.sizing){case"fill":p+=" slice";break;case"stretch":p="none"}r.attr({x:v,y:g,width:c,height:h,preserveAspectRatio:p,opacity:e.opacity});var y=o?o._id:"",b=s?s._id:"",x=y+b;r.call(i.setClipUrl,x?"clip"+u._uid+x:null)}var s,l,u=t._fullLayout,c=[],h={},f=[];for(l=0;l<u.images.length;l++){var d=u.images[l];if(d.visible)if("below"===d.layer&&"paper"!==d.xref&&"paper"!==d.yref){s=d.xref+d.yref;var p=u._plots[s];if(!p){f.push(d);continue}p.mainplot&&(s=p.mainplot.id),h[s]||(h[s]=[]),h[s].push(d)}else"above"===d.layer?c.push(d):f.push(d)}var m={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}}},v=u._imageLowerLayer.selectAll("image").data(f),g=u._imageUpperLayer.selectAll("image").data(c);v.enter().append("image"),g.enter().append("image"),v.exit().remove(),g.exit().remove(),v.each(function(t){e.bind(this)(t),r.bind(this)(t)}),g.each(function(t){e.bind(this)(t),r.bind(this)(t)});var y=Object.keys(u._plots);for(l=0;l<y.length;l++){s=y[l];var b=u._plots[s];if(b.imagelayer){var x=b.imagelayer.selectAll("image").data(h[s]||[]);x.enter().append("image"),x.exit().remove(),x.each(function(t){e.bind(this)(t),r.bind(this)(t)})}}}},{"../../constants/xmlns_namespaces":692,"../../plots/cartesian/axes":748,"../drawing":614,d3:118}],639:[function(t,e,r){"use strict";e.exports={moduleType:"component",name:"images",layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),draw:t("./draw"),convertCoords:t("./convert_coords")}},{"./attributes":635,"./convert_coords":636,"./defaults":637,"./draw":638}],640:[function(t,e,r){"use strict";r.isRightAnchor=function(t){return"right"===t.xanchor||"auto"===t.xanchor&&t.x>=2/3},r.isCenterAnchor=function(t){return"center"===t.xanchor||"auto"===t.xanchor&&t.x>1/3&&t.x<2/3},r.isBottomAnchor=function(t){return"bottom"===t.yanchor||"auto"===t.yanchor&&t.y<=1/3},r.isMiddleAnchor=function(t){return"middle"===t.yanchor||"auto"===t.yanchor&&t.y>1/3&&t.y<2/3}},{}],641:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../color/attributes"),a=t("../../lib/extend").extendFlat;e.exports={bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:i.defaultLine},borderwidth:{valType:"number",min:0,dflt:0},font:a({},n,{}),orientation:{valType:"enumerated",values:["v","h"],dflt:"v"},traceorder:{valType:"flaglist",flags:["reversed","grouped"],extras:["normal"]},tracegroupgap:{valType:"number",min:0,dflt:10},x:{valType:"number",min:-2,max:3,dflt:1.02},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto"}}},{"../../lib/extend":701,"../../plots/font_attributes":772,"../color/attributes":589}],642:[function(t,e,r){"use strict";e.exports={scrollBarWidth:4,scrollBarHeight:20,scrollBarColor:"#808BA4",scrollBarMargin:4}},{}],643:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("./attributes"),o=t("../../plots/layout_attributes"),s=t("./helpers");e.exports=function(t,e,r){function l(t,e){return i.coerce(d,p,a,t,e)}for(var u,c,h,f,d=t.legend||{},p=e.legend={},m=0,v="normal",g=0;g<r.length;g++){var y=r[g];s.legendGetsTrace(y)&&(m++,n.traceIs(y,"pie")&&m++),(n.traceIs(y,"bar")&&"stack"===e.barmode||["tonextx","tonexty"].indexOf(y.fill)!==-1)&&(v=s.isGrouped({traceorder:v})?"grouped+reversed":"reversed"),void 0!==y.legendgroup&&""!==y.legendgroup&&(v=s.isReversed({traceorder:v})?"reversed+grouped":"grouped")}if(i.coerce(t,e,o,"showlegend",m>1)!==!1){if(l("bgcolor",e.paper_bgcolor),l("bordercolor"),l("borderwidth"),i.coerceFont(l,"font",e.font),l("orientation"),"h"===p.orientation){var b=t.xaxis;b&&b.rangeslider&&b.rangeslider.visible?(u=0,h="left",c=1.1,f="bottom"):(u=0,h="left",c=-.1,f="top")}l("traceorder",v),s.isGrouped(e.legend)&&l("tracegroupgap"),l("x",u),l("xanchor",h),l("y",c),l("yanchor",f),i.noneOrAll(d,p,["x","y"])}}},{"../../lib":709,"../../plots/layout_attributes":802,"../../registry":826,"./attributes":641,"./helpers":646}],644:[function(t,e,r){"use strict";function n(t,e){function r(r){y.convertToTspans(r,function(){r.selectAll("tspan.line").attr({x:r.attr("x")}),t.call(o,e)})}var n=t.data()[0][0],i=e._fullLayout,a=n.trace,s=p.traceIs(a,"pie"),l=a.index,u=s?n.label:a.name,c=t.selectAll("text.legendtext").data([0]);c.enter().append("text").classed("legendtext",!0),c.attr({x:40,y:0,"data-unformatted":u}).style("text-anchor","start").classed("user-select-none",!0).call(v.font,i.legend.font).text(u),e._context.editable&&!s?c.call(y.makeEditable).call(r).on("edit",function(t){this.attr({"data-unformatted":t}),this.text(t).call(r),this.text()||(t=" ");var i,a=n.trace._fullInput||{};if(["ohlc","candlestick"].indexOf(a.type)!==-1){var o=n.trace.transforms;i=o[o.length-1].direction+".name"}else i="name";h.restyle(e,i,t,l)}):c.call(r)}function i(t,e){var r,n=1,i=t.selectAll("rect").data([0]);i.enter().append("rect").classed("legendtoggle",!0).style("cursor","pointer").attr("pointer-events","all").call(g.fill,"rgba(0,0,0,0)"),i.on("mousedown",function(){r=(new Date).getTime(),r-e._legendMouseDownTime<T?n+=1:(n=1,e._legendMouseDownTime=r)}),i.on("mouseup",function(){if(!e._dragged&&!e._editing){var r=e._fullLayout.legend;(new Date).getTime()-e._legendMouseDownTime>T&&(n=Math.max(n-1,1)),1===n?r._clickTimeout=setTimeout(function(){a(t,e,n)},T):2===n&&(r._clickTimeout&&clearTimeout(r._clickTimeout),e._legendMouseDownTime=0,a(t,e,n))}})}function a(t,e,r){if(!e._dragged&&!e._editing){var n,i,a=e._fullLayout.hiddenlabels?e._fullLayout.hiddenlabels.slice():[],o=t.data()[0][0],s=e._fullData,l=o.trace,u=l.legendgroup,c=[];if(1===r&&A&&e.data&&e._context.showTips?(f.notifier("Double click on legend to isolate individual trace","long"),A=!1):A=!1,p.traceIs(l,"pie")){var d=o.label,m=a.indexOf(d);1===r?m===-1?a.push(d):a.splice(m,1):2===r&&(a=[],e.calcdata[0].forEach(function(t){d!==t.label&&a.push(t.label)}),e._fullLayout.hiddenlabels&&e._fullLayout.hiddenlabels.length===a.length&&m===-1&&(a=[])),h.relayout(e,"hiddenlabels",a)}else{var v,g=[],y=[];for(v=0;v<s.length;v++)g.push(v),y.push(!!p.traceIs(s[v],"notLegendIsolatable")||"legendonly");if(""===u)c=[l.index],y[l.index]=!0;else for(v=0;v<s.length;v++)n=s[v],n.legendgroup===u&&(c.push(n.index),y[g.indexOf(v)]=!0);if(1===r)i=l.visible!==!0||"legendonly",h.restyle(e,"visible",i,c);else if(2===r){var b=!0;for(v=0;v<s.length;v++)if(s[v].visible!==y[v]){b=!1;break}b&&(y=!0);var x=[];for(v=0;v<s.length;v++)x.push(g[v]);h.restyle(e,"visible",y,x)}}}}function o(t,e){var r,n,i=t.data()[0][0],a=t.select("g[class*=math-group]"),o=e._fullLayout.legend,s=1.3*o.font.size;if(!i.trace.showlegend)return void t.remove();if(a.node()){var l=v.bBox(a.node());r=l.height,n=l.width,v.setTranslate(a,0,r/4)}else{var u=t.selectAll(".legendtext"),c=t.selectAll(".legendtext>tspan"),h=c[0].length||1;r=s*h,n=u.node()&&v.bBox(u.node()).width;var f=s*(.3+(1-h)/2);u.attr("y",f),c.attr("y",f)}r=Math.max(r,16)+3,i.height=r,i.width=n}function s(t,e,r){var n=t._fullLayout,i=n.legend,a=i.borderwidth,o=M.isGrouped(i);if(M.isVertical(i))o&&e.each(function(t,e){v.setTranslate(this,0,e*i.tracegroupgap)}),i.width=0,i.height=0,r.each(function(t){var e=t[0],r=e.height,n=e.width;v.setTranslate(this,a,5+a+i.height+r/2),i.height+=r,i.width=Math.max(i.width,n)}),i.width+=45+2*a,i.height+=10+2*a,o&&(i.height+=(i._lgroupsLength-1)*i.tracegroupgap),i.width=Math.ceil(i.width),i.height=Math.ceil(i.height),r.each(function(e){var r=e[0];c.select(this).select(".legendtoggle").call(v.setRect,0,-r.height/2,(t._context.editable?0:i.width)+40,r.height)});else if(o){i.width=0,i.height=0;for(var s=[i.width],l=e.data(),u=0,h=l.length;u<h;u++){var f=l[u].map(function(t){return t[0].width}),d=40+Math.max.apply(null,f);i.width+=i.tracegroupgap+d,s.push(i.width)}e.each(function(t,e){v.setTranslate(this,s[e],0)}),e.each(function(){var t=c.select(this),e=t.selectAll("g.traces"),r=0;e.each(function(t){var e=t[0],n=e.height;v.setTranslate(this,0,5+a+r+n/2),r+=n}),i.height=Math.max(i.height,r)}),i.height+=10+2*a,i.width+=2*a,i.width=Math.ceil(i.width),i.height=Math.ceil(i.height),r.each(function(e){var r=e[0];c.select(this).select(".legendtoggle").call(v.setRect,0,-r.height/2,t._context.editable?0:i.width,r.height)})}else{i.width=0,i.height=0;var p=0,m=0,g=0,y=0;r.each(function(t){g=Math.max(40+t[0].width,g)}),r.each(function(t){var e=t[0],r=g,o=i.tracegroupgap||5;a+y+o+r>n.width-(n.margin.r+n.margin.l)&&(y=0,p+=m,i.height=i.height+m,m=0),v.setTranslate(this,a+y,5+a+e.height/2+p),i.width+=o+r,i.height=Math.max(i.height,e.height),y+=o+r,m=Math.max(e.height,m)}),i.width+=2*a,i.height+=10+2*a,i.width=Math.ceil(i.width),i.height=Math.ceil(i.height),r.each(function(e){var r=e[0];c.select(this).select(".legendtoggle").call(v.setRect,0,-r.height/2,t._context.editable?0:i.width,r.height)})}}function l(t){var e=t._fullLayout,r=e.legend,n="left";k.isRightAnchor(r)?n="right":k.isCenterAnchor(r)&&(n="center");var i="top";k.isBottomAnchor(r)?i="bottom":k.isMiddleAnchor(r)&&(i="middle"),d.autoMargin(t,"legend",{x:r.x,y:r.y,l:r.width*({right:1,center:.5}[n]||0),r:r.width*({left:1,center:.5}[n]||0),b:r.height*({top:1,middle:.5}[i]||0),t:r.height*({bottom:1,middle:.5}[i]||0)})}function u(t){var e=t._fullLayout,r=e.legend,n="left";k.isRightAnchor(r)?n="right":k.isCenterAnchor(r)&&(n="center"),d.autoMargin(t,"legend",{x:r.x,y:.5,l:r.width*({right:1,center:.5}[n]||0),r:r.width*({left:1,center:.5}[n]||0),b:0,t:0})}var c=t("d3"),h=t("../../plotly"),f=t("../../lib"),d=t("../../plots/plots"),p=t("../../registry"),m=t("../dragelement"),v=t("../drawing"),g=t("../color"),y=t("../../lib/svg_text_utils"),b=t("./constants"),x=t("../../constants/interactions"),_=t("./get_legend_data"),w=t("./style"),M=t("./helpers"),k=t("./anchor_utils"),A=!0,T=x.DBLCLICKDELAY;e.exports=function(t){function e(t,e){L.attr("data-scroll",e).call(v.setTranslate,0,e),C.call(v.setRect,N,t,b.scrollBarWidth,b.scrollBarHeight),S.select("rect").attr({y:y.borderwidth-e})}var r=t._fullLayout,o="legend"+r._uid;if(r._infolayer&&t.calcdata){t._legendMouseDownTime||(t._legendMouseDownTime=0);var y=r.legend,x=r.showlegend&&_(t.calcdata,y),M=r.hiddenlabels||[];if(!r.showlegend||!x.length)return r._infolayer.selectAll(".legend").remove(),r._topdefs.select("#"+o).remove(),void d.autoMargin(t,"legend");var A=r._infolayer.selectAll("g.legend").data([0]);A.enter().append("g").attr({class:"legend","pointer-events":"all"});var S=r._topdefs.selectAll("#"+o).data([0]);S.enter().append("clipPath").attr("id",o).append("rect");var E=A.selectAll("rect.bg").data([0]);E.enter().append("rect").attr({class:"bg","shape-rendering":"crispEdges"}),E.call(g.stroke,y.bordercolor),E.call(g.fill,y.bgcolor),E.style("stroke-width",y.borderwidth+"px");var L=A.selectAll("g.scrollbox").data([0]);L.enter().append("g").attr("class","scrollbox");var C=A.selectAll("rect.scrollbar").data([0]);C.enter().append("rect").attr({class:"scrollbar",rx:20,ry:2,width:0,height:0}).call(g.fill,"#808BA4");var z=L.selectAll("g.groups").data(x);z.enter().append("g").attr("class","groups"),z.exit().remove();var D=z.selectAll("g.traces").data(f.identity);D.enter().append("g").attr("class","traces"),D.exit().remove(),D.call(w).style("opacity",function(t){var e=t[0].trace;return p.traceIs(e,"pie")?M.indexOf(t[0].label)!==-1?.5:1:"legendonly"===e.visible?.5:1}).each(function(){c.select(this).call(n,t).call(i,t)});var I=0!==A.enter().size();I&&(s(t,z,D),l(t));var P=r.width,O=r.height;s(t,z,D),y.height>O?u(t):l(t);var j=r._size,F=j.l+j.w*y.x,R=j.t+j.h*(1-y.y);k.isRightAnchor(y)?F-=y.width:k.isCenterAnchor(y)&&(F-=y.width/2),k.isBottomAnchor(y)?R-=y.height:k.isMiddleAnchor(y)&&(R-=y.height/2);var N=y.width,B=j.w;N>B?(F=j.l,N=B):(F+N>P&&(F=P-N),F<0&&(F=0),N=Math.min(P-F,y.width));var U=y.height,V=j.h;U>V?(R=j.t,U=V):(R+U>O&&(R=O-U),R<0&&(R=0),U=Math.min(O-R,y.height)),v.setTranslate(A,F,R);var q,H,G=U-b.scrollBarHeight-2*b.scrollBarMargin,Y=y.height-U;if(y.height<=U||t._context.staticPlot)E.attr({width:N-y.borderwidth,height:U-y.borderwidth,x:y.borderwidth/2,y:y.borderwidth/2}),v.setTranslate(L,0,0),S.select("rect").attr({width:N-2*y.borderwidth,height:U-2*y.borderwidth,x:y.borderwidth,y:y.borderwidth}),L.call(v.setClipUrl,o);else{q=b.scrollBarMargin,H=L.attr("data-scroll")||0,E.attr({width:N-2*y.borderwidth+b.scrollBarWidth+b.scrollBarMargin,height:U-y.borderwidth,x:y.borderwidth/2,y:y.borderwidth/2}),S.select("rect").attr({width:N-2*y.borderwidth+b.scrollBarWidth+b.scrollBarMargin,height:U-2*y.borderwidth,x:y.borderwidth,y:y.borderwidth-H}),L.call(v.setClipUrl,o),I&&e(q,H),A.on("wheel",null),A.on("wheel",function(){H=f.constrain(L.attr("data-scroll")-c.event.deltaY/G*Y,-Y,0),q=b.scrollBarMargin-H/Y*G,e(q,H),0!==H&&H!==-Y&&c.event.preventDefault()}),C.on(".drag",null),L.on(".drag",null);var X=c.behavior.drag().on("drag",function(){q=f.constrain(c.event.y-b.scrollBarHeight/2,b.scrollBarMargin,b.scrollBarMargin+G),H=-(q-b.scrollBarMargin)/G*Y,e(q,H)});C.call(X),L.call(X)}if(t._context.editable){var W,Z,J,K;A.classed("cursor-move",!0),m.init({element:A.node(),prepFn:function(){var t=v.getTranslate(A);J=t.x,K=t.y},moveFn:function(t,e){var r=J+t,n=K+e;v.setTranslate(A,r,n),W=m.align(r,0,j.l,j.l+j.w,y.xanchor),Z=m.align(n,0,j.t+j.h,j.t,y.yanchor)},doneFn:function(e,n,i){if(e&&void 0!==W&&void 0!==Z)h.relayout(t,{"legend.x":W,"legend.y":Z});else{var o=r._infolayer.selectAll("g.traces").filter(function(){var t=this.getBoundingClientRect();return i.clientX>=t.left&&i.clientX<=t.right&&i.clientY>=t.top&&i.clientY<=t.bottom});o.size()>0&&(1===n?A._clickTimeout=setTimeout(function(){a(o,t,n)},T):2===n&&(A._clickTimeout&&clearTimeout(A._clickTimeout),a(o,t,n)))}}})}}}},{"../../constants/interactions":689,"../../lib":709,"../../lib/svg_text_utils":728,"../../plotly":743,"../../plots/plots":811,"../../registry":826,"../color":590,"../dragelement":611,"../drawing":614,"./anchor_utils":640,"./constants":642,"./get_legend_data":645,"./helpers":646,"./style":648,d3:118}],645:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("./helpers");e.exports=function(t,e){function r(t,r){if(""!==t&&i.isGrouped(e))l.indexOf(t)===-1?(l.push(t),u=!0,s[t]=[[r]]):s[t].push([r]);else{var n="~~i"+h;l.push(n),s[n]=[[r]],h++}}var a,o,s={},l=[],u=!1,c={},h=0;for(a=0;a<t.length;a++){var f=t[a],d=f[0],p=d.trace,m=p.legendgroup;if(i.legendGetsTrace(p)&&p.showlegend)if(n.traceIs(p,"pie"))for(c[m]||(c[m]={}),o=0;o<f.length;o++){var v=f[o].label;c[m][v]||(r(m,{label:v,color:f[o].color,i:f[o].i,trace:p}),c[m][v]=!0)}else r(m,d)}if(!l.length)return[];var g,y,b=l.length;if(u&&i.isGrouped(e))for(y=new Array(b),a=0;a<b;a++)g=s[l[a]],y[a]=i.isReversed(e)?g.reverse():g;else{for(y=[new Array(b)],a=0;a<b;a++)g=s[l[a]][0],y[0][i.isReversed(e)?b-a-1:a]=g;b=1}return e._lgroupsLength=b,y}},{"../../registry":826,"./helpers":646}],646:[function(t,e,r){"use strict";var n=t("../../registry");r.legendGetsTrace=function(t){return t.visible&&n.traceIs(t,"showLegend")},r.isGrouped=function(t){return(t.traceorder||"").indexOf("grouped")!==-1},r.isVertical=function(t){return"h"!==t.orientation},r.isReversed=function(t){return(t.traceorder||"").indexOf("reversed")!==-1}},{"../../registry":826}],647:[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":641,"./defaults":643,"./draw":644,"./style":648}],648:[function(t,e,r){"use strict";function n(t){var e=t[0].trace,r=e.visible&&e.fill&&"none"!==e.fill,n=d.hasLines(e);e&&e._module&&"contourcarpet"===e._module.name&&(n=e.contours.showlines,r="fill"===e.contours.coloring);var i=l.select(this).select(".legendfill").selectAll("path").data(r?[t]:[]);i.enter().append("path").classed("js-fill",!0),i.exit().remove(),i.attr("d","M5,0h30v6h-30z").call(h.fillGroupStyle);var a=l.select(this).select(".legendlines").selectAll("path").data(n?[t]:[]);a.enter().append("path").classed("js-line",!0).attr("d","M5,0h30"),a.exit().remove(),a.call(h.lineGroupStyle)}function i(t){function e(t,e,r){var n=c.nestedProperty(o,t).get(),i=Array.isArray(n)&&e?e(n):n;if(r){if(i<r[0])return r[0];if(i>r[1])return r[1]}return i}function r(t){return t[0]}var n,i,a=t[0],o=a.trace,s=d.hasMarkers(o),u=d.hasText(o),f=d.hasLines(o);if(s||u||f){var p={},m={};s&&(p.mc=e("marker.color",r),p.mo=e("marker.opacity",c.mean,[.2,1]),p.ms=e("marker.size",c.mean,[2,16]),p.mlc=e("marker.line.color",r),p.mlw=e("marker.line.width",c.mean,[0,5]),m.marker={sizeref:1,sizemin:1,sizemode:"diameter"}),f&&(m.line={width:e("line.width",r,[0,10])}),u&&(p.tx="Aa",p.tp=e("textposition",r),p.ts=10,p.tc=e("textfont.color",r),p.tf=e("textfont.family",r)),n=[c.minExtend(a,p)],i=c.minExtend(o,m)}var v=l.select(this).select("g.legendpoints"),g=v.selectAll("path.scatterpts").data(s?n:[]);g.enter().append("path").classed("scatterpts",!0).attr("transform","translate(20,0)"),g.exit().remove(),g.call(h.pointStyle,i),s&&(n[0].mrc=3);var y=v.selectAll("g.pointtext").data(u?n:[]);y.enter().append("g").classed("pointtext",!0).append("text").attr("transform","translate(20,0)"),y.exit().remove(),y.selectAll("text").call(h.textPointStyle,i)}function a(t){var e=t[0].trace,r=e.marker||{},n=r.line||{},i=l.select(this).select("g.legendpoints").selectAll("path.legendbar").data(u.traceIs(e,"bar")?[t]:[]);i.enter().append("path").classed("legendbar",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),i.exit().remove(),i.each(function(t){var e=l.select(this),i=t[0],a=(i.mlw+1||n.width+1)-1;e.style("stroke-width",a+"px").call(f.fill,i.mc||r.color),a&&e.call(f.stroke,i.mlc||n.color)})}function o(t){var e=t[0].trace,r=l.select(this).select("g.legendpoints").selectAll("path.legendbox").data(u.traceIs(e,"box")&&e.visible?[t]:[]);r.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),r.exit().remove(),r.each(function(){var t=e.line.width,r=l.select(this);r.style("stroke-width",t+"px").call(f.fill,e.fillcolor),t&&r.call(f.stroke,e.line.color)})}function s(t){var e=t[0].trace,r=l.select(this).select("g.legendpoints").selectAll("path.legendpie").data(u.traceIs(e,"pie")&&e.visible?[t]:[]);r.enter().append("path").classed("legendpie",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),r.exit().remove(),r.size()&&r.call(p,t[0],e)}var l=t("d3"),u=t("../../registry"),c=t("../../lib"),h=t("../drawing"),f=t("../color"),d=t("../../traces/scatter/subtypes"),p=t("../../traces/pie/style_one");e.exports=function(t){t.each(function(t){var e=l.select(this),r=e.selectAll("g.layers").data([0]);r.enter().append("g").classed("layers",!0),r.style("opacity",t[0].trace.opacity),r.selectAll("g.legendfill").data([t]).enter().append("g").classed("legendfill",!0),r.selectAll("g.legendlines").data([t]).enter().append("g").classed("legendlines",!0);var n=r.selectAll("g.legendsymbols").data([t]);n.enter().append("g").classed("legendsymbols",!0),n.selectAll("g.legendpoints").data([t]).enter().append("g").classed("legendpoints",!0)}).each(a).each(o).each(s).each(n).each(i)}},{"../../lib":709,"../../registry":826,"../../traces/pie/style_one":994,"../../traces/scatter/subtypes":1028,"../color":590,"../drawing":614,d3:118}],649:[function(t,e,r){"use strict";function n(t,e){var r,n,i=e.currentTarget,a=i.getAttribute("data-attr"),o=i.getAttribute("data-val")||!0,s=t._fullLayout,l={},u=f.list(t,null,!0),h="on";if("zoom"===a){var d,p="in"===o?.5:2,m=(1+p)/2,v=(1-p)/2;for(n=0;n<u.length;n++)if(r=u[n],!r.fixedrange)if(d=r._name,"auto"===o)l[d+".autorange"]=!0;else if("reset"===o){if(void 0===r._rangeInitial)l[d+".autorange"]=!0;else{var g=r._rangeInitial.slice();l[d+".range[0]"]=g[0],l[d+".range[1]"]=g[1]}void 0!==r._showSpikeInitial&&(l[d+".showspikes"]=r._showSpikeInitial,"on"!==h||r._showSpikeInitial||(h="off"))}else{var y=[r.r2l(r.range[0]),r.r2l(r.range[1])],b=[m*y[0]+v*y[1],m*y[1]+v*y[0]];l[d+".range[0]"]=r.l2r(b[0]),l[d+".range[1]"]=r.l2r(b[1])}s._cartesianSpikesEnabled=h}else{if("hovermode"!==a||"x"!==o&&"y"!==o){if("hovermode"===a&&"closest"===o){for(n=0;n<u.length;n++)r=u[n],"on"!==h||r.showspikes||(h="off");s._cartesianSpikesEnabled=h}}else o=s._isHoriz?"y":"x",i.setAttribute("data-val",o),"closest"!==o&&(s._cartesianSpikesEnabled="off");l[a]=o}c.relayout(t,l)}function i(t,e){for(var r=e.currentTarget,n=r.getAttribute("data-attr"),i=r.getAttribute("data-val")||!0,a=t._fullLayout,o=h.getSubplotIds(a,"gl3d"),s={},l=n.split("."),u=0;u<o.length;u++)s[o[u]+"."+l[1]]=i;c.relayout(t,s)}function a(t,e){for(var r=e.currentTarget,n=r.getAttribute("data-attr"),i=t._fullLayout,a=h.getSubplotIds(i,"gl3d"),o={},s=0;s<a.length;s++){var l=a[s],u=l+".camera",f=i[l]._scene;"resetDefault"===n?o[u]=null:"resetLastSave"===n&&(o[u]=d.extendDeep({},f.cameraInitial))}c.relayout(t,o)}function o(t,e){var r=e.currentTarget,n=r._previousVal||!1,i=t.layout,a=t._fullLayout,o=h.getSubplotIds(a,"gl3d"),s=["xaxis","yaxis","zaxis"],l=["showspikes","spikesides","spikethickness","spikecolor"],u={},f={},p={};if(n)p=d.extendDeep(i,n),r._previousVal=null;else{p={"allaxes.showspikes":!1};for(var m=0;m<o.length;m++){var v=o[m],g=a[v],y=u[v]={};y.hovermode=g.hovermode,p[v+".hovermode"]=!1;for(var b=0;b<3;b++){var x=s[b];f=y[x]={};for(var _=0;_<l.length;_++){var w=l[_];f[w]=g[x][w]}}}r._previousVal=d.extendDeep({},u)}c.relayout(t,p)}function s(t,e){for(var r=e.currentTarget,n=r.getAttribute("data-attr"),i=r.getAttribute("data-val")||!0,a=t._fullLayout,o=h.getSubplotIds(a,"geo"),s=0;s<o.length;s++){var l=a[o[s]]._subplot;if("zoom"===n){var u=l.projection.scale(),c="in"===i?2*u:.5*u;l.projection.scale(c),l.zoom.scale(c),l.render()}else"reset"===n&&l.zoomReset()}}function l(t){var e,r=t._fullLayout;e=r._has("cartesian")?r._isHoriz?"y":"x":"closest";var n=!t._fullLayout.hovermode&&e;c.relayout(t,"hovermode",n)}function u(t){for(var e,r,n=t._fullLayout,i=f.list(t,null,!0),a={},o=0;o<i.length;o++)e=i[o],r=e._name,a[r+".showspikes"]="on"===n._cartesianSpikesEnabled;return a}var c=t("../../plotly"),h=t("../../plots/plots"),f=t("../../plots/cartesian/axes"),d=t("../../lib"),p=t("../../snapshot/download"),m=t("../../../build/ploticon"),v=e.exports={};v.toImage={name:"toImage",title:"Download plot as a png",icon:m.camera,click:function(t){var e="png";d.notifier("Taking snapshot - this may take a few seconds","long"),d.isIE()&&(d.notifier("IE only supports svg. Changing format to svg.","long"),e="svg"),p(t,{format:e}).then(function(t){d.notifier("Snapshot succeeded - "+t,"long")}).catch(function(){d.notifier("Sorry there was a problem downloading your snapshot!","long")})}},v.sendDataToCloud={name:"sendDataToCloud",title:"Save and edit plot in cloud",icon:m.disk,click:function(t){h.sendDataToCloud(t)}},v.zoom2d={name:"zoom2d",title:"Zoom",attr:"dragmode",val:"zoom",icon:m.zoombox,click:n},v.pan2d={name:"pan2d",title:"Pan",attr:"dragmode",val:"pan",icon:m.pan,click:n},v.select2d={name:"select2d",title:"Box Select",attr:"dragmode",val:"select",icon:m.selectbox,click:n},v.lasso2d={name:"lasso2d",title:"Lasso Select",attr:"dragmode",val:"lasso",icon:m.lasso,click:n},v.zoomIn2d={name:"zoomIn2d",title:"Zoom in",attr:"zoom",val:"in",icon:m.zoom_plus,click:n},v.zoomOut2d={name:"zoomOut2d",title:"Zoom out",attr:"zoom",val:"out",icon:m.zoom_minus,click:n},v.autoScale2d={name:"autoScale2d",title:"Autoscale",attr:"zoom",val:"auto",icon:m.autoscale,click:n},v.resetScale2d={name:"resetScale2d",title:"Reset axes",attr:"zoom",val:"reset",icon:m.home,click:n},v.hoverClosestCartesian={name:"hoverClosestCartesian",title:"Show closest data on hover",attr:"hovermode",val:"closest",icon:m.tooltip_basic,gravity:"ne",click:n},v.hoverCompareCartesian={name:"hoverCompareCartesian",title:"Compare data on hover",attr:"hovermode",val:function(t){return t._fullLayout._isHoriz?"y":"x"},icon:m.tooltip_compare,gravity:"ne",click:n},v.zoom3d={name:"zoom3d",title:"Zoom",attr:"scene.dragmode",val:"zoom",icon:m.zoombox,click:i},v.pan3d={name:"pan3d",title:"Pan",attr:"scene.dragmode",val:"pan",icon:m.pan,click:i},v.orbitRotation={name:"orbitRotation",title:"orbital rotation",attr:"scene.dragmode",val:"orbit",icon:m["3d_rotate"],click:i},v.tableRotation={name:"tableRotation",title:"turntable rotation",attr:"scene.dragmode",val:"turntable",icon:m["z-axis"],click:i},v.resetCameraDefault3d={name:"resetCameraDefault3d",
55 title:"Reset camera to default",attr:"resetDefault",icon:m.home,click:a},v.resetCameraLastSave3d={name:"resetCameraLastSave3d",title:"Reset camera to last save",attr:"resetLastSave",icon:m.movie,click:a},v.hoverClosest3d={name:"hoverClosest3d",title:"Toggle show closest data on hover",attr:"hovermode",val:null,toggle:!0,icon:m.tooltip_basic,gravity:"ne",click:o},v.zoomInGeo={name:"zoomInGeo",title:"Zoom in",attr:"zoom",val:"in",icon:m.zoom_plus,click:s},v.zoomOutGeo={name:"zoomOutGeo",title:"Zoom out",attr:"zoom",val:"out",icon:m.zoom_minus,click:s},v.resetGeo={name:"resetGeo",title:"Reset",attr:"reset",val:null,icon:m.autoscale,click:s},v.hoverClosestGeo={name:"hoverClosestGeo",title:"Toggle show closest data on hover",attr:"hovermode",val:null,toggle:!0,icon:m.tooltip_basic,gravity:"ne",click:l},v.hoverClosestGl2d={name:"hoverClosestGl2d",title:"Toggle show closest data on hover",attr:"hovermode",val:null,toggle:!0,icon:m.tooltip_basic,gravity:"ne",click:l},v.hoverClosestPie={name:"hoverClosestPie",title:"Toggle show closest data on hover",attr:"hovermode",val:"closest",icon:m.tooltip_basic,gravity:"ne",click:l},v.toggleHover={name:"toggleHover",title:"Toggle show closest data on hover",attr:"hovermode",val:null,toggle:!0,icon:m.tooltip_basic,gravity:"ne",click:function(t,e){l(t),o(t,e)}},v.resetViews={name:"resetViews",title:"Reset views",icon:m.home,click:function(t,e){var r=e.currentTarget;r.setAttribute("data-attr","zoom"),r.setAttribute("data-val","reset"),n(t,e),r.setAttribute("data-attr","resetLastSave"),a(t,e)}},v.toggleSpikelines={name:"toggleSpikelines",title:"Toggle Spike Lines",icon:m.spikeline,attr:"_cartesianSpikesEnabled",val:"on",click:function(t){var e=t._fullLayout;e._cartesianSpikesEnabled="closest"===e.hovermode&&"on"===e._cartesianSpikesEnabled?"off":"on";var r=u(t);r.hovermode="closest",c.relayout(t,r)}}},{"../../../build/ploticon":2,"../../lib":709,"../../plotly":743,"../../plots/cartesian/axes":748,"../../plots/plots":811,"../../snapshot/download":828}],650:[function(t,e,r){"use strict";r.manage=t("./manage")},{"./manage":651}],651:[function(t,e,r){"use strict";function n(t,e,r){function n(t){for(var r=[],n=0;n<t.length;n++){var i=t[n];e.indexOf(i)===-1&&r.push(h[i])}v.push(r)}var s=t._fullLayout,l=t._fullData,u=s._has("cartesian"),c=s._has("gl3d"),f=s._has("geo"),d=s._has("pie"),p=s._has("gl2d"),m=s._has("ternary"),v=[];if(n(["toImage","sendDataToCloud"]),(u||p||d||m)+f+c>1)return n(["resetViews","toggleHover"]),o(v,r);c&&(n(["zoom3d","pan3d","orbitRotation","tableRotation"]),n(["resetCameraDefault3d","resetCameraLastSave3d"]),n(["hoverClosest3d"])),f&&(n(["zoomInGeo","zoomOutGeo","resetGeo"]),n(["hoverClosestGeo"]));var g=i(s),y=[];return((u||p)&&!g||m)&&(y=["zoom2d","pan2d"]),(u||m)&&a(l)&&(y.push("select2d"),y.push("lasso2d")),y.length&&n(y),!u&&!p||g||m||n(["zoomIn2d","zoomOut2d","autoScale2d","resetScale2d"]),u&&d?n(["toggleHover"]):p?n(["hoverClosestGl2d"]):u?n(["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]):d&&n(["hoverClosestPie"]),o(v,r)}function i(t){for(var e=l.list({_fullLayout:t},null,!0),r=!0,n=0;n<e.length;n++)if(!e[n].fixedrange){r=!1;break}return r}function a(t){for(var e=!1,r=0;r<t.length&&!e;r++){var n=t[r];n._module&&n._module.selectPoints&&("scatter"===n.type||"scatterternary"===n.type?(u.hasMarkers(n)||u.hasText(n))&&(e=!0):e=!0)}return e}function o(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}function s(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===h[i])throw new Error(["*modeBarButtons* configuration options","invalid button name"].join(" "));t[e][n]=h[i]}}return t}var l=t("../../plots/cartesian/axes"),u=t("../../traces/scatter/subtypes"),c=t("./modebar"),h=t("./buttons");e.exports=function(t){var e=t._fullLayout,r=t._context,i=e._modeBar;if(!r.displayModeBar)return void(i&&(i.destroy(),delete e._modeBar));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 a,o=r.modeBarButtons;a=Array.isArray(o)&&o.length?s(o):n(t,r.modeBarButtonsToRemove,r.modeBarButtonsToAdd),i?i.update(t,a):e._modeBar=c(t,a)}},{"../../plots/cartesian/axes":748,"../../traces/scatter/subtypes":1028,"./buttons":649,"./modebar":652}],652:[function(t,e,r){"use strict";function n(t){this.container=t.container,this.element=document.createElement("div"),this.update(t.graphInfo,t.buttons),this.container.appendChild(this.element)}function i(t,e){var r=t._fullLayout,i=new n({graphInfo:t,container:r._paperdiv.node(),buttons:e});return r._privateplot&&a.select(i.element).append("span").classed("badge-private float--left",!0).text("PRIVATE"),i}var a=t("d3"),o=t("../../lib"),s=t("../../../build/ploticon"),l=n.prototype;l.update=function(t,e){this.graphInfo=t;var r=this.graphInfo._context;"hover"===r.displayModeBar?this.element.className="modebar modebar--hover":this.element.className="modebar";var n=!this.hasButtons(e),i=this.hasLogo!==r.displaylogo;(n||i)&&(this.removeAllButtons(),this.updateButtons(e),r.displaylogo&&(this.element.appendChild(this.getLogo()),this.hasLogo=!0)),this.updateActiveButton()},l.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(e.buttonsNames.indexOf(n)!==-1)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)})},l.createGroup=function(){var t=document.createElement("div");return t.className="modebar-group",t},l.createButton=function(t){var e=this,r=document.createElement("a");r.setAttribute("rel","tooltip"),r.className="modebar-btn";var n=t.title;void 0===n&&(n=t.name),(n||0===n)&&r.setAttribute("data-title",n),void 0!==t.attr&&r.setAttribute("data-attr",t.attr);var i=t.val;if(void 0!==i&&("function"==typeof i&&(i=i(this.graphInfo)),r.setAttribute("data-val",i)),"function"!=typeof t.click)throw new Error("must provide button 'click' function in button config");return r.addEventListener("click",function(r){t.click(e.graphInfo,r),e.updateActiveButton(r.currentTarget)}),r.setAttribute("data-toggle",t.toggle||!1),t.toggle&&a.select(r).classed("active",!0),r.appendChild(this.createIcon(t.icon||s.question,t.name)),r.setAttribute("data-gravity",t.gravity||"n"),r},l.createIcon=function(t,e){var r=t.ascent-t.descent,n="http://www.w3.org/2000/svg",i=document.createElementNS(n,"svg"),a=document.createElementNS(n,"path");i.setAttribute("height","1em"),i.setAttribute("width",t.width/r+"em"),i.setAttribute("viewBox",[0,0,t.width,r].join(" "));var o="toggleSpikelines"===e?"matrix(1.5 0 0 -1.5 0 "+t.ascent+")":"matrix(1 0 0 -1 0 "+t.ascent+")";return a.setAttribute("d",t.path),a.setAttribute("transform",o),i.appendChild(a),i},l.updateActiveButton=function(t){var e=this.graphInfo._fullLayout,r=void 0!==t?t.getAttribute("data-attr"):null;this.buttonElements.forEach(function(t){var n=t.getAttribute("data-val")||!0,i=t.getAttribute("data-attr"),s="true"===t.getAttribute("data-toggle"),l=a.select(t);if(s)i===r&&l.classed("active",!l.classed("active"));else{var u=null===i?i:o.nestedProperty(e,i).get();l.classed("active",u===n)}})},l.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},l.getLogo=function(){var t=this.createGroup(),e=document.createElement("a");return e.href="https://plot.ly/",e.target="_blank",e.setAttribute("data-title","Produced with Plotly"),e.className="modebar-btn plotlyjsicon modebar-btn--logo",e.appendChild(this.createIcon(s.plotlylogo)),t.appendChild(e),t},l.removeAllButtons=function(){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.hasLogo=!1},l.destroy=function(){o.removeElement(this.container.querySelector(".modebar"))},e.exports=i},{"../../../build/ploticon":2,"../../lib":709,d3:118}],653:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../color/attributes"),a=t("../../lib/extend").extendFlat,o=t("./button_attributes");o=a(o,{_isLinkedToArray:"button"}),e.exports={visible:{valType:"boolean"},buttons:o,x:{valType:"number",min:-2,max:3},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left"},y:{valType:"number",min:-2,max:3},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"bottom"},font:a({},n,{}),bgcolor:{valType:"color",dflt:i.lightLine},activecolor:{valType:"color"},bordercolor:{valType:"color",dflt:i.defaultLine},borderwidth:{valType:"number",min:0,dflt:0}}},{"../../lib/extend":701,"../../plots/font_attributes":772,"../color/attributes":589,"./button_attributes":654}],654:[function(t,e,r){"use strict";e.exports={step:{valType:"enumerated",values:["month","year","day","hour","minute","second","all"],dflt:"month"},stepmode:{valType:"enumerated",values:["backward","todate"],dflt:"backward"},count:{valType:"number",min:0,dflt:1},label:{valType:"string"}}},{}],655:[function(t,e,r){"use strict";e.exports={yPad:.02,minButtonWidth:30,rx:3,ry:3,lightAmount:25,darkAmount:10}},{}],656:[function(t,e,r){"use strict";function n(t,e,r){function n(t,e){return a.coerce(i,o,l,t,e)}for(var i,o,s=t.buttons||[],u=e.buttons=[],c=0;c<s.length;c++)if(i=s[c],o={},a.isPlainObject(i)){var h=n("step");"all"!==h&&(!r||"gregorian"===r||"month"!==h&&"year"!==h?n("stepmode"):o.stepmode="backward",n("count")),n("label"),o._index=c,u.push(o)}return u}function i(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+u.yPad]}var a=t("../../lib"),o=t("../color"),s=t("./attributes"),l=t("./button_attributes"),u=t("./constants");e.exports=function(t,e,r,l,c){function h(t,e){return a.coerce(f,d,s,t,e)}var f=t.rangeselector||{},d=e.rangeselector={};if(h("visible",n(f,d,c).length>0)){var p=i(e,r,l);h("x",p[0]),h("y",p[1]),a.noneOrAll(t,e,["x","y"]),h("xanchor"),h("yanchor"),a.coerceFont(h,"font",r.font);var m=h("bgcolor");h("activecolor",o.contrast(m,u.lightAmount,u.darkAmount)),h("bordercolor"),h("borderwidth")}}},{"../../lib":709,"../color":590,"./attributes":653,"./button_attributes":654,"./constants":655}],657:[function(t,e,r){"use strict";function n(t){for(var e=g.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}function i(t){return t._id}function a(t,e,r){if("all"===e.step)return t.autorange===!0;var n=Object.keys(r);return t.range[0]===r[n[0]]&&t.range[1]===r[n[1]]}function o(t,e,r){var n=t.selectAll("rect").data([0]);n.enter().append("rect").classed("selector-rect",!0),n.attr("shape-rendering","crispEdges"),n.attr({rx:b.rx,ry:b.ry}),n.call(p.stroke,e.bordercolor).call(p.fill,s(e,r)).style("stroke-width",e.borderwidth+"px")}function s(t,e){return e.isActive||e.isHovered?t.activecolor:t.bgcolor}function l(t,e,r){function n(t){v.convertToTspans(t)}var i=t.selectAll("text").data([0]);i.enter().append("text").classed("selector-text",!0).classed("user-select-none",!0),i.attr("text-anchor","middle"),i.call(m.font,e.font).text(u(r)).call(n)}function u(t){return t.label?t.label:"all"===t.step?"all":t.count+t.step.charAt(0)}function c(t,e,r,n){r.width=0,r.height=0;var i=r.borderwidth;e.each(function(){var t=h.select(this),e=t.select(".selector-text"),n=e.selectAll("tspan"),i=1.3*r.font.size,a=n[0].length||1,o=Math.max(i*a,16)+3;r.height=Math.max(r.height,o)}),e.each(function(){var t=h.select(this),e=t.select(".selector-rect"),n=t.select(".selector-text"),a=n.selectAll("tspan"),o=n.node()&&m.bBox(n.node()).width,s=1.3*r.font.size,l=a[0].length||1,u=Math.max(o+10,b.minButtonWidth);t.attr("transform","translate("+(i+r.width)+","+i+")"),e.attr({x:0,y:0,width:u,height:r.height});var c={x:u/2,y:r.height/2-(l-1)*s/2+3};n.attr(c),a.attr(c),r.width+=u+5}),e.selectAll("rect").attr("height",r.height);var a=t._fullLayout._size;r.lx=a.l+a.w*r.x,r.ly=a.t+a.h*(1-r.y);var o="left";y.isRightAnchor(r)&&(r.lx-=r.width,o="right"),y.isCenterAnchor(r)&&(r.lx-=r.width/2,o="center");var s="top";y.isBottomAnchor(r)&&(r.ly-=r.height,s="bottom"),y.isMiddleAnchor(r)&&(r.ly-=r.height/2,s="middle"),r.width=Math.ceil(r.width),r.height=Math.ceil(r.height),r.lx=Math.round(r.lx),r.ly=Math.round(r.ly),d.autoMargin(t,n+"-range-selector",{x:r.x,y:r.y,l:r.width*({right:1,center:.5}[o]||0),r:r.width*({left:1,center:.5}[o]||0),b:r.height*({top:1,middle:.5}[s]||0),t:r.height*({bottom:1,middle:.5}[s]||0)})}var h=t("d3"),f=t("../../plotly"),d=t("../../plots/plots"),p=t("../color"),m=t("../drawing"),v=t("../../lib/svg_text_utils"),g=t("../../plots/cartesian/axis_ids"),y=t("../legend/anchor_utils"),b=t("./constants"),x=t("./get_update_object");e.exports=function(t){var e=t._fullLayout,r=e._infolayer.selectAll(".rangeselector").data(n(t),i);r.enter().append("g").classed("rangeselector",!0),r.exit().remove(),r.style({cursor:"pointer","pointer-events":"all"}),r.each(function(e){var r=h.select(this),n=e,i=n.rangeselector,s=r.selectAll("g.button").data(i.buttons);s.enter().append("g").classed("button",!0),s.exit().remove(),s.each(function(e){var r=h.select(this),s=x(n,e);e.isActive=a(n,e,s),r.call(o,i,e),r.call(l,i,e),r.on("click",function(){t._dragged||f.relayout(t,s)}),r.on("mouseover",function(){e.isHovered=!0,r.call(o,i,e)}),r.on("mouseout",function(){e.isHovered=!1,r.call(o,i,e)})}),c(t,s,i,n._name),r.attr("transform","translate("+i.lx+","+i.ly+")")})}},{"../../lib/svg_text_utils":728,"../../plotly":743,"../../plots/cartesian/axis_ids":751,"../../plots/plots":811,"../color":590,"../drawing":614,"../legend/anchor_utils":640,"./constants":655,"./get_update_object":658,d3:118}],658:[function(t,e,r){"use strict";function n(t,e){var r,n=t.range,a=new Date(t.r2l(n[1])),o=e.step,s=e.count;switch(e.stepmode){case"backward":r=t.l2r(+i.time[o].utc.offset(a,-s));break;case"todate":var l=i.time[o].utc.offset(a,-s);r=t.l2r(+i.time[o].utc.ceil(l))}return[r,n[1]]}var i=t("d3");e.exports=function(t,e){var r=t._name,i={};if("all"===e.step)i[r+".autorange"]=!0;else{var a=n(t,e);i[r+".range[0]"]=a[0],i[r+".range[1]"]=a[1]}return i}},{d3:118}],659:[function(t,e,r){"use strict";e.exports={moduleType:"component",name:"rangeselector",schema:{layout:{"xaxis.rangeselector":t("./attributes")}},layoutAttributes:t("./attributes"),handleDefaults:t("./defaults"),draw:t("./draw")}},{"./attributes":653,"./defaults":656,"./draw":657}],660:[function(t,e,r){"use strict";var n=t("../color/attributes");e.exports={bgcolor:{valType:"color",dflt:n.background},bordercolor:{valType:"color",dflt:n.defaultLine},borderwidth:{valType:"integer",dflt:0,min:0},autorange:{valType:"boolean",dflt:!0},range:{valType:"info_array",items:[{valType:"any"},{valType:"any"}]},thickness:{valType:"number",dflt:.15,min:0,max:1},visible:{valType:"boolean",dflt:!0}}},{"../color/attributes":589}],661:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("./constants");e.exports=function(t){for(var e=n.list(t,"x",!0),r=0;r<e.length;r++){var a=e[r],o=a[i.name];o&&o.visible&&o.autorange&&a._min.length&&a._max.length&&(o._input.autorange=!0,o._input.range=o.range=n.getAutoRange(a))}}},{"../../plots/cartesian/axes":748,"./constants":662}],662:[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",maskColor:"rgba(0,0,0,0.4)",slideBoxFill:"transparent",slideBoxCursor:"ew-resize",grabAreaFill:"transparent",grabAreaCursor:"col-resize",grabAreaWidth:10,handleWidth:4,handleRadius:1,handleStrokeWidth:1,extraPad:15}},{}],663:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes");e.exports=function(t,e,r){function a(t,e){return n.coerce(o,l,i,t,e)}if(t[r].rangeslider){n.isPlainObject(t[r].rangeslider)||(t[r].rangeslider={});var o=t[r].rangeslider,s=e[r],l=s.rangeslider={};if(a("visible")){if(a("bgcolor",e.plot_bgcolor),a("bordercolor"),a("borderwidth"),a("thickness"),a("autorange",!s.isValidRange(o.range)),a("range"),l.range){var u=l.range,c=s.range;u[0]=s.l2r(Math.min(s.r2l(u[0]),s.r2l(c[0]))),u[1]=s.l2r(Math.max(s.r2l(u[1]),s.r2l(c[1])))}s.cleanRange("rangeslider.range"),l._input=o}}}},{"../../lib":709,"./attributes":660}],664:[function(t,e,r){"use strict";function n(t){var e=w.list({_fullLayout:t},"x",!0),r=A.name,n=[];if(t._has("gl2d"))return n;for(var i=0;i<e.length;i++){var a=e[i];a[r]&&a[r].visible&&n.push(a)}return n}function i(t,e,r,n){var i=t.select("rect."+A.slideBoxClassName).node(),o=t.select("rect."+A.grabAreaMinClassName).node(),s=t.select("rect."+A.grabAreaMaxClassName).node();t.on("mousedown",function(){function l(l){var u,c,y,b=+l.clientX-f;switch(h){case i:y="ew-resize",u=p+b,c=v+b;break;case o:y="col-resize",u=p+b,c=v;break;case s:y="col-resize",u=p,c=v+b;break;default:y="ew-resize",u=d,c=d+b}if(c<u){var x=c;c=u,u=x}n._pixelMin=u,n._pixelMax=c,k(m.select(g),y),a(t,e,r,n)}function u(){g.removeEventListener("mousemove",l),g.removeEventListener("mouseup",u),y.removeElement(g)}var c=m.event,h=c.target,f=c.clientX,d=f-t.node().getBoundingClientRect().left,p=n.d2p(r._rl[0]),v=n.d2p(r._rl[1]),g=M.coverSlip();g.addEventListener("mousemove",l),g.addEventListener("mouseup",u)})}function a(t,e,r,n){function i(t){return r.l2r(y.constrain(t,n._rl[0],n._rl[1]))}var a=i(n.p2d(n._pixelMin)),o=i(n.p2d(n._pixelMax));window.requestAnimationFrame(function(){v.relayout(e,r._name+".range",[a,o])})}function o(t,e,r,n){function i(t){return y.constrain(t,0,n._width)}function a(t){return y.constrain(t,-o,n._width+o)}var o=A.handleWidth/2,s=i(n.d2p(r._rl[0])),l=i(n.d2p(r._rl[1]));t.select("rect."+A.slideBoxClassName).attr("x",s).attr("width",l-s),t.select("rect."+A.maskMinClassName).attr("width",s),t.select("rect."+A.maskMaxClassName).attr("x",l).attr("width",n._width-l);var u=Math.round(a(s-o))-.5,c=Math.round(a(l-o))+.5;t.select("g."+A.grabberMinClassName).attr("transform","translate("+u+",0.5)"),t.select("g."+A.grabberMaxClassName).attr("transform","translate("+c+",0.5)")}function s(t,e,r,n){var i=t.selectAll("rect."+A.bgClassName).data([0]);i.enter().append("rect").classed(A.bgClassName,!0).attr({x:0,y:0,"shape-rendering":"crispEdges"});var a=n.borderwidth%2==0?n.borderwidth:n.borderwidth-1,o=-n._offsetShift,s=b.crispRound(e,n.borderwidth);i.attr({width:n._width+a,height:n._height+a,transform:"translate("+o+","+o+")",fill:n.bgcolor,stroke:n.bordercolor,"stroke-width":s})}function l(t,e,r,n){var i=e._fullLayout,a=i._topdefs.selectAll("#"+n._clipId).data([0]);a.enter().append("clipPath").attr("id",n._clipId).append("rect").attr({x:0,y:0}),a.select("rect").attr({width:n._width,height:n._height})}function u(t,e,r,n){var i=w.getSubplots(e,r),a=e.calcdata,o=t.selectAll("g."+A.rangePlotClassName).data(i,y.identity);o.enter().append("g").attr("class",function(t){return A.rangePlotClassName+" "+t}).call(b.setClipUrl,n._clipId),o.order(),o.exit().remove();var s;o.each(function(t,i){var o=m.select(this),l=0===i,u=w.getFromId(e,t,"y"),h=u._name,f={data:[],layout:{xaxis:{type:r.type,domain:[0,1],range:n.range.slice(),calendar:r.calendar},width:n._width,height:n._height,margin:{t:0,b:0,l:0,r:0}}};f.layout[h]={type:u.type,domain:[0,1],range:u.range.slice(),calendar:u.calendar},g.supplyDefaults(f);var d=f._fullLayout.xaxis,p=f._fullLayout[h],v={id:t,plotgroup:o,xaxis:d,yaxis:p};l?s=v:(v.mainplot="xy",v.mainplotinfo=s),_.rangePlot(e,v,c(a,t))})}function c(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}function h(t,e,r,n){var i=t.selectAll("rect."+A.maskMinClassName).data([0]);i.enter().append("rect").classed(A.maskMinClassName,!0).attr({x:0,y:0}).attr("shape-rendering","crispEdges"),i.attr("height",n._height).call(x.fill,A.maskColor);var a=t.selectAll("rect."+A.maskMaxClassName).data([0]);a.enter().append("rect").classed(A.maskMaxClassName,!0).attr("y",0).attr("shape-rendering","crispEdges"),a.attr("height",n._height).call(x.fill,A.maskColor)}function f(t,e,r,n){if(!e._context.staticPlot){var i=t.selectAll("rect."+A.slideBoxClassName).data([0]);i.enter().append("rect").classed(A.slideBoxClassName,!0).attr("y",0).attr("cursor",A.slideBoxCursor).attr("shape-rendering","crispEdges"),i.attr({height:n._height,fill:A.slideBoxFill})}}function d(t,e,r,n){var i=t.selectAll("g."+A.grabberMinClassName).data([0]);i.enter().append("g").classed(A.grabberMinClassName,!0);var a=t.selectAll("g."+A.grabberMaxClassName).data([0]);a.enter().append("g").classed(A.grabberMaxClassName,!0);var o={x:0,width:A.handleWidth,rx:A.handleRadius,fill:x.background,stroke:x.defaultLine,"stroke-width":A.handleStrokeWidth,"shape-rendering":"crispEdges"},s={y:Math.round(n._height/4),height:Math.round(n._height/2)},l=i.selectAll("rect."+A.handleMinClassName).data([0]);l.enter().append("rect").classed(A.handleMinClassName,!0).attr(o),l.attr(s);var u=a.selectAll("rect."+A.handleMaxClassName).data([0]);if(u.enter().append("rect").classed(A.handleMaxClassName,!0).attr(o),u.attr(s),!e._context.staticPlot){var c={width:A.grabAreaWidth,x:0,y:0,fill:A.grabAreaFill,cursor:A.grabAreaCursor},h=i.selectAll("rect."+A.grabAreaMinClassName).data([0]);h.enter().append("rect").classed(A.grabAreaMinClassName,!0).attr(c),h.attr("height",n._height);var f=a.selectAll("rect."+A.grabAreaMaxClassName).data([0]);f.enter().append("rect").classed(A.grabAreaMaxClassName,!0).attr(c),f.attr("height",n._height)}}function p(t){for(var e=t._fullLayout._pushmargin||{},r=Object.keys(e),n=0;n<r.length;n++){var i=r[n];i.indexOf(A.name)!==-1&&g.autoMargin(t,i)}}var m=t("d3"),v=t("../../plotly"),g=t("../../plots/plots"),y=t("../../lib"),b=t("../drawing"),x=t("../color"),_=t("../../plots/cartesian"),w=t("../../plots/cartesian/axes"),M=t("../dragelement"),k=t("../../lib/setcursor"),A=t("./constants");e.exports=function(t){function e(t){return t._name}var r=t._fullLayout,a=n(r),c=r._infolayer.selectAll("g."+A.containerClassName).data(a,e);c.enter().append("g").classed(A.containerClassName,!0).attr("pointer-events","all"),c.exit().each(function(t){var e=m.select(this),n=t[A.name];e.remove(),r._topdefs.select("#"+n._clipId).remove()}),c.exit().size()&&p(t),0!==a.length&&c.each(function(e){var n=m.select(this),a=e[A.name],c=r[w.id2name(e.anchor)],p=r.margin,v=r._size,y=e.domain,b=c.domain,x=(e._boundingBox||{}).height||0;a._id=A.name+e._id,a._clipId=a._id+"-"+r._uid,a._width=v.w*(y[1]-y[0]),a._height=(r.height-p.b-p.t)*a.thickness,a._offsetShift=Math.floor(a.borderwidth/2);var _=Math.round(p.l+v.w*y[0]),M=Math.round(p.t+v.h*(1-b[0])+x+a._offsetShift+A.extraPad);n.attr("transform","translate("+_+","+M+")");var k=e.r2l(a.range[0]),T=e.r2l(a.range[1]),S=T-k;a.p2d=function(t){return t/a._width*S+k},a.d2p=function(t){return(t-k)/S*a._width},a._rl=[k,T],n.call(s,t,e,a).call(l,t,e,a).call(u,t,e,a).call(h,t,e,a).call(f,t,e,a).call(d,t,e,a),i(n,t,e,a),o(n,t,e,a),g.autoMargin(t,a._id,{x:y[0],y:b[0],l:0,r:0,t:0,b:a._height+p.b+x,pad:A.extraPad+2*a._offsetShift})})}},{"../../lib":709,"../../lib/setcursor":724,"../../plotly":743,"../../plots/cartesian":758,"../../plots/cartesian/axes":748,"../../plots/plots":811,"../color":590,"../dragelement":611,"../drawing":614,"./constants":662,d3:118}],665:[function(t,e,r){"use strict";e.exports={moduleType:"component",name:"rangeslider",schema:{layout:{"xaxis.rangeslider":t("./attributes")}},layoutAttributes:t("./attributes"),handleDefaults:t("./defaults"),calcAutorange:t("./calc_autorange"),draw:t("./draw")}},{"./attributes":660,"./calc_autorange":661,"./defaults":663,"./draw":664}],666:[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;e.exports={_isLinkedToArray:"shape",visible:{valType:"boolean",dflt:!0},type:{valType:"enumerated",values:["circle","rect","path","line"]},layer:{valType:"enumerated",values:["below","above"],dflt:"above"},xref:o({},n.xref,{}),x0:{valType:"any"},x1:{valType:"any"},yref:o({},n.yref,{}),y0:{valType:"any"},y1:{valType:"any"},path:{valType:"string"},opacity:{valType:"number",min:0,max:1,dflt:1},line:{color:i.color,width:i.width,dash:a},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)"}}},{"../../lib/extend":701,"../../traces/scatter/attributes":1008,"../annotations/attributes":579,"../drawing/attributes":613}],667:[function(t,e,r){"use strict";function n(t,e,r,n,i){var a="category"===t.type?Number:t.d2c;if(void 0!==e)return[a(e),a(r)];if(n){var l,u,c,h,f,d=1/0,p=-1/0,m=n.match(o.segmentRE);for("date"===t.type&&(a=s.decodeDate(a)),l=0;l<m.length;l++)u=m[l],void 0!==(c=i[u.charAt(0)].drawn)&&(!(h=m[l].substr(1).match(o.paramRE))||h.length<c||(f=a(h[c]),f<d&&(d=f),f>p&&(p=f)));return p>=d?[d,p]:void 0}}var i=t("../../lib"),a=t("../../plots/cartesian/axes"),o=t("./constants"),s=t("./helpers");e.exports=function(t){var e=t._fullLayout,r=i.filterVisible(e.shapes);if(r.length&&t._fullData.length)for(var s=0;s<r.length;s++){var l,u,c=r[s],h=c.line.width/2;"paper"!==c.xref&&(l=a.getFromId(t,c.xref),(u=n(l,c.x0,c.x1,c.path,o.paramIsX))&&a.expand(l,u,{ppad:h})),"paper"!==c.yref&&(l=a.getFromId(t,c.yref),(u=n(l,c.y0,c.y1,c.path,o.paramIsY))&&a.expand(l,u,{ppad:h}))}}},{"../../lib":709,"../../plots/cartesian/axes":748,"./constants":668,"./helpers":671}],668:[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}}},{}],669:[function(t,e,r){"use strict";var n=t("../../plots/array_container_defaults"),i=t("./shape_defaults");e.exports=function(t,e){n(t,e,{name:"shapes",handleItemDefaults:i})}},{"../../plots/array_container_defaults":745,"./shape_defaults":673}],670:[function(t,e,r){"use strict";function n(t){var e=t._fullLayout;e._shapeUpperLayer.selectAll("path").remove(),e._shapeLowerLayer.selectAll("path").remove(),e._shapeSubplotLayers.selectAll("path").remove();for(var r=0;r<e.shapes.length;r++)e.shapes[r].visible&&i(t,r)}function i(t,e){function r(r){var n={"data-index":e,"fill-rule":"evenodd",d:o(t,i)},s=i.line.width?i.line.color:"rgba(0,0,0,0)",l=r.append("path").attr(n).style("opacity",i.opacity).call(f.stroke,s).call(f.fill,i.fillcolor).call(d.dashLine,i.line.dash,i.line.width),u=(i.xref+i.yref).replace(/paper/g,"");l.call(d.setClipUrl,u?"clip"+t._fullLayout._uid+u:null),t._context.editable&&a(t,l,i,e)}t._fullLayout._paper.selectAll('.shapelayer [data-index="'+e+'"]').remove();var n=(t.layout.shapes||[])[e],i=t._fullLayout.shapes[e];if(n&&i.visible!==!1)if("below"!==i.layer)r(t._fullLayout._shapeUpperLayer);else if("paper"===i.xref||"paper"===i.yref)r(t._fullLayout._shapeLowerLayer);else{var s=t._fullLayout._plots[i.xref+i.yref];if(s){var l=s.mainplot||s;r(l.shapelayer)}else r(t._fullLayout._shapeLowerLayer)}}function a(t,e,r,n){function i(t){var r=Z.right-Z.left,n=Z.bottom-Z.top,i=t.clientX-Z.left,a=t.clientY-Z.top,o=r>Y&&n>X&&!t.shiftKey?p.getCursor(i/r,1-a/n):"move";m(e,o),G=o.split("-")[0]}function a(e){N=h.getFromId(t,r.xref),B=h.getFromId(t,r.yref),U=g.getDataToPixel(t,N),V=g.getDataToPixel(t,B,!0),q=g.getPixelToData(t,N),H=g.getPixelToData(t,B,!0);var a="shapes["+n+"]";"path"===r.type?(F=r.path,R=a+".path"):(v=U(r.x0),y=V(r.y0),b=U(r.x1),x=V(r.y1),_=a+".x0",w=a+".y0",M=a+".x1",k=a+".y1"),v<b?(S=v,z=a+".x0",O="x0",E=b,D=a+".x1",j="x1"):(S=b,z=a+".x1",O="x1",E=v,D=a+".x0",j="x0"),y<x?(A=y,L=a+".y0",I="y0",T=x,C=a+".y1",P="y1"):(A=x,L=a+".y1",I="y1",T=y,C=a+".y0",P="y0"),d={},i(e),W.moveFn="move"===G?c:f}function s(r){m(e),r&&u.relayout(t,d)}function c(n,i){if("path"===r.type){var a=function(t){return q(U(t)+n)};N&&"date"===N.type&&(a=g.encodeDate(a));var s=function(t){return H(V(t)+i)};B&&"date"===B.type&&(s=g.encodeDate(s)),r.path=l(F,a,s),d[R]=r.path}else d[_]=r.x0=q(v+n),d[w]=r.y0=H(y+i),d[M]=r.x1=q(b+n),d[k]=r.y1=H(x+i);e.attr("d",o(t,r))}function f(n,i){if("path"===r.type){var a=function(t){return q(U(t)+n)};N&&"date"===N.type&&(a=g.encodeDate(a));var s=function(t){return H(V(t)+i)};B&&"date"===B.type&&(s=g.encodeDate(s)),r.path=l(F,a,s),d[R]=r.path}else{var u=~G.indexOf("n")?A+i:A,c=~G.indexOf("s")?T+i:T,h=~G.indexOf("w")?S+n:S,f=~G.indexOf("e")?E+n:E;c-u>X&&(d[L]=r[I]=H(u),d[C]=r[P]=H(c)),f-h>Y&&(d[z]=r[O]=q(h),d[D]=r[j]=q(f))}e.attr("d",o(t,r))}var d,v,y,b,x,_,w,M,k,A,T,S,E,L,C,z,D,I,P,O,j,F,R,N,B,U,V,q,H,G,Y=10,X=10,W={setCursor:i,element:e.node(),prepFn:a,doneFn:s},Z=W.element.getBoundingClientRect();p.init(W)}function o(t,e){var r,n,i,a,o=e.type,l=h.getFromId(t,e.xref),u=h.getFromId(t,e.yref),c=t._fullLayout._size;if(l?(r=g.shapePositionToRange(l),n=function(t){return l._offset+l.r2p(r(t,!0))}):n=function(t){return c.l+c.w*t},u?(i=g.shapePositionToRange(u),a=function(t){return u._offset+u.r2p(i(t,!0))}):a=function(t){return c.t+c.h*(1-t)},"path"===o)return l&&"date"===l.type&&(n=g.decodeDate(n)),u&&"date"===u.type&&(a=g.decodeDate(a)),s(e.path,n,a);var f=n(e.x0),d=n(e.x1),p=a(e.y0),m=a(e.y1);if("line"===o)return"M"+f+","+p+"L"+d+","+m;if("rect"===o)return"M"+f+","+p+"H"+d+"V"+m+"H"+f+"Z";var v=(f+d)/2,y=(p+m)/2,b=Math.abs(v-f),x=Math.abs(y-p),_="A"+b+","+x,w=v+b+","+y;return"M"+w+_+" 0 1,1 "+v+","+(y-x)+_+" 0 0,1 "+w+"Z"}function s(t,e,r){return t.replace(v.segmentRE,function(t){var n=0,i=t.charAt(0),a=v.paramIsX[i],o=v.paramIsY[i],s=v.numParams[i],l=t.substr(1).replace(v.paramRE,function(t){return a[n]?t=e(t):o[n]&&(t=r(t)),n++,n>s&&(t="X"),t});return n>s&&(l=l.replace(/[\s,]*X.*/,""),c.log("Ignoring extra params in segment "+t)),i+l})}function l(t,e,r){return t.replace(v.segmentRE,function(t){var n=0,i=t.charAt(0),a=v.paramIsX[i],o=v.paramIsY[i],s=v.numParams[i];return i+t.substr(1).replace(v.paramRE,function(t){return n>=s?t:(a[n]?t=e(t):o[n]&&(t=r(t)),n++,t)})})}var u=t("../../plotly"),c=t("../../lib"),h=t("../../plots/cartesian/axes"),f=t("../color"),d=t("../drawing"),p=t("../dragelement"),m=t("../../lib/setcursor"),v=t("./constants"),g=t("./helpers");e.exports={draw:n,drawOne:i}},{"../../lib":709,"../../lib/setcursor":724,"../../plotly":743,"../../plots/cartesian/axes":748,"../color":590,"../dragelement":611,"../drawing":614,"./constants":668,"./helpers":671}],671:[function(t,e,r){"use strict";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.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){
56 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}},{}],672:[function(t,e,r){"use strict";var n=t("./draw");e.exports={moduleType:"component",name:"shapes",layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),calcAutorange:t("./calc_autorange"),draw:n.draw,drawOne:n.drawOne}},{"./attributes":666,"./calc_autorange":667,"./defaults":669,"./draw":670}],673:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axes"),a=t("./attributes"),o=t("./helpers");e.exports=function(t,e,r,s,l){function u(r,i){return n.coerce(t,e,a,r,i)}if(s=s||{},l=l||{},!u("visible",!l.itemIsNotPlainObject))return e;u("layer"),u("opacity"),u("fillcolor"),u("line.color"),u("line.width"),u("line.dash");for(var c=t.path?"path":"rect",h=u("type",c),f=["x","y"],d=0;d<2;d++){var p=f[d],m={_fullLayout:r},v=i.coerceRef(t,e,m,p,"","paper");if("path"!==h){var g,y,b;"paper"!==v?(g=i.getFromId(m,v),b=o.rangeToShapePosition(g),y=o.shapePositionToRange(g)):y=b=n.identity;var x=p+"0",_=p+"1",w=t[x],M=t[_];t[x]=y(t[x],!0),t[_]=y(t[_],!0),i.coercePosition(e,m,u,v,x,.25),i.coercePosition(e,m,u,v,_,.75),e[x]=b(e[x]),e[_]=b(e[_]),t[x]=w,t[_]=M}}return"path"===h?u("path"):n.noneOrAll(t,e,["x0","x1","y0","y1"]),e}},{"../../lib":709,"../../plots/cartesian/axes":748,"./attributes":666,"./helpers":671}],674:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../../plots/pad_attributes"),a=t("../../lib/extend").extendFlat,o=t("../../lib/extend").extendDeep,s=t("../../plots/animation_attributes"),l=t("./constants"),u={_isLinkedToArray:"step",method:{valType:"enumerated",values:["restyle","relayout","animate","update"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string"},value:{valType:"string"}};e.exports={_isLinkedToArray:"slider",visible:{valType:"boolean",dflt:!0},active:{valType:"number",min:0,dflt:0},steps:u,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:o({},i,{},{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:a({},n,{})},font:a({},n,{}),activebgcolor:{valType:"color",dflt:l.gripBgActiveColor},bgcolor:{valType:"color",dflt:l.railBgColor},bordercolor:{valType:"color",dflt:l.railBorderColor},borderwidth:{valType:"number",min:0,dflt:l.railBorderWidth},ticklen:{valType:"number",min:0,dflt:l.tickLength},tickcolor:{valType:"color",dflt:l.tickColor},tickwidth:{valType:"number",min:0,dflt:1},minorticklen:{valType:"number",min:0,dflt:l.minorTickLength}}},{"../../lib/extend":701,"../../plots/animation_attributes":744,"../../plots/font_attributes":772,"../../plots/pad_attributes":810,"./constants":675}],675:[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,fontSizeToHeight:1.3,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}},{}],676:[function(t,e,r){"use strict";function n(t,e,r){function n(r,n){return a.coerce(t,e,s,r,n)}n("visible",i(t,e).length>0)&&(n("active"),n("x"),n("y"),a.noneOrAll(t,e,["x","y"]),n("xanchor"),n("yanchor"),n("len"),n("lenmode"),n("pad.t"),n("pad.r"),n("pad.b"),n("pad.l"),a.coerceFont(n,"font",r.font),n("currentvalue.visible")&&(n("currentvalue.xanchor"),n("currentvalue.prefix"),n("currentvalue.suffix"),n("currentvalue.offset"),a.coerceFont(n,"currentvalue.font",e.font)),n("transition.duration"),n("transition.easing"),n("bgcolor"),n("activebgcolor"),n("bordercolor"),n("borderwidth"),n("ticklen"),n("tickwidth"),n("tickcolor"),n("minorticklen"))}function i(t,e){function r(t,e){return a.coerce(n,i,c,t,e)}for(var n,i,o=t.steps||[],s=e.steps=[],l=0;l<o.length;l++)n=o[l],i={},a.isPlainObject(n)&&Array.isArray(n.args)&&(r("method"),r("args"),r("label","step-"+l),r("value",i.label),s.push(i));return s}var a=t("../../lib"),o=t("../../plots/array_container_defaults"),s=t("./attributes"),l=t("./constants"),u=l.name,c=s.steps;e.exports=function(t,e){o(t,e,{name:u,handleItemDefaults:n})}},{"../../lib":709,"../../plots/array_container_defaults":745,"./attributes":674,"./constants":675}],677:[function(t,e,r){"use strict";function n(t){for(var e=t[E.name],r=[],n=0;n<e.length;n++){var i=e[n];i.visible&&i.steps.length&&r.push(i)}return r}function i(t){return t._index}function a(t,e){var r=A.tester.selectAll("g."+E.labelGroupClass).data(e.steps);r.enter().append("g").classed(E.labelGroupClass,!0);var n=0,i=0;if(r.each(function(t){var r=w.select(this),a=u(r,{step:t},e),o=a.node()&&A.bBox(a.node()).width||0;i=a.node()&&A.bBox(a.node()).height||0,n=Math.max(n,o)}),r.remove(),e.inputAreaWidth=Math.max(E.railWidth,E.gripHeight),e.currentValueMaxWidth=0,e.currentValueHeight=0,e.currentValueTotalHeight=0,e.currentvalue.visible){var a=A.tester.append("g");r.each(function(t){var r=s(a,e,t.label),n=r.node()&&A.bBox(r.node())||{width:0,height:0};e.currentValueMaxWidth=Math.max(e.currentValueMaxWidth,Math.ceil(n.width)),e.currentValueHeight=Math.max(e.currentValueHeight,Math.ceil(n.height))}),e.currentValueTotalHeight=e.currentValueHeight+e.currentvalue.offset,a.remove()}var o=t._fullLayout._size;e.lx=o.l+o.w*e.x,e.ly=o.t+o.h*(1-e.y),"fraction"===e.lenmode?e.outerLength=Math.round(o.w*e.len):e.outerLength=e.len,e.lenPad=Math.round(.5*E.gripWidth),e.inputAreaStart=0,e.inputAreaLength=Math.round(e.outerLength-e.pad.l-e.pad.r);var l=e.inputAreaLength-2*E.stepInset,c=l/(e.steps.length-1),h=n+E.labelPadding;e.labelStride=Math.max(1,Math.ceil(h/c)),e.labelHeight=i,e.height=e.currentValueTotalHeight+E.tickOffset+e.ticklen+E.labelOffset+e.labelHeight+e.pad.t+e.pad.b;var f="left";S.isRightAnchor(e)&&(e.lx-=e.outerLength,f="right"),S.isCenterAnchor(e)&&(e.lx-=e.outerLength/2,f="center");var d="top";S.isBottomAnchor(e)&&(e.ly-=e.height,d="bottom"),S.isMiddleAnchor(e)&&(e.ly-=e.height/2,d="middle"),e.outerLength=Math.ceil(e.outerLength),e.height=Math.ceil(e.height),e.lx=Math.round(e.lx),e.ly=Math.round(e.ly),M.autoMargin(t,E.autoMarginIdRoot+e._index,{x:e.x,y:e.y,l:e.outerLength*({right:1,center:.5}[f]||0),r:e.outerLength*({left:1,center:.5}[f]||0),b:e.height*({top:1,middle:.5}[d]||0),t:e.height*({bottom:1,middle:.5}[d]||0)})}function o(t,e,r){r.active>=r.steps.length&&(r.active=0),e.call(s,r).call(x,r).call(c,r).call(p,r).call(b,t,r).call(l,t,r),A.setTranslate(e,r.lx+r.pad.l,r.ly+r.pad.t),e.call(v,r,r.active/(r.steps.length-1),!1),e.call(s,r)}function s(t,e,r){if(e.currentvalue.visible){var n,i,a=t.selectAll("text").data([0]);switch(e.currentvalue.xanchor){case"right":n=e.inputAreaLength-E.currentValueInset-e.currentValueMaxWidth,i="left";break;case"center":n=.5*e.inputAreaLength,i="middle";break;default:n=E.currentValueInset,i="left"}a.enter().append("text").classed(E.labelClass,!0).classed("user-select-none",!0).attr("text-anchor",i);var o=e.currentvalue.prefix?e.currentvalue.prefix:"";if("string"==typeof r)o+=r;else{o+=e.steps[e.active].label}return e.currentvalue.suffix&&(o+=e.currentvalue.suffix),a.call(A.font,e.currentvalue.font).text(o).call(T.convertToTspans),A.setTranslate(a,n,e.currentValueHeight),a}}function l(t,e,r){var n=t.selectAll("rect."+E.gripRectClass).data([0]);n.enter().append("rect").classed(E.gripRectClass,!0).call(d,e,t,r).style("pointer-events","all"),n.attr({width:E.gripWidth,height:E.gripHeight,rx:E.gripRadius,ry:E.gripRadius}).call(k.stroke,r.bordercolor).call(k.fill,r.bgcolor).style("stroke-width",r.borderwidth+"px")}function u(t,e,r){var n=t.selectAll("text").data([0]);return n.enter().append("text").classed(E.labelClass,!0).classed("user-select-none",!0).attr("text-anchor","middle"),n.call(A.font,r.font).text(e.step.label).call(T.convertToTspans),n}function c(t,e){var r=t.selectAll("g."+E.labelsClass).data([0]);r.enter().append("g").classed(E.labelsClass,!0);var n=r.selectAll("g."+E.labelGroupClass).data(e.labelSteps);n.enter().append("g").classed(E.labelGroupClass,!0),n.exit().remove(),n.each(function(t){var r=w.select(this);r.call(u,t,e),A.setTranslate(r,g(e,t.fraction),E.tickOffset+e.ticklen+e.labelHeight+E.labelOffset+e.currentValueTotalHeight)})}function h(t,e,r,n,i){var a=Math.round(n*(r.steps.length-1));a!==r.active&&f(t,e,r,a,!0,i)}function f(t,e,r,n,i,a){var o=r.active;r._input.active=r.active=n;var l=r.steps[r.active];e.call(v,r,r.active/(r.steps.length-1),a),e.call(s,r),t.emit("plotly_sliderchange",{slider:r,step:r.steps[r.active],interaction:i,previousActive:o}),l&&l.method&&i&&(e._nextMethod?(e._nextMethod.step=l,e._nextMethod.doCallback=i,e._nextMethod.doTransition=a):(e._nextMethod={step:l,doCallback:i,doTransition:a},e._nextMethodRaf=window.requestAnimationFrame(function(){var r=e._nextMethod.step;r.method&&(M.executeAPICommand(t,r.method,r.args),e._nextMethod=null,e._nextMethodRaf=null)})))}function d(t,e,r){function n(){return r.data()[0]}var i=r.node(),a=w.select(e);t.on("mousedown",function(){var t=n();e.emit("plotly_sliderstart",{slider:t});var o=r.select("."+E.gripRectClass);w.event.stopPropagation(),w.event.preventDefault(),o.call(k.fill,t.activebgcolor);var s=y(t,w.mouse(i)[0]);h(e,r,t,s,!0),t._dragging=!0,a.on("mousemove",function(){var t=n(),a=y(t,w.mouse(i)[0]);h(e,r,t,a,!1)}),a.on("mouseup",function(){var t=n();t._dragging=!1,o.call(k.fill,t.bgcolor),a.on("mouseup",null),a.on("mousemove",null),e.emit("plotly_sliderend",{slider:t,step:t.steps[t.active]})})})}function p(t,e){var r=t.selectAll("rect."+E.tickRectClass).data(e.steps);r.enter().append("rect").classed(E.tickRectClass,!0),r.exit().remove(),r.attr({width:e.tickwidth+"px","shape-rendering":"crispEdges"}),r.each(function(t,r){var n=r%e.labelStride==0,i=w.select(this);i.attr({height:n?e.ticklen:e.minorticklen}).call(k.fill,e.tickcolor),A.setTranslate(i,g(e,r/(e.steps.length-1))-.5*e.tickwidth,(n?E.tickOffset:E.minorTickOffset)+e.currentValueTotalHeight)})}function m(t){t.labelSteps=[];for(var e=t.steps.length,r=0;r<e;r+=t.labelStride)t.labelSteps.push({fraction:r/(e-1),step:t.steps[r]})}function v(t,e,r,n){var i=t.select("rect."+E.gripRectClass),a=g(e,r);if(!e._invokingCommand){var o=i;n&&e.transition.duration>0&&(o=o.transition().duration(e.transition.duration).ease(e.transition.easing)),o.attr("transform","translate("+(a-.5*E.gripWidth)+","+e.currentValueTotalHeight+")")}}function g(t,e){return t.inputAreaStart+E.stepInset+(t.inputAreaLength-2*E.stepInset)*Math.min(1,Math.max(0,e))}function y(t,e){return Math.min(1,Math.max(0,(e-E.stepInset-t.inputAreaStart)/(t.inputAreaLength-2*E.stepInset-2*t.inputAreaStart)))}function b(t,e,r){var n=t.selectAll("rect."+E.railTouchRectClass).data([0]);n.enter().append("rect").classed(E.railTouchRectClass,!0).call(d,e,t,r).style("pointer-events","all"),n.attr({width:r.inputAreaLength,height:Math.max(r.inputAreaWidth,E.tickOffset+r.ticklen+r.labelHeight)}).call(k.fill,r.bgcolor).attr("opacity",0),A.setTranslate(n,0,r.currentValueTotalHeight)}function x(t,e){var r=t.selectAll("rect."+E.railRectClass).data([0]);r.enter().append("rect").classed(E.railRectClass,!0);var n=e.inputAreaLength-2*E.railInset;r.attr({width:n,height:E.railWidth,rx:E.railRadius,ry:E.railRadius,"shape-rendering":"crispEdges"}).call(k.stroke,e.bordercolor).call(k.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),A.setTranslate(r,E.railInset,.5*(e.inputAreaWidth-E.railWidth)+e.currentValueTotalHeight)}function _(t){for(var e=t._fullLayout._pushmargin||{},r=Object.keys(e),n=0;n<r.length;n++){var i=r[n];i.indexOf(E.autoMarginIdRoot)!==-1&&M.autoMargin(t,i)}}var w=t("d3"),M=t("../../plots/plots"),k=t("../color"),A=t("../drawing"),T=t("../../lib/svg_text_utils"),S=t("../legend/anchor_utils"),E=t("./constants");e.exports=function(t){var e=t._fullLayout,r=n(e),s=e._infolayer.selectAll("g."+E.containerClassName).data(r.length>0?[0]:[]);if(s.enter().append("g").classed(E.containerClassName,!0).style("cursor","ew-resize"),s.exit().remove(),s.exit().size()&&_(t),0!==r.length){var l=s.selectAll("g."+E.groupClassName).data(r,i);l.enter().append("g").classed(E.groupClassName,!0),l.exit().each(function(e){w.select(this).remove(),e._commandObserver.remove(),delete e._commandObserver,M.autoMargin(t,E.autoMarginIdRoot+e._index)});for(var u=0;u<r.length;u++){var c=r[u];a(t,c)}l.each(function(e){if(!(e.steps.length<2)){var r=w.select(this);m(e),M.manageCommandObserver(t,e,e.steps,function(e){var n=r.data()[0];n.active!==e.index&&(n._dragging||f(t,r,n,e.index,!1,!0))}),o(t,w.select(this),e)}})}}},{"../../lib/svg_text_utils":728,"../../plots/plots":811,"../color":590,"../drawing":614,"../legend/anchor_utils":640,"./constants":675,d3:118}],678:[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":674,"./constants":675,"./defaults":676,"./draw":677}],679:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("../../plotly"),o=t("../../plots/plots"),s=t("../../lib"),l=t("../drawing"),u=t("../color"),c=t("../../lib/svg_text_utils"),h=t("../../constants/interactions");(e.exports={}).draw=function(t,e,r){function f(t){s.syncOrAsync([d,p],t)}function d(e){return e.attr("transform",_?"rotate("+[_.rotate,x.x,x.y]+") translate(0, "+_.offset+")":null),e.style({"font-family":k,"font-size":n.round(A,2)+"px",fill:u.rgb(T),opacity:S*u.opacity(T),"font-weight":o.fontWeight}).attr(x).call(c.convertToTspans).attr(x),e.selectAll("tspan.line").attr(x),o.previousPromises(t)}function p(t){var e=n.select(t.node().parentNode);if(b&&b.selection&&b.side&&L){e.attr("transform",null);var r=0,a={left:"right",right:"left",top:"bottom",bottom:"top"}[b.side],o=["left","top"].indexOf(b.side)!==-1?-1:1,u=i(b.pad)?b.pad:2,c=l.bBox(e.node()),h={left:0,top:0,right:M.width,bottom:M.height},f=b.maxShift||(h[b.side]-c[b.side])*("left"===b.side||"top"===b.side?-1:1);if(f<0)r=f;else{var d=b.offsetLeft||0,p=b.offsetTop||0;c.left-=d,c.right-=d,c.top-=p,c.bottom-=p,b.selection.each(function(){var t=l.bBox(this);s.bBoxIntersect(c,t,u)&&(r=Math.max(r,o*(t[b.side]-c[a])+u))}),r=Math.min(f,r)}if(r>0||f<0){var m={left:[-r,0],right:[r,0],top:[0,-r],bottom:[0,r]}[b.side];e.attr("transform","translate("+m+")")}}}var m=r.propContainer,v=r.propName,g=r.traceIndex,y=r.dfltName,b=r.avoid||{},x=r.attributes,_=r.transform,w=r.containerGroup,M=t._fullLayout,k=m.titlefont.family,A=m.titlefont.size,T=m.titlefont.color,S=1,E=!1,L=m.title.trim();""===L&&(S=0),L.match(/Click to enter .+ title/)&&(S=.2,E=!0),w||(w=M._infolayer.selectAll(".g-"+e).data([0]),w.enter().append("g").classed("g-"+e,!0));var C=w.selectAll("text").data([0]);C.enter().append("text"),C.text(L).attr("class",e),C.attr({"data-unformatted":L}).call(f);var z="Click to enter "+y+" title";t._context.editable?(L?C.on(".opacity",null):function(){S=0,E=!0,L=z,C.attr({"data-unformatted":L}).text(L).on("mouseover.opacity",function(){n.select(this).transition().duration(h.SHOW_PLACEHOLDER).style("opacity",1)}).on("mouseout.opacity",function(){n.select(this).transition().duration(h.HIDE_PLACEHOLDER).style("opacity",0)})}(),C.call(c.makeEditable).on("edit",function(e){void 0!==g?a.restyle(t,v,e,g):a.relayout(t,v,e)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(f)}).on("input",function(t){this.text(t||" ").attr(x).selectAll("tspan.line").attr(x)})):L&&!L.match(/Click to enter .+ title/)||C.remove(),C.classed("js-placeholder",E)}},{"../../constants/interactions":689,"../../lib":709,"../../lib/svg_text_utils":728,"../../plotly":743,"../../plots/plots":811,"../color":590,"../drawing":614,d3:118,"fast-isnumeric":127}],680:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../color/attributes"),a=t("../../lib/extend").extendFlat,o=t("../../plots/pad_attributes"),s={_isLinkedToArray:"button",method:{valType:"enumerated",values:["restyle","relayout","animate","update"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""}};e.exports={_isLinkedToArray:"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:s,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({},o,{}),font:a({},n,{}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:i.borderLine},borderwidth:{valType:"number",min:0,dflt:1}}},{"../../lib/extend":701,"../../plots/font_attributes":772,"../../plots/pad_attributes":810,"../color/attributes":589}],681:[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,fontSizeToHeight:1.3,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF"}},{}],682:[function(t,e,r){"use strict";function n(t,e,r){function n(r,n){return a.coerce(t,e,s,r,n)}n("visible",i(t,e).length>0)&&(n("active"),n("direction"),n("type"),n("showactive"),n("x"),n("y"),a.noneOrAll(t,e,["x","y"]),n("xanchor"),n("yanchor"),n("pad.t"),n("pad.r"),n("pad.b"),n("pad.l"),a.coerceFont(n,"font",r.font),n("bgcolor",r.paper_bgcolor),n("bordercolor"),n("borderwidth"))}function i(t,e){function r(t,e){return a.coerce(n,i,c,t,e)}for(var n,i,o=t.buttons||[],s=e.buttons=[],l=0;l<o.length;l++)n=o[l],i={},a.isPlainObject(n)&&Array.isArray(n.args)&&(r("method"),r("args"),r("label"),i._index=l,s.push(i));return s}var a=t("../../lib"),o=t("../../plots/array_container_defaults"),s=t("./attributes"),l=t("./constants"),u=l.name,c=s.buttons;e.exports=function(t,e){o(t,e,{name:u,handleItemDefaults:n})}},{"../../lib":709,"../../plots/array_container_defaults":745,"./attributes":680,"./constants":681}],683:[function(t,e,r){"use strict";function n(t){for(var e=t[E.name],r=[],n=0;n<e.length;n++){var i=e[n];i.visible&&r.push(i)}return r}function i(t){return t._index}function a(t){return+t.attr(E.menuIndexAttrName)==-1}function o(t,e){return+t.attr(E.menuIndexAttrName)===e._index}function s(t,e,r,n,i,a,o,s){e._input.active=e.active=o,"buttons"===e.type?u(t,n,null,null,e):"dropdown"===e.type&&(i.attr(E.menuIndexAttrName,"-1"),l(t,n,i,a,e),s||u(t,n,i,a,e))}function l(t,e,r,n,i){var a=e.selectAll("g."+E.headerClassName).data([0]);a.enter().append("g").classed(E.headerClassName,!0).style("pointer-events","all");var s=i.active,l=i.buttons[s]||E.blankHeaderOpts,c={y:i.pad.t,yPad:0,x:i.pad.l,xPad:0,index:0},h={width:i.headerWidth,height:i.headerHeight};a.call(f,i,l).call(b,i,c,h);var d=e.selectAll("text."+E.headerArrowClassName).data([0]);d.enter().append("text").classed(E.headerArrowClassName,!0).classed("user-select-none",!0).attr("text-anchor","end").call(A.font,i.font).text("\u25bc"),d.attr({x:i.headerWidth-E.arrowOffsetX+i.pad.l,y:i.headerHeight/2+E.textOffsetY+i.pad.t}),a.on("click",function(){r.call(x),r.attr(E.menuIndexAttrName,o(r,i)?-1:String(i._index)),u(t,e,r,n,i)}),a.on("mouseover",function(){a.call(v)}),a.on("mouseout",function(){a.call(g,i)}),A.setTranslate(e,i.lx,i.ly)}function u(t,e,r,n,i){r||(r=e,r.attr("pointer-events","all"));var o=a(r)&&"buttons"!==i.type?[]:i.buttons,l="dropdown"===i.type?E.dropdownButtonClassName:E.buttonClassName,u=r.selectAll("g."+l).data(o),d=u.enter().append("g").classed(l,!0),p=u.exit();"dropdown"===i.type?(d.attr("opacity","0").transition().attr("opacity","1"),p.transition().attr("opacity","0").remove()):p.remove();var y=0,x=0,_=["up","down"].indexOf(i.direction)!==-1;"dropdown"===i.type&&(_?x=i.headerHeight+E.gapButtonHeader:y=i.headerWidth+E.gapButtonHeader),"dropdown"===i.type&&"up"===i.direction&&(x=-E.gapButtonHeader+E.gapButton-i.openHeight),"dropdown"===i.type&&"left"===i.direction&&(y=-E.gapButtonHeader+E.gapButton-i.openWidth);var k={x:i.lx+y+i.pad.l,y:i.ly+x+i.pad.t,yPad:E.gapButton,xPad:E.gapButton,index:0},A={l:k.x+i.borderwidth,t:k.y+i.borderwidth};u.each(function(a,o){var l=w.select(this);l.call(f,i,a).call(b,i,k),l.on("click",function(){w.event.defaultPrevented||(s(t,i,a,e,r,n,o),M.executeAPICommand(t,a.method,a.args),t.emit("plotly_buttonclicked",{menu:i,button:a,active:i.active}))}),l.on("mouseover",function(){l.call(v)}),l.on("mouseout",function(){l.call(g,i),u.call(m,i)})}),u.call(m,i),_?(A.w=Math.max(i.openWidth,i.headerWidth),A.h=k.y-A.t):(A.w=k.x-A.l,A.h=Math.max(i.openHeight,i.headerHeight)),A.direction=i.direction,n&&(u.size()?c(t,e,r,n,i,A):h(n))}function c(t,e,r,n,i,a){var o,s,l,u=i.direction,c="up"===u||"down"===u,h=i.active;if(c)for(s=0,l=0;l<h;l++)s+=i.heights[l]+E.gapButton;else for(o=0,l=0;l<h;l++)o+=i.widths[l]+E.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")}function h(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()})}function f(t,e,r){t.call(d,e).call(p,e,r)}function d(t,e){var r=t.selectAll("rect").data([0]);r.enter().append("rect").classed(E.itemRectClassName,!0).attr({rx:E.rx,ry:E.ry,"shape-rendering":"crispEdges"}),r.call(k.stroke,e.bordercolor).call(k.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px")}function p(t,e,r){var n=t.selectAll("text").data([0]);n.enter().append("text").classed(E.itemTextClassName,!0).classed("user-select-none",!0).attr("text-anchor","start"),n.call(A.font,e.font).text(r.label).call(T.convertToTspans)}function m(t,e){var r=e.active;t.each(function(t,n){var i=w.select(this);n===r&&e.showactive&&i.select("rect."+E.itemRectClassName).call(k.fill,E.activeColor)})}function v(t){t.select("rect."+E.itemRectClassName).call(k.fill,E.hoverColor)}function g(t,e){t.select("rect."+E.itemRectClassName).call(k.fill,e.bgcolor)}function y(t,e){e.width1=0,e.height1=0,e.heights=[],e.widths=[],e.totalWidth=0,e.totalHeight=0,e.openWidth=0,e.openHeight=0,e.lx=0,e.ly=0;var r=A.tester.selectAll("g."+E.dropdownButtonClassName).data(e.buttons);r.enter().append("g").classed(E.dropdownButtonClassName,!0);var n=["up","down"].indexOf(e.direction)!==-1;r.each(function(t,r){var i=w.select(this);i.call(f,e,t);var a=i.select("."+E.itemTextClassName),o=a.selectAll("tspan"),s=a.node()&&A.bBox(a.node()).width,l=Math.max(s+E.textPadX,E.minWidth),u=e.font.size*E.fontSizeToHeight,c=o[0].length||1,h=Math.max(u*c,E.minHeight)+E.textOffsetY;h=Math.ceil(h),l=Math.ceil(l),e.widths[r]=l,e.heights[r]=h,e.height1=Math.max(e.height1,h),e.width1=Math.max(e.width1,l),n?(e.totalWidth=Math.max(e.totalWidth,l),e.openWidth=e.totalWidth,e.totalHeight+=h+E.gapButton,e.openHeight+=h+E.gapButton):(e.totalWidth+=l+E.gapButton,e.openWidth+=l+E.gapButton,e.totalHeight=Math.max(e.totalHeight,h),e.openHeight=e.totalHeight)}),n?e.totalHeight-=E.gapButton:e.totalWidth-=E.gapButton,e.headerWidth=e.width1+E.arrowPadX,e.headerHeight=e.height1,"dropdown"===e.type&&(n?(e.width1+=E.arrowPadX,e.totalHeight=e.height1):e.totalWidth=e.width1,e.totalWidth+=E.arrowPadX),r.remove();var i=e.totalWidth+e.pad.l+e.pad.r,a=e.totalHeight+e.pad.t+e.pad.b,o=t._fullLayout._size;e.lx=o.l+o.w*e.x,e.ly=o.t+o.h*(1-e.y);var s="left";S.isRightAnchor(e)&&(e.lx-=i,s="right"),S.isCenterAnchor(e)&&(e.lx-=i/2,s="center");var l="top";S.isBottomAnchor(e)&&(e.ly-=a,l="bottom"),S.isMiddleAnchor(e)&&(e.ly-=a/2,l="middle"),e.totalWidth=Math.ceil(e.totalWidth),e.totalHeight=Math.ceil(e.totalHeight),e.lx=Math.round(e.lx),e.ly=Math.round(e.ly),M.autoMargin(t,E.autoMarginIdRoot+e._index,{x:e.x,y:e.y,l:i*({right:1,center:.5}[s]||0),r:i*({left:1,center:.5}[s]||0),b:a*({top:1,middle:.5}[l]||0),t:a*({bottom:1,middle:.5}[l]||0)})}function b(t,e,r,n){n=n||{};var i=t.select("."+E.itemRectClassName),a=t.select("."+E.itemTextClassName),o=a.selectAll("tspan"),s=e.borderwidth,l=r.index;A.setTranslate(t,s+r.x,s+r.y);var u=["up","down"].indexOf(e.direction)!==-1;i.attr({x:0,y:0,width:n.width||(u?e.width1:e.widths[l]),height:n.height||(u?e.heights[l]:e.height1)});var c=e.font.size*E.fontSizeToHeight,h=o[0].length||1,f=(h-1)*c/4,d={x:E.textOffsetX,y:e.heights[l]/2-f+E.textOffsetY};a.attr(d),o.attr(d),u?r.y+=e.heights[l]+r.yPad:r.x+=e.widths[l]+r.xPad,r.index++}function x(t){t.selectAll("g."+E.dropdownButtonClassName).remove()}function _(t){for(var e=t._fullLayout._pushmargin||{},r=Object.keys(e),n=0;n<r.length;n++){var i=r[n];i.indexOf(E.autoMarginIdRoot)!==-1&&M.autoMargin(t,i)}}var w=t("d3"),M=t("../../plots/plots"),k=t("../color"),A=t("../drawing"),T=t("../../lib/svg_text_utils"),S=t("../legend/anchor_utils"),E=t("./constants"),L=t("./scrollbox");e.exports=function(t){var e=t._fullLayout,r=n(e),a=e._infolayer.selectAll("g."+E.containerClassName).data(r.length>0?[0]:[]);if(a.enter().append("g").classed(E.containerClassName,!0).style("cursor","pointer"),a.exit().remove(),a.exit().size()&&_(t),0!==r.length){var c=a.selectAll("g."+E.headerGroupClassName).data(r,i);c.enter().append("g").classed(E.headerGroupClassName,!0);var h=a.selectAll("g."+E.dropdownButtonGroupClassName).data([0]);h.enter().append("g").classed(E.dropdownButtonGroupClassName,!0).style("pointer-events","all");for(var f=0;f<r.length;f++){var d=r[f];y(t,d)}var p="updatemenus"+e._uid,m=new L(t,h,p);c.enter().size()&&h.call(x).attr(E.menuIndexAttrName,"-1"),c.exit().each(function(e){w.select(this).remove(),h.call(x).attr(E.menuIndexAttrName,"-1"),M.autoMargin(t,E.autoMarginIdRoot+e._index)}),c.each(function(e){var r=w.select(this),n="dropdown"===e.type?h:null;M.manageCommandObserver(t,e,e.buttons,function(i){s(t,e,e.buttons[i.index],r,n,m,i.index,!0)}),"dropdown"===e.type?(l(t,r,h,m,e),o(h,e)&&u(t,r,h,m,e)):u(t,r,null,null,e)})}}},{"../../lib/svg_text_utils":728,"../../plots/plots":811,"../color":590,"../drawing":614,"../legend/anchor_utils":640,"./constants":681,"./scrollbox":685,d3:118}],684:[function(t,e,r){arguments[4][678][0].apply(r,arguments)},{"./attributes":680,"./constants":681,"./defaults":682,"./draw":683,dup:678}],685:[function(t,e,r){"use strict";function n(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})}e.exports=n;var i=t("d3"),a=t("../color"),o=t("../drawing"),s=t("../../lib");n.barWidth=2,n.barLength=20,n.barRadius=2,n.barPad=1,n.barColor="#808BA4",n.prototype.enable=function(t,e,r){var s=this.gd._fullLayout,l=s.width,u=s.height;this.position=t;var c,h,f,d,p=this.position.l,m=this.position.w,v=this.position.t,g=this.position.h,y=this.position.direction,b="down"===y,x="left"===y,_="right"===y,w="up"===y,M=m,k=g;b||x||_||w||(this.position.direction="down",b=!0),b||w?(c=p,h=c+M,b?(f=v,d=Math.min(f+k,u),k=d-f):(d=v+k,f=Math.max(d-k,0),k=d-f)):(f=v,d=f+k,x?(h=p+M,c=Math.max(h-M,0),M=h-c):(c=p,h=Math.min(c+M,l),M=h-c)),this._box={l:c,t:f,w:M,h:k};var A=m>M,T=n.barLength+2*n.barPad,S=n.barWidth+2*n.barPad,E=p,L=v+g;L+S>u&&(L=u-S);var C=this.container.selectAll("rect.scrollbar-horizontal").data(A?[0]:[]);C.exit().on(".drag",null).remove(),C.enter().append("rect").classed("scrollbar-horizontal",!0).call(a.fill,n.barColor),A?(this.hbar=C.attr({rx:n.barRadius,ry:n.barRadius,x:E,y:L,width:T,height:S}),this._hbarXMin=E+T/2,this._hbarTranslateMax=M-T):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var z=g>k,D=n.barWidth+2*n.barPad,I=n.barLength+2*n.barPad,P=p+m,O=v;P+D>l&&(P=l-D);var j=this.container.selectAll("rect.scrollbar-vertical").data(z?[0]:[]);j.exit().on(".drag",null).remove(),j.enter().append("rect").classed("scrollbar-vertical",!0).call(a.fill,n.barColor),z?(this.vbar=j.attr({rx:n.barRadius,ry:n.barRadius,x:P,y:O,width:D,height:I}),this._vbarYMin=O+I/2,this._vbarTranslateMax=k-I):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var F=this.id,R=c-.5,N=z?h+D+.5:h+.5,B=f-.5,U=A?d+S+.5:d+.5,V=s._topdefs.selectAll("#"+F).data(A||z?[0]:[]);if(V.exit().remove(),V.enter().append("clipPath").attr("id",F).append("rect"),A||z?(this._clipRect=V.select("rect").attr({x:Math.floor(R),y:Math.floor(B),width:Math.ceil(N)-Math.floor(R),height:Math.ceil(U)-Math.floor(B)}),this.container.call(o.setClipUrl,F),this.bg.attr({x:p,y:v,width:m,height:g})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(o.setClipUrl,null),delete this._clipRect),A||z){var q=i.behavior.drag().on("dragstart",function(){i.event.sourceEvent.preventDefault()}).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(q);var H=i.behavior.drag().on("dragstart",function(){i.event.sourceEvent.preventDefault(),i.event.sourceEvent.stopPropagation()}).on("drag",this._onBarDrag.bind(this));A&&this.hbar.on(".drag",null).call(H),z&&this.vbar.on(".drag",null).call(H)}this.setTranslate(e,r)},n.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(o.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)},n.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=i.event.dx),this.vbar&&(e-=i.event.dy),this.setTranslate(t,e)},n.prototype._onBoxWheel=function(){
57 var t=this.translateX,e=this.translateY;this.hbar&&(t+=i.event.deltaY),this.vbar&&(e+=i.event.deltaY),this.setTranslate(t,e)},n.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var r=t+this._hbarXMin,n=r+this._hbarTranslateMax;t=(s.constrain(i.event.x,r,n)-r)/(n-r)*(this.position.w-this._box.w)}if(this.vbar){var a=e+this._vbarYMin,o=a+this._vbarTranslateMax;e=(s.constrain(i.event.y,a,o)-a)/(o-a)*(this.position.h-this._box.h)}this.setTranslate(t,e)},n.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=s.constrain(t||0,0,r),e=s.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(o.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(o.setTranslate,t+i*this._hbarTranslateMax,e)}if(this.vbar){var a=e/n;this.vbar.call(o.setTranslate,t,e+a*this._vbarTranslateMax)}}},{"../../lib":709,"../color":590,"../drawing":614,d3:118}],686:[function(t,e,r){"use strict";e.exports={solid:[1],dot:[1,1],dash:[4,1],longdash:[8,1],dashdot:[4,1,1,1],longdashdot:[8,1,1,1]}},{}],687:[function(t,e,r){"use strict";e.exports={solid:[[],0],dot:[[.5,1],200],dash:[[.5,1],50],longdash:[[.5,1],10],dashdot:[[.5,.625,.875,1],50],longdashdot:[[.5,.7,.8,1],10]}},{}],688:[function(t,e,r){"use strict";e.exports={circle:"\u25cf","circle-open":"\u25cb",square:"\u25a0","square-open":"\u25a1",diamond:"\u25c6","diamond-open":"\u25c7",cross:"+",x:"\u274c"}},{}],689:[function(t,e,r){"use strict";e.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DBLCLICKDELAY:300}},{}],690:[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}},{}],691:[function(t,e,r){"use strict";e.exports={entityToUnicode:{mu:"\u03bc",amp:"&",lt:"<",gt:">",nbsp:"\xa0",times:"\xd7",plusmn:"\xb1",deg:"\xb0"},unicodeToEntity:{"&":"amp","<":"lt",">":"gt",'"':"quot","'":"#x27","/":"#x2F"}}},{}],692:[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}},{}],693:[function(t,e,r){"use strict";var n=t("./plotly");r.version="1.27.1",t("es6-promise").polyfill(),t("../build/plotcss"),t("./fonts/mathjax_config"),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.extendTraces=n.extendTraces,r.prependTraces=n.prependTraces,r.addTraces=n.addTraces,r.deleteTraces=n.deleteTraces,r.moveTraces=n.moveTraces,r.purge=n.purge,r.setPlotConfig=t("./plot_api/set_plot_config"),r.register=t("./plot_api/register"),r.toImage=t("./plot_api/to_image"),r.downloadImage=t("./snapshot/download"),r.validate=t("./plot_api/validate"),r.addFrames=n.addFrames,r.deleteFrames=n.deleteFrames,r.animate=n.animate,r.register(t("./traces/scatter")),r.register([t("./components/fx"),t("./components/legend"),t("./components/annotations"),t("./components/shapes"),t("./components/images"),t("./components/updatemenus"),t("./components/sliders"),t("./components/rangeslider"),t("./components/rangeselector")]),r.Icons=t("../build/ploticon"),r.Plots=n.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,"../build/ploticon":2,"./components/annotations":586,"./components/fx":631,"./components/images":639,"./components/legend":647,"./components/rangeselector":659,"./components/rangeslider":665,"./components/shapes":672,"./components/sliders":678,"./components/updatemenus":684,"./fonts/mathjax_config":694,"./lib/queue":721,"./plot_api/plot_schema":737,"./plot_api/register":738,"./plot_api/set_plot_config":739,"./plot_api/to_image":741,"./plot_api/validate":742,"./plotly":743,"./snapshot":831,"./snapshot/download":828,"./traces/scatter":1018,d3:118,"es6-promise":124}],694:[function(t,e,r){"use strict";"undefined"!=typeof MathJax?(r.MathJax=!0,MathJax.Hub.Config({messageStyle:"none",skipStartupTypeset:!0,displayAlign:"left",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]}}),MathJax.Hub.Configured()):r.MathJax=!1},{}],695:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){Array.isArray(t)&&(e[r]=t[n])}},{}],696:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../constants/numerical").BADNUM;e.exports=function(t){return"string"==typeof t&&(t=t.replace(/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g,"")),n(t)?Number(t):i}},{"../constants/numerical":690,"fast-isnumeric":127}],697:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("tinycolor2"),a=t("../components/colorscale/get_scale"),o=(Object.keys(t("../components/colorscale/scales")),t("./nested_property")),s=/^([2-9]|[1-9][0-9]+)$/;r.valObjects={data_array:{coerceFunction:function(t,e,r){Array.isArray(t)?e.set(t):void 0!==r&&e.set(r)}},enumerated:{coerceFunction:function(t,e,r,n){n.coerceNumber&&(t=+t),n.values.indexOf(t)===-1?e.set(r):e.set(t)}},boolean:{coerceFunction:function(t,e,r){t===!0||t===!1?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;n.strict!==!0&&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)}},colorscale:{coerceFunction:function(t,e,r){e.set(a(t,r))}},angle:{coerceFunction:function(t,e,r){"auto"===t?e.set("auto"):n(t)?(Math.abs(t)>180&&(t-=360*Math.round(t/360)),e.set(+t)):e.set(r)}},subplotid:{coerceFunction:function(t,e,r){var n=r.length;if("string"==typeof t&&t.substr(0,n)===r&&s.test(t.substr(n)))return void e.set(t);e.set(r)},validateFunction:function(t,e){var r=e.dflt,n=r.length;return t===r||"string"==typeof t&&!(t.substr(0,n)!==r||!s.test(t.substr(n)))}},flaglist:{coerceFunction:function(t,e,r,n){if("string"!=typeof t)return void e.set(r);if((n.extras||[]).indexOf(t)!==-1)return void e.set(t);for(var i=t.split("+"),a=0;a<i.length;){var o=i[a];n.flags.indexOf(o)===-1||i.indexOf(o)<a?i.splice(a,1):a++}i.length?e.set(i.join("+")):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){if(!Array.isArray(t))return void e.set(n);var a=i.items,o=[];n=Array.isArray(n)?n:[];for(var s=0;s<a.length;s++)r.coerce(t,o,a,"["+s+"]",n[s]);e.set(o)},validateFunction:function(t,e){if(!Array.isArray(t))return!1;var n=e.items;if(!e.freeLength&&t.length!==n.length)return!1;for(var i=0;i<t.length;i++){if(!r.validate(t[i],e.items[i]))return!1}return!0}}},r.coerce=function(t,e,n,i,a){var s=o(n,i).get(),l=o(t,i),u=o(e,i),c=l.get();return void 0===a&&(a=s.dflt),s.arrayOk&&Array.isArray(c)?(u.set(c),c):(r.valObjects[s.valType].coerceFunction(c,u,a,s),u.get())},r.coerce2=function(t,e,n,i,a){var s=o(t,i),l=r.coerce(t,e,n,i,a),u=s.get();return void 0!==u&&null!==u&&l},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.validate=function(t,e){var n=r.valObjects[e.valType];if(e.arrayOk&&Array.isArray(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}},{"../components/colorscale/get_scale":602,"../components/colorscale/scales":608,"./nested_property":715,"fast-isnumeric":127,tinycolor2:526}],698:[function(t,e,r){"use strict";function n(t){return t&&M.componentsRegistry.calendars&&"string"==typeof t&&"gregorian"!==t}function i(t,e){return String(t+Math.pow(10,e)).substr(1)}function a(t,e,r,n,a){if((e||r||n||a)&&(t+=" "+i(e,2)+":"+i(r,2),(n||a)&&(t+=":"+i(n,2),a))){for(var o=4;a%10==0;)o-=1,a/=10;t+="."+i(a,o)}return t}function o(t,e,r){t=t.replace(z,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(n(r))try{t=M.getComponentMethod("calendars","worldCalFmt")(t,e,r)}catch(t){return"Invalid"}return k(t)(i)}function s(t,e){var r=m(t+.05,y),n=i(Math.floor(r/b),2)+":"+i(m(Math.floor(r/x),60),2);if("M"!==e){d(e)||(e=0);var a=Math.min(m(t/_,60),D[e]),o=(100+a).toFixed(e).substr(1);e>0&&(o=o.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+o}return n}function l(t){return t.formatDate("yyyy")}function u(t){return t.formatDate("M yyyy")}function c(t){return t.formatDate("M d")}function h(t){return t.formatDate("M d, yyyy")}var f=t("d3"),d=t("fast-isnumeric"),p=t("./loggers").error,m=t("./mod"),v=t("../constants/numerical"),g=v.BADNUM,y=v.ONEDAY,b=v.ONEHOUR,x=v.ONEMIN,_=v.ONESEC,w=v.EPOCHJD,M=t("../registry"),k=f.time.format.utc,A=(new Date).getFullYear()-70;r.dateTick0=function(t,e){return n(t)?e?M.getComponentMethod("calendars","CANONICAL_SUNDAY")[t]:M.getComponentMethod("calendars","CANONICAL_TICK")[t]:e?"2000-01-02":"2000-01-01"},r.dfltRange=function(t){return n(t)?M.getComponentMethod("calendars","DFLTRANGE")[t]:["2000-01-01","2001-01-01"]},r.isJSDate=function(t){return"object"==typeof t&&null!==t&&"function"==typeof t.getTime};var T,S;r.dateTime2ms=function(t,e){if(r.isJSDate(t))return t=Number(t)-t.getTimezoneOffset()*x,t>=T&&t<=S?t:g;if("string"!=typeof t&&"number"!=typeof t)return g;t=String(t);var i=n(e),a=t.charAt(0);!i||"G"!==a&&"g"!==a||(t=t.substr(1),e="");var o=i&&"chinese"===e.substr(0,7),s=t.match(o?/^\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:/^\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);if(!s)return g;var l=s[1],u=s[3]||"1",c=Number(s[5]||1),h=Number(s[7]||0),f=Number(s[9]||0),d=Number(s[11]||0);if(i){if(2===l.length)return g;l=Number(l);var p;try{var m=M.getComponentMethod("calendars","getCal")(e);if(o){var v="i"===u.charAt(u.length-1);u=parseInt(u,10),p=m.newDate(l,m.toMonthIndex(l,u,v),c)}else p=m.newDate(l,Number(u),c)}catch(t){return g}return p?(p.toJD()-w)*y+h*b+f*x+d*_:g}l=2===l.length?(Number(l)+2e3-A)%100+A:Number(l),u-=1;var k=new Date(Date.UTC(2e3,u,c,h,f));return k.setUTCFullYear(l),k.getUTCMonth()!==u?g:k.getUTCDate()!==c?g:k.getTime()+d*_},T=r.MIN_MS=r.dateTime2ms("-9999"),S=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(t,e){return r.dateTime2ms(t,e)!==g};var E=90*y,L=3*b,C=5*x;r.ms2DateTime=function(t,e,r){if("number"!=typeof t||!(t>=T&&t<=S))return g;e||(e=0);var i,o,s,l,u,c,h=Math.floor(10*m(t+.05,1)),f=Math.round(t-h/10);if(n(r)){var d=Math.floor(f/y)+w,p=Math.floor(m(t,y));try{i=M.getComponentMethod("calendars","getCal")(r).fromJD(d).formatDate("yyyy-mm-dd")}catch(t){i=k("G%Y-%m-%d")(new Date(f))}if("-"===i.charAt(0))for(;i.length<11;)i="-0"+i.substr(1);else for(;i.length<10;)i="0"+i;o=e<E?Math.floor(p/b):0,s=e<E?Math.floor(p%b/x):0,l=e<L?Math.floor(p%x/_):0,u=e<C?p%_*10+h:0}else c=new Date(f),i=k("%Y-%m-%d")(c),o=e<E?c.getUTCHours():0,s=e<E?c.getUTCMinutes():0,l=e<L?c.getUTCSeconds():0,u=e<C?10*c.getUTCMilliseconds()+h:0;return a(i,o,s,l,u)},r.ms2DateTimeLocal=function(t){if(!(t>=T+y&&t<=S-y))return g;var e=Math.floor(10*m(t+.05,1)),r=new Date(Math.round(t-e/10));return a(f.time.format("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+e)},r.cleanDate=function(t,e,i){if(r.isJSDate(t)||"number"==typeof t){if(n(i))return p("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,i))return p("unrecognized date",t),e;return t};var z=/%\d?f/g,D=[59,59.9,59.99,59.999,59.9999],I=k("%Y"),P=k("%b %Y"),O=k("%b %-d"),j=k("%b %-d, %Y");r.formatDate=function(t,e,r,i){var a,f;if(i=n(i)&&i,e)return o(e,t,i);if(i)try{var d=Math.floor((t+.05)/y)+w,p=M.getComponentMethod("calendars","getCal")(i).fromJD(d);"y"===r?f=l(p):"m"===r?f=u(p):"d"===r?(a=l(p),f=c(p)):(a=h(p),f=s(t,r))}catch(t){return"Invalid"}else{var m=new Date(Math.floor(t+.05));"y"===r?f=I(m):"m"===r?f=P(m):"d"===r?(a=I(m),f=O(m)):(a=j(m),f=s(t,r))}return f+(a?"\n"+a:"")};var F=3*y;r.incrementMonth=function(t,e,r){r=n(r)&&r;var i=m(t,y);if(t=Math.round(t-i),r)try{var a=Math.round(t/y)+w,o=M.getComponentMethod("calendars","getCal")(r),s=o.fromJD(a);return e%12?o.add(s,e,"m"):o.add(s,e/12,"y"),(s.toJD()-w)*y+i}catch(e){p("invalid ms "+t+" in calendar "+r)}var l=new Date(t+F);return l.setUTCMonth(l.getUTCMonth()+e)+i-F},r.findExactDates=function(t,e){for(var r,i,a=0,o=0,s=0,l=0,u=n(e)&&M.getComponentMethod("calendars","getCal")(e),c=0;c<t.length;c++)if(i=t[c],d(i)){if(!(i%y))if(u)try{r=u.fromJD(i/y+w),1===r.day()?1===r.month()?a++:o++:s++}catch(t){}else r=new Date(i),1===r.getUTCDate()?0===r.getUTCMonth()?a++:o++:s++}else l++;o+=a,s+=o;var h=t.length-l;return{exactYears:a/h,exactMonths:o/h,exactDays:s/h}}},{"../constants/numerical":690,"../registry":826,"./loggers":712,"./mod":714,d3:118,"fast-isnumeric":127}],699:[function(t,e,r){"use strict";e.exports=function(t,e){return Array.isArray(t)||(t=[]),t.length=e,t}},{}],700:[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=a._events[e];if(!o)return n;"function"==typeof o&&(o=[o]);for(var s=o.pop(),l=0;l<o.length;l++)o[l](r);return i=s(r),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:125}],701:[function(t,e,r){"use strict";function n(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}function i(t,e,r,s){var l,u,c,h,f,d,p=t[0],m=t.length;if(2===m&&o(p)&&o(t[1])&&0===p.length){if(n(t[1],p))return p;p.splice(0,p.length)}for(var v=1;v<m;v++){l=t[v];for(u in l)c=p[u],h=l[u],s&&o(h)?p[u]=h:e&&h&&(a(h)||(f=o(h)))?(f?(f=!1,d=c&&o(c)?c:[]):d=c&&a(c)?c:{},p[u]=i([d,h],e,r,s)):(void 0!==h||r)&&(p[u]=h)}return p}var a=t("./is_plain_object.js"),o=Array.isArray;r.extendFlat=function(){return i(arguments,!1,!1,!1)},r.extendDeep=function(){return i(arguments,!0,!1,!1)},r.extendDeepAll=function(){return i(arguments,!0,!0,!1)},r.extendDeepNoArrays=function(){return i(arguments,!0,!1,!0)}},{"./is_plain_object.js":711}],702:[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}},{}],703:[function(t,e,r){"use strict";e.exports=function(t){for(var e=[],r=0;r<t.length;r++){var n=t[r];n.visible===!0&&e.push(n)}return e}},{}],704:[function(t,e,r){"use strict";function n(t,e){return(0,l[t])(e)}function i(t){for(var e=0;e<s.length;e++){var r=s[e];if(new RegExp(a[r]).test(t.trim().toLowerCase()))return r}return o.warn("Unrecognized country name: "+t+"."),!1}var a=t("country-regex"),o=t("../lib"),s=Object.keys(a),l={"ISO-3":o.identity,"USA-states":o.identity,"country names":i};r.locationToFeature=function(t,e,r){var i=n(t,e);if(i){for(var a=0;a<r.length;a++){var s=r[a];if(s.id===i)return s}o.warn(["Location with id",i,"does not have a matching topojson feature at this resolution."].join(" "))}return!1}},{"../lib":709,"country-regex":103}],705:[function(t,e,r){"use strict";var n=t("../constants/numerical").BADNUM;r.calcTraceToLineCoords=function(t){for(var e=t[0].trace,r=e.connectgaps,i=[],a=[],o=0;o<t.length;o++){var s=t[o],l=s.lonlat;l[0]!==n?a.push(l):!r&&a.length>0&&(i.push(a),a=[])}return a.length>0&&i.push(a),i},r.makeLine=function(t,e){var r={};return r=1===t.length?{type:"LineString",coordinates:t[0]}:{type:"MultiLineString",coordinates:t},e&&(r.trace=e),r},r.makePolygon=function(t,e){var r={};if(1===t.length)r={type:"Polygon",coordinates:t};else{for(var n=new Array(t.length),i=0;i<t.length;i++)n[i]=[t[i]];r={type:"MultiPolygon",coordinates:n}}return e&&(r.trace=e),r},r.makeBlank=function(){return{type:"Point",coordinates:[]}}},{"../constants/numerical":690}],706:[function(t,e,r){"use strict";function n(t,e){var r=t;return r[3]*=e,r}function i(t){if(s(t))return h;var e=l(t);return e.length?e:h}function a(t){return s(t)?t:f}function o(t,e,r){var o,s,c,d,p,m=t.color,v=Array.isArray(m),g=Array.isArray(e),y=[];if(o=void 0!==t.colorscale?u.makeColorScaleFunc(u.extractScale(t.colorscale,t.cmin,t.cmax)):i,s=v?function(t,e){return void 0===t[e]?h:l(o(t[e]))}:i,c=g?function(t,e){return void 0===t[e]?f:a(t[e])}:a,v||g)for(var b=0;b<r;b++)d=s(m,b),p=c(e,b),y[b]=n(d,p);else y=n(l(m),e);return y}var s=t("fast-isnumeric"),l=t("color-rgba"),u=t("../components/colorscale"),c=t("../components/color/attributes").defaultLine,h=l(c),f=1;e.exports=o},{"../components/color/attributes":589,"../components/colorscale":604,"color-rgba":91,"fast-isnumeric":127}],707:[function(t,e,r){"use strict";function n(t){for(var e=0;(e=t.indexOf("<sup>",e))>=0;){var r=t.indexOf("</sup>",e);if(r<e)break;t=t.slice(0,e)+l(t.slice(e+5,r))+t.slice(r+6)}return t}function i(t){return t.replace(/\<br\>/g,"\n")}function a(t){return t.replace(/\<.*\>/g,"")}function o(t){for(var e=u.entityToUnicode,r=0;(r=t.indexOf("&",r))>=0;){var n=t.indexOf(";",r);if(n<r)r+=1;else{var i=e[t.slice(r+1,n)];t=i?t.slice(0,r)+i+t.slice(n+1):t.slice(0,r)+t.slice(n+1)}}return t}function s(t){return""+o(a(n(i(t))))}var l=t("superscript-text"),u=t("../constants/string_mappings");e.exports=s},{"../constants/string_mappings":691,"superscript-text":522}],708:[function(t,e,r){"use strict";e.exports=function(t){return t}},{}],709:[function(t,e,r){"use strict";var n=t("d3"),i=e.exports={};i.nestedProperty=t("./nested_property"),i.isPlainObject=t("./is_plain_object"),i.isArray=t("./is_array"),i.mod=t("./mod"),i.toLogRange=t("./to_log_range"),i.relinkPrivateKeys=t("./relink_private"),i.ensureArray=t("./ensure_array");var a=t("./coerce");i.valObjects=a.valObjects,i.coerce=a.coerce,i.coerce2=a.coerce2,i.coerceFont=a.coerceFont,i.validate=a.validate;var o=t("./dates");i.dateTime2ms=o.dateTime2ms,i.isDateTime=o.isDateTime,i.ms2DateTime=o.ms2DateTime,i.ms2DateTimeLocal=o.ms2DateTimeLocal,i.cleanDate=o.cleanDate,i.isJSDate=o.isJSDate,i.formatDate=o.formatDate,i.incrementMonth=o.incrementMonth,i.dateTick0=o.dateTick0,i.dfltRange=o.dfltRange,i.findExactDates=o.findExactDates,i.MIN_MS=o.MIN_MS,i.MAX_MS=o.MAX_MS;var s=t("./search");i.findBin=s.findBin,i.sorterAsc=s.sorterAsc,i.sorterDes=s.sorterDes,i.distinctVals=s.distinctVals,i.roundUp=s.roundUp;var l=t("./stats");i.aggNums=l.aggNums,i.len=l.len,i.mean=l.mean,i.variance=l.variance,i.stdev=l.stdev,i.interp=l.interp;var u=t("./matrix");i.init2dArray=u.init2dArray,i.transposeRagged=u.transposeRagged,i.dot=u.dot,i.translationMatrix=u.translationMatrix,i.rotationMatrix=u.rotationMatrix,i.rotationXYMatrix=u.rotationXYMatrix,i.apply2DTransform=u.apply2DTransform,i.apply2DTransform2=u.apply2DTransform2;var c=t("./extend");i.extendFlat=c.extendFlat,i.extendDeep=c.extendDeep,i.extendDeepAll=c.extendDeepAll,i.extendDeepNoArrays=c.extendDeepNoArrays;var h=t("./loggers");i.log=h.log,i.warn=h.warn,i.error=h.error,i.notifier=t("./notifier"),i.filterUnique=t("./filter_unique"),i.filterVisible=t("./filter_visible"),i.pushUnique=t("./push_unique"),i.cleanNumber=t("./clean_number"),i.noop=t("./noop"),i.identity=t("./identity"),i.swapAttrs=function(t,e,r,n){r||(r="x"),n||(n="y");for(var a=0;a<e.length;a++){var o=e[a],s=i.nestedProperty(t,o.replace("?",r)),l=i.nestedProperty(t,o.replace("?",n)),u=s.get();s.set(l.get()),l.set(u)}},i.pauseEvent=function(t){return t.stopPropagation&&t.stopPropagation(),t.preventDefault&&t.preventDefault(),t.cancelBubble=!0,!1},i.constrain=function(t,e,r){return e>r?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},i.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},i.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},i.randstr=function t(e,r,n){if(n||(n=16),void 0===r&&(r=24),r<=0)return"0";var i,a,o,s=Math.log(Math.pow(2,r))/Math.log(n),l="";for(i=2;1/0===s;i*=2)s=Math.log(Math.pow(2,r/i))/Math.log(n)*i;var u=s-Math.floor(s);for(i=0;i<Math.floor(s);i++)o=Math.floor(Math.random()*n).toString(n),l=o+l;u&&(a=Math.pow(n,u),o=Math.floor(Math.random()*a).toString(n),l=o+l);var c=parseInt(l,n);return e&&e.indexOf(l)>-1||1/0!==c&&c>=Math.pow(2,r)?t(e,r,n):l},i.OptionControl=function(t,e){t||(t={}),e||(e="opt");var r={};return r.optionList=[],r._newoption=function(n){n[e]=t,r[n.name]=n,r.optionList.push(n)},r["_"+e]=t,r},i.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,i<-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},i.syncOrAsync=function(t,e,r){function n(){return i.syncOrAsync(t,e,r)}for(var a,o;t.length;)if(o=t.splice(0,1)[0],(a=o(e))&&a.then)return a.then(n).then(void 0,i.promiseError);return r&&r(e)},i.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},i.noneOrAll=function(t,e,r){if(t){var n,i,a=!1,o=!0;for(n=0;n<r.length;n++)i=t[r[n]],void 0!==i&&null!==i?a=!0:o=!1;if(a&&!o)for(n=0;n<r.length;n++)t[r[n]]=e[r[n]]}},i.mergeArray=function(t,e,r){if(Array.isArray(t))for(var n=Math.min(t.length,e.length),i=0;i<n;i++)e[i][r]=t[i]},i.getTargetArray=function(t,e){var r=e.target;if("string"==typeof r&&r){var n=i.nestedProperty(t,r).get();return!!Array.isArray(n)&&n}return!!Array.isArray(r)&&r},i.minExtend=function(t,e){var r={};"object"!=typeof e&&(e={});var n,a,o,s=Object.keys(t);for(n=0;n<s.length;n++)a=s[n],o=t[a],"_"!==a.charAt(0)&&"function"!=typeof o&&("module"===a?r[a]=o:Array.isArray(o)?r[a]=o.slice(0,3):r[a]=o&&"object"==typeof o?i.minExtend(t[a],e[a]):o);for(s=Object.keys(e),n=0;n<s.length;n++)a=s[n],"object"==typeof(o=e[a])&&a in r&&"object"==typeof r[a]||(r[a]=o);return r},i.titleCase=function(t){return t.charAt(0).toUpperCase()+t.substr(1)},i.containsAny=function(t,e){for(var r=0;r<e.length;r++)if(t.indexOf(e[r])!==-1)return!0;return!1},i.getPlotDiv=function(t){for(;t&&t.removeAttribute;t=t.parentNode)if(i.isPlotDiv(t))return t},i.isPlotDiv=function(t){var e=n.select(t);return e.node()instanceof HTMLElement&&e.size()&&e.classed("js-plotly-plot")},i.removeElement=function(t){var e=t&&t.parentNode;e&&e.removeChild(t)},i.addStyleRule=function(t,e){if(!i.styleSheet){var r=document.createElement("style");r.appendChild(document.createTextNode("")),document.head.appendChild(r),i.styleSheet=r.sheet}var n=i.styleSheet;n.insertRule?n.insertRule(t+"{"+e+"}",0):n.addRule?n.addRule(t,e,0):i.warn("addStyleRule failed")},i.isIE=function(){return void 0!==window.navigator.msSaveBlob},i.isD3Selection=function(t){return t&&"function"==typeof t.classed},i.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};i.expandObjectPaths=function(t){var e,r,n,a,o,s,l;if("object"==typeof t&&!Array.isArray(t))for(r in t)t.hasOwnProperty(r)&&((e=r.match(/^([^\[\.]+)\.(.+)?/))?(a=t[r],n=e[1],delete t[r],t[n]=i.extendDeepNoArrays(t[n]||{},i.objectFromPath(r,i.expandObjectPaths(a))[n])):(e=r.match(/^([^\.]+)\[([0-9]+)\](\.)?(.+)?/))?(a=t[r],n=e[1],o=parseInt(e[2]),delete t[r],t[n]=t[n]||[],"."===e[3]?(l=e[4],s=t[n][o]=t[n][o]||{},i.extendDeepNoArrays(s,i.objectFromPath(l,i.expandObjectPaths(a)))):t[n][o]=i.expandObjectPaths(a)):t[r]=i.expandObjectPaths(t[r]));return t},i.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}},{"./clean_number":696,"./coerce":697,"./dates":698,"./ensure_array":699,"./extend":701,"./filter_unique":702,"./filter_visible":703,"./identity":708,"./is_array":710,"./is_plain_object":711,"./loggers":712,"./matrix":713,"./mod":714,"./nested_property":715,"./noop":716,"./notifier":717,"./push_unique":720,"./relink_private":722,"./search":723,"./stats":726,"./to_log_range":729,d3:118}],710:[function(t,e,r){"use strict";var n="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer:{isView:function(){return!1}};e.exports=function(t){return Array.isArray(t)||n.isView(t)}},{}],711:[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}},{}],712:[function(t,e,r){"use strict";function n(t,e){if(t.apply)t.apply(t,e);else for(var r=0;r<e.length;r++)t(e[r])}var i=t("../plot_api/plot_config"),a=e.exports={};a.log=function(){if(i.logging>1){for(var t=["LOG:"],e=0;e<arguments.length;e++)t.push(arguments[e]);n(console.trace||console.log,t)}},a.warn=function(){if(i.logging>0){for(var t=["WARN:"],e=0;e<arguments.length;e++)t.push(arguments[e]);n(console.trace||console.log,t)}},a.error=function(){if(i.logging>0){for(var t=["ERROR:"],e=0;e<arguments.length;e++)t.push(arguments[e]);n(console.error,t)}}},{"../plot_api/plot_config":736}],713:[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)))}}},{}],714:[function(t,e,r){"use strict";e.exports=function(t,e){var r=t%e;return r<0?r+e:r}},{}],715:[function(t,e,r){"use strict";function n(t,e){return function(){var r,i,a,o,s,l=t;for(o=0;o<e.length-1;o++){if((r=e[o])===-1){for(i=!0,a=[],s=0;s<l.length;s++)a[s]=n(l[s],e.slice(o+1))(),a[s]!==a[0]&&(i=!1);return i?a[0]:a}if("number"==typeof r&&!d(l))return;if("object"!=typeof(l=l[r])||null===l)return}if("object"==typeof l&&null!==l&&null!==(a=l[e[o]]))return a}}function i(t,e){if(!c(t)||p(t)&&"]"===e.charAt(e.length-1)||e.match(g)&&void 0!==t)return!1;if(!d(t))return!0;if(e.match(v))return!0;var r=m(e);return r&&""===r.index}function a(t,e,r){return function(n){var a,c,h=t,f="",p=[[t,f]],m=i(n,r);for(c=0;c<e.length-1;c++){if("number"==typeof(a=e[c])&&!d(h))throw"array index but container is not an array";if(a===-1){if(m=!s(h,e.slice(c+1),n,r))break;return}if(!l(h,a,e[c+1],m))break;if("object"!=typeof(h=h[a])||null===h)throw"container is not an object";f=o(f,a),p.push([h,f])}m?(c===e.length-1&&delete h[e[c]],u(p)):h[e[c]]=n}}function o(t,e){var r=e;return f(e)?r="["+e+"]":t&&(r="."+e),t+r}function s(t,e,r,n){var o,s=d(r),u=!0,c=r,h=n.replace("-1",0),f=!s&&i(r,h),p=e[0];for(o=0;o<t.length;o++)h=n.replace("-1",o),s&&(c=r[o%r.length],f=i(c,h)),f&&(u=!1),l(t,o,p,f)&&a(t[o],e,n.replace("-1",o))(c);return u}function l(t,e,r,n){if(void 0===t[e]){if(n)return!1;t[e]="number"==typeof r?[]:{}}return!0}function u(t){var e,r,n,a,s,l;for(e=t.length-1;e>=0;e--){if(n=t[e][0],a=t[e][1],l=!1,d(n))for(r=n.length-1;r>=0;r--)i(n[r],o(a,r))?l?n[r]=void 0:n.pop():l=!0;else if("object"==typeof n&&null!==n)for(s=Object.keys(n),l=!1,r=s.length-1;r>=0;r--)i(n[s[r]],o(a,s[r]))?delete n[s[r]]:l=!0;if(l)return}}function c(t){return void 0===t||null===t||"object"==typeof t&&(d(t)?!t.length:!Object.keys(t).length)}function h(t,e,r){return{set:function(){throw"bad container"},get:function(){},astr:e,parts:r,obj:t}}var f=t("fast-isnumeric"),d=t("./is_array"),p=t("./is_plain_object"),m=t("../plot_api/container_array_match");e.exports=function(t,e){if(f(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,l=e.split(".");s<l.length;){if(r=String(l[s]).match(/^([^\[\]]*)((\[\-?[0-9]*\])+)$/)){if(r[1])l[s]=r[1];else{if(0!==s)throw"bad property string";l.splice(0,1)}for(i=r[2].substr(1,r[2].length-2).split("]["),o=0;o<i.length;o++)s++,l.splice(s,0,Number(i[o]))}s++}return"object"!=typeof t?h(t,e,l):{set:a(t,l,e),get:n(t,l),astr:e,parts:l,obj:t}};var v=/(^|\.)((domain|range)(\.[xy])?|args|parallels)$/,g=/(^|\.)args\[/},{"../plot_api/container_array_match":732,"./is_array":710,"./is_plain_object":711,"fast-isnumeric":127}],716:[function(t,e,r){"use strict";e.exports=function(){}},{}],717:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=[];e.exports=function(t,e){function r(t){t.duration(700).style("opacity",0).each("end",function(t){var e=a.indexOf(t);e!==-1&&a.splice(e,1),n.select(this).remove()})}if(a.indexOf(t)===-1){a.push(t);var o=1e3;i(e)?o=e:"long"===e&&(o=3e3);var s=n.select("body").selectAll(".plotly-notifier").data([0]);s.enter().append("div").classed("plotly-notifier",!0);s.selectAll(".notifier-note").data(a).enter().append("div").classed("notifier-note",!0).style("opacity",0).each(function(t){var e=n.select(this);e.append("button").classed("notifier-close",!0).html("&times;").on("click",function(){e.transition().call(r)});for(var i=e.append("p"),a=t.split(/<br\s*\/?>/g),s=0;s<a.length;s++)s&&i.append("br"),i.append("span").text(a[s]);e.transition().duration(700).style("opacity",1).transition().delay(o).call(r)})}}},{d3:118,"fast-isnumeric":127}],718:[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":724}],719:[function(t,e,r){"use strict";var n=t("./matrix").dot,i=t("../constants/numerical").BADNUM,a=e.exports={};a.tester=function(t){function e(t,e){var r=t[0],n=t[1]
58 ;return!(r===i||r<a||r>o||n===i||n<s||n>l)&&(!e||!c(t))}function r(t,e){var r=t[0],u=t[1];if(r===i||r<a||r>o||u===i||u<s||u>l)return!1;var c,h,f,d,p,m=n.length,v=n[0][0],g=n[0][1],y=0;for(c=1;c<m;c++)if(h=v,f=g,v=n[c][0],g=n[c][1],d=Math.min(h,v),!(r<d||r>Math.max(h,v)||u>Math.max(f,g)))if(u<Math.min(f,g))r!==d&&y++;else{if(p=v===h?u:f+(r-h)*(g-f)/(v-h),u===p)return 1!==c||!e;u<=p&&r!==d&&y++}return y%2==1}var n=t.slice(),a=n[0][0],o=a,s=n[0][1],l=s;n.push(n[0]);for(var u=1;u<n.length;u++)a=Math.min(a,n[u][0]),o=Math.max(o,n[u][0]),s=Math.min(s,n[u][1]),l=Math.max(l,n[u][1]);var c,h=!1;return 5===n.length&&(n[0][0]===n[1][0]?n[2][0]===n[3][0]&&n[0][1]===n[3][1]&&n[1][1]===n[2][1]&&(h=!0,c=function(t){return t[0]===n[0][0]}):n[0][1]===n[1][1]&&n[2][1]===n[3][1]&&n[0][0]===n[3][0]&&n[1][0]===n[2][0]&&(h=!0,c=function(t){return t[1]===n[0][1]})),{xmin:a,xmax:o,ymin:s,ymax:l,pts:n,contains:h?e:r,isRect:h}};var o=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),h=Math.sqrt(c),f=[-u[1]/h,u[0]/h];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,f))>i)return!0;return!1};a.filter=function(t,e){function r(r){t.push(r);var s=n.length,l=i;n.splice(a+1);for(var u=l+1;u<t.length;u++)(u===t.length-1||o(t,l,u+1,e))&&(n.push(t[u]),n.length<s-2&&(i=u,a=n.length-1),l=u)}var n=[t[0]],i=0,a=0;if(t.length>1){r(t.pop())}return{addPt:r,raw:t,filtered:n}}},{"../constants/numerical":690,"./matrix":713}],720:[function(t,e,r){"use strict";e.exports=function(t,e){if(e instanceof RegExp){var r,n=e.toString();for(r=0;r<t.length;r++)if(t[r]instanceof RegExp&&t[r].toString()===n)return t;t.push(e)}else e&&t.indexOf(e)===-1&&t.push(e);return t}},{}],721:[function(t,e,r){"use strict";function n(t,e){for(var r,n=[],a=0;a<e.length;a++)r=e[a],n[a]=r===t?r:"object"==typeof r?Array.isArray(r)?i.extendDeep([],r):i.extendDeepAll({},r):r;return n}var i=t("../lib"),a=t("../plot_api/plot_config"),o={};o.add=function(t,e,r,n,i){var o,s;if(t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},s=t.undoQueue.index,t.autoplay)return void(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(i)),t.undoQueue.queue.length>a.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--)},o.startSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0},o.stopSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1},o.undo=function(t){var e,r;if(t.framework&&t.framework.isPolar)return void t.framework.undo();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++)o.plotDo(t,e.undo.calls[r],e.undo.args[r]);t.undoQueue.inSequence=!1,t.autoplay=!1}},o.redo=function(t){var e,r;if(t.framework&&t.framework.isPolar)return void t.framework.redo();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++)o.plotDo(t,e.redo.calls[r],e.redo.args[r]);t.undoQueue.inSequence=!1,t.autoplay=!1,t.undoQueue.index++}},o.plotDo=function(t,e,r){t.autoplay=!0,r=n(t,r),e.apply(null,r)},e.exports=o},{"../lib":709,"../plot_api/plot_config":736}],722:[function(t,e,r){"use strict";var n=t("./is_array"),i=t("./is_plain_object");e.exports=function t(e,r){for(var a=Object.keys(r||{}),o=0;o<a.length;o++){var s=a[o],l=r[s],u=e[s];if("_"===s.charAt(0)||"function"==typeof l){if(s in e)continue;e[s]=l}else if(n(l)&&n(u)&&i(l[0]))for(var c=0;c<l.length;c++)i(l[c])&&i(u[c])&&t(u[c],l[c]);else i(l)&&i(u)&&(t(u,l),Object.keys(u).length||delete e[s])}}},{"./is_array":710,"./is_plain_object":711}],723:[function(t,e,r){"use strict";function n(t,e){return t<e}function i(t,e){return t<=e}function a(t,e){return t>e}function o(t,e){return t>=e}var s=t("fast-isnumeric"),l=t("./loggers");r.findBin=function(t,e,r){if(s(e.start))return r?Math.ceil((t-e.start)/e.size)-1:Math.floor((t-e.start)/e.size);var u,c,h=0,f=e.length,d=0;for(c=e[e.length-1]>=e[0]?r?n:i:r?o:a;h<f&&d++<100;)u=Math.floor((h+f)/2),c(e[u],t)?h=u+1:f=u;return d>90&&l.log("Long binary search..."),h-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;)n=u((i+a)/2),e[n]<=t?i=n+s:a=n-l;return e[i]}},{"./loggers":712,"fast-isnumeric":127}],724:[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)}},{}],725:[function(t,e,r){"use strict";var n=t("../components/color"),i=function(){};e.exports=function(t){for(var e in t)"function"==typeof t[e]&&(t[e]=i);t.destroy=function(){t.container.parentNode.removeChild(t.container)};var r=document.createElement("div");return r.textContent="Webgl is not supported by your browser - visit http://get.webgl.org for more info",r.style.cursor="pointer",r.style.fontSize="24px",r.style.color=n.defaults[0],t.container.appendChild(r),t.container.style.background="#FFFFFF",t.container.onclick=function(){window.open("http://get.webgl.org")},!1}},{"../components/color":590}],726:[function(t,e,r){"use strict";var n=t("fast-isnumeric");r.aggNums=function(t,e,i,a){var o,s;if(a||(a=i.length),n(e)||(e=!1),Array.isArray(i[0])){for(s=new Array(a),o=0;o<a;o++)s[o]=r.aggNums(t,e,i[o]);i=s}for(o=0;o<a;o++)n(e)?n(i[o])&&(e=t(+e,+i[o])):e=i[o];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.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.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)]}},{"fast-isnumeric":127}],727:[function(t,e,r){"use strict";function n(t){var e=i(t);return e.length?e:[0,0,0,1]}var i=t("color-rgba");e.exports=n},{"color-rgba":91}],728:[function(t,e,r){"use strict";function n(t,e){return t.node().getBoundingClientRect()[e]}function i(t){return t.replace(/(<|&lt;|&#60;)/g,"\\lt ").replace(/(>|&gt;|&#62;)/g,"\\gt ")}function a(t,e,r){var n="math-output-"+d.randstr([],64),a=f.select("body").append("div").attr({id:n}).style({visibility:"hidden",position:"absolute"}).style({"font-size":e.fontSize+"px"}).text(i(t));MathJax.Hub.Queue(["Typeset",MathJax.Hub,a.node()],function(){var e=f.select("body").select("#MathJax_SVG_glyphs");if(a.select(".MathJax_SVG").empty()||!a.select("svg").node())d.log("There was an error in the tex syntax.",t),r();else{var n=a.select("svg").node().getBoundingClientRect();r(a.select(".MathJax_SVG"),e,n)}a.remove()})}function o(t,e){for(var r=t||"",n=0;n<e.length;n++){var i=e[n];r=r.replace(i.regExp,i.sub)}return r}function s(t){return o(t,x)}function l(t){return o(t,_)}function u(t){t=s(t).replace(w," ");for(var e=t.split(M).map(function(t){var e=t.match(k),n=e&&e[2].toLowerCase(),i=v[n];if(void 0!==i){if(e[1])return("a"===n?"</a>":"</tspan>")+(g[n]||"");if("br"===n)return"<br>";var a,o=e[4];if("a"===n){var s=o&&o.match(T),u=s&&(s[3]||s[4]);if(a="<a",u){var c=document.createElement("a");c.href=u,y.indexOf(c.protocol)!==-1&&(a+=' xlink:show="new" xlink:href="'+l(u)+'"')}}else a="<tspan","sup"!==n&&"sub"!==n||(a="&#x200b;"+a);var h=o&&o.match(A),f=h&&(h[3]||h[4]);return f?(f=l(f.replace(S,"$1 fill:")),i&&(f+=";"+i)):i&&(f=i),f?a+' style="'+f+'">':a+">"}return r.xml_entity_encode(t).replace(/</g,"&lt;")}),n=[],i=e.indexOf("<br>");i>0;i=e.indexOf("<br>",i+1))n.push(i);var a=0;n.forEach(function(t){for(var r=t+a,n=e.slice(0,r),i="",o=n.length-1;o>=0;o--){var s=n[o].match(/<(\/?).*>/i);if(s&&"<br>"!==n[o]){s[1]||(i=n[o]);break}}i&&(e.splice(r+1,0,i),e.splice(r,0,"</tspan>"),a+=2)});var o=e.join(""),u=o.split(/<br>/gi);return u.length>1&&(e=u.map(function(t,e){return'<tspan class="line" dy="'+1.3*e+'em">'+t+"</tspan>"})),e.join("")}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}}var h,f=t("d3"),d=t("../lib"),p=t("../constants/xmlns_namespaces"),m=t("../constants/string_mappings");r.getDOMParser=function(){if(h)return h;if(window.DOMParser)return h=new window.DOMParser;throw new Error("Cannot initialize DOMParser")},f.selection.prototype.appendSVG=function(t){for(var e=['<svg xmlns="',p.svg,'" ','xmlns:xlink="',p.xlink,'">',t,"</svg>"].join(""),n=r.getDOMParser(),i=n.parseFromString(e,"application/xml"),a=i.documentElement.firstChild;a;)this.node().appendChild(this.node().ownerDocument.importNode(a,!0)),a=a.nextSibling;return i.querySelector("parsererror")?(d.log(i.querySelector("parsererror div").textContent),null):f.select(this.node().lastChild)},r.html_entity_decode=function(t){var e=f.select("body").append("div").style({display:"none"}).html(""),r=t.replace(/(&[^;]*;)/gi,function(t){return"&lt;"===t?"&#60;":"&rt;"===t?"&#62;":t.indexOf("<")!==-1||t.indexOf(">")!==-1?"":e.html(t).text()});return e.remove(),r},r.xml_entity_encode=function(t){return t.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&amp;")},r.convertToTspans=function(t,e){function r(){h.empty()||(p=s.attr("class")+"-math",h.select("svg."+p).remove()),t.text("").style({visibility:"inherit","white-space":"pre"}),c=t.appendSVG(o),c||t.text(i),t.select("a").size()&&t.style("pointer-events","all"),e&&e.call(s)}var i=t.text(),o=u(i),s=t,l=!s.attr("data-notex")&&o.match(/([^$]*)([$]+[^$]*[$]+)([^$]*)/),c=i,h=f.select(s.node().parentNode);if(!h.empty()){var p=s.attr("class")?s.attr("class").split(" ")[0]:"text";p+="-math",h.selectAll("svg."+p).remove(),h.selectAll("g."+p+"-group").remove(),t.style({visibility:null});for(var m=t.node();m&&m.removeAttribute;m=m.parentNode)m.removeAttribute("data-bb");if(l){var v=d.getPlotDiv(s.node());(v&&v._promises||[]).push(new Promise(function(t){s.style({visibility:"hidden"});var i={fontSize:parseInt(s.style("font-size"),10)};a(l[2],i,function(i,a,o){h.selectAll("svg."+p).remove(),h.selectAll("g."+p+"-group").remove();var l=i&&i.select("svg");if(!l||!l.node())return r(),void t();var u=h.append("g").classed(p+"-group",!0).attr({"pointer-events":"none"});u.node().appendChild(l.node()),a&&a.node()&&l.node().insertBefore(a.node().cloneNode(!0),l.node().firstChild),l.attr({class:p,height:o.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var c=s.style("fill")||"black";l.select("g").attr({fill:c,stroke:c});var f=n(l,"width"),d=n(l,"height"),m=+s.attr("x")-f*{start:0,middle:.5,end:1}[s.attr("text-anchor")||"start"],v=parseInt(s.style("font-size"),10)||n(s,"height"),g=-v/4;"y"===p[0]?(u.attr({transform:"rotate("+[-90,+s.attr("x"),+s.attr("y")]+") translate("+[-f/2,g-d/2]+")"}),l.attr({x:+s.attr("x"),y:+s.attr("y")})):"l"===p[0]?l.attr({x:s.attr("x"),y:g-d/2}):"a"===p[0]?l.attr({x:0,y:g}):l.attr({x:m,y:+s.attr("y")+g-d/2}),e&&e.call(s,u),t(u)})}))}else r();return t}};var v={sup:'font-size:70%" dy="-0.6em',sub:'font-size:70%" dy="0.3em',b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",br:"",em:"font-style:italic;font-weight:bold"},g={sup:'<tspan dy="0.42em">&#x200b;</tspan>',sub:'<tspan dy="-0.21em">&#x200b;</tspan>'},y=["http:","https:","mailto:"],b=new RegExp("</?("+Object.keys(v).join("|")+")( [^>]*)?/?>","g"),x=Object.keys(m.entityToUnicode).map(function(t){return{regExp:new RegExp("&"+t+";","g"),sub:m.entityToUnicode[t]}}),_=Object.keys(m.unicodeToEntity).map(function(t){return{regExp:new RegExp(t,"g"),sub:"&"+m.unicodeToEntity[t]+";"}}),w=/(\r\n?|\n)/g,M=/(<[^<>]*>)/,k=/<(\/?)([^ >]*)(\s+(.*))?>/i,A=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,T=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,S=/(^|;)\s*color:/;r.plainText=function(t){return(t||"").replace(b," ")},r.makeEditable=function(t,e,r){function n(){a(),o.style({opacity:0});var t,e=u.attr("class");(t=e?"."+e.split(" ")[0]+"-math-group":"[class*=-math-group]")&&f.select(o.node().parentNode).select(t).style({opacity:0})}function i(t){var e=t.node(),r=document.createRange();r.selectNodeContents(e);var n=window.getSelection();n.removeAllRanges(),n.addRange(r),e.focus()}function a(){var t=d.getPlotDiv(o.node()),e=f.select(t),n=e.select(".svg-container"),a=n.append("div");a.classed("plugin-editable editable",!0).style({position:"absolute","font-family":o.style("font-family")||"Arial","font-size":o.style("font-size")||12,color:r.fill||o.style("fill")||"black",opacity:1,"background-color":r.background||"transparent",outline:"#ffffff33 1px solid",margin:[-parseFloat(o.style("font-size"))/8+1,0,0,-1].join("px ")+"px",padding:"0","box-sizing":"border-box"}).attr({contenteditable:!0}).text(r.text||o.attr("data-unformatted")).call(c(o,n,r)).on("blur",function(){t._editing=!1,o.text(this.textContent).style({opacity:1});var e,r=f.select(this).attr("class");(e=r?"."+r.split(" ")[0]+"-math-group":"[class*=-math-group]")&&f.select(o.node().parentNode).select(e).style({opacity:0});var n=this.textContent;f.select(this).transition().duration(0).remove(),f.select(document).on("mouseup",null),s.edit.call(o,n)}).on("focus",function(){var e=this;t._editing=!0,f.select(document).on("mouseup",function(){if(f.event.target===e)return!1;document.activeElement===a.node()&&a.node().blur()})}).on("keyup",function(){27===f.event.which?(t._editing=!1,o.style({opacity:1}),f.select(this).style({opacity:0}).on("blur",function(){return!1}).transition().remove(),s.cancel.call(o,this.textContent)):(s.input.call(o,this.textContent),f.select(this).call(c(o,n,r)))}).on("keydown",function(){13===f.event.which&&this.blur()}).call(i)}r||(r={});var o=this,s=f.dispatch("edit","input","cancel"),l=f.select(this.node()).style({"pointer-events":"all"}),u=e||l;return e&&l.style({"pointer-events":"none"}),r.immediate?n():u.on("click",n),f.rebind(this,s,"on")}},{"../constants/string_mappings":691,"../constants/xmlns_namespaces":692,"../lib":709,d3:118}],729:[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":127}],730:[function(t,e,r){"use strict";var n=e.exports={},i=t("../plots/geo/constants").locationmodeToLayer,a=t("topojson-client").feature;n.getTopojsonName=function(t){return[t.scope.replace(/ /g,"-"),"_",t.resolution.toString(),"m"].join("")},n.getTopojsonPath=function(t,e){return t+e+".json"},n.getTopojsonFeatures=function(t,e){var r=i[t.locationmode],n=e.objects[r];return a(e,n).features}},{"../plots/geo/constants":774,"topojson-client":528}],731:[function(t,e,r){"use strict";function n(t,e){for(var r=new Float32Array(e),n=0;n<e;n++)r[n]=t[n];return r}function i(t,e){for(var r=new Float64Array(e),n=0;n<e;n++)r[n]=t[n];return r}e.exports=function(t,e){if(t instanceof Float32Array)return n(t,e);if(t instanceof Float64Array)return i(t,e);throw new Error("This array type is not yet supported by `truncate`.")}},{}],732:[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":826}],733:[function(t,e,r){"use strict";function n(t,e){var r=t[e],n=e.charAt(0);r&&"paper"!==r&&(t[e]=f.cleanId(r,n))}function i(t){var e="middle",r="center";return t.indexOf("top")!==-1?e="top":t.indexOf("bottom")!==-1&&(e="bottom"),t.indexOf("left")!==-1?r="left":t.indexOf("right")!==-1&&(r="right"),e+" "+r}function a(t,e){return e in t&&"object"==typeof t[e]&&0===Object.keys(t[e]).length}function o(t){var e=t.search(p);if(e>0)return t.substr(0,e)}var s=t("fast-isnumeric"),l=t("gl-mat4/fromQuat"),u=t("../registry"),c=t("../lib"),h=t("../plots/plots"),f=t("../plots/cartesian/axes"),d=t("../components/color");r.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||void 0===t)throw new Error("DOM element provided is null or undefined");return t},r.clearPromiseQueue=function(t){Array.isArray(t._promises)&&t._promises.length>0&&c.log("Clearing previous rejected promises from queue."),t._promises=[]},r.cleanLayout=function(t){var e,r;t||(t={}),t.xaxis1&&(t.xaxis||(t.xaxis=t.xaxis1),delete t.xaxis1),t.yaxis1&&(t.yaxis||(t.yaxis=t.yaxis1),delete t.yaxis1);var i=f.list({_fullLayout:t});for(e=0;e<i.length;e++){var o=i[e];o.anchor&&"free"!==o.anchor&&(o.anchor=f.cleanId(o.anchor)),o.overlaying&&(o.overlaying=f.cleanId(o.overlaying)),o.type||(o.isdate?o.type="date":o.islog?o.type="log":o.isdate===!1&&o.islog===!1&&(o.type="linear")),"withzero"!==o.autorange&&"tozero"!==o.autorange||(o.autorange=!0,o.rangemode="tozero"),delete o.islog,delete o.isdate,delete o.categories,a(o,"domain")&&delete o.domain,void 0!==o.autotick&&(void 0===o.tickmode&&(o.tickmode=o.autotick?"auto":"linear"),delete o.autotick)}var s=Array.isArray(t.annotations)?t.annotations.length:0;for(e=0;e<s;e++){var u=t.annotations[e];c.isPlainObject(u)&&(u.ref&&("paper"===u.ref?(u.xref="paper",u.yref="paper"):"data"===u.ref&&(u.xref="x",u.yref="y"),delete u.ref),n(u,"xref"),n(u,"yref"))}var p=Array.isArray(t.shapes)?t.shapes.length:0;for(e=0;e<p;e++){var m=t.shapes[e];c.isPlainObject(m)&&(n(m,"xref"),n(m,"yref"))}var v=t.legend;v&&(v.x>3?(v.x=1.02,v.xanchor="left"):v.x<-2&&(v.x=-.02,v.xanchor="right"),v.y>3?(v.y=1.02,v.yanchor="bottom"):v.y<-2&&(v.y=-.02,v.yanchor="top")),"rotate"===t.dragmode&&(t.dragmode="orbit"),t.scene1&&(t.scene||(t.scene=t.scene1),delete t.scene1);var g=h.getSubplotIds(t,"gl3d");for(e=0;e<g.length;e++){var y=t[g[e]],b=y.cameraposition;if(Array.isArray(b)&&4===b[0].length){var x=b[0],_=b[1],w=b[2],M=l([],x),k=[];for(r=0;r<3;++r)k[r]=_[e]+w*M[2+4*r];y.camera={eye:{x:k[0],y:k[1],z:k[2]},center:{x:_[0],y:_[1],z:_[2]},up:{x:M[1],y:M[5],z:M[9]}},delete y.cameraposition}}return d.clean(t),t},r.cleanData=function(t,e){for(var n=[],o=(t.concat(Array.isArray(e)?e:[]).filter(function(t){return"uid"in t}).map(function(t){return t.uid})),s=0;s<t.length;s++){var l,p=t[s];if(!("uid"in p)||n.indexOf(p.uid)!==-1){var m;for(l=0;l<100&&(m=c.randstr(o),n.indexOf(m)!==-1);l++);p.uid=c.randstr(o),o.push(p.uid)}if(n.push(p.uid),"histogramy"===p.type&&"xbins"in p&&!("ybins"in p)&&(p.ybins=p.xbins,delete p.xbins),p.error_y&&"opacity"in p.error_y){var v=d.defaults,g=p.error_y.color||(u.traceIs(p,"bar")?d.defaultLine:v[s%v.length]);p.error_y.color=d.addOpacity(d.rgb(g),d.opacity(g)*p.error_y.opacity),delete p.error_y.opacity}if("bardir"in p&&("h"!==p.bardir||!u.traceIs(p,"bar")&&"histogram"!==p.type.substr(0,9)||(p.orientation="h",r.swapXYData(p)),delete p.bardir),"histogramy"===p.type&&r.swapXYData(p),"histogramx"!==p.type&&"histogramy"!==p.type||(p.type="histogram"),"scl"in p&&(p.colorscale=p.scl,delete p.scl),"reversescl"in p&&(p.reversescale=p.reversescl,delete p.reversescl),p.xaxis&&(p.xaxis=f.cleanId(p.xaxis,"x")),p.yaxis&&(p.yaxis=f.cleanId(p.yaxis,"y")),u.traceIs(p,"gl3d")&&p.scene&&(p.scene=h.subplotsRegistry.gl3d.cleanId(p.scene)),u.traceIs(p,"pie")||u.traceIs(p,"bar")||(Array.isArray(p.textposition)?p.textposition=p.textposition.map(i):p.textposition&&(p.textposition=i(p.textposition))),u.traceIs(p,"2dMap")&&("YIGnBu"===p.colorscale&&(p.colorscale="YlGnBu"),"YIOrRd"===p.colorscale&&(p.colorscale="YlOrRd")),u.traceIs(p,"markerColorscale")&&p.marker){var y=p.marker;"YIGnBu"===y.colorscale&&(y.colorscale="YlGnBu"),"YIOrRd"===y.colorscale&&(y.colorscale="YlOrRd")}if("surface"===p.type&&c.isPlainObject(p.contours)){var b=["x","y","z"];for(l=0;l<b.length;l++){var x=p.contours[b[l]];c.isPlainObject(x)&&(x.highlightColor&&(x.highlightcolor=x.highlightColor,delete x.highlightColor),x.highlightWidth&&(x.highlightwidth=x.highlightWidth,delete x.highlightWidth))}}if(Array.isArray(p.transforms)){var _=p.transforms;for(l=0;l<_.length;l++){var w=_[l];c.isPlainObject(w)&&("filter"===w.type&&(w.filtersrc&&(w.target=w.filtersrc,delete w.filtersrc),w.calendar&&(w.valuecalendar||(w.valuecalendar=w.calendar),delete w.calendar)))}}a(p,"line")&&delete p.line,"marker"in p&&(a(p.marker,"line")&&delete p.marker.line,a(p,"marker")&&delete p.marker),d.clean(p)}},r.swapXYData=function(t){var e;if(c.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);c.swapAttrs(t,["error_?.copy_ystyle"]),n&&c.swapAttrs(t,["error_?.color","error_?.thickness","error_?.width"])}if(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){return s(e)?[e]:Array.isArray(e)&&e.length?e:t.data.map(function(t,e){return e})},r.manageArrayContainers=function(t,e,r){var n=t.obj,i=t.parts,a=i.length,o=i[a-1],l=s(o);if(l&&null===e){var u=i.slice(0,a-1).join(".");c.nestedProperty(n,u).get().splice(o,1)}else l&&void 0===t.get()?(void 0===t.get()&&(r[t.astr]=null),t.set(e)):t.set(e)};var p=/(\.[^\[\]\.]+|\[[^\[\]\.]+\])$/;r.hasParent=function(t,e){for(var r=o(e);r;){if(r in t)return!0;r=o(r)}return!1}},{"../components/color":590,"../lib":709,"../plots/cartesian/axes":748,"../plots/plots":811,"../registry":826,"fast-isnumeric":127,"gl-mat4/fromQuat":173}],734:[function(t,e,r){"use strict";var n=t("../lib/nested_property"),i=t("../lib/is_plain_object"),a=t("../lib/noop"),o=t("../lib/loggers"),s=t("../lib/search").sorterAsc,l=t("../registry");r.containerArrayMatch=t("./container_array_match");var u=r.isAddVal=function(t){return"add"===t||i(t)},c=r.isRemoveVal=function(t){return null===t||"remove"===t};r.applyContainerArrayChanges=function(t,e,r,i){var h=e.astr,f=l.getComponentMethod(h,"supplyLayoutDefaults"),d=l.getComponentMethod(h,"draw"),p=l.getComponentMethod(h,"drawOne"),m=i.replot||i.recalc||f===a||d===a,v=t.layout,g=t._fullLayout;if(r[""]){Object.keys(r).length>1&&o.warn("Full array edits are incompatible with other edits",h);var y=r[""][""];if(c(y))e.set(null);else{if(!Array.isArray(y))return o.warn("Unrecognized full array edit value",h,y),!0;e.set(y)}return!m&&(f(v,g),d(t),!0)}var b,x,_,w,M,k,A,T=Object.keys(r).map(Number).sort(s),S=e.get(),E=S||[],L=n(g,h).get(),C=[],z=-1,D=E.length;for(b=0;b<T.length;b++)if(_=T[b],w=r[_],M=Object.keys(w),k=w[""],A=u(k),_<0||_>E.length-(A?0:1))o.warn("index out of range",h,_);else if(void 0!==k)M.length>1&&o.warn("Insertion & removal are incompatible with edits to the same index.",h,_),c(k)?C.push(_):A?("add"===k&&(k={}),E.splice(_,0,k),L&&L.splice(_,0,{})):o.warn("Unrecognized full object edit value",h,_,k),z===-1&&(z=_);else for(x=0;x<M.length;x++)n(E[_],M[x]).set(w[M[x]]);for(b=C.length-1;b>=0;b--)E.splice(C[b],1),L&&L.splice(C[b],1);if(E.length?S||e.set(E):e.set(null),m)return!1;if(f(v,g),p!==a){var I;if(z===-1)I=T;else{for(D=Math.max(E.length,D),I=[],b=0;b<T.length&&!((_=T[b])>=z);b++)I.push(_);for(b=z;b<D;b++)I.push(b)}for(b=0;b<I.length;b++)p(t,I[b])}else d(t);return!0}},{"../lib/is_plain_object":711,"../lib/loggers":712,"../lib/nested_property":715,"../lib/noop":716,"../lib/search":723,"../registry":826,"./container_array_match":732}],735:[function(t,e,r){"use strict";function n(t,e){t._fullLayout._paperdiv.style("background","white"),y.defaultConfig.setBackground(t,e)}function i(t,e){t._context||(t._context=b.extendFlat({},y.defaultConfig));var r=t._context;e&&(Object.keys(e).forEach(function(t){t in r&&("setBackground"===t&&"opaque"===e[t]?r[t]=n:r[t]=e[t])}),e.plot3dPixelRatio&&!r.plotGlPixelRatio&&(r.plotGlPixelRatio=r.plot3dPixelRatio)),r.staticPlot&&(r.editable=!1,r.autosizable=!1,r.scrollZoom=!1,r.doubleClick=!1,r.showTips=!1,r.showLink=!1,r.displayModeBar=!1)}function a(t,e,r){var n=v.select(t).selectAll(".plot-container").data([0]);n.enter().insert("div",":first-child").classed("plot-container plotly",!0);var i=n.selectAll(".svg-container").data([0]);i.enter().append("div").classed("svg-container",!0).style("position","relative"),i.html(""),e&&(t.data=e),r&&(t.layout=r),k.manager.fillLayout(t),i.style({width:t._fullLayout.width+"px",height:t._fullLayout.height+"px"}),t.framework=k.manager.framework(t),t.framework({data:t.data,layout:t.layout},i.node()),t.framework.setUndoPoint();var a=t.framework.svg(),o=1,s=t._fullLayout.title;""!==s&&s||(o=0);var l=function(){this.call(L.convertToTspans)},u=a.select(".title-group text").call(l);if(t._context.editable){u.attr({"data-unformatted":s}),s&&"Click to enter title"!==s||(o=.2,u.attr({"data-unformatted":"Click to enter title"}).text("Click to enter title").style({opacity:o}).on("mouseover.opacity",function(){v.select(this).transition().duration(100).style("opacity",1)}).on("mouseout.opacity",function(){v.select(this).transition().duration(1e3).style("opacity",0)}));var c=function(){this.call(L.makeEditable).on("edit",function(e){t.framework({layout:{title:e}}),this.attr({"data-unformatted":e}).text(e).call(l),this.call(c)}).on("cancel",function(){var t=this.attr("data-unformatted");this.text(t).call(l)})};u.call(c)}return t._context.setBackground(t,t._fullLayout.paper_bgcolor),M.addLinks(t),Promise.resolve()}function o(t,e){var r,n,i=e+1,a=[];for(r=0;r<t.length;r++)n=t[r],n<0?a.push(i+n):a.push(n);return a}function s(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 l(t,e,r){if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("currentIndices is a required argument.");if(Array.isArray(e)||(e=[e]),s(t,e,"currentIndices"),void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&s(t,r,"newIndices"),void 0!==r&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function u(t,e,r){var n,i;if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===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(void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&r.length!==e.length)throw new Error("if indices is specified, traces.length must equal indices.length")}function c(t,e,r,n){var i=b.isPlainObject(n);if(!Array.isArray(t.data))throw new Error("gd.data must be an array");if(!b.isPlainObject(e))throw new Error("update must be a key:value object");if(void 0===r)throw new Error("indices must be an integer or array of integers");s(t,r,"indices");for(var a in 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")}}function h(t,e,r,n){var i,a,s,l,u,c=b.isPlainObject(n),h=[];Array.isArray(r)||(r=[r]),r=o(r,t.data.length-1);for(var f in e)for(var d=0;d<r.length;d++){if(i=t.data[r[d]],s=b.nestedProperty(i,f),a=s.get(),l=e[f][d],!Array.isArray(l))throw new Error("attribute: "+f+" index: "+d+" must be an array");if(!Array.isArray(a))throw new Error("cannot extend missing or non-array attribute: "+f);u=c?n[f][d]:n,g(u)||(u=-1),h.push({prop:s,target:a,insert:l,maxp:Math.floor(u)})}return h}function f(t,e,r,n,i,a){c(t,e,r,n);for(var o,s,l,u=h(t,e,r,n),f=[],d={},p={},m=0;m<u.length;m++)s=u[m].prop,l=u[m].maxp,o=i(u[m].target,u[m].insert),l>=0&&l<o.length&&(f=a(o,l)),l=u[m].target.length,s.set(o),Array.isArray(d[s.astr])||(d[s.astr]=[]),Array.isArray(p[s.astr])||(p[s.astr]=[]),d[s.astr].push(f),p[s.astr].push(l);return{update:d,maxPoints:p}}function d(t,e,r){function n(){return d.map(function(){})}function i(t){var e=y.Axes.id2name(t);u.indexOf(e)===-1&&u.push(e)}function a(t){return"LAYOUT"+t+".autorange"}function o(t){return"LAYOUT"+t+".range"}function s(r,i,a){if(Array.isArray(r))return void r.forEach(function(t){s(t,i,a)});if(!(r in e||z.hasParent(e,r))){var o;o="LAYOUT"===r.substr(0,6)?b.nestedProperty(t.layout,r.replace("LAYOUT","")):b.nestedProperty(f[d[a]],r),r in v||(v[r]=n()),void 0===v[r][a]&&(v[r][a]=o.get()),void 0!==i&&o.set(i)}}var l,u,c=t._fullLayout,h=t._fullData,f=t.data,d=z.coerceTraceIndices(t,r),p={docalc:!1,docalcAutorange:!1,doplot:!1,dostyle:!1,docolorbars:!1,autorangeOn:!1,clearCalc:!1,fullReplot:!1
59 },m={},v={},g={},x=["mode","visible","type","orientation","fill","histfunc","histnorm","text","x","y","z","a","b","c","open","high","low","close","base","width","offset","xtype","x0","dx","ytype","y0","dy","xaxis","yaxis","line.width","connectgaps","transpose","zsmooth","showscale","marker.showscale","zauto","marker.cauto","autocolorscale","marker.autocolorscale","colorscale","marker.colorscale","reversescale","marker.reversescale","autobinx","nbinsx","xbins","xbins.start","xbins.end","xbins.size","autobiny","nbinsy","ybins","ybins.start","ybins.end","ybins.size","autocontour","ncontours","contours","contours.coloring","contours.operation","contours.value","contours.type","contours.value[0]","contours.value[1]","error_y","error_y.visible","error_y.value","error_y.type","error_y.traceref","error_y.array","error_y.symmetric","error_y.arrayminus","error_y.valueminus","error_y.tracerefminus","error_x","error_x.visible","error_x.value","error_x.type","error_x.traceref","error_x.array","error_x.symmetric","error_x.arrayminus","error_x.valueminus","error_x.tracerefminus","swapxy","swapxyaxes","orientationaxes","marker.colors","values","labels","label0","dlabel","sort","textinfo","textposition","textfont.size","textfont.family","textfont.color","insidetextfont.size","insidetextfont.family","insidetextfont.color","outsidetextfont.size","outsidetextfont.family","outsidetextfont.color","hole","scalegroup","domain","domain.x","domain.y","domain.x[0]","domain.x[1]","domain.y[0]","domain.y[1]","tilt","tiltaxis","depth","direction","rotation","pull","line.showscale","line.cauto","line.autocolorscale","line.reversescale","marker.line.showscale","marker.line.cauto","marker.line.autocolorscale","marker.line.reversescale","xcalendar","ycalendar","cumulative","cumulative.enabled","cumulative.direction","cumulative.currentbin","a0","da","b0","db","atype","btype","cheaterslope","carpet","sum"],_=["color","smoothing","title","titlefont","titlefont.size","titlefont.family","titlefont.color","titleoffset","type","autorange","rangemode","range","fixedrange","cheatertype","tickmode","nticks","tickvals","ticktext","ticks","mirror","ticklen","tickwidth","tickcolor","showticklabels","tickfont","tickfont.size","tickfont.family","tickfont.color","tickprefix","showtickprefix","ticksuffix","showticksuffix","showexponent","exponentformat","separatethousands","tickformat","categoryorder","categoryarray","labelpadding","labelprefix","labelsuffix","labelfont","labelfont.family","labelfont.size","labelfont.color","showline","linecolor","linewidth","gridcolor","gridwidth","showgrid","minorgridcount","minorgridwidth","minorgridcolor","startline","startlinecolor","startlinewidth","endline","endlinewidth","endlinecolor","tick0","dtick","arraytick0","arraydtick","hoverformat","tickangle"];for(l=0;l<_.length;l++)x.push("aaxis."+_[l]),x.push("baxis."+_[l]);for(l=0;l<d.length;l++)if(w.traceIs(h[d[l]],"box")){x.push("name");break}var k=["marker","marker.size","textfont","boxpoints","jitter","pointpos","whiskerwidth","boxmean","tickwidth"],A=["zmin","zmax","zauto","xgap","ygap","marker.cmin","marker.cmax","marker.cauto","line.cmin","line.cmax","marker.line.cmin","marker.line.cmax","contours.start","contours.end","contours.size","contours.showlines","line","line.smoothing","line.shape","error_y.width","error_x.width","error_x.copy_ystyle","marker.maxdisplayed"],T=["type","x","y","x0","y0","orientation","xaxis","yaxis"],S=["zmin","zmax"],E=["xbins.start","xbins.end","xbins.size"],L=["ybins.start","ybins.end","ybins.size"],C=["contours.start","contours.end","contours.size"],D=["cartesian","pie","ternary"];c._basePlotModules.forEach(function(t){D.indexOf(t.name)===-1&&(p.docalc=!0)});for(var I in e){if(z.hasParent(e,I))throw new Error("cannot set "+I+"and a parent attribute simultaneously");var P,O,j,F,R,N=e[I];if(m[I]=N,"LAYOUT"!==I.substr(0,6)){for(v[I]=n(),l=0;l<d.length;l++)if(P=f[d[l]],O=h[d[l]],j=b.nestedProperty(P,I),F=j.get(),void 0!==(R=Array.isArray(N)?N[l%N.length]:N)){if(S.indexOf(I)!==-1)s("zauto",!1,l);else if("colorscale"===I)s("autocolorscale",!1,l);else if("autocolorscale"===I)s("colorscale",void 0,l);else if("marker.colorscale"===I)s("marker.autocolorscale",!1,l);else if("marker.autocolorscale"===I)s("marker.colorscale",void 0,l);else if("zauto"===I)s(S,void 0,l);else if(E.indexOf(I)!==-1)s("autobinx",!1,l);else if("autobinx"===I)s(E,void 0,l);else if(L.indexOf(I)!==-1)s("autobiny",!1,l);else if("autobiny"===I)s(L,void 0,l);else if(C.indexOf(I)!==-1)s("autocontour",!1,l);else if("autocontour"===I)s(C,void 0,l);else if(["x0","dx"].indexOf(I)!==-1&&O.x&&"scaled"!==O.xtype)s("xtype","scaled",l);else if(["y0","dy"].indexOf(I)!==-1&&O.y&&"scaled"!==O.ytype)s("ytype","scaled",l);else if("colorbar.thicknessmode"===I&&j.get()!==R&&["fraction","pixels"].indexOf(R)!==-1&&O.colorbar){var B=["top","bottom"].indexOf(O.colorbar.orient)!==-1?c.height-c.margin.t-c.margin.b:c.width-c.margin.l-c.margin.r;s("colorbar.thickness",O.colorbar.thickness*("fraction"===R?1/B:B),l)}else if("colorbar.lenmode"===I&&j.get()!==R&&["fraction","pixels"].indexOf(R)!==-1&&O.colorbar){var U=["top","bottom"].indexOf(O.colorbar.orient)!==-1?c.width-c.margin.l-c.margin.r:c.height-c.margin.t-c.margin.b;s("colorbar.len",O.colorbar.len*("fraction"===R?1/U:U),l)}else"colorbar.tick0"===I||"colorbar.dtick"===I?s("colorbar.tickmode","linear",l):"colorbar.tickmode"===I&&s(["colorbar.tick0","colorbar.dtick"],void 0,l);if("type"===I&&"pie"===R!=("pie"===F)){var V="x",q="y";"bar"!==R&&"bar"!==F||"h"!==P.orientation||(V="y",q="x"),b.swapAttrs(P,["?","?src"],"labels",V),b.swapAttrs(P,["d?","?0"],"label",V),b.swapAttrs(P,["?","?src"],"values",q),"pie"===F?(b.nestedProperty(P,"marker.color").set(b.nestedProperty(P,"marker.colors").get()),c._pielayer.selectAll("g.trace").remove()):w.traceIs(P,"cartesian")&&(b.nestedProperty(P,"marker.colors").set(b.nestedProperty(P,"marker.color").get()),g[P.xaxis||"x"]=!0,g[P.yaxis||"y"]=!0)}v[I][l]=F;var H=["swapxy","swapxyaxes","orientation","orientationaxes"];if(H.indexOf(I)!==-1){if("orientation"===I){if(j.set(R),j.get()===v[I][l])continue}else"orientationaxes"===I&&(P.orientation={v:"h",h:"v"}[O.orientation]);z.swapXYData(P)}else if(M.dataArrayContainers.indexOf(j.parts[0])!==-1)z.manageArrayContainers(j,R,v),p.docalc=!0;else{var G=(O._module||{}).attributes||{},Y=b.nestedProperty(G,I).get()||b.nestedProperty(M.attributes,I).get()||{};Y.valType||(p.docalc=!0),Y.arrayOk&&(Array.isArray(R)||Array.isArray(F))&&(p.docalc=!0),"docalc"===Y.editType&&(p.docalc=!0),j.set(R)}}if(["swapxyaxes","orientationaxes"].indexOf(I)!==-1&&y.Axes.swap(t,d),"orientationaxes"===I){var X=b.nestedProperty(t.layout,"hovermode");"x"===X.get()?X.set("y"):"y"===X.get()&&X.set("x")}d.indexOf(0)!==-1&&T.indexOf(I)!==-1&&(y.Axes.clearTypes(t,d),p.docalc=!0),["autobinx","autobiny","zauto"].indexOf(I)!==-1&&R===!1||(p.dostyle=!0),(["colorbar","line"].indexOf(j.parts[0])!==-1||"marker"===j.parts[0]&&"colorbar"===j.parts[1])&&(p.docolorbars=!0);var W=I.indexOf("["),Z=W===-1?I:I.substr(0,W);if(x.indexOf(Z)!==-1){if(["orientation","type"].indexOf(I)!==-1){for(u=[],l=0;l<d.length;l++){var J=f[d[l]];w.traceIs(J,"cartesian")&&(i(J.xaxis||"x"),i(J.yaxis||"y"),"type"===I&&s(["autobinx","autobiny"],!0,l))}s(u.map(a),!0,0),s(u.map(o),[0,1],0)}p.docalc=!0}else A.indexOf(Z)!==-1?p.doplot=!0:0===Z.indexOf("aaxis")||0===Z.indexOf("baxis")?p.doplot=!0:k.indexOf(Z)!==-1&&(p.docalcAutorange=!0)}else j=b.nestedProperty(t.layout,I.replace("LAYOUT","")),v[I]=[j.get()],j.set(Array.isArray(N)?N[0]:N),p.docalc=!0}y.Axes.list(t).forEach(function(t){t.autorange&&(p.autorangeOn=!0)});var K=Object.keys(g);t:for(l=0;l<K.length;l++){for(var Q=K[l],$=Q.charAt(0),tt=$+"axis",et=0;et<f.length;et++)if(w.traceIs(f[et],"cartesian")&&(f[et][tt]||$)===Q)continue t;s("LAYOUT"+y.Axes.id2name(Q),null,0)}return(p.docalc||p.docalcAutorange&&p.autorangeOn)&&(p.clearCalc=!0),(p.docalc||p.doplot||p.docalcAutorange)&&(p.fullReplot=!0),{flags:p,undoit:v,redoit:m,traces:d,eventData:b.extendDeepNoArrays([],[m,d])}}function p(t,e){function r(t,n){if(Array.isArray(t))return void t.forEach(function(t){r(t,n)});if(!(t in e||z.hasParent(e,t))){var i=b.nestedProperty(l,t);t in x||(x[t]=i.get()),void 0!==n&&i.set(n)}}function n(e,r){if(!b.isPlainObject(e))return!1;var n=e[r+"ref"]||r,i=y.Axes.getFromId(t,n);return i||n.charAt(0)!==r||(i=y.Axes.getFromId(t,r)),(i||{}).autorange}function i(t){var e=O.name2id(t.split(".")[0]);_[e]=1}var a,o,s,l=t.layout,u=t._fullLayout,c=Object.keys(e),h=y.Axes.list(t),f={};for(o=0;o<c.length;o++)if(0===c[o].indexOf("allaxes")){for(s=0;s<h.length;s++){var d=h[s]._id.substr(1),p=d.indexOf("scene")!==-1?d+".":"",m=c[o].replace("allaxes",p+h[s]._name);e[m]||(e[m]=e[c[o]])}delete e[c[o]]}var v={dolegend:!1,doticks:!1,dolayoutstyle:!1,doplot:!1,docalc:!1,domodebar:!1,docamera:!1,layoutReplot:!1},g={},x={},_={};for(var k in e){if(z.hasParent(e,k))throw new Error("cannot set "+k+"and a parent attribute simultaneously");var A=b.nestedProperty(l,k),T=e[k],S=A.parts.length,E="string"==typeof A.parts[S-1]?S-1:S-2,L=A.parts[0],D=A.parts[E],P=A.parts[E-1]+"."+D,j=A.parts.slice(0,E).join("."),F=b.nestedProperty(t.layout,j).get(),R=b.nestedProperty(u,j).get();if(void 0!==T){if(g[k]=T,x[k]="reverse"===D?T:A.get(),["width","height"].indexOf(k)!==-1&&null===T?u[k]=t._initialAutoSize[k]:P.match(/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/)?(r(j+".autorange",!1),i(P)):P.match(/^[xyz]axis[0-9]*\.autorange$/)?(r([j+".range[0]",j+".range[1]"],void 0),i(P)):P.match(/^aspectratio\.[xyz]$/)?r(L+".aspectmode","manual"):P.match(/^aspectmode$/)?r([j+".x",j+".y",j+".z"],void 0):"tick0"===D||"dtick"===D?r(j+".tickmode","linear"):"tickmode"===D?r([j+".tick0",j+".dtick"],void 0):/[xy]axis[0-9]*?$/.test(D)&&!Object.keys(T||{}).length?v.docalc=!0:/[xy]axis[0-9]*\.categoryorder$/.test(P)?v.docalc=!0:/[xy]axis[0-9]*\.categoryarray/.test(P)&&(v.docalc=!0),P.indexOf("rangeslider")!==-1&&(v.docalc=!0),"type"===D){var N=F,B="linear"===R.type&&"log"===T,U="log"===R.type&&"linear"===T;if(B||U){if(N&&N.range)if(R.autorange)B&&(N.range=N.range[1]>N.range[0]?[1,2]:[2,1]);else{var V=N.range[0],q=N.range[1];B?(V<=0&&q<=0&&r(j+".autorange",!0),V<=0?V=q/1e6:q<=0&&(q=V/1e6),r(j+".range[0]",Math.log(V)/Math.LN10),r(j+".range[1]",Math.log(q)/Math.LN10)):(r(j+".range[0]",Math.pow(10,V)),r(j+".range[1]",Math.pow(10,q)))}else r(j+".autorange",!0);w.getComponentMethod("annotations","convertCoords")(t,R,T,r),w.getComponentMethod("images","convertCoords")(t,R,T,r)}else r(j+".autorange",!0)}else if(D.match(I.AX_NAME_PATTERN)){var H=b.nestedProperty(u,k).get(),G=(T||{}).type;G&&"-"!==G||(G="linear"),w.getComponentMethod("annotations","convertCoords")(t,H,G,r),w.getComponentMethod("images","convertCoords")(t,H,G,r)}var Y=C.containerArrayMatch(k);if(Y){a=Y.array,o=Y.index;var X=Y.property,W=b.nestedProperty(l,a),Z=(W||[])[o]||{};if(""===o)k.indexOf("updatemenus")===-1&&(v.docalc=!0);else if(""===X){var J=T;C.isAddVal(T)?x[k]=null:C.isRemoveVal(T)?(x[k]=Z,J=Z):b.warn("unrecognized full object value",e),(n(J,"x")||n(J,"y")&&k.indexOf("updatemenus")===-1)&&(v.docalc=!0)}else!n(Z,"x")&&!n(Z,"y")||b.containsAny(k,["color","opacity","align","dash","updatemenus"])||(v.docalc=!0);f[a]||(f[a]={});var K=f[a][o];K||(K=f[a][o]={}),K[X]=T,delete e[k]}else if("reverse"===D)F.range?F.range.reverse():(r(j+".autorange",!0),F.range=[1,0]),R.autorange?v.docalc=!0:v.doplot=!0;else{var Q=String(A.parts[1]||"");0===L.indexOf("scene")?"camera"===A.parts[1]?v.docamera=!0:v.doplot=!0:0===L.indexOf("geo")?v.doplot=!0:0===L.indexOf("ternary")?v.doplot=!0:"paper_bgcolor"===k?v.doplot=!0:"margin"===L||"autorange"===Q||"rangemode"===Q||"type"===Q||"domain"===Q||"fixedrange"===Q||"scaleanchor"===Q||"scaleratio"===Q||k.indexOf("calendar")!==-1||k.match(/^(bar|box|font)/)?v.docalc=!0:!u._has("gl2d")||k.indexOf("axis")===-1&&"plot_bgcolor"!==k?"hiddenlabels"===k?v.docalc=!0:L.indexOf("legend")!==-1?v.dolegend=!0:k.indexOf("title")!==-1?v.doticks=!0:L.indexOf("bgcolor")!==-1?v.dolayoutstyle=!0:S>1&&b.containsAny(Q,["tick","exponent","grid","zeroline"])?v.doticks=!0:k.indexOf(".linewidth")!==-1&&k.indexOf("axis")!==-1?v.doticks=v.dolayoutstyle=!0:S>1&&Q.indexOf("line")!==-1?v.dolayoutstyle=!0:S>1&&"mirror"===Q?v.doticks=v.dolayoutstyle=!0:"margin.pad"===k?v.doticks=v.dolayoutstyle=!0:["hovermode","dragmode"].indexOf(k)!==-1||k.indexOf("spike")!==-1?v.domodebar=!0:["height","width","autosize"].indexOf(k)===-1&&(v.doplot=!0):v.doplot=!0,A.set(T)}}}for(a in f){C.applyContainerArrayChanges(t,b.nestedProperty(l,a),f[a],v)||(v.doplot=!0)}var $=u._axisConstraintGroups;for(var tt in _)for(o=0;o<$.length;o++){var et=$[o];if(et[tt]){v.docalc=!0;for(var rt in et)_[rt]||(O.getFromId(t,rt)._constraintShrinkable=!0)}}var nt=u.width,it=u.height;return t.layout.autosize&&M.plotAutoSize(t,t.layout,u),(e.height||e.width||u.width!==nt||u.height!==it)&&(v.docalc=!0),(v.doplot||v.docalc)&&(v.layoutReplot=!0),{flags:v,undoit:x,redoit:g,eventData:b.extendDeep({},g)}}function m(t){var e=v.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([0]),r._glcontainer.enter().append("div").classed("gl-container",!0),r._paperdiv.selectAll(".main-svg").remove(),r._paper=r._paperdiv.insert("svg",":first-child").classed("main-svg",!0),r._toppaper=r._paperdiv.append("svg").classed("main-svg",!0),!r._uid){var n=[];v.selectAll("defs").each(function(){this.id&&n.push(this.id.split("-")[1])}),r._uid=b.randstr(n)}r._paperdiv.selectAll(".main-svg").attr(E.svgAttrs),r._defs=r._paper.append("defs").attr("id","defs-"+r._uid),r._topdefs=r._toppaper.append("defs").attr("id","topdefs-"+r._uid),r._bgLayer=r._paper.append("g").classed("bglayer",!0),r._draggers=r._paper.append("g").classed("draglayer",!0);var i=r._paper.append("g").classed("layer-below",!0);r._imageLowerLayer=i.append("g").classed("imagelayer",!0),r._shapeLowerLayer=i.append("g").classed("shapelayer",!0),r._cartesianlayer=r._paper.append("g").classed("cartesianlayer",!0),r._ternarylayer=r._paper.append("g").classed("ternarylayer",!0),r._geolayer=r._paper.append("g").classed("geolayer",!0);var a=r._paper.append("g").classed("layer-above",!0);r._imageUpperLayer=a.append("g").classed("imagelayer",!0),r._shapeUpperLayer=a.append("g").classed("shapelayer",!0),r._pielayer=r._paper.append("g").classed("pielayer",!0),r._glimages=r._paper.append("g").classed("glimages",!0),r._infolayer=r._toppaper.append("g").classed("infolayer",!0),r._zoomlayer=r._toppaper.append("g").classed("zoomlayer",!0),r._hoverlayer=r._toppaper.append("g").classed("hoverlayer",!0),t.emit("plotly_framework")}var v=t("d3"),g=t("fast-isnumeric"),y=t("../plotly"),b=t("../lib"),x=t("../lib/events"),_=t("../lib/queue"),w=t("../registry"),M=t("../plots/plots"),k=t("../plots/polar"),A=t("../plots/cartesian/graph_interact"),T=t("../components/drawing"),S=t("../components/errorbars"),E=t("../constants/xmlns_namespaces"),L=t("../lib/svg_text_utils"),C=t("./manage_arrays"),z=t("./helpers"),D=t("./subroutines"),I=t("../plots/cartesian/constants"),P=t("../plots/cartesian/constraints"),O=t("../plots/cartesian/axis_ids");y.plot=function(t,e,r,n){function o(){if(g)return y.addFrames(t,g)}function s(){for(var e=E._basePlotModules,r=0;r<e.length;r++)e[r].drawFramework&&e[r].drawFramework(t);return b.syncOrAsync([D.layoutStyles,f,A],t)}function l(){var e,r,n,i=t.calcdata;for(w.getComponentMethod("legend","draw")(t),w.getComponentMethod("rangeselector","draw")(t),w.getComponentMethod("sliders","draw")(t),w.getComponentMethod("updatemenus","draw")(t),e=0;e<i.length;e++)r=i[e],n=r[0].trace,n.visible===!0&&n._module.colorbar?n._module.colorbar(t,r):M.autoMargin(t,"cb"+n.uid);return M.doAutoMargin(t),M.previousPromises(t)}function u(){var e=JSON.stringify(E._size)===I?[]:[l,D.layoutStyles];return e=e.concat(A),b.syncOrAsync(e,t)}function c(){if(L){for(var e,r,n=M.getSubplotIds(E,"cartesian"),i=E._modules,a=0;a<n.length;a++){e=E._plots[n[a]];for(var o=0;o<i.length;o++)r=i[o],r.setPositions&&r.setPositions(t,e)}return S.calc(t),b.syncOrAsync([w.getComponentMethod("shapes","calcAutorange"),w.getComponentMethod("annotations","calcAutorange"),h,w.getComponentMethod("rangeslider","calcAutorange")],t)}}function h(){if(!t._transitioning){for(var e=y.Axes.list(t,"",!0),r=0;r<e.length;r++)y.Axes.doAutoRange(e[r]);P(t),k&&y.Axes.saveRangeInitial(t)}}function f(){return y.Axes.doTicks(t,"redraw")}function d(){var e,r=t.calcdata,n=E._infolayer.selectAll("g.rangeslider-container");for(e=0;e<r.length;e++){var i=r[e][0].trace,a=i.visible===!0,o=i.uid;if(!a||!w.traceIs(i,"2dMap")){var s=".hm"+o+",.contour"+o+",#clip"+o;E._paper.selectAll(s).remove(),n.selectAll(s).remove()}a&&i._module.colorbar||E._infolayer.selectAll(".cb"+o).remove()}var l=E._basePlotModules;for(e=0;e<l.length;e++)l[e].plot(t);var u=E._paper.selectAll(".layer-subplot");return E._shapeSubplotLayers=u.selectAll(".shapelayer"),M.style(t),w.getComponentMethod("shapes","draw")(t),w.getComponentMethod("annotations","draw")(t),M.addLinks(t),E._replotting=!1,M.previousPromises(t)}function p(){w.getComponentMethod("shapes","draw")(t),w.getComponentMethod("images","draw")(t),w.getComponentMethod("annotations","draw")(t),w.getComponentMethod("legend","draw")(t),w.getComponentMethod("rangeslider","draw")(t),w.getComponentMethod("rangeselector","draw")(t),w.getComponentMethod("sliders","draw")(t),w.getComponentMethod("updatemenus","draw")(t)}var g;if(t=z.getGraphDiv(t),x.init(t),b.isPlainObject(e)){var _=e;e=_.data,r=_.layout,n=_.config,g=_.frames}if(x.triggerHandler(t,"plotly_beforeplot",[e,r,n])===!1)return Promise.reject();e||r||b.isPlotDiv(t)||b.warn("Calling Plotly.plot as if redrawing but this container doesn't yet have a plot.",t),i(t,n),r||(r={}),v.select(t).classed("js-plotly-plot",!0),T.makeTester(),t._promises=[];var k=0===(t.data||[]).length&&Array.isArray(e);if(Array.isArray(e)&&(z.cleanData(e,t.data),k?t.data=e:t.data.push.apply(t.data,e),t.empty=!1),t.layout&&!k||(t.layout=z.cleanLayout(r)),t._dragging&&!t._transitioning)return t._replotPending=!0,Promise.reject();t._replotPending=!1,M.supplyDefaults(t);var E=t._fullLayout;if(e&&e[0]&&e[0].r)return a(t,e,r);E._replotting=!0,k&&m(t),t.framework!==m&&(t.framework=m,m(t)),T.initGradients(t),k&&y.Axes.saveShowSpikeInitial(t);var L=!t.calcdata||t.calcdata.length!==(t._fullData||[]).length;L&&M.doCalcdata(t);for(var C=0;C<t.calcdata.length;C++)t.calcdata[C][0].trace=t._fullData[C];var I=JSON.stringify(E._size),O=[M.previousPromises,o,s,l,u,c,D.layoutStyles,f,d,p,M.rehover];return b.syncOrAsync(O,t),Promise.all(t._promises).then(function(){return t.emit("plotly_afterplot"),t})},y.redraw=function(t){if(t=z.getGraphDiv(t),!b.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t);return z.cleanData(t.data,t.data),z.cleanLayout(t.layout),t.calcdata=void 0,y.plot(t).then(function(){return t.emit("plotly_redraw"),t})},y.newPlot=function(t,e,r,n){return t=z.getGraphDiv(t),M.cleanPlot([],{},t._fullData||{},t._fullLayout||{}),M.purge(t),y.plot(t,e,r,n)},y.extendTraces=function t(e,r,n,i){e=z.getGraphDiv(e);var a=f(e,r,n,i,function(t,e){return t.concat(e)},function(t,e){return t.splice(0,t.length-e)}),o=y.redraw(e),s=[e,a.update,n,a.maxPoints];return _.add(e,y.prependTraces,s,t,arguments),o},y.prependTraces=function t(e,r,n,i){e=z.getGraphDiv(e);var a=f(e,r,n,i,function(t,e){return e.concat(t)},function(t,e){return t.splice(e,t.length)}),o=y.redraw(e),s=[e,a.update,n,a.maxPoints];return _.add(e,y.extendTraces,s,t,arguments),o},y.addTraces=function t(e,r,n){e=z.getGraphDiv(e);var i,a,o=[],s=y.deleteTraces,c=t,h=[e,o],f=[e,r];for(u(e,r,n),Array.isArray(r)||(r=[r]),r=r.map(function(t){return b.extendFlat({},t)}),z.cleanData(r,e.data),i=0;i<r.length;i++)e.data.push(r[i]);for(i=0;i<r.length;i++)o.push(-r.length+i);if(void 0===n)return a=y.redraw(e),_.add(e,s,h,c,f),a;Array.isArray(n)||(n=[n]);try{l(e,o,n)}catch(t){throw e.data.splice(e.data.length-r.length,r.length),t}return _.startSequence(e),_.add(e,s,h,c,f),a=y.moveTraces(e,o,n),_.stopSequence(e),a},y.deleteTraces=function t(e,r){e=z.getGraphDiv(e);var n,i,a=[],l=y.addTraces,u=t,c=[e,a,r],h=[e,r];if(void 0===r)throw new Error("indices must be an integer or array of integers.");for(Array.isArray(r)||(r=[r]),s(e,r,"indices"),r=o(r,e.data.length-1),r.sort(b.sorterDes),n=0;n<r.length;n+=1)i=e.data.splice(r[n],1)[0],a.push(i);var f=y.redraw(e);return _.add(e,l,c,u,h),f},y.moveTraces=function t(e,r,n){e=z.getGraphDiv(e);var i,a=[],s=[],u=t,c=t,h=[e,n,r],f=[e,r,n];if(l(e,r,n),r=Array.isArray(r)?r:[r],void 0===n)for(n=[],i=0;i<r.length;i++)n.push(-r.length+i);for(n=Array.isArray(n)?n:[n],r=o(r,e.data.length-1),n=o(n,e.data.length-1),i=0;i<e.data.length;i++)r.indexOf(i)===-1&&a.push(e.data[i]);for(i=0;i<r.length;i++)s.push({newIndex:n[i],trace:e.data[r[i]]});for(s.sort(function(t,e){return t.newIndex-e.newIndex}),i=0;i<s.length;i+=1)a.splice(s[i].newIndex,0,s[i].trace);e.data=a;var d=y.redraw(e);return _.add(e,u,h,c,f),d},y.restyle=function t(e,r,n,i){e=z.getGraphDiv(e),z.clearPromiseQueue(e);var a={};if("string"==typeof r)a[r]=n;else{if(!b.isPlainObject(r))return b.warn("Restyle fail.",r,n,i),Promise.reject();a=b.extendFlat({},r),void 0===i&&(i=n)}Object.keys(a).length&&(e.changed=!0);var o=d(e,a,i),s=o.flags;s.clearCalc&&(e.calcdata=void 0);var l=[];s.fullReplot?l.push(y.plot):(l.push(M.previousPromises),M.supplyDefaults(e),s.dostyle&&l.push(D.doTraceStyle),s.docolorbars&&l.push(D.doColorBars)),l.push(M.rehover),_.add(e,t,[e,o.undoit,o.traces],t,[e,o.redoit,o.traces]);var u=b.syncOrAsync(l,e);return u&&u.then||(u=Promise.resolve()),u.then(function(){return e.emit("plotly_restyle",o.eventData),e})},y.relayout=function t(e,r,n){if(e=z.getGraphDiv(e),z.clearPromiseQueue(e),e.framework&&e.framework.isPolar)return Promise.resolve(e);var i={};if("string"==typeof r)i[r]=n;else{if(!b.isPlainObject(r))return b.warn("Relayout fail.",r,n),Promise.reject();i=b.extendFlat({},r)}Object.keys(i).length&&(e.changed=!0);var a=p(e,i),o=a.flags;o.docalc&&(e.calcdata=void 0);var s=[M.previousPromises];o.layoutReplot?s.push(D.layoutReplot):Object.keys(i).length&&(M.supplyDefaults(e),o.dolegend&&s.push(D.doLegend),o.dolayoutstyle&&s.push(D.layoutStyles),o.doticks&&s.push(D.doTicksRelayout),o.domodebar&&s.push(D.doModeBar),o.docamera&&s.push(D.doCamera)),s.push(M.rehover),_.add(e,t,[e,a.undoit],t,[e,a.redoit]);var l=b.syncOrAsync(s,e);return l&&l.then||(l=Promise.resolve(e)),l.then(function(){return e.emit("plotly_relayout",a.eventData),e})},y.update=function t(e,r,n,i){if(e=z.getGraphDiv(e),z.clearPromiseQueue(e),e.framework&&e.framework.isPolar)return Promise.resolve(e);b.isPlainObject(r)||(r={}),b.isPlainObject(n)||(n={}),Object.keys(r).length&&(e.changed=!0),Object.keys(n).length&&(e.changed=!0);var a=d(e,b.extendFlat({},r),i),o=a.flags,s=p(e,b.extendFlat({},n)),l=s.flags;(o.clearCalc||l.docalc)&&(e.calcdata=void 0);var u=[];if(o.fullReplot&&l.layoutReplot){var c=e.data,h=e.layout;e.data=void 0,e.layout=void 0,u.push(function(){return y.plot(e,c,h)})}else o.fullReplot?u.push(y.plot):l.layoutReplot?u.push(D.layoutReplot):(u.push(M.previousPromises),M.supplyDefaults(e),o.dostyle&&u.push(D.doTraceStyle),o.docolorbars&&u.push(D.doColorBars),l.dolegend&&u.push(D.doLegend),l.dolayoutstyle&&u.push(D.layoutStyles),l.doticks&&u.push(D.doTicksRelayout),l.domodebar&&u.push(D.doModeBar),l.doCamera&&u.push(D.doCamera));u.push(M.rehover),_.add(e,t,[e,a.undoit,s.undoit,a.traces],t,[e,a.redoit,s.redoit,a.traces]);var f=b.syncOrAsync(u,e);return f&&f.then||(f=Promise.resolve(e)),f.then(function(){return e.emit("plotly_update",{data:a.eventData,layout:s.eventData}),e})},y.animate=function(t,e,r){function n(t){return Array.isArray(s)?t>=s.length?s[0]:s[t]:s}function i(t){return Array.isArray(l)?t>=l.length?l[0]:l[t]:l}function a(t,e){var r=0;return function(){if(t&&++r===e)return t()}}if(t=z.getGraphDiv(t),!b.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 o=t._transitionData;o._frameQueue||(o._frameQueue=[]),r=M.supplyAnimationDefaults(r);var s=r.transition,l=r.frame;return void 0===o._frameWaitingCnt&&(o._frameWaitingCnt=0),new Promise(function(l,u){function c(){t.emit("plotly_animated"),window.cancelAnimationFrame(o._animationRaf),o._animationRaf=null}function h(){o._currentFrame&&o._currentFrame.onComplete&&o._currentFrame.onComplete();var e=o._currentFrame=o._frameQueue.shift();if(e){var r=e.name?e.name.toString():null;t._fullLayout._currentFrame=r,o._lastFrameAt=Date.now(),o._timeToNext=e.frameOpts.duration,M.transition(t,e.frame.data,e.frame.layout,z.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 c()}function f(){t.emit("plotly_animating"),o._lastFrameAt=-1/0,o._timeToNext=0,o._runningTransitions=0,o._currentFrame=null;var e=function(){o._animationRaf=window.requestAnimationFrame(e),Date.now()-o._lastFrameAt>o._timeToNext&&h()};e()}function d(t){return Array.isArray(s)?v>=s.length?t.transitionOpts=s[v]:t.transitionOpts=s[0]:t.transitionOpts=s,v++,t}var p,m,v=0,g=[],y=void 0===e||null===e,x=Array.isArray(e);if(y||x||!b.isPlainObject(e)){if(y||["string","number"].indexOf(typeof e)!==-1)for(p=0;p<o._frames.length;p++)(m=o._frames[p])&&(y||String(m.group)===String(e))&&g.push({type:"byname",name:String(m.name),data:d({name:m.name})});else if(x)for(p=0;p<e.length;p++){var _=e[p];["number","string"].indexOf(typeof _)!==-1?(_=String(_),g.push({type:"byname",name:_,data:d({name:_})})):b.isPlainObject(_)&&g.push({type:"object",data:d(b.extendFlat({},_))})}}else g.push({type:"object",data:d(b.extendFlat({},e))});for(p=0;p<g.length;p++)if(m=g[p],"byname"===m.type&&!o._frameHash[m.data.name])return b.warn('animate failure: frame not found: "'+m.data.name+'"'),void u();["next","immediate"].indexOf(r.mode)!==-1&&function(){if(0!==o._frameQueue.length){for(;o._frameQueue.length;){var e=o._frameQueue.pop();e.onInterrupt&&e.onInterrupt()}t.emit("plotly_animationinterrupted",[])}}(),"reverse"===r.direction&&g.reverse();var w=t._fullLayout._currentFrame;if(w&&r.fromcurrent){var k=-1;for(p=0;p<g.length;p++)if(m=g[p],"byname"===m.type&&m.name===w){k=p;break}if(k>0&&k<g.length-1){var A=[];for(p=0;p<g.length;p++)m=g[p],("byname"!==g[p].type||p>k)&&A.push(m);g=A}}g.length>0?function(e){if(0!==e.length){for(var s=0;s<e.length;s++){var c;c="byname"===e[s].type?M.computeFrame(t,e[s].name):e[s].data;var h=i(s),d=n(s);d.duration=Math.min(d.duration,h.duration);var p={frame:c,name:e[s].name,frameOpts:h,transitionOpts:d};s===e.length-1&&(p.onComplete=a(l,2),p.onInterrupt=u),o._frameQueue.push(p)}"immediate"===r.mode&&(o._lastFrameAt=-1/0),o._animationRaf||f()}}(g):(t.emit("plotly_animated"),l())})},y.addFrames=function(t,e,r){t=z.getGraphDiv(t);var n=0;if(null===e||void 0===e)return Promise.resolve();if(!b.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 i,a,o,s,l=t._transitionData._frames,u=t._transitionData._frameHash;if(!Array.isArray(e))throw new Error("addFrames failure: frameList must be an Array of frame definitions"+e);var c=l.length+2*e.length,h=[];for(i=e.length-1;i>=0;i--)if(b.isPlainObject(e[i])){var f=(u[e[i].name]||{}).name,d=e[i].name;f&&d&&"number"==typeof d&&u[f]&&(n++,b.warn('addFrames: overwriting frame "'+u[f].name+'" with a frame whose name of type "number" also equates to "'+f+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),n>5&&b.warn("addFrames: This API call has yielded too many warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),h.push({frame:M.supplyFrameDefaults(e[i]),index:r&&void 0!==r[i]&&null!==r[i]?r[i]:c+i})}h.sort(function(t,e){return t.index>e.index?-1:t.index<e.index?1:0});var p=[],m=[],v=l.length;for(i=h.length-1;i>=0;i--){if(a=h[i].frame,"number"==typeof a.name&&b.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!a.name)for(;u[a.name="frame "+t._transitionData._counter++];);if(u[a.name]){for(o=0;o<l.length&&(l[o]||{}).name!==a.name;o++);p.push({type:"replace",index:o,value:a}),m.unshift({type:"replace",index:o,value:l[o]})}else s=Math.max(0,Math.min(h[i].index,v)),p.push({type:"insert",index:s,value:a}),m.unshift({type:"delete",index:s}),v++}var g=M.modifyFrames,y=M.modifyFrames,x=[t,m],w=[t,p];return _&&_.add(t,g,x,y,w),M.modifyFrames(t,p)},y.deleteFrames=function(t,e){if(t=z.getGraphDiv(t),!b.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t);var r,n,i=t._transitionData._frames,a=[],o=[];if(!e)for(e=[],r=0;r<i.length;r++)e.push(r);for(e=e.slice(0),e.sort(),r=e.length-1;r>=0;r--)n=e[r],a.push({type:"delete",index:n}),o.unshift({type:"insert",index:n,value:i[n]});var s=M.modifyFrames,l=M.modifyFrames,u=[t,o],c=[t,a];return _&&_.add(t,s,u,l,c),M.modifyFrames(t,a)},y.purge=function(t){t=z.getGraphDiv(t);var e=t._fullLayout||{},r=t._fullData||[];return M.cleanPlot([],{},r,e),M.purge(t),x.purge(t),e._container&&e._container.remove(),delete t._context,delete t._replotPending,delete t._mouseDownTime,delete t._legendMouseDownTime,delete t._hmpixcount,delete t._hmlumcount,t}},{"../components/drawing":614,"../components/errorbars":620,"../constants/xmlns_namespaces":692,"../lib":709,"../lib/events":700,"../lib/queue":721,"../lib/svg_text_utils":728,"../plotly":743,"../plots/cartesian/axis_ids":751,"../plots/cartesian/constants":753,"../plots/cartesian/constraints":755,"../plots/cartesian/graph_interact":757,"../plots/plots":811,"../plots/polar":814,"../registry":826,"./helpers":733,"./manage_arrays":734,"./subroutines":740,d3:118,"fast-isnumeric":127}],736:[function(t,e,r){"use strict";function n(t,r){try{t._fullLayout._paper.style("background",r)}catch(t){e.exports.logging>0&&console.error(t)}}e.exports={staticPlot:!1,editable:!1,autosizable:!1,queueLength:0,fillFrame:!1,frameMargins:0,scrollZoom:!1,doubleClick:"reset+autosize",showTips:!0,showAxisDragHandles:!0,showAxisRangeEntryBoxes:!0,showLink:!1,sendData:!0,linkText:"Edit chart",showSources:!1,displayModeBar:"hover",modeBarButtonsToRemove:[],modeBarButtonsToAdd:[],modeBarButtons:!1,displaylogo:!0,plotGlPixelRatio:2,setBackground:n,topojsonURL:"https://cdn.plot.ly/",mapboxAccessToken:null,logging:!1,globalTransforms:[]}},{}],737:[function(t,e,r){"use strict";function n(t){var e,r;"area"===t?(e={attributes:b},r={}):(e=d.modules[t]._module,r=e.basePlotModule);var n={};n.type=null,w(n,m),w(n,e.attributes),r.attributes&&w(n,r.attributes),Object.keys(d.componentsRegistry).forEach(function(e){var r=d.componentsRegistry[e];r.schema&&r.schema.traces&&r.schema.traces[t]&&Object.keys(r.schema.traces[t]).forEach(function(e){f(n,r.schema.traces[t][e],e)})}),n.type=t;var i={meta:e.meta||{},attributes:s(n)};if(e.layoutAttributes){var a={};w(a,e.layoutAttributes),i.layoutAttributes=s(a)}return i}function i(){var t={};return w(t,v),Object.keys(d.subplotsRegistry).forEach(function(e){var r=d.subplotsRegistry[e];if(r.layoutAttributes)if("cartesian"===r.name)h(t,r,"xaxis"),h(t,r,"yaxis");else{var n="subplot"===r.attr?r.name:r.attr;h(t,r,n)}}),t=c(t),Object.keys(d.componentsRegistry).forEach(function(e){var r=d.componentsRegistry[e];r.layoutAttributes&&(r.schema&&r.schema.layout?Object.keys(r.schema.layout).forEach(function(e){
60 f(t,r.schema.layout[e],e)}):f(t,r.layoutAttributes,r.name))}),{layoutAttributes:s(t)}}function a(t){var e=d.transformsRegistry[t],r=w({},e.attributes);return Object.keys(d.componentsRegistry).forEach(function(e){var n=d.componentsRegistry[e];n.schema&&n.schema.transforms&&n.schema.transforms[t]&&Object.keys(n.schema.transforms[t]).forEach(function(e){f(r,n.schema.transforms[t][e],e)})}),{attributes:s(r)}}function o(){var t={frames:p.extendDeep({},g)};return s(t),t.frames}function s(t){return l(t),u(t),t}function l(t){function e(t){return{valType:"string"}}function n(t,n,i){r.isValObject(t)?"data_array"===t.valType?(t.role="data",i[n+"src"]=e(n)):t.arrayOk===!0&&(i[n+"src"]=e(n)):p.isPlainObject(t)&&(t.role="object")}r.crawl(t,n)}function u(t){function e(t,e,r){if(t){var n=t[k];n&&(delete t[k],r[e]={items:{}},r[e].items[n]=t,r[e].role="object")}}r.crawl(t,e)}function c(t){return _(t,{radialaxis:x.radialaxis,angularaxis:x.angularaxis}),_(t,x.layout),t}function h(t,e,r){var n=p.nestedProperty(t,r),i=w({},e.layoutAttributes);i[M]=!0,n.set(i)}function f(t,e,r){var n=p.nestedProperty(t,r);n.set(w(n.get()||{},e))}var d=t("../registry"),p=t("../lib"),m=t("../plots/attributes"),v=t("../plots/layout_attributes"),g=t("../plots/frame_attributes"),y=t("../plots/animation_attributes"),b=t("../plots/polar/area_attributes"),x=t("../plots/polar/axis_attributes"),_=p.extendFlat,w=p.extendDeep,M="_isSubplotObj",k="_isLinkedToArray",A=[M,k,"_arrayAttrRegexps","_deprecated"];r.IS_SUBPLOT_OBJ=M,r.IS_LINKED_TO_ARRAY=k,r.DEPRECATED="_deprecated",r.UNDERSCORE_ATTRS=A,r.get=function(){var t={};d.allTypes.concat("area").forEach(function(e){t[e]=n(e)});var e={};return Object.keys(d.transformsRegistry).forEach(function(t){e[t]=a(t)}),{defs:{valObjects:p.valObjects,metaKeys:A.concat(["description","role"])},traces:t,layout:i(),transforms:e,frames:o(),animation:s(y)}},r.crawl=function(t,e,n){var i=n||0;Object.keys(t).forEach(function(n){var a=t[n];A.indexOf(n)===-1&&(e(a,n,t,i),r.isValObject(a)||p.isPlainObject(a)&&r.crawl(a,e,i+1))})},r.isValObject=function(t){return t&&void 0!==t.valType},r.findArrayAttributes=function(t){function e(e,r,o,s){if(a=a.slice(0,s).concat([r]),e&&("data_array"===e.valType||e.arrayOk===!0)){var l=n(a),u=p.nestedProperty(t,l).get();Array.isArray(u)&&i.push(l)}}function n(t){return t.join(".")}var i=[],a=[];if(r.crawl(t._module.attributes,e),t.transforms)for(var o=t.transforms,s=0;s<o.length;s++){var l=o[s];a=["transforms["+s+"]"],r.crawl(l._module.attributes,e,1)}return t._fullInput&&(r.crawl(t._fullInput._module.attributes,e),i=p.filterUnique(i)),i}},{"../lib":709,"../plots/animation_attributes":744,"../plots/attributes":746,"../plots/frame_attributes":773,"../plots/layout_attributes":802,"../plots/polar/area_attributes":812,"../plots/polar/axis_attributes":813,"../registry":826}],738:[function(t,e,r){"use strict";function n(t){o.register(t,t.name,t.categories,t.meta),o.subplotsRegistry[t.basePlotModule.name]||o.registerSubplot(t.basePlotModule)}function i(t){if("string"!=typeof t.name)throw new Error("Transform module *name* must be a string.");var e="Transform module "+t.name,r="function"==typeof t.transform,n="function"==typeof t.calcTransform;if(!r&&!n)throw new Error(e+" is missing a *transform* or *calcTransform* method.");r&&n&&s.log([e+" has both a *transform* and *calcTransform* methods.","Please note that all *transform* methods are executed","before all *calcTransform* methods."].join(" ")),s.isPlainObject(t.attributes)||s.log(e+" registered without an *attributes* object."),"function"!=typeof t.supplyDefaults&&s.log(e+" registered without a *supplyDefaults* method."),o.transformsRegistry[t.name]=t}function a(t){if("string"!=typeof t.name)throw new Error("Component module *name* must be a string.");o.registerComponent(t)}var o=t("../registry"),s=t("../lib");e.exports=function(t){if(!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 r=t[e];if(!r)throw new Error("Invalid module was attempted to be registered!");switch(r.moduleType){case"trace":n(r);break;case"transform":i(r);break;case"component":a(r);break;default:throw new Error("Invalid module was attempted to be registered!")}}}},{"../lib":709,"../registry":826}],739:[function(t,e,r){"use strict";var n=t("../plotly"),i=t("../lib");e.exports=function(t){return i.extendFlat(n.defaultConfig,t)}},{"../lib":709,"../plotly":743}],740:[function(t,e,r){"use strict";function n(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}var i=t("d3"),a=t("../plotly"),o=t("../registry"),s=t("../plots/plots"),l=t("../lib"),u=t("../components/color"),c=t("../components/drawing"),h=t("../components/titles"),f=t("../components/modebar"),d=t("../plots/cartesian/graph_interact");r.layoutStyles=function(t){return l.syncOrAsync([s.doAutoMargin,r.lsInner],t)},r.lsInner=function(t){var e,o=t._fullLayout,s=o._size,l=a.Axes.list(t);for(e=0;e<l.length;e++)l[e]._linepositions={};o._paperdiv.style({width:o.width+"px",height:o.height+"px"}).selectAll(".main-svg").call(c.setSize,o.width,o.height),t._context.setBackground(t,o.paper_bgcolor);var h=o._paper.selectAll("g.subplot"),d=[],p=[];h.each(function(e){var r=o._plots[e];if(r.mainplot)return r.bg&&r.bg.remove(),void(r.bg=void 0);var i=a.Axes.getFromId(t,e,"x"),s=a.Axes.getFromId(t,e,"y"),l=i.domain,u=s.domain,c=[];n(l,u,p)?c=[0]:(d.push(e),p.push([l,u]));var h=r.plotgroup.selectAll(".bg").data(c);h.enter().append("rect").classed("bg",!0),h.exit().remove(),h.each(function(){r.bg=h;var t=r.plotgroup.node();t.insertBefore(this,t.childNodes[0])})});var m=o._bgLayer.selectAll(".bg").data(d);m.enter().append("rect").classed("bg",!0),m.exit().remove(),m.each(function(t){o._plots[t].bg=i.select(this)});var v=[];return h.each(function(e){var r=o._plots[e],n=a.Axes.getFromId(t,e,"x"),i=a.Axes.getFromId(t,e,"y");n.setScale(),i.setScale(),r.bg&&r.bg.call(c.setRect,n._offset-s.p,i._offset-s.p,n._length+2*s.p,i._length+2*s.p).call(u.fill,o.plot_bgcolor).style("stroke-width",0),r.clipId="clip"+o._uid+e+"plot";var l=o._defs.selectAll("g.clips").selectAll("#"+r.clipId).data([0]);l.enter().append("clipPath").attr({class:"plotclip",id:r.clipId}).append("rect"),l.selectAll("rect").attr({width:n._length,height:i._length}),r.plot.call(c.setTranslate,n._offset,i._offset),r.plot.call(c.setClipUrl,r.clipId);var h=c.crispRound(t,n.linewidth,1),f=c.crispRound(t,i.linewidth,1),d=s.p+f,p="M"+-d+",",m="h"+(n._length+2*d),g="free"===n.anchor&&v.indexOf(n._id)===-1,y=s.h*(1-(n.position||0))+h/2%1,b=n.anchor===i._id&&(n.mirror||"top"!==n.side)||"all"===n.mirror||"allticks"===n.mirror||n.mirrors&&n.mirrors[i._id+"bottom"],x=i._length+s.p+h/2,_=n.anchor===i._id&&(n.mirror||"top"===n.side)||"all"===n.mirror||"allticks"===n.mirror||n.mirrors&&n.mirrors[i._id+"top"],w=-s.p-h/2,M=s.p,k=b?0:h,A=_?0:h,T=","+(-M-A)+"v"+(i._length+2*M+A+k),S="free"===i.anchor&&v.indexOf(i._id)===-1,E=s.w*(i.position||0)+f/2%1,L=i.anchor===n._id&&(i.mirror||"right"!==i.side)||"all"===i.mirror||"allticks"===i.mirror||i.mirrors&&i.mirrors[n._id+"left"],C=-s.p-f/2,z=i.anchor===n._id&&(i.mirror||"right"===i.side)||"all"===i.mirror||"allticks"===i.mirror||i.mirrors&&i.mirrors[n._id+"right"],D=n._length+s.p+f/2;n._linepositions[e]=[b?x:void 0,_?w:void 0,g?y:void 0],n.anchor===i._id?n._linepositions[e][3]="top"===n.side?w:x:g&&(n._linepositions[e][3]=y),i._linepositions[e]=[L?C:void 0,z?D:void 0,S?E:void 0],i.anchor===n._id?i._linepositions[e][3]="right"===i.side?D:C:S&&(i._linepositions[e][3]=E);var I="translate("+n._offset+","+i._offset+")",P=I,O=I;g&&(P="translate("+n._offset+","+s.t+")",w+=i._offset-s.t,x+=i._offset-s.t),S&&(O="translate("+s.l+","+i._offset+")",C+=n._offset-s.l,D+=n._offset-s.l),r.xlines.attr("transform",P).attr("d",(b?p+x+m:"")+(_?p+w+m:"")+(g?p+y+m:"")||"M0,0").style("stroke-width",h+"px").call(u.stroke,n.showline?n.linecolor:"rgba(0,0,0,0)"),r.ylines.attr("transform",O).attr("d",(L?"M"+C+T:"")+(z?"M"+D+T:"")+(S?"M"+E+T:"")||"M0,0").attr("stroke-width",f+"px").call(u.stroke,i.showline?i.linecolor:"rgba(0,0,0,0)"),r.xaxislayer.attr("transform",P),r.yaxislayer.attr("transform",O),r.gridlayer.attr("transform",I),r.zerolinelayer.attr("transform",I),r.draglayer.attr("transform",I),g&&v.push(n._id),S&&v.push(i._id)}),a.Axes.makeClipPaths(t),r.drawMainTitle(t),f.manage(t),t._promises.length&&Promise.all(t._promises)},r.drawMainTitle=function(t){var e=t._fullLayout;h.draw(t,"gtitle",{propContainer:e,propName:"title",dfltName:"Plot",attributes:{x:e.width/2,y:e._size.t/2,"text-anchor":"middle"}})},r.doTraceStyle=function(t){for(var e=0;e<t.calcdata.length;e++){var r=t.calcdata[e],n=((r[0]||{}).trace||{})._module||{},i=n.arraysToCalcdata;i&&i(r,r[0].trace)}return s.style(t),o.getComponentMethod("legend","draw")(t),s.previousPromises(t)},r.doColorBars=function(t){for(var e=0;e<t.calcdata.length;e++){var r=t.calcdata[e][0];if((r.t||{}).cb){var n=r.trace,i=r.t.cb;o.traceIs(n,"contour")&&i.line({width:n.contours.showlines!==!1?n.line.width:0,dash:n.line.dash,color:"line"===n.contours.coloring?i._opts.line.color:n.line.color}),o.traceIs(n,"markerColorscale")?i.options(n.marker.colorbar)():i.options(n.colorbar)()}}return s.previousPromises(t)},r.layoutReplot=function(t){var e=t.layout;return t.layout=void 0,a.plot(t,"",e)},r.doLegend=function(t){return o.getComponentMethod("legend","draw")(t),s.previousPromises(t)},r.doTicksRelayout=function(t){return a.Axes.doTicks(t,"redraw"),r.drawMainTitle(t),s.previousPromises(t)},r.doModeBar=function(t){var e,r,n=t._fullLayout;for(f.manage(t),d(t),e=s.getSubplotIds(n,"gl3d"),r=0;r<e.length;r++){n[e[r]]._scene.updateFx(n.dragmode,n.hovermode)}return s.previousPromises(t)},r.doCamera=function(t){for(var e=t._fullLayout,r=s.getSubplotIds(e,"gl3d"),n=0;n<r.length;n++){var i=e[r[n]];i._scene.setCamera(i.camera)}}},{"../components/color":590,"../components/drawing":614,"../components/modebar":650,"../components/titles":679,"../lib":709,"../plotly":743,"../plots/cartesian/graph_interact":757,"../plots/plots":811,"../registry":826,d3:118}],741:[function(t,e,r){"use strict";function n(t,e){return new Promise(function(r,n){function h(){var t=s.getDelay(p._fullLayout);return new Promise(function(r,n){setTimeout(function(){var t=u(p),i=document.createElement("canvas");i.id=o.randstr(),c({format:e.format,width:p._fullLayout.width,height:p._fullLayout.height,canvas:i,svg:t,promise:!0}).then(function(t){p&&document.body.removeChild(p),r(t)}).catch(function(t){n(t)})},t)})}e=e||{},e.format=e.format||"png";var f=function(t){return void 0===t||null===t||!!(i(t)&&t>1)};f(e.width)&&f(e.height)||n(new Error("Height and width should be pixel values."));var d=l(t,{format:"png",height:e.height,width:e.width}),p=d.gd;p.style.position="absolute",p.style.left="-5000px",document.body.appendChild(p);var m=s.getRedrawFunc(p);a.plot(p,d.data,d.layout,d.config).then(m).then(h).then(function(t){r(t)}).catch(function(t){n(t)})})}var i=t("fast-isnumeric"),a=t("../plotly"),o=t("../lib"),s=t("../snapshot/helpers"),l=t("../snapshot/cloneplot"),u=t("../snapshot/tosvg"),c=t("../snapshot/svgtoimg");e.exports=n},{"../lib":709,"../plotly":743,"../snapshot/cloneplot":827,"../snapshot/helpers":830,"../snapshot/svgtoimg":832,"../snapshot/tosvg":834,"fast-isnumeric":127}],742:[function(t,e,r){"use strict";function n(t,e,r,i,a,u){u=u||[];for(var c=Object.keys(t),f=0;f<c.length;f++){var d=c[f];if("transforms"!==d){var v=u.slice();v.push(d);var g=t[d],y=e[d],b=l(r,d),x="info_array"===(b||{}).valType,_="colorscale"===(b||{}).valType;if(s(r,d))if(p(g)&&p(y))n(g,y,b,i,a,v);else if(b.items&&!x&&m(g)){var w,M,k=b.items,A=k[Object.keys(k)[0]],T=[];for(w=0;w<y.length;w++){var S=y[w]._index||w;M=v.slice(),M.push(S),p(g[S])&&p(y[w])&&(T.push(S),n(g[S],y[w],A,i,a,M))}for(w=0;w<g.length;w++)M=v.slice(),M.push(w),p(g[w])?T.indexOf(w)===-1&&i.push(o("unused",a,M)):i.push(o("object",a,M,g[w]))}else!p(g)&&p(y)?i.push(o("object",a,v,g)):m(g)||!m(y)||x||_?d in e?h.validate(g,b)||i.push(o("value",a,v,g)):i.push(o("unused",a,v,g)):i.push(o("array",a,v,g));else i.push(o("schema",a,v))}}return i}function i(t,e){for(var r=0;r<e.length;r++){var n=e[r].type,i=t.traces[n].layoutAttributes;i&&h.extendFlat(t.layout.layoutAttributes,i)}return t.layout.layoutAttributes}function a(t){return m(t)?"In data trace "+t[1]+", ":"In "+t+", "}function o(t,e,r,n){r=r||"";var i,a;m(e)?(i=e[0],a=e[1]):(i=e,a=null);var o=c(r),s=v[t](e,o,n);return h.log(s),{code:t,container:i,trace:a,path:r,astr:o,msg:s}}function s(t,e){var r=u(e),n=r.keyMinusId,i=r.id;return!!(n in t&&t[n]._isSubplotObj&&i)||e in t}function l(t,e){return t[u(e).keyMinusId]}function u(t){var e=t.split(/([2-9]|[1-9][0-9]+)$/)[0];return{keyMinusId:e,id:t.substr(e.length,t.length)}}function c(t){if(!m(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}var h=t("../lib"),f=t("../plots/plots"),d=t("./plot_schema"),p=h.isPlainObject,m=Array.isArray;e.exports=function(t,e){var r,a,s=d.get(),l=[],u={};m(t)?(u.data=h.extendDeep([],t),r=t):(u.data=[],r=[],l.push(o("array","data"))),p(e)?(u.layout=h.extendDeep({},e),a=e):(u.layout={},a={},arguments.length>1&&l.push(o("object","layout"))),f.supplyDefaults(u);for(var c=u._fullData,v=r.length,g=0;g<v;g++){var y=r[g],b=["data",g];if(p(y)){var x=c[g],_=x.type,w=s.traces[_].attributes;w.type={valType:"enumerated",values:[_]},x.visible===!1&&y.visible!==!1&&l.push(o("invisible",b)),n(y,x,w,l,b);var M=y.transforms,k=x.transforms;if(M){m(M)||l.push(o("array",b,["transforms"])),b.push("transforms");for(var A=0;A<M.length;A++){var T=["transforms",A],S=M[A].type;if(p(M[A])){var E=s.transforms[S]?s.transforms[S].attributes:{};E.type={valType:"enumerated",values:Object.keys(s.transforms)},n(M[A],k[A],E,l,b,T)}else l.push(o("object",b,T))}}}else l.push(o("object",b))}return n(a,u._fullLayout,i(s,c),l,"layout"),0===l.length?void 0:l};var v={object:function(t,e){return("layout"===t&&""===e?"The layout argument":"data"===t[0]&&""===e?"Trace "+t[1]+" in the data argument":a(t)+"key "+e)+" must be linked to an object container"},array:function(t,e){return("data"===t?"The data argument":a(t)+"key "+e)+" must be linked to an array container"},schema:function(t,e){return a(t)+"key "+e+" is not part of the schema"},unused:function(t,e,r){var n=p(r)?"container":"key";return a(t)+n+" "+e+" did not get coerced"},invisible:function(t){return"Trace "+t[1]+" got defaulted to be not visible"},value:function(t,e,r){return[a(t)+"key "+e,"is set to an invalid value ("+r+")"].join(" ")}}},{"../lib":709,"../plots/plots":811,"./plot_schema":737}],743:[function(t,e,r){"use strict";r.defaultConfig=t("./plot_api/plot_config"),r.Plots=t("./plots/plots"),r.Axes=t("./plots/cartesian/axes"),r.ModeBar=t("./components/modebar"),t("./plot_api/plot_api")},{"./components/modebar":650,"./plot_api/plot_api":735,"./plot_api/plot_config":736,"./plots/cartesian/axes":748,"./plots/plots":811}],744:[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},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"]}}}},{}],745:[function(t,e,r){"use strict";var n=t("../lib");e.exports=function(t,e,r){var i,a=r.name,o=e[a],s=n.isArray(t[a])?t[a]:[],l=e[a]=[];for(i=0;i<s.length;i++){var u=s[i],c={},h={};n.isPlainObject(u)||(h.itemIsNotPlainObject=!0,u={}),r.handleItemDefaults(u,c,e,r,h),c._input=u,c._index=i,l.push(c)}if(n.isArray(o)){var f=Math.min(o.length,l.length);for(i=0;i<f;i++)n.relinkPrivateKeys(l[i],o[i])}}},{"../lib":709}],746:[function(t,e,r){"use strict";var n=t("../components/fx/attributes");e.exports={type:{valType:"enumerated",values:[],dflt:"scatter"},visible:{valType:"enumerated",values:[!0,!1,"legendonly"],dflt:!0},showlegend:{valType:"boolean",dflt:!0},legendgroup:{valType:"string",dflt:""},opacity:{valType:"number",min:0,max:1,dflt:1},name:{valType:"string"},uid:{valType:"string",dflt:""},hoverinfo:{valType:"flaglist",flags:["x","y","z","text","name"],extras:["all","none","skip"],dflt:"all"},hoverlabel:n.hoverlabel,stream:{token:{valType:"string",noBlank:!0,strict:!0},maxpoints:{valType:"number",min:0,max:1e4,dflt:500}}}},{"../components/fx/attributes":623}],747:[function(t,e,r){"use strict";e.exports={xaxis:{valType:"subplotid",dflt:"x"},yaxis:{valType:"subplotid",dflt:"y"}}},{}],748:[function(t,e,r){"use strict";function n(t,e,r,n,i){function a(e){return(1+100*(e-t)/r.dtick)%100<2}for(var o=0,s=0,l=0,u=0,c=0;c<e.length;c++)e[c]%1==0?l++:b(e[c])||u++,a(e[c])&&o++,a(e[c]+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||a(n)||a(i))){var f=r.dtick/2;t+=t+f<n?f:-f}return t}function i(t,e,r,n,i){var a=_.findExactDates(e,i);if(a.exactDays>.8){var o=Number(r.substr(1));a.exactYears>.8&&o%12==0?t=O.tickIncrement(t,"M6","reverse")+1.5*C:a.exactMonths>.8?t=O.tickIncrement(t,"M1","reverse")+15.5*C:t-=C/2;var s=O.tickIncrement(t,r);if(s<=n)return s}return t}function a(t){var e,r,n=t.tickvals,i=t.ticktext,a=new Array(n.length),o=_.simpleMap(t.range,t.r2l),s=1.0001*o[0]-1e-4*o[1],u=1.0001*o[1]-1e-4*o[0],c=Math.min(s,u),h=Math.max(s,u),f=0;Array.isArray(i)||(i=[]);var d="category"===t.type?t.d2l_noadd:t.d2l;for("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)),r=0;r<n.length;r++)(e=d(n[r]))>c&&e<h&&(void 0===i[r]?a[f]=O.tickText(t,e):a[f]=l(t,e,String(i[r])),f++);return f<n.length&&a.splice(f,n.length-f),a}function o(t,e,r){return e*_.roundUp(t/e,r)}function s(t){var e=t.dtick;if(t._tickexponent=0,b(e)||"string"==typeof e||(e=1),"category"===t.type&&(t._tickround=null),"date"===t.type){var r=t.r2l(t.tick0),n=t.l2r(r).replace(/(^-|i)/g,""),i=n.length;if("M"===String(e).charAt(0))i>10||"01-01"!==n.substr(5)?t._tickround="d":t._tickround=+e.substr(1)%12==0?"y":"m";else if(e>=C&&i<=10||e>=15*C)t._tickround="d";else if(e>=D&&i<=16||e>=z)t._tickround="M";else if(e>=I&&i<=19||e>=D)t._tickround="S";else{var a=t.l2r(r+e).replace(/^-/,"").length;t._tickround=Math.max(i,a)-20}}else if(b(e)||"L"===e.charAt(0)){var o=t.range.map(t.r2d||Number);b(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var s=Math.max(Math.abs(o[0]),Math.abs(o[1])),l=Math.floor(Math.log(s)/Math.LN10+.01);Math.abs(l)>3&&("SI"===t.exponentformat||"B"===t.exponentformat?t._tickexponent=3*Math.round((l-1)/3):t._tickexponent=l)}else t._tickround=null}function l(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}}function u(t,e,r,n){var i=t._tickround,a=r&&t.hoverformat||t.tickformat;n&&(i=b(i)?4:{y:"m",m:"d",d:"M",M:"S",S:4}[i]);var o,s=_.formatDate(e.x,a,i,t.calendar),l=s.indexOf("\n");l!==-1&&(o=s.substr(l+1),s=s.substr(0,l)),n&&("00:00:00"===s||"00:00"===s?(s=o,o=""):8===s.length&&(s=s.replace(/:00$/,""))),o&&(r?"d"===i?s+=", "+o:s=o+(s?", "+s:""):t._inCalcTicks&&o===t._prevDateHead||(s+="<br>"+o,t._prevDateHead=o)),e.text=s}function c(t,e,r,n,i){var a=t.dtick,o=e.x;if(!n||"string"==typeof a&&"L"===a.charAt(0)||(a="L3"),t.tickformat||"string"==typeof a&&"L"===a.charAt(0))e.text=d(Math.pow(10,o),t,i,n);else if(b(a)||"D"===a.charAt(0)&&_.mod(o+.01,1)<.1)if(["e","E","power"].indexOf(t.exponentformat)!==-1){var s=Math.round(o);e.text=0===s?1:1===s?"10":s>1?"10<sup>"+s+"</sup>":"10<sup>\u2212"+-s+"</sup>",e.fontSize*=1.25}else e.text=d(Math.pow(10,o),t,"","fakehover"),"D1"===a&&"y"===t._id.charAt(0)&&(e.dy-=e.fontSize/6);else{if("D"!==a.charAt(0))throw"unrecognized dtick "+String(a);e.text=String(Math.round(Math.pow(10,_.mod(o,1)))),e.fontSize*=.75}if("D1"===t.dtick){var l=String(e.text).charAt(0);"0"!==l&&"1"!==l||("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*(o<0?.5:.25)))}}function h(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r=""),e.text=String(r)}function f(t,e,r,n,i){"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(i="hide"),e.text=d(e.x,t,i,n)}function d(t,e,r,n){var i=t<0,a=e._tickround,o=r||e.exponentformat||"B",l=e._tickexponent,u=e.tickformat,c=e.separatethousands;if(n){var h={exponentformat:e.exponentformat,dtick:"none"===e.showexponent?e.dtick:b(t)?Math.abs(t)||1:1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};s(h),a=(Number(h._tickround)||0)+4,l=h._tickexponent,e.hoverformat&&(u=e.hoverformat)}if(u)return y.format(u)(t).replace(/-/g,"\u2212");var f=Math.pow(10,-a)/2;if("none"===o&&(l=0),(t=Math.abs(t))<f)t="0",i=!1;else{if(t+=f,l&&(t*=Math.pow(10,-l),a+=l),0===a)t=String(Math.floor(t));else if(a<0){t=String(Math.round(t)),t=t.substr(0,t.length+a);for(var d=a;d<0;d++)t+="0"}else{t=String(t);var p=t.indexOf(".")+1;p&&(t=t.substr(0,p+a).replace(/\.?0+$/,""))}t=_.numSeparate(t,e._separators,c)}if(l&&"hide"!==o){var m;m=l<0?"\u2212"+-l:"power"!==o?"+"+l:String(l),"e"===o||("SI"===o||"B"===o)&&(l>12||l<-15)?t+="e"+m:"E"===o?t+="E"+m:"power"===o?t+="\xd710<sup>"+m+"</sup>":"B"===o&&9===l?t+="B":"SI"!==o&&"B"!==o||(t+=H[l/3+5])}return i?"\u2212"+t:t}function p(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++)i[n].x.indexOf(o)===-1&&i[n].y.indexOf(s)===-1||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]],m(u.x,l.x),m(u.y,l.y);m(u.x,[o]),m(u.y,[s])}else i.push({x:[o],y:[s]})}}return i}function m(t,e){for(var r=0;r<e.length;r++)t.indexOf(e[r])===-1&&t.push(e[r])}function v(t,e,r){var n,i,a=[],o=[],s=t.layout;for(n=0;n<e.length;n++)a.push(O.getFromId(t,e[n]));for(n=0;n<r.length;n++)o.push(O.getFromId(t,r[n]));var l=Object.keys(a[0]),u=["anchor","domain","overlaying","position","side","tickangle"],c=["linear","log"];for(n=0;n<l.length;n++){var h=l[n],f=a[0][h],d=o[0][h],p=!0,m=!1,v=!1;if("_"!==h.charAt(0)&&"function"!=typeof f&&u.indexOf(h)===-1){for(i=1;i<a.length&&p;i++){var y=a[i][h];"type"===h&&c.indexOf(f)!==-1&&c.indexOf(y)!==-1&&f!==y?m=!0:y!==f&&(p=!1)}for(i=1;i<o.length&&p;i++){var b=o[i][h];"type"===h&&c.indexOf(d)!==-1&&c.indexOf(b)!==-1&&d!==b?v=!0:o[i][h]!==d&&(p=!1)}p&&(m&&(s[a[0]._name].type="linear"),v&&(s[o[0]._name].type="linear"),g(s,h,a,o))}}for(n=0;n<t._fullLayout.annotations.length;n++){var x=t._fullLayout.annotations[n];e.indexOf(x.xref)!==-1&&r.indexOf(x.yref)!==-1&&_.swapAttrs(s.annotations[n],["?"])}}function g(t,e,r,n){var i,a=_.nestedProperty,o=a(t[r[0]._name],e).get(),s=a(t[n[0]._name],e).get();for("title"===e&&("Click to enter X axis title"===o&&(o="Click to enter Y axis title"),"Click to enter Y axis title"===s&&(s="Click to enter X axis title")),i=0;i<r.length;i++)a(t,r[i]._name+"."+e).set(s);for(i=0;i<n.length;i++)a(t,n[i]._name+"."+e).set(o)}var y=t("d3"),b=t("fast-isnumeric"),x=t("../../registry"),_=t("../../lib"),w=t("../../lib/svg_text_utils"),M=t("../../components/titles"),k=t("../../components/color"),A=t("../../components/drawing"),T=t("../../constants/numerical"),S=T.FP_SAFE,E=T.ONEAVGYEAR,L=T.ONEAVGMONTH,C=T.ONEDAY,z=T.ONEHOUR,D=T.ONEMIN,I=T.ONESEC,P=T.BADNUM,O=e.exports={};O.layoutAttributes=t("./layout_attributes"),O.supplyLayoutDefaults=t("./layout_defaults"),O.setConvert=t("./set_convert");var j=t("./axis_autotype"),F=t("./axis_ids");O.id2name=F.id2name,O.cleanId=F.cleanId,O.list=F.list,O.listIds=F.listIds,O.getFromId=F.getFromId,O.getFromTrace=F.getFromTrace,O.coerceRef=function(t,e,r,n,i,a){var o=n.charAt(n.length-1),s=O.listIds(r,o),l=n+"ref",u={};return i||(i=s[0]||a),a||(a=i),u[l]={valType:"enumerated",values:s.concat(a?[a]:[]),dflt:i},_.coerce(t,e,u,l)},O.coercePosition=function(t,e,r,n,i,a){var o,s;if("paper"===n||"pixel"===n)o=r(i,a);else{var l=O.getFromId(e,n);if(a=l.fraction2r(a),o=r(i,a),"category"===l.type){if("string"==typeof o&&(l._categories||[]).length)return s=l._categories.indexOf(o),void(t[i]=s===-1?a:s)}else if("date"===l.type)return void(t[i]=_.cleanDate(o,P,l.calendar))}t[i]=b(o)?Number(o):a},O.getDataToCoordFunc=function(t,e,r,n){var i,a="x"===r||"y"===r||"z"===r?r:n;if(Array.isArray(a)){if(i={type:j(n),_categories:[]},O.setConvert(i),"category"===i.type)for(var o=0;o<n.length;o++)i.d2c(n[o])}else i=O.getFromTrace(t,e,a);return i?i.d2c:"ids"===a?function(t){return String(t)}:function(t){return+t}},O.clearTypes=function(t,e){Array.isArray(e)&&e.length||(e=t._fullData.map(function(t,e){return e})),e.forEach(function(e){var r=t.data[e];delete(O.getFromId(t,r.xaxis)||{}).type,delete(O.getFromId(t,r.yaxis)||{}).type})},O.counterLetter=function(t){var e=t.charAt(0);return"x"===e?"y":"y"===e?"x":void 0},O.minDtick=function(t,e,r,n){["log","category"].indexOf(t.type)===-1&&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},O.getAutoRange=function(t){var e,r=[],n=t._min[0].val,i=t._max[0].val;for(e=1;e<t._min.length&&n===i;e++)n=Math.min(n,t._min[e].val);for(e=1;e<t._max.length&&n===i;e++)i=Math.max(i,t._max[e].val);var a,o,s,l,u,c,h,f=0,d=!1;if(t.range){var p=_.simpleMap(t.range,t.r2l);d=p[1]<p[0]}for("reversed"===t.autorange&&(d=!0,t.autorange=!0),e=0;e<t._min.length;e++)for(o=t._min[e],a=0;a<t._max.length;a++)s=t._max[a],h=s.val-o.val,c=t._length-o.pad-s.pad,h>0&&c>0&&h/c>f&&(l=o,u=s,f=h/c);if(n===i){var m=n-1,v=n+1;r="tozero"===t.rangemode?n<0?[m,0]:[0,v]:"nonnegative"===t.rangemode?[Math.max(0,m),Math.max(0,v)]:[m,v]}else f&&("linear"!==t.type&&"-"!==t.type||("tozero"===t.rangemode?(l.val>=0&&(l={val:0,pad:0}),u.val<=0&&(u={val:0,pad:0})):"nonnegative"===t.rangemode&&(l.val-f*l.pad<0&&(l={val:0,pad:0}),u.val<0&&(u={val:1,pad:0})),f=(u.val-l.val)/(t._length-l.pad-u.pad)),r=[l.val-f*l.pad,u.val+f*u.pad]);return r[0]===r[1]&&("tozero"===t.rangemode?r=r[0]<0?[r[0],0]:r[0]>0?[0,r[0]]:[0,1]:(r=[r[0]-1,r[0]+1],"nonnegative"===t.rangemode&&(r[0]=Math.max(0,r[0])))),d&&r.reverse(),_.simpleMap(r,t.l2r||Number)},O.doAutoRange=function(t){t._length||t.setScale();var e=t._min&&t._max&&t._min.length&&t._max.length;if(t.autorange&&e){t.range=O.getAutoRange(t);var r=t._input;r.range=t.range.slice(),r.autorange=t.autorange}},O.saveRangeInitial=function(t,e){for(var r=O.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&&a.autorange===!1||e&&s)&&(a._rangeInitial=a.range.slice(),n=!0)}return n},O.saveShowSpikeInitial=function(t,e){for(var r=O.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},O.expand=function(t,e,r){function n(t){if(Array.isArray(t))return function(e){return Math.max(Number(t[e]||0),0)};var e=Math.max(Number(t||0),0);return function(){return e}}function i(r){function n(t){return b(t)&&Math.abs(t)<S}if(l=e[r],b(l)){if(h=x(r)+g,f=w(r)+g,p=l-k(r),m=l+M(r),"log"===t.type&&p<m/10&&(p=m/10),u=t.c2l(p),c=t.c2l(m),y&&(u=Math.min(0,u),c=Math.max(0,c)),n(u)){for(d=!0,o=0;o<t._min.length&&d;o++)s=t._min[o],s.val<=u&&s.pad>=f?d=!1:s.val>=u&&s.pad<=f&&(t._min.splice(o,1),o--);d&&t._min.push({val:u,pad:y&&0===u?0:f})}if(n(c)){for(d=!0,o=0;o<t._max.length&&d;o++)s=t._max[o],s.val>=c&&s.pad>=h?d=!1:s.val<=c&&s.pad<=h&&(t._max.splice(o,1),o--);d&&t._max.push({val:c,pad:y&&0===c?0:h})}}}if((t.autorange||!!_.nestedProperty(t,"rangeslider.autorange").get())&&e){t._min||(t._min=[]),t._max||(t._max=[]),r||(r={}),t._m||t.setScale();var a,o,s,l,u,c,h,f,d,p,m,v=e.length,g=r.padded?.05*t._length:0,y=r.tozero&&("linear"===t.type||"-"===t.type),x=n((t._m>0?r.ppadplus:r.ppadminus)||r.ppad||0),w=n((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),M=n(r.vpadplus||r.vpad),k=n(r.vpadminus||r.vpad);for(a=0;a<6;a++)i(a);for(a=v-1;a>5;a--)i(a)}},O.autoBin=function(t,e,r,a,o){var s=_.aggNums(Math.min,null,t),l=_.aggNums(Math.max,null,t);if(o||(o=e.calendar),"category"===e.type)return{start:s-.5,end:l+.5,size:1};var u;if(r)u=(l-s)/r;else{var c=_.distinctVals(t),h=Math.pow(10,Math.floor(Math.log(c.minDiff)/Math.LN10)),f=h*_.roundUp(c.minDiff/h,[.9,1.9,4.9,9.9],!0);u=Math.max(f,2*_.stdev(t)/Math.pow(t.length,a?.25:.4)),b(u)||(u=1)}var d;d="log"===e.type?{type:"linear",range:[s,l]}:{type:e.type,range:_.simpleMap([s,l],e.c2r,0,o),calendar:o},O.setConvert(d),O.autoTicks(d,u);var p,m=O.tickIncrement(O.tickFirst(d),d.dtick,"reverse",o);if("number"==typeof d.dtick){m=n(m,t,d,s,l);p=m+(1+Math.floor((l-m)/d.dtick))*d.dtick}else for("M"===d.dtick.charAt(0)&&(m=i(m,t,d.dtick,s,o)),p=m;p<=l;)p=O.tickIncrement(p,d.dtick,!1,o);return{start:e.c2r(m,0,o),end:e.c2r(p,0,o),size:d.dtick}},O.calcTicks=function(t){var e=_.simpleMap(t.range,t.r2l);if("auto"===t.tickmode||!t.dtick){var r,n=t.nticks;n||("category"===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=_.constrain(t._length/r,4,9)+1)),"array"===t.tickmode&&(n*=100),O.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))}if(t.tick0||(t.tick0="date"===t.type?"2000-01-01":0),s(t),"array"===t.tickmode)return a(t);t._tmin=O.tickFirst(t);var i=e[1]<e[0],o=[],l=1.0001*e[1]-1e-4*e[0];"category"===t.type&&(l=i?Math.max(-.5,l):Math.min(t._categories.length-.5,l));for(var u=t._tmin;(i?u>=l:u<=l)&&(o.push(u),!(o.length>1e3));u=O.tickIncrement(u,t.dtick,i,t.calendar));t._tmax=o[o.length-1],t._prevDateHead="",t._inCalcTicks=!0;for(var c=new Array(o.length),h=0;h<o.length;h++)c[h]=O.tickText(t,o[h]);return t._inCalcTicks=!1,c};var R=[2,5,10],N=[1,2,3,6,12],B=[1,2,5,10,15,30],U=[1,2,3,7,14],V=[-.046,0,.301,.477,.602,.699,.778,.845,.903,.954,1],q=[-.301,0,.301,.699,1];O.autoTicks=function(t,e){var r;if("date"===t.type){t.tick0=_.dateTick0(t.calendar);var n=2*e;n>E?(e/=E,r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick="M"+12*o(e,r,R)):n>L?(e/=L,t.dtick="M"+o(e,1,N)):n>C?(t.dtick=o(e,C,U),t.tick0=_.dateTick0(t.calendar,!0)):n>z?t.dtick=o(e,z,N):n>D?t.dtick=o(e,D,B):n>I?t.dtick=o(e,I,B):(r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick=o(e,r,R))}else if("log"===t.type){t.tick0=0;var i=_.simpleMap(t.range,t.r2l);if(e>.7)t.dtick=Math.ceil(e);else if(Math.abs(i[1]-i[0])<1){var a=1.5*Math.abs((i[1]-i[0])/e);e=Math.abs(Math.pow(10,i[1])-Math.pow(10,i[0]))/a,r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick="L"+o(e,r,R)}else t.dtick=e>.3?"D2":"D1"}else"category"===t.type?(t.tick0=0,t.dtick=Math.ceil(Math.max(e,1))):(t.tick0=0,r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick=o(e,r,R));if(0===t.dtick&&(t.dtick=1),!b(t.dtick)&&"string"!=typeof t.dtick){var s=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(s)}},O.tickIncrement=function(t,e,r,n){var i=r?-1:1;if(b(e))return t+i*e;var a=e.charAt(0),o=i*Number(e.substr(1));if("M"===a)return _.incrementMonth(t,o,n);if("L"===a)return Math.log(Math.pow(10,t)+o)/Math.LN10;if("D"===a){var s="D2"===e?q:V,l=t+.01*i,u=_.roundUp(_.mod(l,1),s,r);return Math.floor(l)+Math.log(y.round(Math.pow(10,u),1))/Math.LN10}
61 throw"unrecognized dtick "+String(e)},O.tickFirst=function(t){var e=t.r2l||Number,r=_.simpleMap(t.range,e),n=r[1]<r[0],i=n?Math.floor:Math.ceil,a=1.0001*r[0]-1e-4*r[1],o=t.dtick,s=e(t.tick0);if(b(o)){var l=i((a-s)/o)*o+s;return"category"===t.type&&(l=_.constrain(l,0,t._categories.length-1)),l}var u=o.charAt(0),c=Number(o.substr(1));if("M"===u){for(var h,f,d,p=0,m=s;p<10;){if(((h=O.tickIncrement(m,o,n,t.calendar))-a)*(m-a)<=0)return n?Math.min(m,h):Math.max(m,h);f=(a-(m+h)/2)/(h-m),d=u+(Math.abs(Math.round(f))||1)*c,m=O.tickIncrement(m,d,f<0?!n:n,t.calendar),p++}return _.error("tickFirst did not converge",t),m}if("L"===u)return Math.log(i((Math.pow(10,a)-s)/c)*c+s)/Math.LN10;if("D"===u){var v="D2"===o?q:V,g=_.roundUp(_.mod(a,1),v,n);return Math.floor(a)+Math.log(y.round(Math.pow(10,g),1))/Math.LN10}throw"unrecognized dtick "+String(o)},O.tickText=function(t,e,r){function n(n){var i;return void 0===n||(r?"none"===n:(i={first:t._tmin,last:t._tmax}[n],"all"!==n&&e!==i))}var i,a,o=l(t,e),s="array"===t.tickmode,d=r||s,p="category"===t.type?t.d2l_noadd:t.d2l;if(s&&Array.isArray(t.ticktext)){var m=_.simpleMap(t.range,t.r2l),v=Math.abs(m[1]-m[0])/1e4;for(a=0;a<t.ticktext.length&&!(Math.abs(e-p(t.tickvals[a]))<v);a++);if(a<t.ticktext.length)return o.text=String(t.ticktext[a]),o}return i="none"!==t.exponentformat&&n(t.showexponent)?"hide":"","date"===t.type?u(t,o,r,d):"log"===t.type?c(t,o,r,d,i):"category"===t.type?h(t,o):f(t,o,r,d,i),t.tickprefix&&!n(t.showtickprefix)&&(o.text=t.tickprefix+o.text),t.ticksuffix&&!n(t.showticksuffix)&&(o.text+=t.ticksuffix),o};var H=["f","p","n","\u03bc","m","","k","M","G","T"];O.subplotMatch=/^x([0-9]*)y([0-9]*)$/,O.getSubplots=function(t,e){var r,n,i,a=[],o=t._fullData||t.data||[];for(r=0;r<o.length;r++){var s=o[r];if(s.visible!==!1&&"legendonly"!==s.visible&&(x.traceIs(s,"cartesian")||x.traceIs(s,"gl2d"))){i=(s.xaxis||"x")+(s.yaxis||"y"),a.indexOf(i)===-1&&a.push(i)}}var l=O.list(t,"",!0);for(r=0;r<l.length;r++){var u=l[r],c=u._id.charAt(0),h="free"===u.anchor?"x"===c?"y":"x":u.anchor,f=O.getFromId(t,h),d=!1;for(n=0;n<a.length;n++)if(function(t,e){return t.indexOf(e._id)!==-1}(a[n],u)){d=!0;break}"free"===u.anchor&&d||f&&(i="x"===c?u._id+f._id:f._id+u._id,a.indexOf(i)===-1&&a.push(i))}var p=O.subplotMatch,m=[];for(r=0;r<a.length;r++)i=a[r],p.test(i)&&m.push(i);return m.sort(function(t,e){var r=t.match(p),n=e.match(p);return r[1]===n[1]?+(r[2]||1)-(n[2]||1):+(r[1]||0)-(n[1]||0)}),e?O.findSubplotsWithAxis(m,e):m},O.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},O.makeClipPaths=function(t){var e,r,n=t._fullLayout,i=n._defs,a={_offset:0,_length:n.width,_id:""},o={_offset:0,_length:n.height,_id:""},s=O.list(t,"x",!0),l=O.list(t,"y",!0),u=[];for(e=0;e<s.length;e++)for(u.push({x:s[e],y:o}),r=0;r<l.length;r++)0===e&&u.push({x:a,y:l[r]}),u.push({x:s[e],y:l[r]});var c=i.selectAll("g.clips").data([0]);c.enter().append("g").classed("clips",!0);var h=c.selectAll(".axesclip").data(u,function(t){return t.x._id+t.y._id});h.enter().append("clipPath").classed("axesclip",!0).attr("id",function(t){return"clip"+n._uid+t.x._id+t.y._id}).append("rect"),h.exit().remove(),h.each(function(t){y.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})})},O.doTicks=function(t,e,r){function n(t){var e=u.l2p(t.x);return e>1&&e<u._length-1}function i(t,e){var r=t.selectAll("path."+L).data("inside"===u.ticks?q:S,E);e&&u.ticks?(r.enter().append("path").classed(L,1).classed("ticks",1).classed("crisp",1).call(k.stroke,u.tickcolor).style("stroke-width",N+"px").attr("d",e),r.attr("transform",d),r.exit().remove()):r.remove()}function a(r,n){function i(t,e){t.each(function(t){var r=x(e),n=y.select(this),i=n.select(".text-math-group"),a=d(t)+(b(e)&&0!=+e?" rotate("+e+","+f(t)+","+(p(t)-t.fontSize/2)+")":"");if(i.empty()){var o=n.select("text").attr({transform:a,"text-anchor":r});o.empty()||o.selectAll("tspan.line").attr({x:o.attr("x"),y:o.attr("y")})}else{var s=A.bBox(i.node()).width*{end:-.5,start:.5}[r];i.attr("transform",a+(s?"translate("+s+",0)":""))}})}function a(){return z.length&&Promise.all(z)}function s(){if(i(h,u.tickangle),"x"===g&&!b(u.tickangle)&&("log"!==u.type||"D"!==String(u.dtick).charAt(0))){var t=[];for(h.each(function(e){var r=y.select(this),n=r.select(".text-math-group"),i=u.l2p(e.x);n.empty()&&(n=r.select("text"));var a=A.bBox(n.node());t.push({top:0,bottom:10,height:10,left:i-a.width/2,right:i+a.width/2+2,width:a.width+2})}),v=0;v<t.length-1;v++)if(_.bBoxIntersect(t[v],t[v+1])){C=30;break}if(C){Math.abs((S[S.length-1].x-S[0].x)*u._m)/(S.length-1)<2.5*T&&(C=90),i(h,C)}u._lastangle=C}return o(),e+" done"}function l(){function e(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.max(t[1],e[1])}var n=r.node().getBoundingClientRect(),i=t.getBoundingClientRect();if(u._boundingBox={width:n.width,height:n.height,left:n.left-i.left,right:n.right-i.left,top:n.top-i.top,bottom:n.bottom-i.top},m){var a=u._counterSpan=[1/0,-1/0];for(v=0;v<m.length;v++){var o=c._plots[m[v]],s=o["x"===g?"yaxis":"xaxis"];e(a,[s._offset,s._offset+s._length])}"free"===u.anchor&&e(a,"x"===g?[u._boundingBox.bottom,u._boundingBox.top]:[u._boundingBox.right,u._boundingBox.left])}}var h=r.selectAll("g."+L).data(S,E);if(!u.showticklabels||!b(n))return h.remove(),void o();var f,p,x,M,k;"x"===g?(k="bottom"===U?1:-1,f=function(t){return t.dx+P*k},M=n+(I+D)*k,p=function(t){return t.dy+M+t.fontSize*("bottom"===U?1:-.5)},x=function(t){return b(t)&&0!==t&&180!==t?t*k<0?"end":"start":"middle"}):(k="right"===U?1:-1,p=function(t){return t.dy+t.fontSize/2-P*k},f=function(t){return t.dx+n+(I+D+(90===Math.abs(u.tickangle)?t.fontSize/2:0))*k},x=function(t){return b(t)&&90===Math.abs(t)?"middle":"right"===U?"start":"end"});var T=0,C=0,z=[];h.enter().append("g").classed(L,1).append("text").attr("text-anchor","middle").each(function(e){var r=y.select(this),n=t._promises.length;r.call(A.setPosition,f(e),p(e)).call(A.font,e.font,e.fontSize,e.fontColor).text(e.text).call(w.convertToTspans),n=t._promises[n],n?z.push(t._promises.pop().then(function(){i(r,u.tickangle)})):i(r,u.tickangle)}),h.exit().remove(),h.each(function(t){T=Math.max(T,t.fontSize)}),i(h,u._lastangle||u.tickangle);var O=_.syncOrAsync([a,s,l]);return O&&O.then&&t._promises.push(O),O}function o(){if(!r){var n,i,a,o,s=F.getFromId(t,e),l=y.select(t).selectAll("g."+e+"tick"),u={selection:l,side:s.side},h=e.charAt(0),f=t._fullLayout._size,d=s.titlefont.size;if(l.size()){var p=A.getTranslate(l.node().parentNode);u.offsetLeft=p.x,u.offsetTop=p.y}"x"===h?(i="free"===s.anchor?{_offset:f.t+(1-(s.position||0))*f.h,_length:0}:F.getFromId(t,s.anchor),a=s._offset+s._length/2,o=i._offset+("top"===s.side?-10-d*(1.5+(s.showticklabels?1:0)):i._length+10+d*(1.5+(s.showticklabels?1.5:.5))),s.rangeslider&&s.rangeslider.visible&&s._boundingBox&&(o+=(c.height-c.margin.b-c.margin.t)*s.rangeslider.thickness+s._boundingBox.height),u.side||(u.side="bottom")):(i="free"===s.anchor?{_offset:f.l+(s.position||0)*f.w,_length:0}:F.getFromId(t,s.anchor),o=s._offset+s._length/2,a=i._offset+("right"===s.side?i._length+10+d*(1.5+(s.showticklabels?1:.5)):-10-d*(1.5+(s.showticklabels?.5:0))),n={rotate:"-90",offset:0},u.side||(u.side="left")),M.draw(t,e+"title",{propContainer:s,propName:s._name+".title",dfltName:h.toUpperCase()+" axis",avoid:u,transform:n,attributes:{x:a,y:o,"text-anchor":"middle"}})}}function s(t,e){return t.visible===!0&&t.xaxis+t.yaxis===e&&(!(!x.traceIs(t,"bar")||t.orientation!=={x:"h",y:"v"}[g])||t.fill&&t.fill.charAt(t.fill.length-1)===g)}function l(e,r,i){var a=e.gridlayer,o=e.zerolinelayer,l=e["hidegrid"+g]?[]:q,c=u._gridpath||"M0,0"+("x"===g?"v":"h")+r._length,h=a.selectAll("path."+C).data(u.showgrid===!1?[]:l,E);if(h.enter().append("path").classed(C,1).classed("crisp",1).attr("d",c).each(function(t){u.zeroline&&("linear"===u.type||"-"===u.type)&&Math.abs(t.x)<u.dtick/100&&y.select(this).remove()}),h.attr("transform",d).call(k.stroke,u.gridcolor||"#ddd").style("stroke-width",j+"px"),h.exit().remove(),o){for(var f=!1,p=0;p<t._fullData.length;p++)if(s(t._fullData[p],i)){f=!0;break}var m=_.simpleMap(u.range,u.r2l),v=m[0]*m[1]<=0&&u.zeroline&&("linear"===u.type||"-"===u.type)&&l.length&&(f||n({x:0})||!u.showline),b=o.selectAll("path."+z).data(v?[{x:0}]:[]);b.enter().append("path").classed(z,1).classed("zl",1).classed("crisp",1).attr("d",c),b.attr("transform",d).call(k.stroke,u.zerolinecolor||k.defaultLine).style("stroke-width",R+"px"),b.exit().remove()}}var u,c=t._fullLayout,h=!1;if("object"==typeof e)u=e,e=u._id,h=!0;else if(u=O.getFromId(t,e),"redraw"===e&&c._paper.selectAll("g.subplot").each(function(t){var e=c._plots[t],r=e.xaxis,n=e.yaxis;e.xaxislayer.selectAll("."+r._id+"tick").remove(),e.yaxislayer.selectAll("."+n._id+"tick").remove(),e.gridlayer.selectAll("path").remove(),e.zerolinelayer.selectAll("path").remove()}),!e||"redraw"===e)return _.syncOrAsync(O.list(t,"",!0).map(function(r){return function(){if(r._id){var n=O.doTicks(t,r._id);return"redraw"===e&&(r._r=r.range.slice(),r._rl=_.simpleMap(r._r,r.r2l)),n}}}));u.tickformat||(["none","e","E","power","SI","B"].indexOf(u.exponentformat)===-1&&(u.exponentformat="e"),["all","first","last","none"].indexOf(u.showexponent)===-1&&(u.showexponent="all")),u.setScale();var f,d,p,m,v,g=e.charAt(0),T=O.counterLetter(e),S=O.calcTicks(u),E=function(t){return[t.text,t.x,u.mirror].join("_")},L=e+"tick",C=e+"grid",z=e+"zl",D=(u.linewidth||1)/2,I=("outside"===u.ticks?u.ticklen:1)+(u.linewidth||0),P=0,j=A.crispRound(t,u.gridwidth,1),R=A.crispRound(t,u.zerolinewidth,j),N=A.crispRound(t,u.tickwidth,1);if(u._counterangle&&"outside"===u.ticks){var B=u._counterangle*Math.PI/180;I=u.ticklen*Math.cos(B)+(u.linewidth||0),P=u.ticklen*Math.sin(B)}if("x"===g)f=["bottom","top"],d=function(t){return"translate("+u.l2p(t.x)+",0)"},p=function(t,e){if(u._counterangle){var r=u._counterangle*Math.PI/180;return"M0,"+t+"l"+Math.sin(r)*e+","+Math.cos(r)*e}return"M0,"+t+"v"+e};else{if("y"!==g)return void _.warn("Unrecognized doTicks axis:",e);f=["left","right"],d=function(t){return"translate(0,"+u.l2p(t.x)+")"},p=function(t,e){if(u._counterangle){var r=u._counterangle*Math.PI/180;return"M"+t+",0l"+Math.cos(r)*e+","+-Math.sin(r)*e}return"M"+t+",0h"+e}}var U=u.side||f[0],V=[-1,1,U===f[1]?1:-1];if("inside"!==u.ticks==("x"===g)&&(V=V.map(function(t){return-t})),u.visible){var q=S.filter(n);if(h){if(i(u._axislayer,p(u._pos+D*V[2],V[2]*u.ticklen)),u._counteraxis){l({gridlayer:u._gridlayer,zerolinelayer:u._zerolinelayer},u._counteraxis)}return a(u._axislayer,u._pos)}m=O.getSubplots(t,u);var H=m.map(function(t){var e=c._plots[t];if(c._has("cartesian")){var r=e[g+"axislayer"],n=u._linepositions[t]||[],o=e[T+"axis"],s=o._id===u.anchor,h=[!1,!1,!1],d="";if("allticks"===u.mirror?h=[!0,!0,!1]:s&&("ticks"===u.mirror?h=[!0,!0,!1]:h[f.indexOf(U)]=!0),u.mirrors)for(v=0;v<2;v++){var m=u.mirrors[o._id+f[v]];"ticks"!==m&&"labels"!==m||(h[v]=!0)}return void 0!==n[2]&&(h[2]=!0),h.forEach(function(t,e){var r=n[e],i=V[e];t&&b(r)&&(d+=p(r+D*i,i*u.ticklen))}),i(r,d),l(e,o,t),a(r,n[3])}}).filter(function(t){return t&&t.then});return H.length?Promise.all(H):0}},O.swap=function(t,e){for(var r=p(t,e),n=0;n<r.length;n++)v(t,r[n].x,r[n].y)}},{"../../components/color":590,"../../components/drawing":614,"../../components/titles":679,"../../constants/numerical":690,"../../lib":709,"../../lib/svg_text_utils":728,"../../registry":826,"./axis_autotype":749,"./axis_ids":751,"./layout_attributes":759,"./layout_defaults":760,"./set_convert":765,d3:118,"fast-isnumeric":127}],749:[function(t,e,r){"use strict";function n(t){if(!t)return!1;for(var e=0;e<t.length;e++)if(o(t[e]))return!0;return!1}function i(t,e){for(var r,n=0,i=0,a=Math.max(1,(t.length-1)/1e3),l=0;l<t.length;l+=a)r=t[Math.round(l)],s.isDateTime(r,e)&&(n+=1),o(r)&&(i+=1);return n>2*i}function a(t){for(var e,r=Math.max(1,(t.length-1)/1e3),n=0,i=0,a=0;a<t.length;a+=r)e=t[Math.round(a)],s.cleanNumber(e)!==l?n++:"string"==typeof e&&""!==e&&"None"!==e&&i++;return i>2*n}var o=t("fast-isnumeric"),s=t("../../lib"),l=t("../../constants/numerical").BADNUM;e.exports=function(t,e){return i(t,e)?"date":a(t)?"category":n(t)?"linear":"-"}},{"../../constants/numerical":690,"../../lib":709,"fast-isnumeric":127}],750:[function(t,e,r){"use strict";var n=t("tinycolor2").mix,i=t("../../registry"),a=t("../../lib"),o=t("../../components/color/attributes").lightFraction,s=t("./layout_attributes"),l=t("./tick_value_defaults"),u=t("./tick_mark_defaults"),c=t("./tick_label_defaults"),h=t("./category_order_defaults"),f=t("./set_convert"),d=t("./ordered_categories");e.exports=function(t,e,r,p,m){function v(r,n){return a.coerce2(t,e,s,r,n)}var g=p.letter,y=p.font||{},b="Click to enter "+(p.title||g.toUpperCase()+" axis")+" title",x=r("visible",!p.cheateronly),_=e.type;if("date"===_){i.getComponentMethod("calendars","handleDefaults")(t,e,"calendar",p.calendar)}if(f(e,m),r("autorange",!e.isValidRange(t.range))&&r("rangemode"),r("range"),e.cleanRange(),h(t,e,r),e._initialCategories="category"===_?d(g,e.categoryorder,e.categoryarray,p.data):[],!x)return e;var w=r("color"),M=w===t.color?w:y.color;r("title",b),a.coerceFont(r,"titlefont",{family:y.family,size:Math.round(1.2*y.size),color:M}),l(t,e,r,_),c(t,e,r,_,p),u(t,e,r,p);var k=v("linecolor",w),A=v("linewidth"),T=r("showline",!!k||!!A);T||(delete e.linecolor,delete e.linewidth),(T||e.ticks)&&r("mirror");var S=v("gridcolor",n(w,p.bgColor,o).toRgbString()),E=v("gridwidth");r("showgrid",p.showGrid||!!S||!!E)||(delete e.gridcolor,delete e.gridwidth);var L=v("zerolinecolor",w),C=v("zerolinewidth");return r("zeroline",p.showGrid||!!L||!!C)||(delete e.zerolinecolor,delete e.zerolinewidth),e}},{"../../components/color/attributes":589,"../../lib":709,"../../registry":826,"./category_order_defaults":752,"./layout_attributes":759,"./ordered_categories":761,"./set_convert":765,"./tick_label_defaults":766,"./tick_mark_defaults":767,"./tick_value_defaults":768,tinycolor2:526}],751:[function(t,e,r){"use strict";function n(t,e,r){function n(t,r){for(var n=Object.keys(t),i=/^[xyz]axis[0-9]*/,a=[],o=0;o<n.length;o++){var s=n[o];e&&s.charAt(0)!==e||i.test(s)&&a.push(r+s)}return a.sort()}var i=t._fullLayout;if(!i)return[];var o=n(i,"");if(r)return o;for(var s=a.getSubplotIds(i,"gl3d")||[],l=0;l<s.length;l++){var u=s[l];o=o.concat(n(i[u],u+"."))}return o}var i=t("../../registry"),a=t("../plots"),o=t("../../lib"),s=t("./constants");r.id2name=function(t){if("string"==typeof t&&t.match(s.AX_ID_PATTERN)){var e=t.substr(1);return"1"===e&&(e=""),t.charAt(0)+"axis"+e}},r.name2id=function(t){if(t.match(s.AX_NAME_PATTERN)){var e=t.substr(5);return"1"===e&&(e=""),t.charAt(0)+e}},r.cleanId=function(t,e){if(t.match(s.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,r){return n(t,e,r).map(function(e){return o.nestedProperty(t._fullLayout,e).get()})},r.listIds=function(t,e){return n(t,e,!0).map(r.name2id)},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,n){var a=t._fullLayout,o=null;if(i.traceIs(e,"gl3d")){var s=e.scene;"scene"===s.substr(0,5)&&(o=a[s][n+"axis"])}else o=r.getFromId(t,e[n+"axis"]||n);return o}},{"../../lib":709,"../../registry":826,"../plots":811,"./constants":753}],752:[function(t,e,r){"use strict";e.exports=function(t,e,r){if("category"===e.type){var n,i=t.categoryarray,a=Array.isArray(i)&&i.length>0;a&&(n="array");var o=r("categoryorder",n);"array"===o&&r("categoryarray"),a||"array"!==o||(e.categoryorder="trace")}}},{}],753:[function(t,e,r){"use strict";e.exports={idRegex:{x:/^x([2-9]|[1-9][0-9]+)?$/,y:/^y([2-9]|[1-9][0-9]+)?$/},attrRegex:{x:/^xaxis([2-9]|[1-9][0-9]+)?$/,y:/^yaxis([2-9]|[1-9][0-9]+)?$/},xAxisMatch:/^xaxis[0-9]*$/,yAxisMatch:/^yaxis[0-9]*$/,AX_ID_PATTERN:/^[xyz][0-9]*$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,MINDRAG:8,MINSELECT:12,MINZOOM:20,DRAGGERSIZE:20,BENDPX:1.5,REDRAWDELAY:50,DFLTRANGEX:[-1,6],DFLTRANGEY:[-1,4]}},{}],754:[function(t,e,r){"use strict";function n(t,e,r,n){var i,a,s,l,u=n[o(e)].type,c=[];for(a=0;a<r.length;a++)(s=r[a])!==e&&(l=n[o(s)],l.type!==u||l.fixedrange||c.push(s));for(i=0;i<t.length;i++)if(t[i][e]){var h=t[i],f=[];for(a=0;a<c.length;a++)s=c[a],h[s]||f.push(s);return{linkableAxes:f,thisGroup:h}}return{linkableAxes:c,thisGroup:null}}function i(t,e,r,n,i){var a,o,s,l,u;null===e?(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 h=s[n];for(o=0;o<c.length;o++)l=c[o],s[l]=h*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}var a=t("../../lib"),o=t("./axis_ids").id2name;e.exports=function(t,e,r,o,s){var l=s._axisConstraintGroups;if(!e.fixedrange&&t.scaleanchor){var u=n(l,e._id,o,s),c=a.coerce(t,e,{scaleanchor:{valType:"enumerated",values:u.linkableAxes}},"scaleanchor");if(c){var h=r("scaleratio");h||(h=e.scaleratio=1),i(l,u.thisGroup,e._id,c,h)}else o.indexOf(t.scaleanchor)!==-1&&a.warn("ignored "+e._name+'.scaleanchor: "'+t.scaleanchor+'" to avoid either an infinite loop and possibly inconsistent scaleratios, or because the targetaxis has fixed range.')}}},{"../../lib":709,"./axis_ids":751}],755:[function(t,e,r){"use strict";var n=t("./axis_ids").id2name,i=t("./scale_zoom"),a=t("../../constants/numerical").ALMOST_EQUAL;e.exports=function(t){var e,r,o,s,l,u=t._fullLayout,c=u._axisConstraintGroups;for(e=0;e<c.length;e++){var h=c[e],f=Object.keys(h),d=1/0,p=0,m=1/0,v={},g={};for(r=0;r<f.length;r++)o=f[r],g[o]=s=u[n(o)],s.setScale(),v[o]=l=Math.abs(s._m)/h[o],d=Math.min(d,l),s._constraintShrinkable?delete s._constraintShrinkable:m=Math.min(m,l),p=Math.max(p,l);if(!(d>a*p))for(r=0;r<f.length;r++)o=f[r],(l=v[o])!==m&&i(g[o],l/m)}}},{"../../constants/numerical":690,"./axis_ids":751,"./scale_zoom":763}],756:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o){var s=t.draglayer.selectAll("."+e).data([0]);return s.enter().append("rect").classed("drag",!0).classed(e,!0).style({fill:"transparent","stroke-width":0}).attr("data-subplot",t.id),s.call(S.setRect,n,i,a,o).call(E,r),s.node()}function i(t,e){for(var r=0;r<t.length;r++)if(!t[r].fixedrange)return e;return""}function a(t,e){var r,n=t.range[e],i=Math.abs(n-t.range[1-e]);return"date"===t.type?n:"log"===t.type?(r=Math.ceil(Math.max(0,-Math.log(i)/Math.LN10))+3,x.format("."+r+"g")(Math.pow(10,n))):(r=Math.floor(Math.log(Math.abs(n))/Math.LN10)-Math.floor(Math.log(i)/Math.LN10)+4,x.format("."+String(r)+"g")(n))}function o(t,e,r,n){var i,a,s,l;for(i=0;i<t.length;i++)a=t[i],a.fixedrange||(s=a._rl[0],l=a._rl[1]-s,a.range=[a.l2r(s+l*e),a.l2r(s+l*r)]);if(n&&n.length){var u=(e+(1-r))/2;o(n,u,1-u)}}function s(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 l(t){return 1-(t>=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function u(t,e){return t?"nsew"===t?"pan"===e?"move":"crosshair":t.toLowerCase()+"-resize":"pointer"}function c(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 h(t,e,r){return t.append("path").attr("class","zoombox-corners").style({fill:T.background,stroke:T.defaultLine,"stroke-width":1,opacity:0}).attr("transform","translate("+e+", "+r+")").attr("d","M0,0Z")}function f(t){t.selectAll(".select-outline").remove()}function d(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"),i||(t.transition().style("fill",a>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),e.transition().style("opacity",1).duration(200))}function p(t){x.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function m(t){return["lasso","select"].indexOf(t)!==-1}function v(t,e){return"M"+(t.l-.5)+","+(e-j-.5)+"h-3v"+(2*j+1)+"h3ZM"+(t.r+.5)+","+(e-j-.5)+"h3v"+(2*j+1)+"h-3Z"}function g(t,e){return"M"+(e-j-.5)+","+(t.t-.5)+"v-3h"+(2*j+1)+"v3ZM"+(e-j-.5)+","+(t.b+.5)+"v3h"+(2*j+1)+"v-3Z"}function y(t){var e=Math.floor(Math.min(t.b-t.t,t.r-t.l,j)/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 b(t,e,r){var n,i,a,o,s,l,u=!1,c={},h={};for(n=0;n<t.length;n++){for(o=t[n],i=0;i<e.length;i++)if(o[e[i]]){for(s in o)("x"===s.charAt(0)?e:r).indexOf(s)===-1&&(c[s]=1);for(a=0;a<r.length;a++)o[r[a]]&&(u=!0)}for(i=0;i<r.length;i++)if(o[r[i]])for(l in o)("x"===l.charAt(0)?e:r).indexOf(l)===-1&&(h[l]=1)}return u&&(k.extendFlat(c,h),h={}),{x:c,y:h,xy:u}}var x=t("d3"),_=t("tinycolor2"),w=t("../../plotly"),M=t("../../registry"),k=t("../../lib"),A=t("../../lib/svg_text_utils"),T=t("../../components/color"),S=t("../../components/drawing"),E=t("../../lib/setcursor"),L=t("../../components/dragelement"),C=t("./axes").doTicks,z=t("./axis_ids").getFromId,D=t("./select"),I=t("./scale_zoom"),P=t("./constants"),O=P.MINDRAG,j=P.MINZOOM,F=!0;e.exports=function(t,e,r,T,E,R,N,B){function U(){$=[e.xaxis],tt=[e.yaxis];var r=$[0],n=tt[0];nt=r._length,it=n._length;var a=ht._axisConstraintGroups,o=[r._id],s=[n._id];Q=[e].concat(N&&B?e.overlays:[]);for(var l=1;l<Q.length;l++){var c=Q[l].xaxis,h=Q[l].yaxis;$.indexOf(c)===-1&&($.push(c),o.push(c._id)),tt.indexOf(h)===-1&&(tt.push(h),s.push(h._id))}at=i($,B),ot=i(tt,N),st=u(ot+at,ht.dragmode),et=r._offset,rt=n._offset;var f=b(a,o,s);lt=f.xy,ut=[];for(var d in f.x)ut.push(z(t,d));ct=[];for(var p in f.y)ct.push(z(t,p))}function V(e,r,n){var i=pt.getBoundingClientRect();vt=r-i.left,gt=n-i.top,yt={l:vt,r:vt,w:0,t:gt,b:gt,h:0},bt=t._hmpixcount?t._hmlumcount/t._hmpixcount:_(t._fullLayout.plot_bgcolor).getLuminance(),xt="M0,0H"+nt+"V"+it+"H0V0",_t=!1,wt="xy",Mt=c(ft,bt,et,rt,xt),kt=h(ft,et,rt),f(ft)}function q(e,r){function n(){wt="",yt.r=yt.l,yt.t=yt.b,kt.attr("d","M0,0Z")}if(t._transitioningWithDuration)return!1;var i=Math.max(0,Math.min(nt,e+vt)),a=Math.max(0,Math.min(it,r+gt)),o=Math.abs(i-vt),s=Math.abs(a-gt);yt.l=Math.min(vt,i),yt.r=Math.max(vt,i),yt.t=Math.min(gt,a),yt.b=Math.max(gt,a),lt?o>j||s>j?(wt="xy",o/nt>s/it?(s=o*it/nt,gt>a?yt.t=gt-s:yt.b=gt+s):(o=s*nt/it,vt>i?yt.l=vt-o:yt.r=vt+o),kt.attr("d",y(yt))):n():!ot||s<Math.min(Math.max(.6*o,O),j)?o<O?n():(yt.t=0,yt.b=it,wt="x",kt.attr("d",v(yt,gt))):!at||o<Math.min(.6*s,j)?(yt.l=0,yt.r=nt,wt="y",kt.attr("d",g(yt,vt))):(wt="xy",kt.attr("d",y(yt))),yt.w=yt.r-yt.l,yt.h=yt.b-yt.t,d(Mt,kt,yt,xt,_t,bt),_t=!0}function H(e,r){if(Math.min(yt.h,yt.w)<2*O)return 2===r&&Z(),p(t);"xy"!==wt&&"x"!==wt||o($,yt.l/nt,yt.r/nt,ut),"xy"!==wt&&"y"!==wt||o(tt,(it-yt.b)/it,(it-yt.t)/it,ct),p(t),J(wt),F&&t.data&&t._context.showTips&&(k.notifier("Double-click to<br>zoom back out","long"),F=!1)}function G(e,r){var n=1===(N+B).length;if(e)J();else if(2!==r||n){if(1===r&&n){var i=N?tt[0]:$[0],o="s"===N||"w"===B?0:1,s=i._name+".range["+o+"]",l=a(i,o),u="left",c="middle";if(i.fixedrange)return;N?(c="n"===N?"top":"bottom","right"===i.side&&(u="right")):"e"===B&&(u="right"),t._context.showAxisRangeEntryBoxes&&x.select(pt).call(A.makeEditable,null,{immediate:!0,background:ht.paper_bgcolor,text:String(l),fill:i.tickfont?i.tickfont.color:"#444",horizontalAlign:u,verticalAlign:c}).on("edit",function(e){var r=i.d2r(e);void 0!==r&&w.relayout(t,s,r)})}}else Z()}function Y(e){function r(t,e,r){function n(e){return t.l2r(a+(e-a)*r)}if(!t.fixedrange){var i=k.simpleMap(t.range,t.r2l),a=i[0]+(i[1]-i[0])*e;t.range=i.map(n)}}if(t._context.scrollZoom||ht._enablescrollzoom){if(t._transitioningWithDuration)return k.pauseEvent(e);var n=t.querySelector(".plotly");if(U(),!(n.scrollHeight-n.clientHeight>10||n.scrollWidth-n.clientWidth>10)){clearTimeout(Tt);var i=-e.deltaY;if(isFinite(i)||(i=e.wheelDelta/10),!isFinite(i))return void k.log("Did not find wheel motion attributes: ",e);var a,o=Math.exp(-Math.min(Math.max(i,-20),20)/100),s=Et.draglayer.select(".nsewdrag").node().getBoundingClientRect(),l=(e.clientX-s.left)/s.width,u=(s.bottom-e.clientY)/s.height;if(B||lt){for(B||(l=.5),a=0;a<$.length;a++)r($[a],l,o);At[2]*=o,At[0]+=At[2]*l*(1/o-1)}if(N||lt){for(N||(u=.5),a=0;a<tt.length;a++)r(tt[a],u,o);At[3]*=o,At[1]+=At[3]*(1-u)*(1/o-1)}return K(At),W(N,B),Tt=setTimeout(function(){At=[0,0,nt,it];var t;t=lt?"xy":(B?"x":"")+(N?"y":""),J(t)},St),k.pauseEvent(e)}}}function X(e,r){function n(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])/l(r/s._length);var u=s.l2r(i);u!==!1&&void 0!==u&&(s.range[e]=u)}}return n._length*(n._rl[e]-i)/(n._rl[e]-n._rl[a])}if(!t._transitioningWithDuration){if(U(),"ew"===at||"ns"===ot)return at&&s($,e),ot&&s(tt,r),K([at?-e:0,ot?-r:0,nt,it]),void W(ot,at);if(lt&&at&&ot){var i="w"===at==("n"===ot)?1:-1,a=(e/nt+i*r/it)/2;e=a*nt,r=i*a*it}"w"===at?e=n($,0,e):"e"===at?e=n($,1,-e):at||(e=0),"n"===ot?r=n(tt,1,r):"s"===ot?r=n(tt,0,-r):ot||(r=0);var o="w"===at?e:0,u="n"===ot?r:0;if(lt){var c;if(!at&&1===ot.length){for(c=0;c<$.length;c++)$[c].range=$[c]._r.slice(),I($[c],1-r/it);e=r*nt/it,o=e/2}if(!ot&&1===at.length){for(c=0;c<tt.length;c++)tt[c].range=tt[c]._r.slice(),I(tt[c],1-e/nt);r=e*it/nt,u=r/2}}K([o,u,nt-e,it-r]),W(ot,at)}}function W(e,r){function n(t){for(a=0;a<t.length;a++)t[a].fixedrange||o.push(t[a]._id)}function i(n,i,s){for(a=0;a<n.length;a++){var l=n[a];if((r&&o.indexOf(l.xref)!==-1||e&&o.indexOf(l.yref)!==-1)&&(i(t,a),s))return}}var a,o=[];for((r||lt)&&(n($),n(ut)),(e||lt)&&(n(tt),n(ct)),a=0;a<o.length;a++)C(t,o[a],!0);i(ht.annotations||[],M.getComponentMethod("annotations","drawOne")),i(ht.shapes||[],M.getComponentMethod("shapes","drawOne")),i(ht.images||[],M.getComponentMethod("images","draw"),!0)}function Z(){if(!t._transitioningWithDuration){var e,r,n,i=t._context.doubleClick,a=(at?$:[]).concat(ot?tt:[]),o={};if("reset+autosize"===i)for(i="autosize",r=0;r<a.length;r++)if(e=a[r],e._rangeInitial&&(e.range[0]!==e._rangeInitial[0]||e.range[1]!==e._rangeInitial[1])||!e._rangeInitial&&!e.autorange){i="reset";break}if("autosize"===i)for(r=0;r<a.length;r++)e=a[r],e.fixedrange||(o[e._name+".autorange"]=!0);else if("reset"===i)for((at||lt)&&(a=a.concat(ut)),ot&&!lt&&(a=a.concat(ct)),lt&&(at?ot||(a=a.concat(tt)):a=a.concat($)),r=0;r<a.length;r++)e=a[r],e._rangeInitial?(n=e._rangeInitial,o[e._name+".range[0]"]=n[0],o[e._name+".range[1]"]=n[1]):o[e._name+".autorange"]=!0;t.emit("plotly_doubleclick",null),w.relayout(t,o)}}function J(e){void 0===e&&(e=(B?"x":"")+(N?"y":""));var r,n={};"xy"===e?r=$.concat(tt):"x"===e?r=$:"y"===e&&(r=tt);for(var i=0;i<r.length;i++){var a=r[i];a._r[0]!==a.range[0]&&(n[a._name+".range[0]"]=a.range[0]),a._r[1]!==a.range[1]&&(n[a._name+".range[1]"]=a.range[1]),a.range=a._input.range=a._r.slice()}K([0,0,nt,it]),w.relayout(t,n)}function K(t){function e(t){return t.fixedrange?0:f&&ut.indexOf(t)!==-1?c:d&&(lt?ut:ct).indexOf(t)!==-1?h:0}function r(t,e){return e?(t.range=t._r.slice(),I(t,e),t._length*(1-e)/2):0}var n,i,a,o,s,l=ht._plots,u=Object.keys(l),c=t[2]/$[0]._length,h=t[3]/tt[0]._length,f=B||lt,d=N||lt;for(n=0;n<u.length;n++){var p=l[u[n]],m=p.xaxis,v=p.yaxis,g=f&&!m.fixedrange&&$.indexOf(m)!==-1,y=d&&!v.fixedrange&&tt.indexOf(v)!==-1;if(g?(i=c,o=t[0]):(i=e(m),o=r(m,i)),y?(a=h,s=t[1]):(a=e(v),s=r(v,a)),i||a){i||(i=1),a||(a=1);var b=m._offset-o/i,x=v._offset-s/a;ht._defs.selectAll("#"+p.clipId).call(S.setTranslate,o,s).call(S.setScale,i,a),p.plot.call(S.setTranslate,b,x).call(S.setScale,1/i,1/a).select(".scatterlayer").selectAll(".points").selectAll(".point").call(S.setPointGroupScale,i,a),p.plot.select(".scatterlayer").selectAll(".points").selectAll(".textpoint").call(S.setTextPointsScale,i,a)}}}var Q,$,tt,et,rt,nt,it,at,ot,st,lt,ut,ct,ht=t._fullLayout,ft=t._fullLayout._zoomlayer,dt=N+B==="nsew";U();var pt=n(e,N+B+"drag",st,r,T,E,R);if(!ot&&!at&&!m(ht.dragmode))return pt.onmousedown=null,pt.style.pointerEvents=dt?"all":"none",pt;var mt={element:pt,gd:t,plotinfo:e,doubleclick:Z,prepFn:function(e,r,n){var i=t._fullLayout.dragmode;dt?e.shiftKey&&(i="pan"===i?"zoom":"pan"):i="pan",mt.minDrag="lasso"===i?1:void 0,"zoom"===i?(mt.moveFn=q,mt.doneFn=H,mt.minDrag=1,V(e,r,n)):"pan"===i?(mt.moveFn=X,mt.doneFn=G,f(ft)):m(i)&&(mt.xaxes=$,mt.yaxes=tt,D(e,r,n,mt,i))}};L.init(mt);var vt,gt,yt,bt,xt,_t,wt,Mt,kt,At=[0,0,nt,it],Tt=null,St=P.REDRAWDELAY,Et=e.mainplot?ht._plots[e.mainplot]:e;return N.length*B.length!=1&&(void 0!==pt.onwheel?pt.onwheel=Y:void 0!==pt.onmousewheel&&(pt.onmousewheel=Y)),pt}},{"../../components/color":590,"../../components/dragelement":611,"../../components/drawing":614,"../../lib":709,"../../lib/setcursor":724,"../../lib/svg_text_utils":728,"../../plotly":743,"../../registry":826,"./axes":748,"./axis_ids":751,"./constants":753,"./scale_zoom":763,"./select":764,d3:118,tinycolor2:526}],757:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../components/fx"),a=t("../../components/dragelement"),o=t("./constants"),s=t("./dragbox");e.exports=function(t){var e=t._fullLayout;if(e._has("cartesian")&&!t._context.staticPlot){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 l=e._plots[r];if(e._has("cartesian")){var u=l.xaxis,c=l.yaxis,h=(u._linepositions[r]||[])[3],f=(c._linepositions[r]||[])[3],d=o.DRAGGERSIZE;if(n(h)&&"top"===u.side&&(h-=d),n(f)&&"right"!==c.side&&(f-=d),!l.mainplot){var p=s(t,l,0,0,u._length,c._length,"ns","ew");p.onmousemove=function(e){t._fullLayout._rehover=function(){t._fullLayout._hoversubplot===r&&i.hover(t,e,r)},i.hover(t,e,r),t._fullLayout._lasthover=p,t._fullLayout._hoversubplot=r},p.onmouseout=function(e){t._dragging||(t._fullLayout._hoversubplot=null,a.unhover(t,e))},p.onclick=function(e){i.click(t,e)},t._context.showAxisDragHandles&&(s(t,l,-d,-d,d,d,"n","w"),s(t,l,u._length,-d,d,d,"n","e"),s(t,l,-d,c._length,d,d,"s","w"),s(t,l,u._length,c._length,d,d,"s","e"))}t._context.showAxisDragHandles&&(n(h)&&("free"===u.anchor&&(h-=e._size.h*(1-c.domain[1])),s(t,l,.1*u._length,h,.8*u._length,d,"","ew"),s(t,l,0,h,.1*u._length,d,"","w"),s(t,l,.9*u._length,h,.1*u._length,d,"","e")),n(f)&&("free"===c.anchor&&(f-=e._size.w*u.domain[0]),s(t,l,f,.1*c._length,d,.8*c._length,"ns",""),s(t,l,f,.9*c._length,d,.1*c._length,"s",""),s(t,l,f,0,d,.1*c._length,"n","")))}});var r=e._hoverlayer.node();r.onmousemove=function(r){r.target=e._lasthover,i.hover(t,r,e._hoversubplot)},r.onclick=function(r){r.target=e._lasthover,i.click(t,r)},r.onmousedown=function(t){e._lasthover.onmousedown(t)}}}},{"../../components/dragelement":611,"../../components/fx":631,"./constants":753,"./dragbox":756,"fast-isnumeric":127}],758:[function(t,e,r){"use strict";function n(t,e,r,n,i){var a=t._fullLayout,o=a._modules;e.plot&&e.plot.selectAll("g:not(.scatterlayer)").selectAll("g.trace").remove();for(var s=0;s<o.length;s++){var l=o[s];if("cartesian"===l.basePlotModule.name){for(var u=[],c=0;c<r.length;c++){var h=r[c],f=h[0].trace;f._module===l&&f.visible===!0&&u.push(h)}l.plot(t,e,u,n,i)}}}function i(t){for(var e=t._fullLayout,r=Object.keys(e._plots),n=[],i=[],a=0;a<r.length;a++){var o=r[a],s=e._plots[o],l=s.xaxis,u=s.yaxis,c=h.getFromId(t,l.overlaying)||l;c!==l&&c.overlaying&&(c=l,l.overlaying=!1);var f=h.getFromId(t,u.overlaying)||u;f!==u&&f.overlaying&&(f=u,u.overlaying=!1);var d=c._id+f._id;d!==o&&r.indexOf(d)!==-1?(s.mainplot=d,s.mainplotinfo=e._plots[d],i.push(o),l.domain=c.domain.slice(),u.domain=f.domain.slice()):n.push(o)}return n=n.concat(i)}function a(t){function e(t){s(t,"g","imagelayer"),s(t,"g","maplayer"),s(t,"g","barlayer"),s(t,"g","carpetlayer"),s(t,"g","boxlayer"),
62 s(t,"g","scatterlayer")}var r=t.plotgroup,n=t.id;if(t.mainplot){var i=t.mainplotinfo;t.gridlayer=s(i.overgrid,"g",n),t.zerolinelayer=s(i.overzero,"g",n),t.plot=s(i.overplot,"g",n),t.xlines=s(i.overlines,"path",n),t.ylines=s(i.overlines,"path",n),t.xaxislayer=s(i.overaxes,"g",n),t.yaxislayer=s(i.overaxes,"g",n)}else{var a=s(r,"g","layer-subplot");t.shapelayer=s(a,"g","shapelayer"),t.imagelayer=s(a,"g","imagelayer"),t.gridlayer=s(r,"g","gridlayer"),t.overgrid=s(r,"g","overgrid"),t.zerolinelayer=s(r,"g","zerolinelayer"),t.overzero=s(r,"g","overzero"),t.plot=s(r,"g","plot"),t.overplot=s(r,"g","overplot"),t.xlines=s(r,"path","xlines"),t.ylines=s(r,"path","ylines"),t.overlines=s(r,"g","overlines"),t.xaxislayer=s(r,"g","xaxislayer"),t.yaxislayer=s(r,"g","yaxislayer"),t.overaxes=s(r,"g","overaxes")}t.plot.call(e),t.xlines.style("fill","none").classed("crisp",!0),t.ylines.style("fill","none").classed("crisp",!0)}function o(t,e){t&&t.each(function(t){var r=l.select(this),n="clip"+e._uid+t+"plot";r.remove(),e._draggers.selectAll("g."+t).remove(),e._defs.select("#"+n).remove()})}function s(t,e,r){var n=t.selectAll("."+r).data([0]);return n.enter().append(e).classed(r,!0),n}var l=t("d3"),u=t("../../lib"),c=t("../plots"),h=t("./axis_ids"),f=t("./constants");r.name="cartesian",r.attr=["xaxis","yaxis"],r.idRoot=["x","y"],r.idRegex=f.idRegex,r.attrRegex=f.attrRegex,r.attributes=t("./attributes"),r.layoutAttributes=t("./layout_attributes"),r.transitionAxes=t("./transition_axes"),r.plot=function(t,e,r,i){var a,o=t._fullLayout,s=c.getSubplotIds(o,"cartesian"),l=t.calcdata;if(!Array.isArray(e))for(e=[],a=0;a<l.length;a++)e.push(a);for(a=0;a<s.length;a++){for(var u,h=s[a],f=o._plots[h],d=[],p=0;p<l.length;p++){var m=l[p],v=m[0].trace;v.xaxis+v.yaxis===h&&((e.indexOf(v.index)!==-1||v.carpet)&&(u&&u[0].trace.xaxis+u[0].trace.yaxis===h&&["tonextx","tonexty","tonext"].indexOf(v.fill)!==-1&&d.indexOf(u)===-1&&d.push(u),d.push(m)),u=m)}n(t,f,d,r,i)}},r.clean=function(t,e,r,n){var i,a,s,l=n._modules||[],u=e._modules||[];for(s=0;s<l.length;s++)if("scatter"===l[s].name){i=!0;break}for(s=0;s<u.length;s++)if("scatter"===u[s].name){a=!0;break}if(i&&!a){var c=n._plots,f=Object.keys(c||{});for(s=0;s<f.length;s++){var d=c[f[s]];d.plot&&d.plot.select("g.scatterlayer").selectAll("g.trace").remove()}n._infolayer.selectAll("g.rangeslider-container").select("g.scatterlayer").selectAll("g.trace").remove()}var p=n._has&&n._has("cartesian"),m=e._has&&e._has("cartesian");if(p&&!m){var v=n._cartesianlayer.selectAll(".subplot"),g=h.listIds({_fullLayout:n});for(v.call(o,n),n._defs.selectAll(".axesclip").remove(),s=0;s<g.length;s++)n._infolayer.select("."+g[s]+"title").remove()}},r.drawFramework=function(t){var e=t._fullLayout,r=i(t),n=e._cartesianlayer.selectAll(".subplot").data(r,u.identity);n.enter().append("g").attr("class",function(t){return"subplot "+t}),n.order(),n.exit().call(o,e),n.each(function(t){var r=e._plots[t];if(r.plotgroup=l.select(this),r.overlays=[],a(r),r.mainplot){e._plots[r.mainplot].overlays.push(r)}r.draglayer=s(e._draggers,"g",t)})},r.rangePlot=function(t,e,r){a(e),n(t,e,r),c.style(t)}},{"../../lib":709,"../plots":811,"./attributes":747,"./axis_ids":751,"./constants":753,"./layout_attributes":759,"./transition_axes":769,d3:118}],759:[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("./constants");e.exports={visible:{valType:"boolean"},color:{valType:"color",dflt:i.defaultLine},title:{valType:"string"},titlefont:o({},n,{}),type:{valType:"enumerated",values:["-","linear","log","date","category"],dflt:"-"},autorange:{valType:"enumerated",values:[!0,!1,"reversed"],dflt:!0},rangemode:{valType:"enumerated",values:["normal","tozero","nonnegative"],dflt:"normal"},range:{valType:"info_array",items:[{valType:"any"},{valType:"any"}]},fixedrange:{valType:"boolean",dflt:!1},scaleanchor:{valType:"enumerated",values:[s.idRegex.x.toString(),s.idRegex.y.toString()]},scaleratio:{valType:"number",min:0,dflt:1},tickmode:{valType:"enumerated",values:["auto","linear","array"]},nticks:{valType:"integer",min:0,dflt:0},tick0:{valType:"any"},dtick:{valType:"any"},tickvals:{valType:"data_array"},ticktext:{valType:"data_array"},ticks:{valType:"enumerated",values:["outside","inside",""]},mirror:{valType:"enumerated",values:[!0,"ticks",!1,"all","allticks"],dflt:!1},ticklen:{valType:"number",min:0,dflt:5},tickwidth:{valType:"number",min:0,dflt:1},tickcolor:{valType:"color",dflt:i.defaultLine},showticklabels:{valType:"boolean",dflt:!0},showspikes:{valType:"boolean",dflt:!1},spikecolor:{valType:"color",dflt:null},spikethickness:{valType:"number",dflt:3},spikedash:o({},a,{dflt:"dash"}),spikemode:{valType:"flaglist",flags:["toaxis","across","marker"],dflt:"toaxis"},tickfont:o({},n,{}),tickangle:{valType:"angle",dflt:"auto"},tickprefix:{valType:"string",dflt:""},showtickprefix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all"},ticksuffix:{valType:"string",dflt:""},showticksuffix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all"},showexponent:{valType:"enumerated",values:["all","first","last","none"],dflt:"all"},exponentformat:{valType:"enumerated",values:["none","e","E","power","SI","B"],dflt:"B"},separatethousands:{valType:"boolean",dflt:!1},tickformat:{valType:"string",dflt:""},hoverformat:{valType:"string",dflt:""},showline:{valType:"boolean",dflt:!1},linecolor:{valType:"color",dflt:i.defaultLine},linewidth:{valType:"number",min:0,dflt:1},showgrid:{valType:"boolean"},gridcolor:{valType:"color",dflt:i.lightLine},gridwidth:{valType:"number",min:0,dflt:1},zeroline:{valType:"boolean"},zerolinecolor:{valType:"color",dflt:i.defaultLine},zerolinewidth:{valType:"number",dflt:1},anchor:{valType:"enumerated",values:["free",s.idRegex.x.toString(),s.idRegex.y.toString()]},side:{valType:"enumerated",values:["top","bottom","left","right"]},overlaying:{valType:"enumerated",values:["free",s.idRegex.x.toString(),s.idRegex.y.toString()]},domain:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]},position:{valType:"number",min:0,max:1,dflt:0},categoryorder:{valType:"enumerated",values:["trace","category ascending","category descending","array"],dflt:"trace"},categoryarray:{valType:"data_array"},_deprecated:{autotick:{valType:"boolean"}}}},{"../../components/color/attributes":589,"../../components/drawing/attributes":613,"../../lib/extend":701,"../font_attributes":772,"./constants":753}],760:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("../../components/color"),o=t("../layout_attributes"),s=t("./constants"),l=t("./layout_attributes"),u=t("./type_defaults"),c=t("./axis_defaults"),h=t("./constraint_defaults"),f=t("./position_defaults"),d=t("./axis_ids");e.exports=function(t,e,r){function p(t,e){return Number(t.substr(5)||1)-Number(e.substr(5)||1)}function m(t,e){return i.coerce(N,B,l,t,e)}function v(t){var e={x:P,y:I}[t];return i.simpleMap(e,d.name2id)}var g,y=Object.keys(t),b=[],x=[],_=[],w=[],M=[],k=[],A={},T={};for(g=0;g<r.length;g++){var S,E,L=r[g];if(n.traceIs(L,"cartesian"))S=b,E=x;else{if(!n.traceIs(L,"gl2d"))continue;S=_,E=w}var C=d.id2name(L.xaxis),z=d.id2name(L.yaxis);if(n.traceIs(L,"carpet")&&("carpet"!==L.type||L._cheater)||C&&i.pushUnique(k,C),"carpet"===L.type&&L._cheater&&C&&i.pushUnique(M,C),C&&S.indexOf(C)===-1&&S.push(C),z&&E.indexOf(z)===-1&&E.push(z),n.traceIs(L,"2dMap")&&(A[C]=!0,A[z]=!0),n.traceIs(L,"oriented")){T["h"===L.orientation?z:C]=!0}}if(!e._has("gl3d")&&!e._has("geo"))for(g=0;g<y.length;g++){var D=y[g];_.indexOf(D)===-1&&b.indexOf(D)===-1&&s.xAxisMatch.test(D)?b.push(D):w.indexOf(D)===-1&&x.indexOf(D)===-1&&s.yAxisMatch.test(D)&&x.push(D)}b.length&&x.length&&i.pushUnique(e._basePlotModules,n.subplotsRegistry.cartesian);var I=b.concat(_).sort(p),P=x.concat(w).sort(p),O=I.concat(P),j=a.background;I.length&&P.length&&(j=i.coerce(t,e,o,"plot_bgcolor"));var F,R,N,B,U=a.combine(j,e.paper_bgcolor),V={x:v("x"),y:v("y")};for(g=0;g<O.length;g++){F=O[g],i.isPlainObject(t[F])||(t[F]={}),N=t[F],B=e[F]={},u(N,B,m,r,F),R=F.charAt(0);var q=function(e,r){for(var n={x:I,y:P}[e],i=[],a=0;a<n.length;a++){var o=n[a];o===r||(t[o]||{}).overlaying||i.push(d.name2id(o))}return i}(R,F),H={letter:R,font:e.font,outerTicks:A[F],showGrid:!T[F],data:r,bgColor:U,calendar:e.calendar,cheateronly:"x"===R&&M.indexOf(F)!==-1&&k.indexOf(F)===-1};c(N,B,m,H,e);m("showspikes")&&(m("spikecolor"),m("spikethickness"),m("spikedash"),m("spikemode"));var G={letter:R,counterAxes:V[R],overlayableAxes:q};f(N,B,m,G),B._input=N}var Y=n.getComponentMethod("rangeslider","handleDefaults"),X=n.getComponentMethod("rangeselector","handleDefaults");for(g=0;g<I.length;g++)F=I[g],N=t[F],B=e[F],Y(t,e,F),"date"===B.type&&X(N,B,e,P,B.calendar),m("fixedrange");for(g=0;g<P.length;g++){F=P[g],N=t[F],B=e[F];var W=e[d.id2name(B.anchor)];m("fixedrange",W&&W.rangeslider&&W.rangeslider.visible)}e._axisConstraintGroups=[];var Z=V.x.concat(V.y);for(g=0;g<O.length;g++)F=O[g],R=F.charAt(0),N=t[F],B=e[F],h(N,B,m,Z,e)}},{"../../components/color":590,"../../lib":709,"../../registry":826,"../layout_attributes":802,"./axis_defaults":750,"./axis_ids":751,"./constants":753,"./constraint_defaults":754,"./layout_attributes":759,"./position_defaults":762,"./type_defaults":770}],761:[function(t,e,r){"use strict";function n(t,e,r){var n,a,o,s,l,u=[],c=r.map(function(e){return e[t]}),h=i.bisector(e).left;for(n=0;n<c.length;n++)for(o=c[n],a=0;a<o.length;a++)null!==(s=o[a])&&void 0!==s&&((l=h(u,s))<u.length&&u[l]===s||u.splice(l,0,s));return u}var i=t("d3");e.exports=function(t,e,r,a){switch(e){case"array":return Array.isArray(r)?r.slice():[];case"category ascending":return n(t,i.ascending,a);case"category descending":return n(t,i.descending,a);case"trace":default:return[]}}},{d3:118}],762:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib");e.exports=function(t,e,r,a){var o=a.counterAxes||[],s=a.overlayableAxes||[],l=a.letter;"free"===i.coerce(t,e,{anchor:{valType:"enumerated",values:["free"].concat(o),dflt:n(t.position)?"free":o[0]||"free"}},"anchor")&&r("position"),i.coerce(t,e,{side:{valType:"enumerated",values:"x"===l?["bottom","top"]:["left","right"],dflt:"x"===l?"bottom":"left"}},"side");var u=!1;if(s.length&&(u=i.coerce(t,e,{overlaying:{valType:"enumerated",values:[!1].concat(s),dflt:!1}},"overlaying")),!u){var c=r("domain");c[0]>c[1]-.01&&(e.domain=[0,1]),i.noneOrAll(t.domain,e.domain,[0,1])}return e}},{"../../lib":709,"fast-isnumeric":127}],763:[function(t,e,r){"use strict";e.exports=function(t,e,r){void 0===r&&(r=.5);var n=[t.r2l(t.range[0]),t.r2l(t.range[1])],i=n[0]+(n[1]-n[0])*r,a=(i-n[0])*e;t.range=t._input.range=[t.l2r(i-a),t.l2r(i+a)]}},{}],764:[function(t,e,r){"use strict";function n(t){return t._id}var i=t("../../lib/polygon"),a=t("../../components/color"),o=t("./axes"),s=t("./constants"),l=i.filter,u=i.tester,c=s.MINSELECT;e.exports=function(t,e,r,i,h){function f(t){var e="y"===t._id.charAt(0)?1:0;return function(r){return t.p2d(r[e])}}function d(t,e){return t-e}var p,m=i.gd._fullLayout._zoomlayer,v=i.element.getBoundingClientRect(),g=i.plotinfo.xaxis._offset,y=i.plotinfo.yaxis._offset,b=e-v.left,x=r-v.top,_=b,w=x,M="M"+b+","+x,k=i.xaxes[0]._length,A=i.yaxes[0]._length,T=i.xaxes.map(n),S=i.yaxes.map(n),E=i.xaxes.concat(i.yaxes);"lasso"===h&&(p=l([[b,x]],s.BENDPX));var L=m.selectAll("path.select-outline").data([1,2]);L.enter().append("path").attr("class",function(t){return"select-outline select-outline-"+t}).attr("transform","translate("+g+", "+y+")").attr("d",M+"Z");var C,z,D,I,P,O=m.append("path").attr("class","zoombox-corners").style({fill:a.background,stroke:a.defaultLine,"stroke-width":1}).attr("transform","translate("+g+", "+y+")").attr("d","M0,0Z"),j=[],F=i.gd,R=[];for(C=0;C<F.calcdata.length;C++)if(z=F.calcdata[C],D=z[0].trace,D._module&&D._module.selectPoints)if(i.subplot){if(D.subplot!==i.subplot)continue;j.push({selectPoints:D._module.selectPoints,cd:z,xaxis:i.xaxes[0],yaxis:i.yaxes[0]})}else{if(T.indexOf(D.xaxis)===-1)continue;if(S.indexOf(D.yaxis)===-1)continue;j.push({selectPoints:D._module.selectPoints,cd:z,xaxis:o.getFromId(F,D.xaxis),yaxis:o.getFromId(F,D.yaxis)})}i.moveFn=function(t,e){var r,n;_=Math.max(0,Math.min(k,t+b)),w=Math.max(0,Math.min(A,e+x));var a=Math.abs(_-b),o=Math.abs(w-x);for("select"===h?(o<Math.min(.6*a,c)?(r=u([[b,0],[b,A],[_,A],[_,0]]),O.attr("d","M"+r.xmin+","+(x-c)+"h-4v"+2*c+"h4ZM"+(r.xmax-1)+","+(x-c)+"h4v"+2*c+"h-4Z")):a<Math.min(.6*o,c)?(r=u([[0,x],[0,w],[k,w],[k,x]]),O.attr("d","M"+(b-c)+","+r.ymin+"v-4h"+2*c+"v4ZM"+(b-c)+","+(r.ymax-1)+"v4h"+2*c+"v-4Z")):(r=u([[b,x],[b,w],[_,w],[_,x]]),O.attr("d","M0,0Z")),L.attr("d","M"+r.xmin+","+r.ymin+"H"+(r.xmax-1)+"V"+(r.ymax-1)+"H"+r.xmin+"Z")):"lasso"===h&&(p.addPt([_,w]),r=u(p.filtered),L.attr("d","M"+p.filtered.join("L")+"Z")),R=[],C=0;C<j.length;C++)I=j[C],[].push.apply(R,I.selectPoints(I,r));if(P={points:R},"select"===h){var s,l=P.range={};for(C=0;C<E.length;C++)n=E[C],s=n._id.charAt(0),l[n._id]=[n.p2d(r[s+"min"]),n.p2d(r[s+"max"])].sort(d)}else{var m=P.lassoPoints={};for(C=0;C<E.length;C++)n=E[C],m[n._id]=p.filtered.map(f(n))}i.gd.emit("plotly_selecting",P)},i.doneFn=function(t,e){if(O.remove(),t||2!==e)i.gd.emit("plotly_selected",P);else{for(L.remove(),C=0;C<j.length;C++)I=j[C],I.selectPoints(I,!1);F.emit("plotly_deselect",null)}}}},{"../../components/color":590,"../../lib/polygon":719,"./axes":748,"./constants":753}],765:[function(t,e,r){"use strict";function n(t){return Math.pow(10,t)}function i(t){return o(t)?(t=Number(t),t<-f||t>f?d:o(t)?Number(t):d):d}var a=t("d3"),o=t("fast-isnumeric"),s=t("../../lib"),l=s.cleanNumber,u=s.ms2DateTime,c=s.dateTime2ms,h=t("../../constants/numerical"),f=h.FP_SAFE,d=h.BADNUM,p=t("./constants"),m=t("./axis_ids");e.exports=function(t,e){function r(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-3*w*Math.abs(n-i))}return d}function h(e,r,n){var i=c(e,n||t.calendar);if(i===d){if(!o(e))return d;i=c(new Date(+e))}return i}function v(e,r,n){return u(e,r,n||t.calendar)}function g(e){return t._categories[Math.round(e)]}function y(e){if(null!==e&&void 0!==e){if(void 0===t._categoriesMap&&(t._categoriesMap={}),void 0!==t._categoriesMap[e])return t._categoriesMap[e];t._categories.push(e);var r=t._categories.length-1;return t._categoriesMap[e]=r,r}return d}function b(e){if(t._categoriesMap){var r=t._categoriesMap[e];if(void 0!==r)return r}if("number"==typeof e)return e}function x(e){return o(e)?a.round(t._b+t._m*e,2):d}function _(e){return(e-t._b)/t._m}e=e||{};var w=10;t.c2l="log"===t.type?r:i,t.l2c="log"===t.type?n:i,t.l2p=x,t.p2l=_,t.c2p="log"===t.type?function(t,e){return x(r(t,e))}:x,t.p2c="log"===t.type?function(t){return n(_(t))}:_,["linear","-"].indexOf(t.type)!==-1?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=l,t.c2d=t.c2r=t.l2d=t.l2r=i,t.d2p=t.r2p=function(t){return x(l(t))},t.p2d=t.p2r=_):"log"===t.type?(t.d2r=t.d2l=function(t,e){return r(l(t),e)},t.r2d=t.r2c=function(t){return n(l(t))},t.d2c=t.r2l=l,t.c2d=t.l2r=i,t.c2r=r,t.l2d=n,t.d2p=function(e,r){return x(t.d2r(e,r))},t.p2d=function(t){return n(_(t))},t.r2p=function(t){return x(l(t))},t.p2r=_):"date"===t.type?(t.d2r=t.r2d=s.identity,t.d2c=t.r2c=t.d2l=t.r2l=h,t.c2d=t.c2r=t.l2d=t.l2r=v,t.d2p=t.r2p=function(t,e,r){return x(h(t,0,r))},t.p2d=t.p2r=function(t,e,r){return v(_(t),e,r)}):"category"===t.type&&(t.d2r=t.d2c=t.d2l=y,t.r2d=t.c2d=t.l2d=g,t.d2l_noadd=b,t.r2l=t.l2r=t.r2c=t.c2r=i,t.d2p=function(t){return x(b(t))},t.p2d=function(t){return g(_(t))},t.r2p=x,t.p2r=_),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){e||(e="range");var r,n,i=s.nestedProperty(t,e).get(),a=(t._id||"x").charAt(0);if(n="date"===t.type?s.dfltRange(t.calendar):"y"===a?p.DFLTRANGEY:p.DFLTRANGEX,n=n.slice(),!i||2!==i.length)return void s.nestedProperty(t,e).set(n);for("date"===t.type&&(i[0]=s.cleanDate(i[0],d,t.calendar),i[1]=s.cleanDate(i[1],d,t.calendar)),r=0;r<2;r++)if("date"===t.type){if(!s.isDateTime(i[r],t.calendar)){t[e]=n;break}if(t.r2l(i[0])===t.r2l(i[1])){var l=s.constrain(t.r2l(i[0]),s.MIN_MS+1e3,s.MAX_MS-1e3);i[0]=t.l2r(l-1e3),i[1]=t.l2r(l+1e3);break}}else{if(!o(i[r])){if(!o(i[1-r])){t[e]=n;break}i[r]=i[1-r]*(r?10:.1)}if(i[r]<-f?i[r]=-f:i[r]>f&&(i[r]=f),i[0]===i[1]){var u=Math.max(1,Math.abs(1e-6*i[0]));i[0]-=u,i[1]+=u}}},t.setScale=function(r){var n=e._size,i=t._id.charAt(0);if(t._categories||(t._categories=[]),t._categoriesMap||(t._categoriesMap={}),t.overlaying){var a=m.getFromId({_fullLayout:e},t.overlaying);t.domain=a.domain}var o=r&&t._r?"_r":"range",l=t.calendar;t.cleanRange(o);var u=t.r2l(t[o][0],l),c=t.r2l(t[o][1],l);if("y"===i?(t._offset=n.t+(1-t.domain[1])*n.h,t._length=n.h*(t.domain[1]-t.domain[0]),t._m=t._length/(u-c),t._b=-t._m*c):(t._offset=n.l+t.domain[0]*n.w,t._length=n.w*(t.domain[1]-t.domain[0]),t._m=t._length/(c-u),t._b=-t._m*u),!isFinite(t._m)||!isFinite(t._b))throw s.notifier("Something went wrong with axis scaling","long"),e._replotting=!1,new Error("axis scaling")},t.makeCalcdata=function(e,r){var n,i,a,o="date"===t.type&&e[r+"calendar"];if(r in e)for(n=e[r],i=new Array(n.length),a=0;a<n.length;a++)i[a]=t.d2c(n[a],0,o);else{var s=r+"0"in e?t.d2c(e[r+"0"],0,o):0,l=e["d"+r]?Number(e["d"+r]):1;for(n=e[{x:"y",y:"x"}[r]],i=new Array(n.length),a=0;a<n.length;a++)i[a]=s+a*l}return i},t.isValidRange=function(e){return Array.isArray(e)&&2===e.length&&o(t.r2l(e[0]))&&o(t.r2l(e[1]))},t._min=[],t._max=[],t._separators=e.separators,delete t._minDtick,delete t._forceTick0}},{"../../constants/numerical":690,"../../lib":709,"./axis_ids":751,"./constants":753,d3:118,"fast-isnumeric":127}],766:[function(t,e,r){"use strict";function n(t){var e=["showexponent","showtickprefix","showticksuffix"],r=e.filter(function(e){return void 0!==t[e]}),n=function(e){return t[e]===t[r[0]]};if(r.every(n)||1===r.length)return t[r[0]]}var i=t("../../lib");e.exports=function(t,e,r,a,o){var s=n(t);if(r("tickprefix")&&r("showtickprefix",s),r("ticksuffix")&&r("showticksuffix",s),r("showticklabels")){var l=o.font||{},u=e.color===t.color?e.color:l.color;i.coerceFont(r,"tickfont",{family:l.family,size:l.size,color:u}),r("tickangle"),"category"!==a&&(r("tickformat")||"date"===a||(r("showexponent",s),r("exponentformat"),r("separatethousands")))}"category"===a||o.noHover||r("hoverformat")}},{"../../lib":709}],767:[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":709,"./layout_attributes":759}],768:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../constants/numerical").ONEDAY;e.exports=function(t,e,r,o){var s="auto";"array"!==t.tickmode||"log"!==o&&"date"!==o||(t.tickmode="auto"),Array.isArray(t.tickvals)?s="array":t.dtick&&(s="linear");var l=r("tickmode",s);if("auto"===l)r("nticks");else if("linear"===l){var u="date"===o?a:1,c=r("dtick",u);if(n(c))e.dtick=c>0?Number(c):u;else if("string"!=typeof c)e.dtick=u;else{var h=c.charAt(0),f=c.substr(1);f=n(f)?Number(f):0,(f<=0||!("date"===o&&"M"===h&&f===Math.round(f)||"log"===o&&"L"===h||"log"===o&&"D"===h&&(1===f||2===f)))&&(e.dtick=u)}var d="date"===o?i.dateTick0(e.calendar):0,p=r("tick0",d);"date"===o?e.tick0=i.cleanDate(p,d):n(p)&&"D1"!==c&&"D2"!==c?e.tick0=Number(p):e.tick0=d}else{var m=r("tickvals");void 0===m?e.tickmode="auto":r("ticktext")}}},{"../../constants/numerical":690,"../../lib":709,"fast-isnumeric":127}],769:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../plotly"),a=t("../../registry"),o=t("../../components/drawing"),s=t("./axes"),l=/((x|y)([2-9]|[1-9][0-9]+)?)axis$/;e.exports=function(t,e,r,u){function c(e,r){function n(e,r){for(i=0;i<e.length;i++){var n=e[i];o.indexOf(n.xref)===-1&&o.indexOf(n.yref)===-1||r(t,i)}}var i,o=[];for(o=[e._id,r._id],i=0;i<o.length;i++)s.doTicks(t,o[i],!0);n(v.annotations||[],a.getComponentMethod("annotations","drawOne")),n(v.shapes||[],a.getComponentMethod("shapes","drawOne")),n(v.images||[],a.getComponentMethod("images","draw"))}function h(t){var e=t.xaxis,r=t.yaxis;v._defs.selectAll("#"+t.clipId).call(o.setTranslate,0,0).call(o.setScale,1,1),t.plot.call(o.setTranslate,e._offset,r._offset).call(o.setScale,1,1).select(".scatterlayer").selectAll(".points").selectAll(".point").call(o.setPointGroupScale,1,1),t.plot.select(".scatterlayer").selectAll(".points").selectAll(".textpoint").call(o.setTextPointsScale,1,1)}function f(e,r){var n,i,a,s=y[e.xaxis._id],l=y[e.yaxis._id],u=[];if(s){n=t._fullLayout[s.axisName],i=n._r,a=s.to,u[0]=(i[0]*(1-r)+r*a[0]-i[0])/(i[1]-i[0])*e.xaxis._length;var h=i[1]-i[0],f=a[1]-a[0];n.range[0]=i[0]*(1-r)+r*a[0],n.range[1]=i[1]*(1-r)+r*a[1],u[2]=e.xaxis._length*(1-r+r*f/h)}else u[0]=0,u[2]=e.xaxis._length;if(l){n=t._fullLayout[l.axisName],i=n._r,a=l.to,u[1]=(i[1]*(1-r)+r*a[1]-i[1])/(i[0]-i[1])*e.yaxis._length;var d=i[1]-i[0],p=a[1]-a[0];n.range[0]=i[0]*(1-r)+r*a[0],n.range[1]=i[1]*(1-r)+r*a[1],u[3]=e.yaxis._length*(1-r+r*p/d)}else u[1]=0,u[3]=e.yaxis._length;c(e.xaxis,e.yaxis);var m=e.xaxis,g=e.yaxis,b=!!s,x=!!l,_=b?m._length/u[2]:1,w=x?g._length/u[3]:1,M=b?u[0]:0,k=x?u[1]:0,A=b?u[0]/u[2]*m._length:0,T=x?u[1]/u[3]*g._length:0,S=m._offset-A,E=g._offset-T;v._defs.selectAll("#"+e.clipId).call(o.setTranslate,M,k).call(o.setScale,1/_,1/w),e.plot.call(o.setTranslate,S,E).call(o.setScale,_,w).selectAll(".points").selectAll(".point").call(o.setPointGroupScale,1/_,1/w),e.plot.selectAll(".points").selectAll(".textpoint").call(o.setTextPointsScale,1/_,1/w)}function d(){for(var e={},r=0;r<b.length;r++){var n=t._fullLayout[y[b[r]].axisName],a=y[b[r]].to;e[n._name+".range[0]"]=a[0],e[n._name+".range[1]"]=a[1],n.range=a.slice()}return _&&_(),i.relayout(t,e).then(function(){for(var t=0;t<x.length;t++)h(x[t])})}function p(){for(var e={},r=0;r<b.length;r++){var n=t._fullLayout[b[r]+"axis"];e[n._name+".range[0]"]=n.range[0],e[n._name+".range[1]"]=n.range[1],n.range=n._r.slice()}return i.relayout(t,e).then(function(){for(var t=0;t<x.length;t++)h(x[t])})}function m(){M=Date.now();for(var t=Math.min(1,(M-w)/r.duration),e=A(t),n=0;n<x.length;n++)f(x[n],e);M-w>r.duration?(d(),k=window.cancelAnimationFrame(m)):k=window.requestAnimationFrame(m)}var v=t._fullLayout,g=[],y=function(t){var e,r,n,i,a,o={};for(e in t)if(r=e.split("."),n=r[0].match(l)){var s=n[1],u=s+"axis";if(i=v[u],a={},Array.isArray(t[e])?a.to=t[e].slice(0):Array.isArray(t[e].range)&&(a.to=t[e].range.slice(0)),!a.to)continue;a.axisName=u,a.length=i._length,g.push(s),o[s]=a}return o}(e),b=Object.keys(y),x=function(t,e,r){var n,i,a,o=t._plots,s=[];for(n in o){var l=o[n];if(s.indexOf(l)===-1){var u=l.xaxis._id,c=l.yaxis._id,h=l.xaxis.range,f=l.yaxis.range;l.xaxis._r=l.xaxis.range.slice(),l.yaxis._r=l.yaxis.range.slice(),i=r[u]?r[u].to:h,a=r[c]?r[c].to:f,h[0]===i[0]&&h[1]===i[1]&&f[0]===a[0]&&f[1]===a[1]||e.indexOf(u)===-1&&e.indexOf(c)===-1||s.push(l)}}return s}(v,b,y);if(!x.length)return!1;var _;u&&(_=u());var w,M,k,A=n.ease(r.easing);return t._transitionData._interruptCallbacks.push(function(){return window.cancelAnimationFrame(k),k=null,p()}),w=Date.now(),k=window.requestAnimationFrame(m),Promise.resolve()}},{"../../components/drawing":614,"../../plotly":743,"../../registry":826,"./axes":748,d3:118}],770:[function(t,e,r){"use strict";function n(t,e){if("-"===t.type){var r=t._id,n=r.charAt(0);r.indexOf("scene")!==-1&&(r=n);var u=i(e,r,n);if(u){if("histogram"===u.type&&n==={v:"y",h:"x"}[u.orientation||"v"])return void(t.type="linear");var c=n+"calendar",h=u[c];if(o(u,n)){for(var f,d=a(u),p=[],m=0;m<e.length;m++)f=e[m],s.traceIs(f,"box")&&(f[n+"axis"]||n)===r&&(void 0!==f[d]?p.push(f[d][0]):void 0!==f.name?p.push(f.name):p.push("text"),f[c]!==h&&(h=void 0));t.type=l(p,h)}else t.type=l(u[n]||[u[n+"0"]],h)}}}function i(t,e,r){for(var n=0;n<t.length;n++){var i=t[n];if((i[r+"axis"]||r)===e){if(o(i,r))return i;if((i[r]||[]).length||i[r+"0"])return i}}}function a(t){return{v:"x",h:"y"}[t.orientation||"v"]}function o(t,e){var r=a(t),n=s.traceIs(t,"box"),i=s.traceIs(t._fullInput||{},"candlestick");return n&&!i&&e===r&&void 0===t[r]&&void 0===t[r+"0"]}var s=t("../../registry"),l=t("./axis_autotype"),u=t("./axis_ids").name2id;e.exports=function(t,e,r,i,a){a&&(e._name=a,e._id=u(a)),"-"===r("type")&&(n(e,i),"-"===e.type?e.type="linear":t.type=e.type)}},{"../../registry":826,"./axis_autotype":749,"./axis_ids":751}],771:[function(t,e,r){"use strict";function n(t,e,r){var n,i,a,o=!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 i=u.nestedProperty(n,e.prop).get(),a=r[e.type]=r[e.type]||{},a.hasOwnProperty(e.prop)&&a[e.prop]!==i&&(o=!0),a[e.prop]=i,{changed:o,value:i}}function i(t,e){return Array.isArray(e[0])&&1===e[0].length&&["string","number"].indexOf(typeof e[0][0])!==-1?[{type:"layout",prop:"_currentFrame",value:e[0][0].toString()}]:[]}function a(t,e){var r=[],n=e[0],i={};if("string"==typeof n)i[n]=e[1];else{if(!u.isPlainObject(n))return r;i=n}return s(i,function(t,e,n){r.push({type:"layout",prop:t,value:n})},"",0),r}function o(t,e){var r,n,i,a,o=[];if(n=e[0],i=e[1],r=e[2],a={},"string"==typeof n)a[n]=i;else{if(!u.isPlainObject(n))return o;a=n,void 0===r&&(r=i)}return void 0===r&&(r=null),s(a,function(e,n,i){var a;if(Array.isArray(i)){var s=Math.min(i.length,t.data.length);r&&(s=Math.min(s,r.length)),a=[];for(var l=0;l<s;l++)a[l]=r?r[l]:l}else a=r?r.slice(0):null;if(null===a)Array.isArray(i)&&(i=i[0]);else if(Array.isArray(a)){if(!Array.isArray(i)){var u=i;i=[];for(var c=0;c<a.length;c++)i[c]=u}i.length=Math.min(a.length,i.length)}o.push({type:"data",prop:e,traces:a,value:i})},"",0),o}function s(t,e,r,n){Object.keys(t).forEach(function(i){var a=t[i];if("_"!==i[0]){var o=r+(n>0?".":"")+i;u.isPlainObject(a)?s(a,e,o,n+1):e(o,i,a)}})}var l=t("../plotly"),u=t("../lib");r.manageCommandObserver=function(t,e,i,a){var o={},s=!0;e&&e._commandObserver&&(o=e._commandObserver),o.cache||(o.cache={}),o.lookupTable={};var l=r.hasSimpleAPICommandBindings(t,i,o.lookupTable);if(e&&e._commandObserver){if(l)return o;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,o}if(l){n(t,l,o.cache),o.check=function(){if(s){var e=n(t,l,o.cache);return e.changed&&a&&void 0!==o.lookupTable[e.value]&&(o.disable(),Promise.resolve(a({value:e.value,type:l.type,prop:l.prop,traces:l.traces,index:o.lookupTable[e.value]})).then(o.enable,o.enable)),e.changed}};for(var c=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],h=0;h<c.length;h++)t._internalOn(c[h],o.check);o.remove=function(){for(var e=0;e<c.length;e++)t._removeInternalListener(c[e],o.check)}}else u.warn("Unable to automatically bind plot updates to API command"),o.lookupTable={},o.remove=function(){};return o.disable=function(){s=!1},o.enable=function(){s=!0},e&&(e._commandObserver=o),o},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 h=r.computeAPICommandBindings(t,u,c);if(1!==h.length)return!1;if(a){if(s=h[0],s.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 f=0;f<a.traces.length;f++)if(a.traces[f]!==s.traces[f])return!1}else if(s.prop!==a.prop)return!1}else a=h[0],Array.isArray(a.traces)&&a.traces.sort();s=h[0];var d=s.value;if(Array.isArray(d)){if(1!==d.length)return!1;d=d[0]}n&&(n[d]=i)}return a},r.executeAPICommand=function(t,e,r){var n=l[e],i=[t];Array.isArray(r)||(r=[]);for(var a=0;a<r.length;a++)i.push(r[a]);return n.apply(null,i).catch(function(t){return u.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=o(t,r);break;case"relayout":n=a(t,r);break;case"update":n=o(t,[r[0],r[2]]).concat(a(t,[r[1]]));break;case"animate":n=i(t,r);break;default:n=[]}return n}},{"../lib":709,"../plotly":743}],772:[function(t,e,r){"use strict";e.exports={family:{valType:"string",noBlank:!0,strict:!0},size:{valType:"number",min:1},color:{valType:"color"}}},{}],773:[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"}}},{}],774:[function(t,e,r){"use strict";var n=e.exports={};n.projNames={equirectangular:"equirectangular",mercator:"mercator",orthographic:"orthographic","natural earth":"naturalEarth",kavrayskiy7:"kavrayskiy7",miller:"miller",robinson:"robinson",eckert4:"eckert4","azimuthal equal area":"azimuthalEqualArea","azimuthal equidistant":"azimuthalEquidistant","conic equal area":"conicEqualArea","conic conformal":"conicConformal","conic equidistant":"conicEquidistant",gnomonic:"gnomonic",stereographic:"stereographic",mollweide:"mollweide",hammer:"hammer","transverse mercator":"transverseMercator","albers usa":"albersUsa","winkel tripel":"winkel3",aitoff:"aitoff",sinusoidal:"sinusoidal"},n.axesNames=["lonaxis","lataxis"],n.lonaxisSpan={orthographic:180,"azimuthal equal area":360,"azimuthal equidistant":360,"conic conformal":180,gnomonic:160,stereographic:180,"transverse mercator":180,"*":360},n.lataxisSpan={"conic conformal":150,stereographic:179.5,"*":180},n.scopeDefaults={world:{lonaxisRange:[-180,180],lataxisRange:[-90,90],projType:"equirectangular",projRotate:[0,0,0]},usa:{lonaxisRange:[-180,-50],lataxisRange:[15,80],projType:"albers usa"},europe:{lonaxisRange:[-30,60],lataxisRange:[30,80],projType:"conic conformal",projRotate:[15,0,0],projParallels:[0,60]},asia:{lonaxisRange:[22,160],lataxisRange:[-15,55],projType:"mercator",projRotate:[0,0,0]},africa:{lonaxisRange:[-30,60],lataxisRange:[-40,40],projType:"mercator",projRotate:[0,0,0]},"north america":{lonaxisRange:[-180,-45],lataxisRange:[5,85],projType:"conic conformal",projRotate:[-100,0,0],projParallels:[29.5,45.5]},"south america":{lonaxisRange:[-100,-30],lataxisRange:[-60,15],projType:"mercator",projRotate:[0,0,0]}},n.clipPad=.001,n.precision=.1,n.landColor="#F0DC82",n.waterColor="#3399FF",n.locationmodeToLayer={"ISO-3":"countries","USA-states":"subunits","country names":"countries"},n.sphereSVG={type:"Sphere"},n.fillLayers=["ocean","land","lakes"],n.lineLayers=["subunits","countries","coastlines","rivers","frame"],n.baseLayers=["ocean","land","lakes","subunits","countries","coastlines","rivers","lataxis","lonaxis","frame"],n.layerNameToAdjective={ocean:"ocean",land:"land",lakes:"lake",subunits:"subunit",countries:"country",coastlines:"coastline",rivers:"river",frame:"frame"},n.baseLayersOverChoropleth=["rivers","lakes"]},{}],775:[function(t,e,r){"use strict";function n(t){this.id=t.id,this.graphDiv=t.graphDiv,this.container=t.container,this.topojsonURL=t.topojsonURL,this.topojsonName=null,this.topojson=null,this.projectionType=null,this.projection=null,this.clipAngle=null,this.setScale=null,this.path=null,this.zoom=null,this.zoomReset=null,this.makeFramework(),this.traceHash={}}function i(t,e,r){return u.geo.graticule().extent([[t[0],e[0]],[t[1],e[1]]]).step(r)}function a(t,e,r){var n=b.layerNameToAdjective[e];t.select("."+e).selectAll("path").attr("stroke","none").call(c.fill,r[n+"color"])}function o(t,e,r){var n=b.layerNameToAdjective[e];t.select("."+e).selectAll("path").attr("fill","none").call(c.stroke,r[n+"color"]).call(h.dashLine,"",r[n+"width"])}function s(t,e,r){
63 t.select("."+e+"graticule").selectAll("path").attr("fill","none").call(c.stroke,r[e].gridcolor).call(h.dashLine,"",r[e].gridwidth)}function l(t){var e={type:"linear",showexponent:"all",exponentformat:p.layoutAttributes.exponentformat.dflt};return p.setConvert(e,t),e}var u=t("d3"),c=t("../../components/color"),h=t("../../components/drawing"),f=t("../../components/fx"),d=t("../plots"),p=t("../cartesian/axes"),m=t("./projections"),v=t("./set_scale"),g=t("./zoom"),y=t("./zoom_reset"),b=t("./constants"),x=t("../../lib/topojson_utils"),_=t("topojson-client").feature;m(u),e.exports=n;var w=n.prototype;w.plot=function(t,e,r){var n,i,a=this,o=e[a.id],s=e._size;a.projection=null,a.setScale=v(o,s),a.makeProjection(o),a.makePath(),a.adjustLayout(o,s),a.zoom=g(a,o),a.zoomReset=y(a,o),a.mockAxis=l(e),a.framework.call(a.zoom).on("dblclick.zoom",a.zoomReset),a.framework.on("mousemove",function(){var t=u.mouse(this),e=a.projection.invert(t);if(e&&!isNaN(e[0])&&!isNaN(e[1])){var r=u.event;r.xpx=t[0],r.ypx=t[1],a.xaxis.c2p=function(){return t[0]},a.xaxis.p2c=function(){return e[0]},a.yaxis.c2p=function(){return t[1]},a.yaxis.p2c=function(){return e[1]},f.hover(a.graphDiv,r,a.id)}}),a.framework.on("mouseout",function(){f.loneUnhover(e._toppaper)}),a.framework.on("click",function(){f.click(a.graphDiv,u.event)}),n=x.getTopojsonName(o),null===a.topojson||n!==a.topojsonName?(a.topojsonName=n,void 0!==PlotlyGeoAssets.topojson[a.topojsonName]?(a.topojson=PlotlyGeoAssets.topojson[a.topojsonName],a.onceTopojsonIsLoaded(t,o)):(i=x.getTopojsonPath(a.topojsonURL,a.topojsonName),r.push(new Promise(function(e,r){u.json(i,function(n,s){if(n)return void r(404===n.status?new Error(["plotly.js could not find topojson file at",i,".","Make sure the *topojsonURL* plot config option","is set properly."].join(" ")):new Error(["unexpected error while fetching topojson file at",i].join(" ")));a.topojson=s,PlotlyGeoAssets.topojson[a.topojsonName]=s,a.onceTopojsonIsLoaded(t,o),e()})})))):a.onceTopojsonIsLoaded(t,o)},w.onceTopojsonIsLoaded=function(t,e){this.drawLayout(e),d.generalUpdatePerTraceModule(this,t,e),this.render()},w.makeProjection=function(t){var e,r=t.projection,n=r.type,i=null===this.projection||n!==this.projectionType;i?(this.projectionType=n,e=this.projection=u.geo[b.projNames[n]]()):e=this.projection,e.translate(r._translate0).precision(b.precision),t._isAlbersUsa||e.rotate(r._rotate).center(r._center),t._clipAngle?(this.clipAngle=t._clipAngle,e.clipAngle(t._clipAngle-b.clipPad)):this.clipAngle=null,r.parallels&&e.parallels(r.parallels),i&&this.setScale(e),e.translate(r._translate).scale(r._scale)},w.makePath=function(){this.path=u.geo.path().projection(this.projection)},w.makeFramework=function(){var t=this.graphDiv._fullLayout,e="clip"+t._uid+this.id,r=t._defs.selectAll("g.clips").data([0]);r.enter().append("g").classed("clips",!0),(this.clipDef=r.selectAll("#"+e).data([0])).enter().append("clipPath").attr("id",e).append("rect");var n=this.framework=u.select(this.container).append("g");n.attr("class","geo "+this.id).style("pointer-events","all").call(h.setClipUrl,e),n.append("g").attr("class","bglayer").append("rect"),n.append("g").attr("class","baselayer"),n.append("g").attr("class","choroplethlayer"),n.append("g").attr("class","baselayeroverchoropleth"),n.append("g").attr("class","scattergeolayer"),n.on("dblclick.zoom",null),this.xaxis={_id:"x"},this.yaxis={_id:"y"}},w.adjustLayout=function(t,e){var r=t.domain,n=e.l+e.w*r.x[0]+t._marginX,i=e.t+e.h*(1-r.y[1])+t._marginY;h.setTranslate(this.framework,n,i);var a={x:0,y:0,width:t._width,height:t._height};this.clipDef.select("rect").attr(a),this.framework.select(".bglayer").select("rect").attr(a).call(c.fill,t.bgcolor),this.xaxis._offset=n,this.xaxis._length=t._width,this.yaxis._offset=i,this.yaxis._length=t._height},w.drawTopo=function(t,e,r){if(r["show"+e]===!0){var n=this.topojson,i="frame"===e?b.sphereSVG:_(n,n.objects[e]);t.append("g").datum(i).attr("class",e).append("path").attr("class","basepath")}},w.drawGraticule=function(t,e,r){var n=r[e];if(n.showgrid===!0){var a=b.scopeDefaults[r.scope],o=a.lonaxisRange,s=a.lataxisRange,l="lonaxis"===e?[n.dtick]:[0,n.dtick],u=i(o,s,l);t.append("g").datum(u).attr("class",e+"graticule").append("path").attr("class","graticulepath")}},w.drawLayout=function(t){var e,r=this.framework.select("g.baselayer"),n=b.baseLayers,i=b.axesNames;r.selectAll("*").remove();for(var a=0;a<n.length;a++)e=n[a],i.indexOf(e)!==-1?this.drawGraticule(r,e,t):this.drawTopo(r,e,t);this.styleLayout(t)},w.styleLayer=function(t,e,r){var n=b.fillLayers,i=b.lineLayers;n.indexOf(e)!==-1?a(t,e,r):i.indexOf(e)!==-1&&o(t,e,r)},w.styleLayout=function(t){for(var e,r=this.framework.select("g.baselayer"),n=b.baseLayers,i=b.axesNames,a=0;a<n.length;a++)e=n[a],i.indexOf(e)!==-1?s(r,e,t):this.styleLayer(r,e,t)},w.isLonLatOverEdges=function(t){var e=this.clipAngle;if(null===e)return!1;var r=this.projection.rotate();return u.geo.distance(t,[-r[0],-r[1]])>e*Math.PI/180},w.render=function(){function t(t){var e=r.projection(t.lonlat);return e?"translate("+e[0]+","+e[1]+")":null}function e(t){return r.isLonLatOverEdges(t.lonlat)?"0":"1.0"}var r=this,n=r.framework,i=n.select("g.choroplethlayer"),a=n.select("g.scattergeolayer"),o=r.path;n.selectAll("path.basepath").attr("d",o),n.selectAll("path.graticulepath").attr("d",o),i.selectAll("path.choroplethlocation").attr("d",o),i.selectAll("path.basepath").attr("d",o),a.selectAll("path.js-line").attr("d",o),null!==r.clipAngle?(a.selectAll("path.point").style("opacity",e).attr("transform",t),a.selectAll("text").style("opacity",e).attr("transform",t)):(a.selectAll("path.point").attr("transform",t),a.selectAll("text").attr("transform",t))}},{"../../components/color":590,"../../components/drawing":614,"../../components/fx":631,"../../lib/topojson_utils":730,"../cartesian/axes":748,"../plots":811,"./constants":774,"./projections":782,"./set_scale":783,"./zoom":784,"./zoom_reset":785,d3:118,"topojson-client":528}],776:[function(t,e,r){"use strict";var n=t("./geo"),i=t("../../plots/plots");r.name="geo",r.attr="geo",r.idRoot="geo",r.idRegex=/^geo([2-9]|[1-9][0-9]+)?$/,r.attrRegex=/^geo([2-9]|[1-9][0-9]+)?$/,r.attributes=t("./layout/attributes"),r.layoutAttributes=t("./layout/layout_attributes"),r.supplyLayoutDefaults=t("./layout/defaults"),r.plot=function(t){var e=t._fullLayout,r=t.calcdata,a=i.getSubplotIds(e,"geo");void 0===window.PlotlyGeoAssets&&(window.PlotlyGeoAssets={topojson:{}});for(var o=0;o<a.length;o++){var s=a[o],l=i.getSubplotCalcData(r,"geo",s),u=e[s]._subplot;u||(u=new n({id:s,graphDiv:t,container:e._geolayer.node(),topojsonURL:t._context.topojsonURL}),e[s]._subplot=u),u.plot(l,e,t._promises)}},r.clean=function(t,e,r,n){for(var a=i.getSubplotIds(n,"geo"),o=0;o<a.length;o++){var s=a[o],l=n[s]._subplot;!e[s]&&l&&(l.framework.remove(),l.clipDef.remove())}}},{"../../plots/plots":811,"./geo":775,"./layout/attributes":777,"./layout/defaults":780,"./layout/layout_attributes":781}],777:[function(t,e,r){"use strict";e.exports={geo:{valType:"subplotid",dflt:"geo"}}},{}],778:[function(t,e,r){"use strict";var n=t("../../../components/color/attributes");e.exports={range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},showgrid:{valType:"boolean",dflt:!1},tick0:{valType:"number"},dtick:{valType:"number"},gridcolor:{valType:"color",dflt:n.lightLine},gridwidth:{valType:"number",min:0,dflt:1}}},{"../../../components/color/attributes":589}],779:[function(t,e,r){"use strict";var n=t("../../../lib"),i=t("../constants"),a=t("./axis_attributes");e.exports=function(t,e){function r(t,e){return n.coerce(o,s,a,t,e)}for(var o,s,l=i.axesNames,u=0;u<l.length;u++){var c=l[u];o=t[c]||{},s={};var h=function(t){var r,n,a,o,s,l,u=e.scope;return"world"===u?(r=e.projection,n=r.type,a=r.rotation,s=i[t+"Span"],l=void 0!==s[n]?s[n]/2:s["*"]/2,o="lonaxis"===t?a.lon:a.lat,[o-l,o+l]):i.scopeDefaults[u][t+"Range"]}(c),f=r("range",h);n.noneOrAll(o.range,s.range,[0,1]),r("tick0",f[0]),r("dtick","lonaxis"===c?30:10);r("showgrid")&&(r("gridcolor"),r("gridwidth")),e[c]=s,e[c]._fullRange=h}}},{"../../../lib":709,"../constants":774,"./axis_attributes":778}],780:[function(t,e,r){"use strict";function n(t,e,r){var n,i=r("scope"),o="world"!==i,l=a.scopeDefaults[i],u=r("resolution"),c=r("projection.type",l.projType),h="albers usa"===c,f=c.indexOf("conic")!==-1;if(f){r("projection.parallels",l.projParallels||[0,60])}if(h)e.scope="usa";else{var d=l.projRotate||[0,0,0];r("projection.rotation.lon",d[0]),r("projection.rotation.lat",d[1]),r("projection.rotation.roll",d[2]),n=r("showcoastlines",!o),n&&(r("coastlinecolor"),r("coastlinewidth")),n=r("showocean"),n&&r("oceancolor")}r("projection.scale"),n=r("showland"),n&&r("landcolor"),n=r("showlakes"),n&&r("lakecolor"),n=r("showrivers"),n&&(r("rivercolor"),r("riverwidth")),n=r("showcountries",o&&"usa"!==i),n&&(r("countrycolor"),r("countrywidth")),("usa"===i||"north america"===i&&50===u)&&(r("showsubunits",!0),r("subunitcolor"),r("subunitwidth")),o||(n=r("showframe",!0))&&(r("framecolor"),r("framewidth")),r("bgcolor"),s(t,e),e._isHighRes=50===u,e._clipAngle=a.lonaxisSpan[c]/2,e._isAlbersUsa=h,e._isConic=f,e._isScoped=o;var p=e.projection.rotation||{};e.projection._rotate=[-p.lon||0,-p.lat||0,p.roll||0]}var i=t("../../subplot_defaults"),a=t("../constants"),o=t("./layout_attributes"),s=t("./axis_defaults");e.exports=function(t,e,r){i(t,e,r,{type:"geo",attributes:o,handleDefaults:n,partition:"y"})}},{"../../subplot_defaults":818,"../constants":774,"./axis_defaults":779,"./layout_attributes":781}],781:[function(t,e,r){"use strict";var n=t("../../../components/color/attributes"),i=t("../constants"),a=t("./axis_attributes");e.exports={domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]},y:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]}},resolution:{valType:"enumerated",values:[110,50],dflt:110,coerceNumber:!0},scope:{valType:"enumerated",values:Object.keys(i.scopeDefaults),dflt:"world"},projection:{type:{valType:"enumerated",values:Object.keys(i.projNames)},rotation:{lon:{valType:"number"},lat:{valType:"number"},roll:{valType:"number"}},parallels:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},scale:{valType:"number",min:0,max:10,dflt:1}},showcoastlines:{valType:"boolean"},coastlinecolor:{valType:"color",dflt:n.defaultLine},coastlinewidth:{valType:"number",min:0,dflt:1},showland:{valType:"boolean",dflt:!1},landcolor:{valType:"color",dflt:i.landColor},showocean:{valType:"boolean",dflt:!1},oceancolor:{valType:"color",dflt:i.waterColor},showlakes:{valType:"boolean",dflt:!1},lakecolor:{valType:"color",dflt:i.waterColor},showrivers:{valType:"boolean",dflt:!1},rivercolor:{valType:"color",dflt:i.waterColor},riverwidth:{valType:"number",min:0,dflt:1},showcountries:{valType:"boolean"},countrycolor:{valType:"color",dflt:n.defaultLine},countrywidth:{valType:"number",min:0,dflt:1},showsubunits:{valType:"boolean"},subunitcolor:{valType:"color",dflt:n.defaultLine},subunitwidth:{valType:"number",min:0,dflt:1},showframe:{valType:"boolean"},framecolor:{valType:"color",dflt:n.defaultLine},framewidth:{valType:"number",min:0,dflt:1},bgcolor:{valType:"color",dflt:n.background},lonaxis:a,lataxis:a}},{"../../../components/color/attributes":589,"../constants":774,"./axis_attributes":778}],782:[function(t,e,r){"use strict";function n(t){function e(t,e){return{type:"Feature",id:t.id,properties:t.properties,geometry:r(t.geometry,e)}}function r(e,n){if(!e)return null;if("GeometryCollection"===e.type)return{type:"GeometryCollection",geometries:object.geometries.map(function(t){return r(t,n)})};if(!S.hasOwnProperty(e.type))return null;var i=S[e.type];return t.geo.stream(e,n(i)),i.result()}function n(){}function i(t){if((e=t.length)<4)return!1;for(var e,r=0,n=t[e-1][1]*t[0][0]-t[e-1][0]*t[0][1];++r<e;)n+=t[r-1][1]*t[r][0]-t[r-1][0]*t[r][1];return n<=0}function a(t,e){for(var r=e[0],n=e[1],i=!1,a=0,o=t.length,s=o-1;a<o;s=a++){var l=t[a],u=l[0],c=l[1],h=t[s],f=h[0],d=h[1];c>n^d>n&&r<(f-u)*(n-c)/(d-c)+u&&(i=!i)}return i}function o(t){return t?t/Math.sin(t):1}function s(t){return t>1?z:t<-1?-z:Math.asin(t)}function l(t){return t>1?0:t<-1?C:Math.acos(t)}function u(t,e){var r=(2+z)*Math.sin(e);e/=2;for(var n=0,i=1/0;n<10&&Math.abs(i)>E;n++){var a=Math.cos(e);e-=i=(e+Math.sin(e)*(a+2)-r)/(2*a*(1+a))}return[2/Math.sqrt(C*(4+C))*t*(1+Math.cos(e)),2*Math.sqrt(C/(4+C))*Math.sin(e)]}function c(t,e){function r(r,n){var i=j(r/e,n);return i[0]*=t,i}return arguments.length<2&&(e=t),1===e?j:1/0===e?f:(r.invert=function(r,n){var i=j.invert(r/t,n);return i[0]*=e,i},r)}function h(){var t=2,e=O(c),r=e(t);return r.coefficient=function(r){return arguments.length?e(t=+r):t},r}function f(t,e){return[t*Math.cos(e)/Math.cos(e/=2),2*Math.sin(e)]}function d(t,e){return[3*t/(2*C)*Math.sqrt(C*C/3-e*e),e]}function p(t,e){return[t,1.25*Math.log(Math.tan(C/4+.4*e))]}function m(t){return function(e){var r,n=t*Math.sin(e),i=30;do{e-=r=(e+Math.sin(e)-n)/(1+Math.cos(e))}while(Math.abs(r)>E&&--i>0);return e/2}}function v(t,e){var r=e*e,n=r*r;return[t*(.8707-.131979*r+n*(n*(.003971*r-.001529*n)-.013791)),e*(1.007226+r*(.015085+n*(.028874*r-.044475-.005916*n)))]}function g(t,e){var r,n=Math.min(18,36*Math.abs(e)/C),i=Math.floor(n),a=n-i,o=(r=R[i])[0],s=r[1],l=(r=R[++i])[0],u=r[1],c=(r=R[Math.min(19,++i)])[0],h=r[1];return[t*(l+a*(c-o)/2+a*a*(c-2*l+o)/2),(e>0?z:-z)*(u+a*(h-s)/2+a*a*(h-2*u+s)/2)]}function y(t,e){return[t*Math.cos(e),e]}function b(t,e){var r=Math.cos(e),n=o(l(r*Math.cos(t/=2)));return[2*r*Math.sin(t)*n,Math.sin(e)*n]}function x(t,e){var r=b(t,e);return[(r[0]+t/z)/2,(r[1]+e)/2]}t.geo.project=function(t,e){var n=e.stream;if(!n)throw new Error("not yet supported");return(t&&_.hasOwnProperty(t.type)?_[t.type]:r)(t,n)};var _={Feature:e,FeatureCollection:function(t,r){return{type:"FeatureCollection",features:t.features.map(function(t){return e(t,r)})}}},w=[],M=[],k={point:function(t,e){w.push([t,e])},result:function(){var t=w.length?w.length<2?{type:"Point",coordinates:w[0]}:{type:"MultiPoint",coordinates:w}:null;return w=[],t}},A={lineStart:n,point:function(t,e){w.push([t,e])},lineEnd:function(){w.length&&(M.push(w),w=[])},result:function(){var t=M.length?M.length<2?{type:"LineString",coordinates:M[0]}:{type:"MultiLineString",coordinates:M}:null;return M=[],t}},T={polygonStart:n,lineStart:n,point:function(t,e){w.push([t,e])},lineEnd:function(){var t=w.length;if(t){do{w.push(w[0].slice())}while(++t<4);M.push(w),w=[]}},polygonEnd:n,result:function(){if(!M.length)return null;var t=[],e=[];return M.forEach(function(r){i(r)?t.push([r]):e.push(r)}),e.forEach(function(e){var r=e[0];t.some(function(t){if(a(t[0],r))return t.push(e),!0})||t.push([e])}),M=[],t.length?t.length>1?{type:"MultiPolygon",coordinates:t}:{type:"Polygon",coordinates:t[0]}:null}},S={Point:k,MultiPoint:k,LineString:A,MultiLineString:A,Polygon:T,MultiPolygon:T,Sphere:T},E=1e-6,L=E*E,C=Math.PI,z=C/2,D=(Math.sqrt(C),C/180),I=180/C,P=t.geo.projection,O=t.geo.projectionMutator;t.geo.interrupt=function(e){function r(t,r){for(var n=r<0?-1:1,i=l[+(r<0)],a=0,o=i.length-1;a<o&&t>i[a][2][0];++a);var s=e(t-i[a][1][0],r);return s[0]+=e(i[a][1][0],n*r>n*i[a][0][1]?i[a][0][1]:r)[0],s}function n(){s=l.map(function(t){return t.map(function(t){var r,n=e(t[0][0],t[0][1])[0],i=e(t[2][0],t[2][1])[0],a=e(t[1][0],t[0][1])[1],o=e(t[1][0],t[1][1])[1];return a>o&&(r=a,a=o,o=r),[[n,a],[i,o]]})})}function i(){for(var e=1e-6,r=[],n=0,i=l[0].length;n<i;++n){var o=l[0][n],s=180*o[0][0]/C,u=180*o[0][1]/C,c=180*o[1][1]/C,h=180*o[2][0]/C,f=180*o[2][1]/C;r.push(a([[s+e,u+e],[s+e,c-e],[h-e,c-e],[h-e,f+e]],30))}for(var n=l[1].length-1;n>=0;--n){var o=l[1][n],s=180*o[0][0]/C,u=180*o[0][1]/C,c=180*o[1][1]/C,h=180*o[2][0]/C,f=180*o[2][1]/C;r.push(a([[h-e,f-e],[h-e,c+e],[s+e,c+e],[s+e,u-e]],30))}return{type:"Polygon",coordinates:[t.merge(r)]}}function a(t,e){for(var r,n,i,a=-1,o=t.length,s=t[0],l=[];++a<o;){r=t[a],n=(r[0]-s[0])/e,i=(r[1]-s[1])/e;for(var u=0;u<e;++u)l.push([s[0]+u*n,s[1]+u*i]);s=r}return l.push(r),l}function o(t,e){return Math.abs(t[0]-e[0])<E&&Math.abs(t[1]-e[1])<E}var s,l=[[[[-C,0],[0,z],[C,0]]],[[[-C,0],[0,-z],[C,0]]]];e.invert&&(r.invert=function(t,n){for(var i=s[+(n<0)],a=l[+(n<0)],u=0,c=i.length;u<c;++u){var h=i[u];if(h[0][0]<=t&&t<h[1][0]&&h[0][1]<=n&&n<h[1][1]){var f=e.invert(t-e(a[u][1][0],0)[0],n);return f[0]+=a[u][1][0],o(r(f[0],f[1]),[t,n])?f:null}}});var u=t.geo.projection(r),c=u.stream;return u.stream=function(e){var r=u.rotate(),n=c(e),a=(u.rotate([0,0]),c(e));return u.rotate(r),n.sphere=function(){t.geo.stream(i(),a)},n},u.lobes=function(t){return arguments.length?(l=t.map(function(t){return t.map(function(t){return[[t[0][0]*C/180,t[0][1]*C/180],[t[1][0]*C/180,t[1][1]*C/180],[t[2][0]*C/180,t[2][1]*C/180]]})}),n(),u):l.map(function(t){return t.map(function(t){return[[180*t[0][0]/C,180*t[0][1]/C],[180*t[1][0]/C,180*t[1][1]/C],[180*t[2][0]/C,180*t[2][1]/C]]})})},u},u.invert=function(t,e){var r=.5*e*Math.sqrt((4+C)/C),n=s(r),i=Math.cos(n);return[t/(2/Math.sqrt(C*(4+C))*(1+i)),s((n+r*(i+2))/(2+z))]},(t.geo.eckert4=function(){return P(u)}).raw=u;var j=t.geo.azimuthalEqualArea.raw;f.invert=function(t,e){var r=2*s(e/2);return[t*Math.cos(r/2)/Math.cos(r),r]},(t.geo.hammer=h).raw=c,d.invert=function(t,e){return[2/3*C*t/Math.sqrt(C*C/3-e*e),e]},(t.geo.kavrayskiy7=function(){return P(d)}).raw=d,p.invert=function(t,e){return[t,2.5*Math.atan(Math.exp(.8*e))-.625*C]},(t.geo.miller=function(){return P(p)}).raw=p;var F=(m(C),function(t,e,r){function n(r,n){return[t*r*Math.cos(n=i(n)),e*Math.sin(n)]}var i=m(r);return n.invert=function(n,i){var a=s(i/e);return[n/(t*Math.cos(a)),s((2*a+Math.sin(2*a))/r)]},n}(Math.SQRT2/z,Math.SQRT2,C));(t.geo.mollweide=function(){return P(F)}).raw=F,v.invert=function(t,e){var r,n=e,i=25;do{var a=n*n,o=a*a;n-=r=(n*(1.007226+a*(.015085+o*(.028874*a-.044475-.005916*o)))-e)/(1.007226+a*(.045255+o*(.259866*a-.311325-.005916*11*o)))}while(Math.abs(r)>E&&--i>0);return[t/(.8707+(a=n*n)*(a*(a*a*a*(.003971-.001529*a)-.013791)-.131979)),n]},(t.geo.naturalEarth=function(){return P(v)}).raw=v;var R=[[.9986,-.062],[1,0],[.9986,.062],[.9954,.124],[.99,.186],[.9822,.248],[.973,.31],[.96,.372],[.9427,.434],[.9216,.4958],[.8962,.5571],[.8679,.6176],[.835,.6769],[.7986,.7346],[.7597,.7903],[.7186,.8435],[.6732,.8936],[.6213,.9394],[.5722,.9761],[.5322,1]];R.forEach(function(t){t[1]*=1.0144}),g.invert=function(t,e){var r=e/z,n=90*r,i=Math.min(18,Math.abs(n/5)),a=Math.max(0,Math.floor(i));do{var o=R[a][1],s=R[a+1][1],l=R[Math.min(19,a+2)][1],u=l-o,c=l-2*s+o,h=2*(Math.abs(r)-s)/u,f=c/u,d=h*(1-f*h*(1-2*f*h));if(d>=0||1===a){n=(e>=0?5:-5)*(d+i);var p,m=50;do{i=Math.min(18,Math.abs(n)/5),a=Math.floor(i),d=i-a,o=R[a][1],s=R[a+1][1],l=R[Math.min(19,a+2)][1],n-=(p=(e>=0?z:-z)*(s+d*(l-o)/2+d*d*(l-2*s+o)/2)-e)*I}while(Math.abs(p)>L&&--m>0);break}}while(--a>=0);var v=R[a][0],g=R[a+1][0],y=R[Math.min(19,a+2)][0];return[t/(g+d*(y-v)/2+d*d*(y-2*g+v)/2),n*D]},(t.geo.robinson=function(){return P(g)}).raw=g,y.invert=function(t,e){return[t/Math.cos(e),e]},(t.geo.sinusoidal=function(){return P(y)}).raw=y,b.invert=function(t,e){if(!(t*t+4*e*e>C*C+E)){var r=t,n=e,i=25;do{var a,o=Math.sin(r),s=Math.sin(r/2),u=Math.cos(r/2),c=Math.sin(n),h=Math.cos(n),f=Math.sin(2*n),d=c*c,p=h*h,m=s*s,v=1-p*u*u,g=v?l(h*u)*Math.sqrt(a=1/v):a=0,y=2*g*h*s-t,b=g*c-e,x=a*(p*m+g*h*u*d),_=a*(.5*o*f-2*g*c*s),w=.25*a*(f*s-g*c*p*o),M=a*(d*u+g*m*h),k=_*w-M*x;if(!k)break;var A=(b*_-y*M)/k,T=(y*w-b*x)/k;r-=A,n-=T}while((Math.abs(A)>E||Math.abs(T)>E)&&--i>0);return[r,n]}},(t.geo.aitoff=function(){return P(b)}).raw=b,x.invert=function(t,e){var r=t,n=e,i=25;do{var a,o=Math.cos(n),s=Math.sin(n),u=Math.sin(2*n),c=s*s,h=o*o,f=Math.sin(r),d=Math.cos(r/2),p=Math.sin(r/2),m=p*p,v=1-h*d*d,g=v?l(o*d)*Math.sqrt(a=1/v):a=0,y=.5*(2*g*o*p+r/z)-t,b=.5*(g*s+n)-e,x=.5*a*(h*m+g*o*d*c)+.5/z,_=a*(f*u/4-g*s*p),w=.125*a*(u*p-g*s*h*f),M=.5*a*(c*d+g*m*o)+.5,k=_*w-M*x,A=(b*_-y*M)/k,T=(y*w-b*x)/k;r-=A,n-=T}while((Math.abs(A)>E||Math.abs(T)>E)&&--i>0);return[r,n]},(t.geo.winkel3=function(){return P(x)}).raw=x}e.exports=n},{}],783:[function(t,e,r){"use strict";function n(t,e){var r=t.projection,n=t.lonaxis,o=t.lataxis,l=t.domain,u=t.framewidth||0,c=e.w*(l.x[1]-l.x[0]),h=e.h*(l.y[1]-l.y[0]),f=n.range[0]+s,d=n.range[1]-s,p=o.range[0]+s,m=o.range[1]-s,v=n._fullRange[0]+s,g=n._fullRange[1]-s,y=o._fullRange[0]+s,b=o._fullRange[1]-s;r._translate0=[e.l+c/2,e.t+h/2];var x=d-f,_=m-p,w=[f+x/2,p+_/2],M=r._rotate;return r._center=[w[0]+M[0],w[1]+M[1]],function(e){function n(t){return Math.min(_*c/(t[1][0]-t[0][0]),_*h/(t[1][1]-t[0][1]))}var o,s,l,x,_=e.scale(),w=r._translate0,M=i(f,p,d,m),k=i(v,y,g,b);l=a(e,M),o=n(l),x=a(e,k),r._fullScale=n(x),e.scale(o),l=a(e,M),s=[w[0]-l[0][0]+u,w[1]-l[0][1]+u],r._translate=s,e.translate(s),l=a(e,M),t._isAlbersUsa||e.clipExtent(l),o=r.scale*o,r._scale=o,t._width=Math.round(l[1][0])+u,t._height=Math.round(l[1][1])+u,t._marginX=(c-Math.round(l[1][0]))/2,t._marginY=(h-Math.round(l[1][1]))/2}}function i(t,e,r,n){var i=(r-t)/4;return{type:"Polygon",coordinates:[[[t,e],[t,n],[t+i,n],[t+2*i,n],[t+3*i,n],[r,n],[r,e],[r-i,e],[r-2*i,e],[r-3*i,e],[t,e]]]}}function a(t,e){return o.geo.path().projection(t).bounds(e)}var o=t("d3"),s=t("./constants").clipPad;e.exports=n},{"./constants":774,d3:118}],784:[function(t,e,r){"use strict";function n(t,e){return(e._isScoped?a:e._clipAngle?s:o)(t,e.projection)}function i(t,e){var r=e._fullScale;return _.behavior.zoom().translate(t.translate()).scale(t.scale()).scaleExtent([.5*r,100*r])}function a(t,e){function r(){_.select(this).style(k)}function n(){o.scale(_.event.scale).translate(_.event.translate),t.render()}function a(){_.select(this).style(A)}var o=t.projection,s=i(o,e);return s.on("zoomstart",r).on("zoom",n).on("zoomend",a),s}function o(t,e){function r(t){return v.invert(t)}function n(t){var e=v(r(t));return Math.abs(e[0]-t[0])>y||Math.abs(e[1]-t[1])>y}function a(){_.select(this).style(k),l=_.mouse(this),u=v.rotate(),c=v.translate(),h=u,f=r(l)}function o(){if(d=_.mouse(this),n(l))return g.scale(v.scale()),void g.translate(v.translate());v.scale(_.event.scale),v.translate([c[0],_.event.translate[1]]),f?r(d)&&(m=r(d),p=[h[0]+(m[0]-f[0]),u[1],u[2]],v.rotate(p),h=p):(l=d,f=r(l)),t.render()}function s(){_.select(this).style(A)}var l,u,c,h,f,d,p,m,v=t.projection,g=i(v,e),y=2;return g.on("zoomstart",a).on("zoom",o).on("zoomend",s),g}function s(t,e){function r(t){g++||t({type:"zoomstart"})}function n(t){t({type:"zoom"})}function a(t){--g||t({type:"zoomend"})}var o,s=t.projection,d={r:s.rotate(),k:s.scale()},p=i(s,e),m=x(p,"zoomstart","zoom","zoomend"),g=0,y=p.on;return p.on("zoomstart",function(){_.select(this).style(k);var t=_.mouse(this),e=s.rotate(),i=e,a=s.translate(),g=u(e);o=l(s,t),y.call(p,"zoom",function(){var r=_.mouse(this);if(s.scale(d.k=_.event.scale),o){if(l(s,r)){s.rotate(e).translate(a);var u=l(s,r),p=h(o,u),y=v(c(g,p)),b=d.r=f(y,o,i);isFinite(b[0])&&isFinite(b[1])&&isFinite(b[2])||(b=i),s.rotate(b),i=b}}else t=r,o=l(s,t);n(m.of(this,arguments))}),r(m.of(this,arguments))}).on("zoomend",function(){_.select(this).style(A),y.call(p,"zoom",null),a(m.of(this,arguments))}).on("zoom.redraw",function(){t.render()}),_.rebind(p,m,"on")}function l(t,e){var r=t.invert(e);return r&&isFinite(r[0])&&isFinite(r[1])&&g(r)}function u(t){var e=.5*t[0]*w,r=.5*t[1]*w,n=.5*t[2]*w,i=Math.sin(e),a=Math.cos(e),o=Math.sin(r),s=Math.cos(r),l=Math.sin(n),u=Math.cos(n);return[a*s*u+i*o*l,i*s*u-a*o*l,a*o*u+i*s*l,a*s*l-i*o*u]}function c(t,e){var r=t[0],n=t[1],i=t[2],a=t[3],o=e[0],s=e[1],l=e[2],u=e[3];return[r*o-n*s-i*l-a*u,r*s+n*o+i*u-a*l,r*l-n*u+i*o+a*s,r*u+n*l-i*s+a*o]}function h(t,e){if(t&&e){var r=b(t,e),n=Math.sqrt(y(r,r)),i=.5*Math.acos(Math.max(-1,Math.min(1,y(t,e)))),a=Math.sin(i)/n;return n&&[Math.cos(i),r[2]*a,-r[1]*a,r[0]*a]}}function f(t,e,r){var n=m(e,2,t[0]);n=m(n,1,t[1]),n=m(n,0,t[2]-r[2]);var i,a,o=e[0],s=e[1],l=e[2],u=n[0],c=n[1],h=n[2],f=Math.atan2(s,o)*M,p=Math.sqrt(o*o+s*s);Math.abs(c)>p?(a=(c>0?90:-90)-f,i=0):(a=Math.asin(c/p)*M-f,i=Math.sqrt(p*p-c*c));var v=180-a-2*f,g=(Math.atan2(h,u)-Math.atan2(l,i))*M,y=(Math.atan2(h,u)-Math.atan2(l,-i))*M;return d(r[0],r[1],a,g)<=d(r[0],r[1],v,y)?[a,g,r[2]]:[v,y,r[2]]}function d(t,e,r,n){var i=p(r-t),a=p(n-e);return Math.sqrt(i*i+a*a)}function p(t){return(t%360+540)%360-180}function m(t,e,r){var n=r*w,i=t.slice(),a=0===e?1:0,o=2===e?1:2,s=Math.cos(n),l=Math.sin(n);return i[a]=t[a]*s-t[o]*l,i[o]=t[o]*s+t[a]*l,i}function v(t){return[Math.atan2(2*(t[0]*t[1]+t[2]*t[3]),1-2*(t[1]*t[1]+t[2]*t[2]))*M,Math.asin(Math.max(-1,Math.min(1,2*(t[0]*t[2]-t[3]*t[1]))))*M,Math.atan2(2*(t[0]*t[3]+t[1]*t[2]),1-2*(t[2]*t[2]+t[3]*t[3]))*M]}function g(t){var e=t[0]*w,r=t[1]*w,n=Math.cos(r);return[n*Math.cos(e),n*Math.sin(e),Math.sin(r)]}function y(t,e){for(var r=0,n=0,i=t.length;n<i;++n)r+=t[n]*e[n];return r}function b(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 x(t){for(var e=0,r=arguments.length,n=[];++e<r;)n.push(arguments[e]);var i=_.dispatch.apply(null,n);return i.of=function(e,r){return function(n){var a;try{a=n.sourceEvent=_.event,n.target=t,_.event=n,i[n.type].apply(e,r)}finally{_.event=a}}},i}var _=t("d3"),w=Math.PI/180,M=180/Math.PI,k={cursor:"pointer"},A={cursor:"auto"};e.exports=n},{d3:118}],785:[function(t,e,r){"use strict";e.exports=function(t,e){var r=t.projection,n=t.zoom;return function(){t.makeProjection(e),t.makePath(),n.scale(r.scale()),n.translate(r.translate()),t.render()}}},{}],786:[function(t,e,r){"use strict";function n(t,e){this.element=t,this.plot=e,this.mouseListener=null,this.wheelListener=null,this.lastInputTime=Date.now(),this.lastPos=[0,0],this.boxEnabled=!1,this.boxInited=!1,this.boxStart=[0,0],this.boxEnd=[0,0],this.dragStart=[0,0]}function i(t){function e(){t.xaxis.autorange=!1,t.yaxis.autorange=!1}function r(){for(var e=t.graphDiv._fullLayout._axisConstraintGroups,r=t.xaxis._id,n=t.yaxis._id,i=0;i<e.length;i++)if(e[i][r]!==-1){if(e[i][n]!==-1)return!0;break}return!1}var i=t.mouseContainer,l=t.glplot,u=new n(i,l);return u.mouseListener=a(i,function(n,i,a){function o(e,r,n){var i=Math.min(r,n),a=Math.max(r,n);i!==a?(f[e]=i,f[e+2]=a,u.dataBox=f,t.setRanges(f)):(t.selectBox.selectBox=[0,0,1,1],t.glplot.setDirty())}var c,h,f=t.calcDataBox(),d=l.viewBox,p=u.lastPos[0],m=u.lastPos[1],v=s.MINDRAG*l.pixelRatio,g=s.MINZOOM*l.pixelRatio;switch(i*=l.pixelRatio,a*=l.pixelRatio,a=d[3]-d[1]-a,t.fullLayout.dragmode){case"zoom":if(n){var y=i/(d[2]-d[0])*(f[2]-f[0])+f[0],b=a/(d[3]-d[1])*(f[3]-f[1])+f[1];u.boxInited||(u.boxStart[0]=y,u.boxStart[1]=b,u.dragStart[0]=i,u.dragStart[1]=a),u.boxEnd[0]=y,u.boxEnd[1]=b,u.boxInited=!0,u.boxEnabled||u.boxStart[0]===u.boxEnd[0]&&u.boxStart[1]===u.boxEnd[1]||(u.boxEnabled=!0);var x=Math.abs(u.dragStart[0]-i)<g,_=Math.abs(u.dragStart[1]-a)<g;if(!r()||x&&_)x&&(u.boxEnd[0]=u.boxStart[0]),_&&(u.boxEnd[1]=u.boxStart[1]);else{c=u.boxEnd[0]-u.boxStart[0],h=u.boxEnd[1]-u.boxStart[1];var w=(f[3]-f[1])/(f[2]-f[0]);Math.abs(c*w)>Math.abs(h)?(u.boxEnd[1]=u.boxStart[1]+Math.abs(c)*w*(Math.sign(h)||1),u.boxEnd[1]<f[1]?(u.boxEnd[1]=f[1],u.boxEnd[0]=u.boxStart[0]+(f[1]-u.boxStart[1])/Math.abs(w)):u.boxEnd[1]>f[3]&&(u.boxEnd[1]=f[3],u.boxEnd[0]=u.boxStart[0]+(f[3]-u.boxStart[1])/Math.abs(w))):(u.boxEnd[0]=u.boxStart[0]+Math.abs(h)/w*(Math.sign(c)||1),u.boxEnd[0]<f[0]?(u.boxEnd[0]=f[0],u.boxEnd[1]=u.boxStart[1]+(f[0]-u.boxStart[0])*Math.abs(w)):u.boxEnd[0]>f[2]&&(u.boxEnd[0]=f[2],u.boxEnd[1]=u.boxStart[1]+(f[2]-u.boxStart[0])*Math.abs(w)))}}else u.boxEnabled?(c=u.boxStart[0]!==u.boxEnd[0],h=u.boxStart[1]!==u.boxEnd[1],c||h?(c&&(o(0,u.boxStart[0],u.boxEnd[0]),t.xaxis.autorange=!1),h&&(o(1,u.boxStart[1],u.boxEnd[1]),t.yaxis.autorange=!1),t.relayoutCallback()):t.glplot.setDirty(),u.boxEnabled=!1,u.boxInited=!1):u.boxInited&&(u.boxInited=!1);break;case"pan":u.boxEnabled=!1,u.boxInited=!1,n?(u.panning||(u.dragStart[0]=i,u.dragStart[1]=a),Math.abs(u.dragStart[0]-i)<v&&(i=u.dragStart[0]),Math.abs(u.dragStart[1]-a)<v&&(a=u.dragStart[1]),c=(p-i)*(f[2]-f[0])/(l.viewBox[2]-l.viewBox[0]),h=(m-a)*(f[3]-f[1])/(l.viewBox[3]-l.viewBox[1]),f[0]+=c,f[2]+=c,f[1]+=h,f[3]+=h,t.setRanges(f),u.panning=!0,u.lastInputTime=Date.now(),e(),t.cameraChanged(),t.handleAnnotations()):u.panning&&(u.panning=!1,t.relayoutCallback())}u.lastPos[0]=i,u.lastPos[1]=a}),u.wheelListener=o(i,function(r,n){var i=t.calcDataBox(),a=l.viewBox,o=u.lastPos[0],s=u.lastPos[1];switch(t.fullLayout.dragmode){case"zoom":break;case"pan":var c=Math.exp(.1*n/(a[3]-a[1])),h=o/(a[2]-a[0])*(i[2]-i[0])+i[0],f=s/(a[3]-a[1])*(i[3]-i[1])+i[1];i[0]=(i[0]-h)*c+h,i[2]=(i[2]-h)*c+h,i[1]=(i[1]-f)*c+f,i[3]=(i[3]-f)*c+f,t.setRanges(i),u.lastInputTime=Date.now(),e(),t.cameraChanged(),t.handleAnnotations(),t.relayoutCallback()}return!0}),u}var a=t("mouse-change"),o=t("mouse-wheel"),s=t("../cartesian/constants");e.exports=i},{"../cartesian/constants":753,"mouse-change":445,"mouse-wheel":448}],787:[function(t,e,r){"use strict";function n(t){this.scene=t,this.gl=t.gl,this.pixelRatio=t.pixelRatio,this.screenBox=[0,0,1,1],this.viewBox=[0,0,1,1],this.dataBox=[-1,-1,1,1],this.borderLineEnable=[!1,!1,!1,!1],this.borderLineWidth=[1,1,1,1],this.borderLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.ticks=[[],[]],this.tickEnable=[!0,!0,!1,!1],this.tickPad=[15,15,15,15],this.tickAngle=[0,0,0,0],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickMarkLength=[0,0,0,0],this.tickMarkWidth=[0,0,0,0],this.tickMarkColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labels=["x","y"],this.labelEnable=[!0,!0,!1,!1],this.labelAngle=[0,Math.PI/2,0,3*Math.PI/2],this.labelPad=[15,15,15,15],this.labelSize=[12,12],this.labelFont=["sans-serif","sans-serif"],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.title="",this.titleEnable=!0,this.titleCenter=[0,0,0,0],this.titleAngle=0,this.titleColor=[0,0,0,1],this.titleFont="sans-serif",this.titleSize=18,this.gridLineEnable=[!0,!0],this.gridLineColor=[[0,0,0,.5],[0,0,0,.5]],this.gridLineWidth=[1,1],this.zeroLineEnable=[!0,!0],this.zeroLineWidth=[1,1],this.zeroLineColor=[[0,0,0,1],[0,0,0,1]],this.borderColor=[0,0,0,0],this.backgroundColor=[0,0,0,0],this.static=this.scene.staticPlot}function i(t){return new n(t)}var a=t("../plots"),o=t("../cartesian/axes"),s=t("../../lib/html2unicode"),l=t("../../lib/str2rgbarray"),u=n.prototype,c=["xaxis","yaxis"];u.merge=function(t){this.titleEnable=!1,this.backgroundColor=l(t.plot_bgcolor);var e,r,n,i,a,o,u,h,f,d,p;for(d=0;d<2;++d){for(e=c[d],r=t[this.scene[e]._name],n=/Click to enter .+ title/.test(r.title)?"":r.title,p=0;p<=2;p+=2)this.labelEnable[d+p]=!1,this.labels[d+p]=s(n),this.labelColor[d+p]=l(r.titlefont.color),this.labelFont[d+p]=r.titlefont.family,this.labelSize[d+p]=r.titlefont.size,this.labelPad[d+p]=this.getLabelPad(e,r),this.tickEnable[d+p]=!1,this.tickColor[d+p]=l((r.tickfont||{}).color),this.tickAngle[d+p]="auto"===r.tickangle?0:Math.PI*-r.tickangle/180,this.tickPad[d+p]=this.getTickPad(r),this.tickMarkLength[d+p]=0,this.tickMarkWidth[d+p]=r.tickwidth||0,this.tickMarkColor[d+p]=l(r.tickcolor),this.borderLineEnable[d+p]=!1,this.borderLineColor[d+p]=l(r.linecolor),this.borderLineWidth[d+p]=r.linewidth||0;u=this.hasSharedAxis(r),a=this.hasAxisInDfltPos(e,r)&&!u,o=this.hasAxisInAltrPos(e,r)&&!u,i=r.mirror||!1,h=u?String(i).indexOf("all")!==-1:!!i,f=u?"allticks"===i:String(i).indexOf("ticks")!==-1,a?this.labelEnable[d]=!0:o&&(this.labelEnable[d+2]=!0),a?this.tickEnable[d]=r.showticklabels:o&&(this.tickEnable[d+2]=r.showticklabels),(a||h)&&(this.borderLineEnable[d]=r.showline),(o||h)&&(this.borderLineEnable[d+2]=r.showline),(a||f)&&(this.tickMarkLength[d]=this.getTickMarkLength(r)),(o||f)&&(this.tickMarkLength[d+2]=this.getTickMarkLength(r)),this.gridLineEnable[d]=r.showgrid,this.gridLineColor[d]=l(r.gridcolor),this.gridLineWidth[d]=r.gridwidth,this.zeroLineEnable[d]=r.zeroline,this.zeroLineColor[d]=l(r.zerolinecolor),this.zeroLineWidth[d]=r.zerolinewidth}},u.hasSharedAxis=function(t){
64 var e=this.scene,r=a.getSubplotIds(e.fullLayout,"gl2d");return 0!==o.findSubplotsWithAxis(r,t).indexOf(e.id)},u.hasAxisInDfltPos=function(t,e){var r=e.side;return"xaxis"===t?"bottom"===r:"yaxis"===t?"left"===r:void 0},u.hasAxisInAltrPos=function(t,e){var r=e.side;return"xaxis"===t?"top"===r:"yaxis"===t?"right"===r:void 0},u.getLabelPad=function(t,e){var r=e.titlefont.size,n=e.showticklabels;return"xaxis"===t?"top"===e.side?r*(1.5+(n?1:0))-10:r*(1.5+(n?.5:0))-10:"yaxis"===t?"right"===e.side?10+r*(1.5+(n?1:.5)):10+r*(1.5+(n?.5:0)):void 0},u.getTickPad=function(t){return"outside"===t.ticks?10+t.ticklen:15},u.getTickMarkLength=function(t){if(!t.ticks)return 0;var e=t.ticklen;return"inside"===t.ticks?-e:e},e.exports=i},{"../../lib/html2unicode":707,"../../lib/str2rgbarray":727,"../cartesian/axes":748,"../plots":811}],788:[function(t,e,r){"use strict";var n=t("./scene2d"),i=t("../plots"),a=t("../../constants/xmlns_namespaces");r.name="gl2d",r.attr=["xaxis","yaxis"],r.idRoot=["x","y"],r.idRegex={x:/^x([2-9]|[1-9][0-9]+)?$/,y:/^y([2-9]|[1-9][0-9]+)?$/},r.attrRegex={x:/^xaxis([2-9]|[1-9][0-9]+)?$/,y:/^yaxis([2-9]|[1-9][0-9]+)?$/},r.attributes=t("../cartesian/attributes"),r.plot=function(t){for(var e=t._fullLayout,r=t._fullData,a=i.getSubplotIds(e,"gl2d"),o=0;o<a.length;o++){var s=a[o],l=e._plots[s],u=i.getSubplotData(r,"gl2d",s),c=l._scene2d;void 0===c&&(c=new n({id:s,graphDiv:t,container:t.querySelector(".gl-container"),staticPlot:t._context.staticPlot,plotGlPixelRatio:t._context.plotGlPixelRatio},e),l._scene2d=c),c.plot(u,t.calcdata,e,t.layout)}},r.clean=function(t,e,r,n){for(var a=i.getSubplotIds(n,"gl2d"),o=0;o<a.length;o++){var s=a[o],l=n._plots[s];if(l._scene2d){0===i.getSubplotData(t,"gl2d",s).length&&(l._scene2d.destroy(),delete n._plots[s])}}},r.toSVG=function(t){for(var e=t._fullLayout,r=i.getSubplotIds(e,"gl2d"),n=0;n<r.length;n++){var o=e._plots[r[n]],s=o._scene2d,l=s.toImage("png");e._glimages.append("svg:image").attr({xmlns:a.svg,"xlink:href":l,x:0,y:0,width:"100%",height:"100%",preserveAspectRatio:"none"}),s.destroy()}}},{"../../constants/xmlns_namespaces":692,"../cartesian/attributes":747,"../plots":811,"./scene2d":789}],789:[function(t,e,r){"use strict";function n(t,e){this.container=t.container,this.graphDiv=t.graphDiv,this.pixelRatio=t.plotGlPixelRatio||window.devicePixelRatio,this.id=t.id,this.staticPlot=!!t.staticPlot,this.fullData=null,this.updateRefs(e),this.makeFramework(),this.glplotOptions=p(this),this.glplotOptions.merge(e),this.glplot=c(this.glplotOptions),this.camera=m(this),this.traces={},this.spikes=h(this.glplot),this.selectBox=f(this.glplot,{innerFill:!1,outerFill:!0}),this.lastButtonState=0,this.pickResult=null,this.bounds=[1/0,1/0,-1/0,-1/0],this.stopped=!1,this.redraw=this.draw.bind(this),this.redraw()}function i(t,e){for(var r=0;r<2;++r){var n=t[r],i=e[r];if(n.length!==i.length)return!0;for(var a=0;a<n.length;++a)if(n[a].x!==i[a].x)return!0}return!1}var a,o,s=t("../../registry"),l=t("../../plots/cartesian/axes"),u=t("../../components/fx"),c=t("gl-plot2d"),h=t("gl-spikes2d"),f=t("gl-select-box"),d=t("webgl-context"),p=t("./convert"),m=t("./camera"),v=t("../../lib/html2unicode"),g=t("../../lib/show_no_webgl_msg"),y=t("../../plots/cartesian/constraints"),b=["xaxis","yaxis"];e.exports=n;var x=n.prototype;x.makeFramework=function(){if(this.staticPlot){if(!(o||(a=document.createElement("canvas"),o=d({canvas:a,preserveDrawingBuffer:!1,premultipliedAlpha:!0,antialias:!0}))))throw new Error("Error creating static canvas/context for image server");this.canvas=a,this.gl=o}else{var t=document.createElement("canvas"),e=d({canvas:t,premultipliedAlpha:!0});e||g(this),this.canvas=t,this.gl=e}var r=this.canvas;r.style.width="100%",r.style.height="100%",r.style.position="absolute",r.style.top="0px",r.style.left="0px",r.style["pointer-events"]="none",this.updateSize(r),r.className+="user-select-none";var n=this.svgContainer=document.createElementNS("http://www.w3.org/2000/svg","svg");n.style.position="absolute",n.style.top=n.style.left="0px",n.style.width=n.style.height="100%",n.style["z-index"]=20,n.style["pointer-events"]="none";var i=this.mouseContainer=document.createElement("div");i.style.position="absolute";var s=this.container;s.appendChild(r),s.appendChild(n),s.appendChild(i)},x.toImage=function(t){t||(t="png"),this.stopped=!0,this.staticPlot&&this.container.appendChild(a),this.updateSize(this.canvas),this.glplot.setDirty(),this.glplot.draw();var e=this.glplot.gl,r=e.drawingBufferWidth,n=e.drawingBufferHeight;e.bindFramebuffer(e.FRAMEBUFFER,null);var i=new Uint8Array(r*n*4);e.readPixels(0,0,r,n,e.RGBA,e.UNSIGNED_BYTE,i);for(var o=0,s=n-1;o<s;++o,--s)for(var l=0;l<r;++l)for(var u=0;u<4;++u){var c=i[4*(r*o+l)+u];i[4*(r*o+l)+u]=i[4*(r*s+l)+u],i[4*(r*s+l)+u]=c}var h=document.createElement("canvas");h.width=r,h.height=n;var f=h.getContext("2d"),d=f.createImageData(r,n);d.data.set(i),f.putImageData(d,0,0);var p;switch(t){case"jpeg":p=h.toDataURL("image/jpeg");break;case"webp":p=h.toDataURL("image/webp");break;default:p=h.toDataURL("image/png")}return this.staticPlot&&this.container.removeChild(a),p},x.updateSize=function(t){t||(t=this.canvas);var e=this.pixelRatio,r=this.fullLayout,n=r.width,i=r.height,a=0|Math.ceil(e*n),o=0|Math.ceil(e*i);return t.width===a&&t.height===o||(t.width=a,t.height=o),this.redraw&&this.redraw(),t},x.computeTickMarks=function(){this.xaxis.setScale(),this.yaxis.setScale(),this.xaxis._length=this.glplot.viewBox[2]-this.glplot.viewBox[0],this.yaxis._length=this.glplot.viewBox[3]-this.glplot.viewBox[1];for(var t=[l.calcTicks(this.xaxis),l.calcTicks(this.yaxis)],e=0;e<2;++e)for(var r=0;r<t[e].length;++r)t[e][r].text=v(t[e][r].text+"");return t},x.updateRefs=function(t){this.fullLayout=t;var e=l.subplotMatch,r="xaxis"+this.id.match(e)[1],n="yaxis"+this.id.match(e)[2];this.xaxis=this.fullLayout[r],this.yaxis=this.fullLayout[n]},x.relayoutCallback=function(){var t=this.graphDiv,e=this.xaxis,r=this.yaxis,n=t.layout;n.xaxis.autorange=e.autorange,n.xaxis.range=e.range.slice(0),n.yaxis.autorange=r.autorange,n.yaxis.range=r.range.slice(0);var i={lastInputTime:this.camera.lastInputTime};i[e._name]=e.range.slice(0),i[r._name]=r.range.slice(0),t.emit("plotly_relayout",i)},x.cameraChanged=function(){var t=this.camera;this.glplot.setDataBox(this.calcDataBox());var e=this.computeTickMarks();i(e,this.glplotOptions.ticks)&&(this.glplotOptions.ticks=e,this.glplotOptions.dataBox=t.dataBox,this.glplot.update(this.glplotOptions),this.handleAnnotations())},x.handleAnnotations=function(){for(var t=this.graphDiv,e=this.fullLayout.annotations,r=0;r<e.length;r++){var n=e[r];n.xref===this.xaxis._id&&n.yref===this.yaxis._id&&s.getComponentMethod("annotations","drawOne")(t,r)}},x.destroy=function(){var t=this.traces;t&&Object.keys(t).map(function(e){t[e].dispose(),delete t[e]}),this.glplot.dispose(),this.staticPlot||this.container.removeChild(this.canvas),this.container.removeChild(this.svgContainer),this.container.removeChild(this.mouseContainer),this.fullData=null,this.glplot=null,this.stopped=!0},x.plot=function(t,e,r){var n=this.glplot;this.updateRefs(r),this.updateTraces(t,e);var i=r.width,a=r.height;this.updateSize(this.canvas);var o=this.glplotOptions;o.merge(r),o.screenBox=[0,0,i,a];var s=r._size,u=this.xaxis.domain,c=this.yaxis.domain;o.viewBox=[s.l+u[0]*s.w,s.b+c[0]*s.h,i-s.r-(1-u[1])*s.w,a-s.t-(1-c[1])*s.h],this.mouseContainer.style.width=s.w*(u[1]-u[0])+"px",this.mouseContainer.style.height=s.h*(c[1]-c[0])+"px",this.mouseContainer.height=s.h*(c[1]-c[0]),this.mouseContainer.style.left=s.l+u[0]*s.w+"px",this.mouseContainer.style.top=s.t+(1-c[1])*s.h+"px";var h=this.bounds;h[0]=h[1]=1/0,h[2]=h[3]=-1/0;var f,d,p=Object.keys(this.traces);for(d=0;d<p.length;++d)for(var m=this.traces[p[d]],v=0;v<2;++v)h[v]=Math.min(h[v],m.bounds[v]),h[v+2]=Math.max(h[v+2],m.bounds[v+2]);for(d=0;d<2;++d)h[d]>h[d+2]&&(h[d]=-1,h[d+2]=1),f=this[b[d]],f._length=o.viewBox[d+2]-o.viewBox[d],l.doAutoRange(f),f.setScale();var g={_axisConstraintGroups:this.graphDiv._fullLayout._axisConstraintGroups,xaxis:this.xaxis,yaxis:this.yaxis};y({_fullLayout:g}),o.ticks=this.computeTickMarks(),o.dataBox=this.calcDataBox(),o.merge(r),n.update(o),this.glplot.draw()},x.calcDataBox=function(){var t=this.xaxis,e=this.yaxis,r=t.range,n=e.range,i=t.r2l,a=e.r2l;return[i(r[0]),a(n[0]),i(r[1]),a(n[1])]},x.setRanges=function(t){var e=this.xaxis,r=this.yaxis,n=e.l2r,i=r.l2r;e.range=[n(t[0]),n(t[2])],r.range=[i(t[1]),i(t[3])]},x.updateTraces=function(t,e){var r,n,i,a=Object.keys(this.traces);this.fullData=t;t:for(r=0;r<a.length;r++){var o=a[r],s=this.traces[o];for(n=0;n<t.length;n++)if(i=t[n],i.uid===o&&i.type===s.type)continue t;s.dispose(),delete this.traces[o]}for(r=0;r<t.length;r++){i=t[r];var l=e[r],u=this.traces[i.uid];u?u.update(i,l):(u=i._module.plot(this,i,l),this.traces[i.uid]=u)}this.glplot.objects.sort(function(t,e){return t._trace.index-e._trace.index})},x.emitPointAction=function(t,e){for(var r,n=t.trace.uid,i=0;i<this.fullData.length;i++)this.fullData[i].uid===n&&(r=this.fullData[i]);this.graphDiv.emit(e,{points:[{x:t.traceCoord[0],y:t.traceCoord[1],curveNumber:r.index,pointNumber:t.pointIndex,data:r._input,fullData:this.fullData,xaxis:this.xaxis,yaxis:this.yaxis}]})},x.draw=function(){if(!this.stopped){requestAnimationFrame(this.redraw);var t=this.glplot,e=this.camera,r=e.mouseListener,n=1===this.lastButtonState&&0===r.buttons,i=this.fullLayout;this.lastButtonState=r.buttons,this.cameraChanged();var a,o=r.x*t.pixelRatio,s=this.canvas.height-t.pixelRatio*r.y;if(e.boxEnabled&&"zoom"===i.dragmode){this.selectBox.enabled=!0;for(var l=this.selectBox.selectBox=[Math.min(e.boxStart[0],e.boxEnd[0]),Math.min(e.boxStart[1],e.boxEnd[1]),Math.max(e.boxStart[0],e.boxEnd[0]),Math.max(e.boxStart[1],e.boxEnd[1])],c=0;c<2;c++)e.boxStart[c]===e.boxEnd[c]&&(l[c]=t.dataBox[c],l[c+2]=t.dataBox[c+2]);t.setDirty()}else if(!e.panning){this.selectBox.enabled=!1;var h=i._size,f=this.xaxis.domain,d=this.yaxis.domain;a=t.pick(o/t.pixelRatio+h.l+f[0]*h.w,s/t.pixelRatio-(h.t+(1-d[1])*h.h));var p=a&&a.object._trace.handlePick(a);if(p&&n&&this.emitPointAction(p,"plotly_click"),a&&"skip"!==a.object._trace.hoverinfo&&i.hovermode&&p&&(!this.lastPickResult||this.lastPickResult.traceUid!==p.trace.uid||this.lastPickResult.dataCoord[0]!==p.dataCoord[0]||this.lastPickResult.dataCoord[1]!==p.dataCoord[1])){var m=p;this.lastPickResult={traceUid:p.trace?p.trace.uid:null,dataCoord:p.dataCoord.slice()},this.spikes.update({center:a.dataCoord}),m.screenCoord=[((t.viewBox[2]-t.viewBox[0])*(a.dataCoord[0]-t.dataBox[0])/(t.dataBox[2]-t.dataBox[0])+t.viewBox[0])/t.pixelRatio,(this.canvas.height-(t.viewBox[3]-t.viewBox[1])*(a.dataCoord[1]-t.dataBox[1])/(t.dataBox[3]-t.dataBox[1])-t.viewBox[1])/t.pixelRatio],this.emitPointAction(p,"plotly_hover");var v=m.hoverinfo;if("all"!==v){var g=v.split("+");g.indexOf("x")===-1&&(m.traceCoord[0]=void 0),g.indexOf("y")===-1&&(m.traceCoord[1]=void 0),g.indexOf("z")===-1&&(m.traceCoord[2]=void 0),g.indexOf("text")===-1&&(m.textLabel=void 0),g.indexOf("name")===-1&&(m.name=void 0)}var y=this.fullData[m.trace.index]||{},b=m.pointIndex;u.loneHover({x:m.screenCoord[0],y:m.screenCoord[1],xLabel:this.hoverFormatter("xaxis",m.traceCoord[0]),yLabel:this.hoverFormatter("yaxis",m.traceCoord[1]),zLabel:m.traceCoord[2],text:m.textLabel,name:m.name,color:u.castHoverOption(y,b,"bgcolor")||m.color,borderColor:u.castHoverOption(y,b,"bordercolor"),fontFamily:u.castHoverOption(y,b,"font.family"),fontSize:u.castHoverOption(y,b,"font.size"),fontColor:u.castHoverOption(y,b,"font.color")},{container:this.svgContainer})}}!a&&this.lastPickResult&&(this.spikes.update({}),this.lastPickResult=null,this.graphDiv.emit("plotly_unhover"),u.loneUnhover(this.svgContainer)),t.draw()}},x.hoverFormatter=function(t,e){if(void 0!==e){var r=this[t];return l.tickText(r,r.c2l(e),"hover").text}}},{"../../components/fx":631,"../../lib/html2unicode":707,"../../lib/show_no_webgl_msg":725,"../../plots/cartesian/axes":748,"../../plots/cartesian/constraints":755,"../../registry":826,"./camera":786,"./convert":787,"gl-plot2d":214,"gl-select-box":248,"gl-spikes2d":257,"webgl-context":555}],790:[function(t,e,r){"use strict";function n(t,e){t=t||document.body,e=e||{};var r=[.01,1/0];"distanceLimits"in e&&(r[0]=e.distanceLimits[0],r[1]=e.distanceLimits[1]),"zoomMin"in e&&(r[0]=e.zoomMin),"zoomMax"in e&&(r[1]=e.zoomMax);var n=a({center:e.center||[0,0,0],up:e.up||[0,1,0],eye:e.eye||[0,0,10],mode:e.mode||"orbit",distanceLimits:r}),l=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],u=0,c=t.clientWidth,h=t.clientHeight,f={keyBindingMode:"rotate",view:n,element:t,delay:e.delay||16,rotateSpeed:e.rotateSpeed||1,zoomSpeed:e.zoomSpeed||1,translateSpeed:e.translateSpeed||1,flipX:!!e.flipX,flipY:!!e.flipY,modes:n.modes,tick:function(){var e=i(),r=this.delay,a=e-2*r;n.idle(e-r),n.recalcMatrix(a),n.flush(e-(100+2*r));for(var o=!0,s=n.computedMatrix,f=0;f<16;++f)o=o&&l[f]===s[f],l[f]=s[f];var d=t.clientWidth===c&&t.clientHeight===h;return c=t.clientWidth,h=t.clientHeight,o?!d:(u=Math.exp(n.computedRadius[0]),!0)},lookAt:function(t,e,r){n.lookAt(n.lastT(),t,e,r)},rotate:function(t,e,r){n.rotate(n.lastT(),t,e,r)},pan:function(t,e,r){n.pan(n.lastT(),t,e,r)},translate:function(t,e,r){n.translate(n.lastT(),t,e,r)}};Object.defineProperties(f,{matrix:{get:function(){return n.computedMatrix},set:function(t){return n.setMatrix(n.lastT(),t),n.computedMatrix},enumerable:!0},mode:{get:function(){return n.getMode()},set:function(t){var e=n.computedUp.slice(),r=n.computedEye.slice(),a=n.computedCenter.slice();if(n.setMode(t),"turntable"===t){var o=i();n._active.lookAt(o,r,a,e),n._active.lookAt(o+500,r,a,[0,0,1]),n._active.flush(o)}return n.getMode()},enumerable:!0},center:{get:function(){return n.computedCenter},set:function(t){return n.lookAt(n.lastT(),null,t),n.computedCenter},enumerable:!0},eye:{get:function(){return n.computedEye},set:function(t){return n.lookAt(n.lastT(),t),n.computedEye},enumerable:!0},up:{get:function(){return n.computedUp},set:function(t){return n.lookAt(n.lastT(),null,null,t),n.computedUp},enumerable:!0},distance:{get:function(){return u},set:function(t){return n.setDistance(n.lastT(),t),t},enumerable:!0},distanceLimits:{get:function(){return n.getDistanceLimits(r)},set:function(t){return n.setDistanceLimits(t),t},enumerable:!0}}),t.addEventListener("contextmenu",function(t){return t.preventDefault(),!1});var d=0,p=0;return o(t,function(e,r,a,o){var s=f.keyBindingMode;if(s!==!1){var l="rotate"===s,c="pan"===s,h="zoom"===s,m=!!o.control,v=!!o.alt,g=!!o.shift,y=!!(1&e),b=!!(2&e),x=!!(4&e),_=1/t.clientHeight,w=_*(r-d),M=_*(a-p),k=f.flipX?1:-1,A=f.flipY?1:-1,T=i(),S=Math.PI*f.rotateSpeed;if((l&&y&&!m&&!v&&!g||y&&!m&&!v&&g)&&n.rotate(T,k*S*w,-A*S*M,0),(c&&y&&!m&&!v&&!g||b||y&&m&&!v&&!g)&&n.pan(T,-f.translateSpeed*w*u,f.translateSpeed*M*u,0),h&&y&&!m&&!v&&!g||x||y&&!m&&v&&!g){var E=-f.zoomSpeed*M/window.innerHeight*(T-n.lastT())*100;n.pan(T,0,0,u*(Math.exp(E)-1))}return d=r,p=a,!0}}),s(t,function(t,e){if(f.keyBindingMode!==!1){var r=f.flipX?1:-1,a=f.flipY?1:-1,o=i();if(Math.abs(t)>Math.abs(e))n.rotate(o,0,0,-t*r*Math.PI*f.rotateSpeed/window.innerWidth);else{var s=-f.zoomSpeed*a*e/window.innerHeight*(o-n.lastT())/100;n.pan(o,0,0,u*(Math.exp(s)-1))}}},!0),f}e.exports=n;var i=t("right-now"),a=t("3d-view"),o=t("mouse-change"),s=t("mouse-wheel")},{"3d-view":35,"mouse-change":445,"mouse-wheel":448,"right-now":494}],791:[function(t,e,r){"use strict";var n=t("./scene"),i=t("../plots"),a=t("../../lib"),o=t("../../constants/xmlns_namespaces");r.name="gl3d",r.attr="scene",r.idRoot="scene",r.idRegex=/^scene([2-9]|[1-9][0-9]+)?$/,r.attrRegex=/^scene([2-9]|[1-9][0-9]+)?$/,r.attributes=t("./layout/attributes"),r.layoutAttributes=t("./layout/layout_attributes"),r.supplyLayoutDefaults=t("./layout/defaults"),r.plot=function(t){for(var e=t._fullLayout,r=t._fullData,o=i.getSubplotIds(e,"gl3d"),s=0;s<o.length;s++){var l=o[s],u=i.getSubplotData(r,"gl3d",l),c=e[l],h=c._scene;h||(h=new n({id:l,graphDiv:t,container:t.querySelector(".gl-container"),staticPlot:t._context.staticPlot,plotGlPixelRatio:t._context.plotGlPixelRatio},e),c._scene=h),h.cameraInitial||(h.cameraInitial=a.extendDeep({},c.camera)),h.plot(u,e,t.layout)}},r.clean=function(t,e,r,n){for(var a=i.getSubplotIds(n,"gl3d"),o=0;o<a.length;o++){var s=a[o];!e[s]&&n[s]._scene&&n[s]._scene.destroy()}},r.toSVG=function(t){for(var e=t._fullLayout,r=i.getSubplotIds(e,"gl3d"),n=e._size,a=0;a<r.length;a++){var s=e[r[a]],l=s.domain,u=s._scene,c=u.toImage("png");e._glimages.append("svg:image").attr({xmlns:o.svg,"xlink:href":c,x:n.l+n.w*l.x[0],y:n.t+n.h*(1-l.y[1]),width:n.w*(l.x[1]-l.x[0]),height:n.h*(l.y[1]-l.y[0]),preserveAspectRatio:"none"}),u.destroy()}},r.cleanId=function(t){if(t.match(/^scene[0-9]*$/)){var e=t.substr(5);return"1"===e&&(e=""),"scene"+e}}},{"../../constants/xmlns_namespaces":692,"../../lib":709,"../plots":811,"./layout/attributes":792,"./layout/defaults":796,"./layout/layout_attributes":797,"./scene":801}],792:[function(t,e,r){"use strict";e.exports={scene:{valType:"subplotid",dflt:"scene"}}},{}],793:[function(t,e,r){"use strict";var n=t("../../../components/color"),i=t("../../cartesian/layout_attributes"),a=t("../../../lib/extend").extendFlat;e.exports={visible:i.visible,showspikes:{valType:"boolean",dflt:!0},spikesides:{valType:"boolean",dflt:!0},spikethickness:{valType:"number",min:0,dflt:2},spikecolor:{valType:"color",dflt:n.defaultLine},showbackground:{valType:"boolean",dflt:!1},backgroundcolor:{valType:"color",dflt:"rgba(204, 204, 204, 0.5)"},showaxeslabels:{valType:"boolean",dflt:!0},color:i.color,categoryorder:i.categoryorder,categoryarray:i.categoryarray,title:i.title,titlefont:i.titlefont,type:i.type,autorange:i.autorange,rangemode:i.rangemode,range:i.range,tickmode:i.tickmode,nticks:i.nticks,tick0:i.tick0,dtick:i.dtick,tickvals:i.tickvals,ticktext:i.ticktext,ticks:i.ticks,mirror:i.mirror,ticklen:i.ticklen,tickwidth:i.tickwidth,tickcolor:i.tickcolor,showticklabels:i.showticklabels,tickfont:i.tickfont,tickangle:i.tickangle,tickprefix:i.tickprefix,showtickprefix:i.showtickprefix,ticksuffix:i.ticksuffix,showticksuffix:i.showticksuffix,showexponent:i.showexponent,exponentformat:i.exponentformat,separatethousands:i.separatethousands,tickformat:i.tickformat,hoverformat:i.hoverformat,showline:i.showline,linecolor:i.linecolor,linewidth:i.linewidth,showgrid:i.showgrid,gridcolor:a({},i.gridcolor,{dflt:"rgb(204, 204, 204)"}),gridwidth:i.gridwidth,zeroline:i.zeroline,zerolinecolor:i.zerolinecolor,zerolinewidth:i.zerolinewidth}},{"../../../components/color":590,"../../../lib/extend":701,"../../cartesian/layout_attributes":759}],794:[function(t,e,r){"use strict";var n=t("tinycolor2").mix,i=t("../../../lib"),a=t("./axis_attributes"),o=t("../../cartesian/type_defaults"),s=t("../../cartesian/axis_defaults"),l=["xaxis","yaxis","zaxis"];e.exports=function(t,e,r){function u(t,e){return i.coerce(c,h,a,t,e)}for(var c,h,f=0;f<l.length;f++){var d=l[f];c=t[d]||{},h=e[d]={_id:d[0]+r.scene,_name:d},o(c,h,u,r.data),s(c,h,u,{font:r.font,letter:d[0],data:r.data,showGrid:!0,bgColor:r.bgColor,calendar:r.calendar}),u("gridcolor",n(h.color,r.bgColor,13600/187).toRgbString()),u("title",d[0]),h.setScale=i.noop,u("showspikes")&&(u("spikesides"),u("spikethickness"),u("spikecolor",h.color)),u("showaxeslabels"),u("showbackground")&&u("backgroundcolor")}}},{"../../../lib":709,"../../cartesian/axis_defaults":750,"../../cartesian/type_defaults":770,"./axis_attributes":793,tinycolor2:526}],795:[function(t,e,r){"use strict";function n(){this.bounds=[[-10,-10,-10],[10,10,10]],this.ticks=[[],[],[]],this.tickEnable=[!0,!0,!0],this.tickFont=["sans-serif","sans-serif","sans-serif"],this.tickSize=[12,12,12],this.tickAngle=[0,0,0],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickPad=[18,18,18],this.labels=["x","y","z"],this.labelEnable=[!0,!0,!0],this.labelFont=["Open Sans","Open Sans","Open Sans"],this.labelSize=[20,20,20],this.labelAngle=[0,0,0],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labelPad=[30,30,30],this.lineEnable=[!0,!0,!0],this.lineMirror=[!1,!1,!1],this.lineWidth=[1,1,1],this.lineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.lineTickEnable=[!0,!0,!0],this.lineTickMirror=[!1,!1,!1],this.lineTickLength=[10,10,10],this.lineTickWidth=[1,1,1],this.lineTickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.gridEnable=[!0,!0,!0],this.gridWidth=[1,1,1],this.gridColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroEnable=[!0,!0,!0],this.zeroLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroLineWidth=[2,2,2],this.backgroundEnable=[!0,!0,!0],this.backgroundColor=[[.8,.8,.8,.5],[.8,.8,.8,.5],[.8,.8,.8,.5]],this._defaultTickPad=this.tickPad.slice(),this._defaultLabelPad=this.labelPad.slice(),this._defaultLineTickLength=this.lineTickLength.slice()}function i(t){var e=new n;return e.merge(t),e}var a=t("../../../lib/html2unicode"),o=t("../../../lib/str2rgbarray"),s=["xaxis","yaxis","zaxis"];n.prototype.merge=function(t){for(var e=this,r=0;r<3;++r){var n=t[s[r]];n.visible?(e.labels[r]=a(n.title),"titlefont"in n&&(n.titlefont.color&&(e.labelColor[r]=o(n.titlefont.color)),n.titlefont.family&&(e.labelFont[r]=n.titlefont.family),n.titlefont.size&&(e.labelSize[r]=n.titlefont.size)),"showline"in n&&(e.lineEnable[r]=n.showline),"linecolor"in n&&(e.lineColor[r]=o(n.linecolor)),"linewidth"in n&&(e.lineWidth[r]=n.linewidth),"showgrid"in n&&(e.gridEnable[r]=n.showgrid),"gridcolor"in n&&(e.gridColor[r]=o(n.gridcolor)),"gridwidth"in n&&(e.gridWidth[r]=n.gridwidth),"log"===n.type?e.zeroEnable[r]=!1:"zeroline"in n&&(e.zeroEnable[r]=n.zeroline),"zerolinecolor"in n&&(e.zeroLineColor[r]=o(n.zerolinecolor)),"zerolinewidth"in n&&(e.zeroLineWidth[r]=n.zerolinewidth),"ticks"in n&&n.ticks?e.lineTickEnable[r]=!0:e.lineTickEnable[r]=!1,"ticklen"in n&&(e.lineTickLength[r]=e._defaultLineTickLength[r]=n.ticklen),"tickcolor"in n&&(e.lineTickColor[r]=o(n.tickcolor)),"tickwidth"in n&&(e.lineTickWidth[r]=n.tickwidth),"tickangle"in n&&(e.tickAngle[r]="auto"===n.tickangle?0:Math.PI*-n.tickangle/180),"showticklabels"in n&&(e.tickEnable[r]=n.showticklabels),"tickfont"in n&&(n.tickfont.color&&(e.tickColor[r]=o(n.tickfont.color)),n.tickfont.family&&(e.tickFont[r]=n.tickfont.family),n.tickfont.size&&(e.tickSize[r]=n.tickfont.size)),"mirror"in n?["ticks","all","allticks"].indexOf(n.mirror)!==-1?(e.lineTickMirror[r]=!0,e.lineMirror[r]=!0):n.mirror===!0?(e.lineTickMirror[r]=!1,e.lineMirror[r]=!0):(e.lineTickMirror[r]=!1,e.lineMirror[r]=!1):e.lineMirror[r]=!1,"showbackground"in n&&n.showbackground!==!1?(e.backgroundEnable[r]=!0,e.backgroundColor[r]=o(n.backgroundcolor)):e.backgroundEnable[r]=!1):(e.tickEnable[r]=!1,e.labelEnable[r]=!1,e.lineEnable[r]=!1,e.lineTickEnable[r]=!1,e.gridEnable[r]=!1,e.zeroEnable[r]=!1,e.backgroundEnable[r]=!1)}},e.exports=i},{"../../../lib/html2unicode":707,"../../../lib/str2rgbarray":727}],796:[function(t,e,r){"use strict";function n(t,e,r,n){for(var i=r("bgcolor"),o=a.combine(i,n.paper_bgcolor),u=Object.keys(s.camera),c=0;c<u.length;c++)r("camera."+u[c]+".x"),r("camera."+u[c]+".y"),r("camera."+u[c]+".z");var h=!!r("aspectratio.x")&&!!r("aspectratio.y")&&!!r("aspectratio.z"),f=h?"manual":"auto",d=r("aspectmode",f);h||(t.aspectratio=e.aspectratio={x:1,y:1,z:1},"manual"===d&&(e.aspectmode="auto")),l(t,e,{font:n.font,scene:n.id,data:n.fullData,bgColor:o,calendar:n.calendar}),r("dragmode",n.getDfltFromLayout("dragmode")),r("hovermode",n.getDfltFromLayout("hovermode"))}var i=t("../../../lib"),a=t("../../../components/color"),o=t("../../subplot_defaults"),s=t("./layout_attributes"),l=t("./axis_defaults");e.exports=function(t,e,r){function a(e){if(!l){return i.validate(t[e],s[e])?t[e]:void 0}}var l=e._basePlotModules.length>1;o(t,e,r,{type:"gl3d",attributes:s,handleDefaults:n,font:e.font,fullData:r,getDfltFromLayout:a,paper_bgcolor:e.paper_bgcolor,calendar:e.calendar})}},{"../../../components/color":590,"../../../lib":709,"../../subplot_defaults":818,"./axis_defaults":794,"./layout_attributes":797}],797:[function(t,e,r){"use strict";function n(t,e,r){return{x:{valType:"number",dflt:t},y:{valType:"number",dflt:e},z:{valType:"number",dflt:r}}}var i=t("./axis_attributes"),a=t("../../../lib/extend").extendFlat;e.exports={bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},camera:{up:a(n(0,0,1),{}),center:a(n(0,0,0),{}),eye:a(n(1.25,1.25,1.25),{})},domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]},y:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]}},aspectmode:{valType:"enumerated",values:["auto","cube","data","manual"],dflt:"auto"},aspectratio:{x:{valType:"number",min:0},y:{valType:"number",min:0},z:{valType:"number",min:0}},xaxis:i,yaxis:i,zaxis:i,dragmode:{valType:"enumerated",values:["orbit","turntable","zoom","pan",!1],dflt:"turntable"},hovermode:{valType:"enumerated",values:["closest",!1],dflt:"closest"},_deprecated:{cameraposition:{valType:"info_array"}}}},{"../../../lib/extend":701,"./axis_attributes":793}],798:[function(t,e,r){"use strict";function n(){this.enabled=[!0,!0,!0],this.colors=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.drawSides=[!0,!0,!0],this.lineWidth=[1,1,1]}function i(t){var e=new n;return e.merge(t),e}var a=t("../../../lib/str2rgbarray"),o=["xaxis","yaxis","zaxis"];n.prototype.merge=function(t){for(var e=0;e<3;++e){var r=t[o[e]];r.visible?(this.enabled[e]=r.showspikes,this.colors[e]=a(r.spikecolor),this.drawSides[e]=r.spikesides,this.lineWidth[e]=r.spikethickness):(this.enabled[e]=!1,this.drawSides[e]=!1)}},e.exports=i},{"../../../lib/str2rgbarray":727}],799:[function(t,e,r){"use strict";function n(t){for(var e=new Array(3),r=0;r<3;++r){for(var n=t[r],i=new Array(n.length),a=0;a<n.length;++a)i[a]=n[a].x;e[r]=i}return e}function i(t){for(var e=t.axesOptions,r=t.glplot.axesPixels,i=t.fullSceneLayout,c=[[],[],[]],h=0;h<3;++h){var f=i[l[h]];if(f._length=(r[h].hi-r[h].lo)*r[h].pixelsPerDataUnit/t.dataScale[h],1/0===Math.abs(f._length))c[h]=[];else{f.range[0]=r[h].lo/t.dataScale[h],f.range[1]=r[h].hi/t.dataScale[h],f._m=1/(t.dataScale[h]*r[h].pixelsPerDataUnit),f.range[0]===f.range[1]&&(f.range[0]-=1,f.range[1]+=1);var d=f.tickmode;if("auto"===f.tickmode){f.tickmode="linear";var p=f.nticks||o.constrain(f._length/40,4,9);a.autoTicks(f,Math.abs(f.range[1]-f.range[0])/p)}for(var m=a.calcTicks(f),v=0;v<m.length;++v)m[v].x=m[v].x*t.dataScale[h],m[v].text=s(m[v].text);c[h]=m,f.tickmode=d}}e.ticks=c;for(var h=0;h<3;++h){u[h]=.5*(t.glplot.bounds[0][h]+t.glplot.bounds[1][h]);for(var v=0;v<2;++v)e.bounds[v][h]=t.glplot.bounds[v][h]}t.contourLevels=n(c)}e.exports=i;var a=t("../../cartesian/axes"),o=t("../../../lib"),s=t("../../../lib/html2unicode"),l=["xaxis","yaxis","zaxis"],u=[0,0,0]},{"../../../lib":709,"../../../lib/html2unicode":707,"../../cartesian/axes":748}],800:[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}function i(t,e){return n(t.projection,n(t.view,n(t.model,[e[0],e[1],e[2],1])))}e.exports=i},{}],801:[function(t,e,r){"use strict";function n(t){function e(e,r){var n=t.fullSceneLayout[e];return m.tickText(n,n.d2l(r),"hover").text}var r,n=t.svgContainer,i=t.container.getBoundingClientRect(),a=i.width,o=i.height;n.setAttributeNS(null,"viewBox","0 0 "+a+" "+o),n.setAttributeNS(null,"width",a),n.setAttributeNS(null,"height",o),M(t),t.glplot.axes.update(t.axesOptions);for(var s=Object.keys(t.traces),l=null,u=t.glplot.selection,c=0;c<s.length;++c)r=t.traces[s[c]],"skip"!==r.data.hoverinfo&&r.handlePick(u)&&(l=r),r.setContourLevels&&r.setContourLevels();var h;if(null!==l){var f=x(t.glplot.cameraParams,u.dataCoordinate);r=l.data;var d=r.hoverinfo,p=u.index,g=e("xaxis",u.traceCoordinate[0]),y=e("yaxis",u.traceCoordinate[1]),b=e("zaxis",u.traceCoordinate[2]);if("all"!==d){var _=d.split("+");_.indexOf("x")===-1&&(g=void 0),_.indexOf("y")===-1&&(y=void 0),_.indexOf("z")===-1&&(b=void 0),_.indexOf("text")===-1&&(u.textLabel=void 0),_.indexOf("name")===-1&&(l.name=void 0)}t.fullSceneLayout.hovermode&&v.loneHover({x:(.5+.5*f[0]/f[3])*a,y:(.5-.5*f[1]/f[3])*o,xLabel:g,yLabel:y,zLabel:b,text:u.textLabel,name:l.name,color:v.castHoverOption(r,p,"bgcolor")||l.color,borderColor:v.castHoverOption(r,p,"bordercolor"),fontFamily:v.castHoverOption(r,p,"font.family"),fontSize:v.castHoverOption(r,p,"font.size"),fontColor:v.castHoverOption(r,p,"font.color")},{container:n});var w={points:[{x:u.traceCoordinate[0],y:u.traceCoordinate[1],z:u.traceCoordinate[2],data:r._input,fullData:r,curveNumber:r.index,pointNumber:p}]};u.buttons&&u.distance<5?t.graphDiv.emit("plotly_click",w):t.graphDiv.emit("plotly_hover",w),h=w}else v.loneUnhover(n),t.graphDiv.emit("plotly_unhover",h)}function i(t,e,r,i){var a={canvas:r,gl:i,container:t.container,axes:t.axesOptions,spikes:t.spikeOptions,pickRadius:10,snapToData:!0,autoScale:!0,autoBounds:!1};if(t.staticMode){if(!(h||(c=document.createElement("canvas"),h=d({canvas:c,preserveDrawingBuffer:!0,premultipliedAlpha:!0,antialias:!0}))))throw new Error("error creating static canvas/context for image server");a.pixelRatio=t.pixelRatio,a.gl=h,a.canvas=c}try{t.glplot=f(a)}catch(e){y(t)}var o=function(t){if(t.fullSceneLayout.dragmode!==!1){var e={};e[t.id]=u(t.camera),t.saveCamera(t.graphDiv.layout),t.graphDiv.emit("plotly_relayout",e)}};if(t.glplot.canvas.addEventListener("mouseup",o.bind(null,t)),t.glplot.canvas.addEventListener("wheel",o.bind(null,t)),t.staticMode||t.glplot.canvas.addEventListener("webglcontextlost",function(t){p.warn("Lost WebGL context."),t.preventDefault()}),!t.camera){var s=t.fullSceneLayout.camera;t.camera=b(t.container,{center:[s.center.x,s.center.y,s.center.z],eye:[s.eye.x,s.eye.y,s.eye.z],up:[s.up.x,s.up.y,s.up.z],zoomMin:.1,zoomMax:100,mode:"orbit"})}return t.glplot.camera=t.camera,t.glplot.oncontextloss=function(){t.recoverContext()},t.glplot.onrender=n.bind(null,t),t.traces={},!0}function a(t,e){var r=document.createElement("div"),n=t.container;this.graphDiv=t.graphDiv;var a=document.createElementNS("http://www.w3.org/2000/svg","svg");a.style.position="absolute",a.style.top=a.style.left="0px",a.style.width=a.style.height="100%",a.style["z-index"]=20,a.style["pointer-events"]="none",r.appendChild(a),this.svgContainer=a,r.id=t.id,r.style.position="absolute",r.style.top=r.style.left="0px",r.style.width=r.style.height="100%",n.appendChild(r),this.fullLayout=e,this.id=t.id||"scene",this.fullSceneLayout=e[this.id],this.plotArgs=[[],{},{}],this.axesOptions=_(e[this.id]),this.spikeOptions=w(e[this.id]),this.container=r,this.staticMode=!!t.staticPlot,this.pixelRatio=t.plotGlPixelRatio||2,this.dataScale=[1,1,1],this.contourLevels=[[],[],[]],i(this,e)}function o(t,e,r,n,i){for(var a,o=0;o<e.length;++o)if(Array.isArray(e[o]))for(var s=0;s<e[o].length;++s)a=t.d2l(e[o][s],0,i),!isNaN(a)&&isFinite(a)&&(n[0][r]=Math.min(n[0][r],a),n[1][r]=Math.max(n[1][r],a));else a=t.d2l(e[o],0,i),!isNaN(a)&&isFinite(a)&&(n[0][r]=Math.min(n[0][r],a),n[1][r]=Math.max(n[1][r],a))}function s(t,e,r){var n=t.fullSceneLayout;o(n.xaxis,e.x,0,r,e.xcalendar),o(n.yaxis,e.y,1,r,e.ycalendar),o(n.zaxis,e.z,2,r,e.zcalendar)}function l(t){return[[t.eye.x,t.eye.y,t.eye.z],[t.center.x,t.center.y,t.center.z],[t.up.x,t.up.y,t.up.z]]}function u(t){return{up:{x:t.up[0],y:t.up[1],z:t.up[2]},center:{x:t.center[0],y:t.center[1],z:t.center[2]},eye:{x:t.eye[0],y:t.eye[1],z:t.eye[2]}}}var c,h,f=t("gl-plot3d"),d=t("webgl-context"),p=t("../../lib"),m=t("../../plots/cartesian/axes"),v=t("../../components/fx"),g=t("../../lib/str2rgbarray"),y=t("../../lib/show_no_webgl_msg"),b=t("./camera"),x=t("./project"),_=t("./layout/convert"),w=t("./layout/spikes"),M=t("./layout/tick_marks"),k=a.prototype;k.recoverContext=function(){function t(){return r.isContextLost()?void requestAnimationFrame(t):i(e,e.fullLayout,n,r)?void e.plot.apply(e,e.plotArgs):void p.error("Catastrophic and unrecoverable WebGL error. Context lost.")}var e=this,r=this.glplot.gl,n=this.glplot.canvas;this.glplot.dispose(),requestAnimationFrame(t)};var A=["xaxis","yaxis","zaxis"]
65 ;k.plot=function(t,e,r){if(this.plotArgs=[t,e,r],!this.glplot.contextLost){var n,i,a,o,l,u,c=e[this.id],h=r[this.id];c.bgcolor?this.glplot.clearColor=g(c.bgcolor):this.glplot.clearColor=[0,0,0,0],this.glplot.snapToData=!0,this.fullLayout=e,this.fullSceneLayout=c,this.glplotLayout=c,this.axesOptions.merge(c),this.spikeOptions.merge(c),this.setCamera(c.camera),this.updateFx(c.dragmode,c.hovermode),this.glplot.update({}),this.setConvert(l),t?Array.isArray(t)||(t=[t]):t=[];var f=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]];for(a=0;a<t.length;++a)n=t[a],n.visible===!0&&s(this,n,f);var d=[1,1,1];for(o=0;o<3;++o)f[0][o]>f[1][o]?d[o]=1:f[1][o]===f[0][o]?d[o]=1:d[o]=1/(f[1][o]-f[0][o]);for(this.dataScale=d,a=0;a<t.length;++a)n=t[a],n.visible===!0&&(i=this.traces[n.uid],i?i.update(n):(i=n._module.plot(this,n),this.traces[n.uid]=i),i.name=n.name);var p=Object.keys(this.traces);t:for(a=0;a<p.length;++a){for(o=0;o<t.length;++o)if(t[o].uid===p[a]&&t[o].visible===!0)continue t;i=this.traces[p[a]],i.dispose(),delete this.traces[p[a]]}this.glplot.objects.sort(function(t,e){return t._trace.data.index-e._trace.data.index});var m=[[0,0,0],[0,0,0]],v=[],y={};for(a=0;a<3;++a){if(l=c[A[a]],u=l.type,u in y?(y[u].acc*=d[a],y[u].count+=1):y[u]={acc:d[a],count:1},l.autorange){for(m[0][a]=1/0,m[1][a]=-1/0,o=0;o<this.glplot.objects.length;++o){var b=this.glplot.objects[o].bounds;m[0][a]=Math.min(m[0][a],b[0][a]/d[a]),m[1][a]=Math.max(m[1][a],b[1][a]/d[a])}if("rangemode"in l&&"tozero"===l.rangemode&&(m[0][a]=Math.min(m[0][a],0),m[1][a]=Math.max(m[1][a],0)),m[0][a]>m[1][a])m[0][a]=-1,m[1][a]=1;else{var x=m[1][a]-m[0][a];m[0][a]-=x/32,m[1][a]+=x/32}}else{var _=c[A[a]].range;m[0][a]=_[0],m[1][a]=_[1]}m[0][a]===m[1][a]&&(m[0][a]-=1,m[1][a]+=1),v[a]=m[1][a]-m[0][a],this.glplot.bounds[0][a]=m[0][a]*d[a],this.glplot.bounds[1][a]=m[1][a]*d[a]}var w=[1,1,1];for(a=0;a<3;++a){l=c[A[a]],u=l.type;var M=y[u];w[a]=Math.pow(M.acc,1/M.count)/d[a]}var k;if("auto"===c.aspectmode)k=Math.max.apply(null,w)/Math.min.apply(null,w)<=4?w:[1,1,1];else if("cube"===c.aspectmode)k=[1,1,1];else if("data"===c.aspectmode)k=w;else{if("manual"!==c.aspectmode)throw new Error("scene.js aspectRatio was not one of the enumerated types");var T=c.aspectratio;k=[T.x,T.y,T.z]}c.aspectratio.x=h.aspectratio.x=k[0],c.aspectratio.y=h.aspectratio.y=k[1],c.aspectratio.z=h.aspectratio.z=k[2],this.glplot.aspect=k;var S=c.domain||null,E=e._size||null;if(S&&E){var L=this.container.style;L.position="absolute",L.left=E.l+S.x[0]*E.w+"px",L.top=E.t+(1-S.y[1])*E.h+"px",L.width=E.w*(S.x[1]-S.x[0])+"px",L.height=E.h*(S.y[1]-S.y[0])+"px"}this.glplot.redraw()}},k.destroy=function(){this.glplot.dispose(),this.container.parentNode.removeChild(this.container),this.glplot=null},k.getCamera=function(){return this.glplot.camera.view.recalcMatrix(this.camera.view.lastT()),u(this.glplot.camera)},k.setCamera=function(t){this.glplot.camera.lookAt.apply(this,l(t))},k.saveCamera=function(t){var e=this.getCamera(),r=p.nestedProperty(t,this.id+".camera"),n=r.get(),i=!1;if(void 0===n)i=!0;else for(var a=0;a<3;a++)for(var o=0;o<3;o++)if(!function(t,e,r,n){var i=["up","center","eye"],a=["x","y","z"];return e[i[r]]&&t[i[r]][a[n]]===e[i[r]][a[n]]}(e,n,a,o)){i=!0;break}return i&&r.set(e),i},k.updateFx=function(t,e){var r=this.camera;r&&("orbit"===t?(r.mode="orbit",r.keyBindingMode="rotate"):"turntable"===t?(r.up=[0,0,1],r.mode="turntable",r.keyBindingMode="rotate"):r.keyBindingMode=t),this.fullSceneLayout.hovermode=e},k.toImage=function(t){t||(t="png"),this.staticMode&&this.container.appendChild(c),this.glplot.redraw();var e=this.glplot.gl,r=e.drawingBufferWidth,n=e.drawingBufferHeight;e.bindFramebuffer(e.FRAMEBUFFER,null);var i=new Uint8Array(r*n*4);e.readPixels(0,0,r,n,e.RGBA,e.UNSIGNED_BYTE,i);for(var a=0,o=n-1;a<o;++a,--o)for(var s=0;s<r;++s)for(var l=0;l<4;++l){var u=i[4*(r*a+s)+l];i[4*(r*a+s)+l]=i[4*(r*o+s)+l],i[4*(r*o+s)+l]=u}var h=document.createElement("canvas");h.width=r,h.height=n;var f=h.getContext("2d"),d=f.createImageData(r,n);d.data.set(i),f.putImageData(d,0,0);var p;switch(t){case"jpeg":p=h.toDataURL("image/jpeg");break;case"webp":p=h.toDataURL("image/webp");break;default:p=h.toDataURL("image/png")}return this.staticMode&&this.container.removeChild(c),p},k.setConvert=function(){for(var t=0;t<3;++t){var e=this.fullSceneLayout[A[t]];m.setConvert(e,this.fullLayout),e.setScale=p.noop}},e.exports=a},{"../../components/fx":631,"../../lib":709,"../../lib/show_no_webgl_msg":725,"../../lib/str2rgbarray":727,"../../plots/cartesian/axes":748,"./camera":790,"./layout/convert":795,"./layout/spikes":798,"./layout/tick_marks":799,"./project":800,"gl-plot3d":216,"webgl-context":555}],802:[function(t,e,r){"use strict";var n=t("../lib"),i=n.extendFlat,a=t("./font_attributes"),o=t("../components/color/attributes");e.exports={font:{family:i({},a.family,{dflt:'"Open Sans", verdana, arial, sans-serif'}),size:i({},a.size,{dflt:12}),color:i({},a.color,{dflt:o.defaultLine})},title:{valType:"string",dflt:"Click to enter Plot title"},titlefont:i({},a,{}),autosize:{valType:"boolean",dflt:!1},width:{valType:"number",min:10,dflt:700},height:{valType:"number",min:10,dflt:450},margin:{l:{valType:"number",min:0,dflt:80},r:{valType:"number",min:0,dflt:80},t:{valType:"number",min:0,dflt:100},b:{valType:"number",min:0,dflt:80},pad:{valType:"number",min:0,dflt:0},autoexpand:{valType:"boolean",dflt:!0}},paper_bgcolor:{valType:"color",dflt:o.background},plot_bgcolor:{valType:"color",dflt:o.background},separators:{valType:"string",dflt:".,"},hidesources:{valType:"boolean",dflt:!1},smith:{valType:"enumerated",values:[!1],dflt:!1},showlegend:{valType:"boolean"}}},{"../components/color/attributes":589,"../lib":709,"./font_attributes":772}],803:[function(t,e,r){"use strict";e.exports={styleUrlPrefix:"mapbox://styles/mapbox/",styleUrlSuffix:"v9",controlContainerClassName:"mapboxgl-control-container",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"),mapOnErrorMsg:"Mapbox error."}},{}],804:[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=Array.isArray(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}var h;return h=u[0]&&u[1]?u.join("-"):u[0]?u[0]:u[1]?u[1]:"center",{anchor:h,offset:c}}},{"../../lib":709}],805:[function(t,e,r){"use strict";function n(t,e){var r=t._fullLayout,n=t._context;if(""===n.mapboxAccessToken)return"";for(var i=n.mapboxAccessToken,a=0;a<e.length;a++){var o=r[e[a]];if(o.accesstoken){i=o.accesstoken;break}}if(!i)throw new Error(l.noAccessTokenErrorMsg);return i}var i=t("mapbox-gl"),a=t("../plots"),o=t("../../constants/xmlns_namespaces"),s=t("./mapbox"),l=t("./constants");r.name="mapbox",r.attr="subplot",r.idRoot="mapbox",r.idRegex=/^mapbox([2-9]|[1-9][0-9]+)?$/,r.attrRegex=/^mapbox([2-9]|[1-9][0-9]+)?$/,r.attributes={subplot:{valType:"subplotid",dflt:"mapbox"}},r.layoutAttributes=t("./layout_attributes"),r.supplyLayoutDefaults=t("./layout_defaults"),r.plot=function(t){var e=t._fullLayout,r=t.calcdata,o=a.getSubplotIds(e,"mapbox"),l=n(t,o);i.accessToken=l;for(var u=0;u<o.length;u++){var c=o[u],h=a.getSubplotCalcData(r,"mapbox",c),f=e[c],d=f._subplot;f.accesstoken=l,d||(d=s({gd:t,container:e._glcontainer.node(),id:c,fullLayout:e,staticPlot:t._context.staticPlot}),e[c]._subplot=d),d.plot(h,e,t._promises)}},r.clean=function(t,e,r,n){for(var i=a.getSubplotIds(n,"mapbox"),o=0;o<i.length;o++){var s=i[o];!e[s]&&n[s]._subplot&&n[s]._subplot.destroy()}},r.toSVG=function(t){for(var e=t._fullLayout,r=a.getSubplotIds(e,"mapbox"),n=e._size,i=0;i<r.length;i++){var s=e[r[i]],l=s.domain,u=s._subplot,c=u.toImage("png");e._glimages.append("svg:image").attr({xmlns:o.svg,"xlink:href":c,x:n.l+n.w*l.x[0],y:n.t+n.h*(1-l.y[1]),width:n.w*(l.x[1]-l.x[0]),height:n.h*(l.y[1]-l.y[0]),preserveAspectRatio:"none"}),u.destroy()}}},{"../../constants/xmlns_namespaces":692,"../plots":811,"./constants":803,"./layout_attributes":807,"./layout_defaults":808,"./mapbox":809,"mapbox-gl":336}],806:[function(t,e,r){"use strict";function n(t,e){this.mapbox=t,this.map=t.map,this.uid=t.uid+"-layer"+e,this.idSource=this.uid+"-source",this.idLayer=this.uid+"-layer",this.sourceType=null,this.source=null,this.layerType=null,this.below=null,this.visible=!1}function i(t){var e=t.source;return s.isPlainObject(e)||"string"==typeof e&&e.length>0}function a(t){var e={},r={};switch(t.type){case"circle":s.extendFlat(r,{"circle-radius":t.circle.radius,"circle-color":t.color,"circle-opacity":t.opacity});break;case"line":s.extendFlat(r,{"line-width":t.line.width,"line-color":t.color,"line-opacity":t.opacity});break;case"fill":s.extendFlat(r,{"fill-color":t.color,"fill-outline-color":t.fill.outlinecolor,"fill-opacity":t.opacity});break;case"symbol":var n=t.symbol,i=l(n.textposition,n.iconsize);s.extendFlat(e,{"icon-image":n.icon+"-15","icon-size":n.iconsize/10,"text-field":n.text,"text-size":n.textfont.size,"text-anchor":i.anchor,"text-offset":i.offset}),s.extendFlat(r,{"icon-color":t.color,"text-color":n.textfont.color,"text-opacity":t.opacity})}return{layout:e,paint:r}}function o(t){var e,r=t.sourcetype,n=t.source,i={type:r},a="string"==typeof n;return"geojson"===r?e="data":"vector"===r&&(e=a?"url":"tiles"),i[e]=n,i}var s=t("../../lib"),l=t("./convert_text_opts"),u=n.prototype;u.update=function(t){this.visible?this.needsNewSource(t)?(this.updateLayer(t),this.updateSource(t)):this.needsNewLayer(t)&&this.updateLayer(t):(this.updateSource(t),this.updateLayer(t)),this.updateStyle(t),this.visible=i(t)},u.needsNewSource=function(t){return this.sourceType!==t.sourcetype||this.source!==t.source||this.layerType!==t.type},u.needsNewLayer=function(t){return this.layerType!==t.type||this.below!==t.below},u.updateSource=function(t){var e=this.map;if(e.getSource(this.idSource)&&e.removeSource(this.idSource),this.sourceType=t.sourcetype,this.source=t.source,i(t)){var r=o(t);e.addSource(this.idSource,r)}},u.updateLayer=function(t){var e=this.map;if(e.getLayer(this.idLayer)&&e.removeLayer(this.idLayer),this.layerType=t.type,i(t)){e.addLayer({id:this.idLayer,source:this.idSource,"source-layer":t.sourcelayer||"",type:t.type},t.below);var r={visibility:"visible"};this.mapbox.setOptions(this.idLayer,"setLayoutProperty",r)}},u.updateStyle=function(t){var e=a(t);i(t)&&(this.mapbox.setOptions(this.idLayer,"setLayoutProperty",e.layout),this.mapbox.setOptions(this.idLayer,"setPaintProperty",e.paint))},u.dispose=function(){var t=this.map;t.removeLayer(this.idLayer),t.removeSource(this.idSource)},e.exports=function(t,e,r){var i=new n(t,e);return i.update(r),i}},{"../../lib":709,"./convert_text_opts":804}],807:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../components/color").defaultLine,a=t("../font_attributes"),o=t("../../traces/scatter/attributes").textposition;e.exports={_arrayAttrRegexps:[/^mapbox([2-9]|[1-9][0-9]+)?\.layers/],domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]},y:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]}},accesstoken:{valType:"string",noBlank:!0,strict:!0},style:{valType:"any",values:["basic","streets","outdoors","light","dark","satellite","satellite-streets"],dflt:"basic"},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:{_isLinkedToArray:"layer",sourcetype:{valType:"enumerated",values:["geojson","vector"],dflt:"geojson"},source:{valType:"any"},sourcelayer:{valType:"string",dflt:""},type:{valType:"enumerated",values:["circle","line","fill","symbol"],dflt:"circle"},below:{valType:"string",dflt:""},color:{valType:"color",dflt:i},opacity:{valType:"number",min:0,max:1,dflt:1},circle:{radius:{valType:"number",dflt:15}},line:{width:{valType:"number",dflt:2}},fill:{outlinecolor:{valType:"color",dflt:i}},symbol:{icon:{valType:"string",dflt:"marker"},iconsize:{valType:"number",dflt:10},text:{valType:"string",dflt:""},textfont:n.extendDeep({},a,{family:{dflt:"Open Sans Regular, Arial Unicode MS Regular"}}),textposition:n.extendFlat({},o,{arrayOk:!1})}}}},{"../../components/color":590,"../../lib":709,"../../traces/scatter/attributes":1008,"../font_attributes":772}],808:[function(t,e,r){"use strict";function n(t,e,r){r("accesstoken"),r("style"),r("center.lon"),r("center.lat"),r("zoom"),r("bearing"),r("pitch"),i(t,e),e._input=t}function i(t,e){function r(t,e){return a.coerce(n,i,s.layers,t,e)}for(var n,i,o=t.layers||[],l=e.layers=[],u=0;u<o.length;u++)if(n=o[u],i={},a.isPlainObject(n)){var c=r("sourcetype");r("source"),"vector"===c&&r("sourcelayer");var h=r("type");r("below"),r("color"),r("opacity"),"circle"===h&&r("circle.radius"),"line"===h&&r("line.width"),"fill"===h&&r("fill.outlinecolor"),"symbol"===h&&(r("symbol.icon"),r("symbol.iconsize"),r("symbol.text"),a.coerceFont(r,"symbol.textfont"),r("symbol.textposition")),i._index=u,l.push(i)}}var a=t("../../lib"),o=t("../subplot_defaults"),s=t("./layout_attributes");e.exports=function(t,e,r){o(t,e,r,{type:"mapbox",attributes:s,handleDefaults:n,partition:"y"})}},{"../../lib":709,"../subplot_defaults":818,"./layout_attributes":807}],809:[function(t,e,r){"use strict";function n(t){this.id=t.id,this.gd=t.gd,this.container=t.container,this.isStatic=t.staticPlot;var e=t.fullLayout;this.uid=e._uid+"-"+this.id,this.opts=e[this.id],this.div=null,this.xaxis=null,this.yaxis=null,this.createFramework(e),this.map=null,this.accessToken=null,this.styleObj=null,this.traceHash={},this.layerList=[]}function i(t){var e=h.style.values,r=h.style.dflt,n={};return u.isPlainObject(t)?(n.id=t.id,n.style=t):"string"==typeof t?(n.id=t,n.style=e.indexOf(t)!==-1?a(t):t):(n.id=r,n.style=a(r)),n}function a(t){return c.styleUrlPrefix+t+"-"+c.styleUrlSuffix}function o(t){return[t.lon,t.lat]}var s=t("mapbox-gl"),l=t("../../components/fx"),u=t("../../lib"),c=t("./constants"),h=t("./layout_attributes"),f=t("./layers"),d=n.prototype;e.exports=function(t){return new n(t)},d.plot=function(t,e,r){var n=this,i=n.opts=e[this.id];n.map&&i.accesstoken!==n.accessToken&&(n.map.remove(),n.map=null,n.styleObj=null,n.traceHash=[],n.layerList={});var a;a=n.map?new Promise(function(r,i){n.updateMap(t,e,r,i)}):new Promise(function(r,i){n.createMap(t,e,r,i)}),r.push(a)},d.createMap=function(t,e,r,n){function a(){l.loneUnhover(e._toppaper)}var h=this,f=h.gd,d=h.opts,p=h.styleObj=i(d.style);h.accessToken=d.accesstoken;var m=h.map=new s.Map({container:h.div,style:p.style,center:o(d.center),zoom:d.zoom,bearing:d.bearing,pitch:d.pitch,interactive:!h.isStatic,preserveDrawingBuffer:h.isStatic}),v=c.controlContainerClassName,g=h.div.getElementsByClassName(v)[0];h.div.removeChild(g),m._canvas.canvas.style.left="0px",m._canvas.canvas.style.top="0px",h.rejectOnError(n),m.once("load",function(){h.updateData(t),h.updateLayout(e),h.resolveOnRender(r)}),m.on("moveend",function(t){if(h.map){var e=h.getView();if(d._input.center=d.center=e.center,d._input.zoom=d.zoom=e.zoom,d._input.bearing=d.bearing=e.bearing,d._input.pitch=d.pitch=e.pitch,t.originalEvent){var r={};r[h.id]=u.extendFlat({},e),f.emit("plotly_relayout",r)}}}),m.on("mousemove",function(t){var e=h.div.getBoundingClientRect();t.clientX=t.point.x+e.left,t.clientY=t.point.y+e.top,t.target.getBoundingClientRect=function(){return e},h.xaxis.p2c=function(){return t.lngLat.lng},h.yaxis.p2c=function(){return t.lngLat.lat},l.hover(f,t,h.id)}),m.on("click",function(t){l.click(f,t.originalEvent)}),m.on("dragstart",a),m.on("zoomstart",a)},d.updateMap=function(t,e,r,n){var a=this,o=a.map;a.rejectOnError(n);var s=i(a.opts.style);a.styleObj.id!==s.id?(a.styleObj=s,o.setStyle(s.style),o.style.once("load",function(){a.traceHash={},a.updateData(t),a.updateLayout(e),a.resolveOnRender(r)})):(a.updateData(t),a.updateLayout(e),a.resolveOnRender(r))},d.updateData=function(t){var e,r,n,i,a=this.traceHash;for(n=0;n<t.length;n++){var o=t[n];r=o[0].trace,e=a[r.uid],e?e.update(o):r._module&&(a[r.uid]=r._module.plot(this,o))}var s=Object.keys(a);t:for(n=0;n<s.length;n++){var l=s[n];for(i=0;i<t.length;i++)if(r=t[i][0].trace,l===r.uid)continue t;e=a[l],e.dispose(),delete a[l]}},d.updateLayout=function(t){var e=this.map,r=this.opts;e.setCenter(o(r.center)),e.setZoom(r.zoom),e.setBearing(r.bearing),e.setPitch(r.pitch),this.updateLayers(),this.updateFramework(t),this.map.resize()},d.resolveOnRender=function(t){var e=this.map;e.on("render",function r(){e.loaded()&&(e.off("render",r),t())})},d.rejectOnError=function(t){function e(){t(new Error(c.mapOnErrorMsg))}var r=this.map;r.once("error",e),r.once("style.error",e),r.once("source.error",e),r.once("tile.error",e),r.once("layer.error",e)},d.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)},d.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])},d.updateLayers=function(){var t,e=this.opts,r=e.layers,n=this.layerList;if(r.length!==n.length){for(t=0;t<n.length;t++)n[t].dispose();for(n=this.layerList=[],t=0;t<r.length;t++)n.push(f(this,t,r[t]))}else for(t=0;t<r.length;t++)n[t].update(r[t])},d.destroy=function(){this.map&&(this.map.remove(),this.map=null),this.container.removeChild(this.div)},d.toImage=function(){return this.map.getCanvas().toDataURL()},d.initSource=function(t){var e={type:"geojson",data:{type:"Feature",geometry:{type:"Point",coordinates:[]}}};return this.map.addSource(t,e)},d.setSourceData=function(t,e){this.map.getSource(t).setData(e)},d.setOptions=function(t,e,r){for(var n=this.map,i=Object.keys(r),a=0;a<i.length;a++){var o=i[a];n[e](t,o,r[o])}},d.project=function(t){return this.map.project(new s.LngLat(t[0],t[1]))},d.getView=function(){var t=this.map,e=t.getCenter();return{center:{lon:e.lng,lat:e.lat},zoom:t.getZoom(),bearing:t.getBearing(),pitch:t.getPitch()}}},{"../../components/fx":631,"../../lib":709,"./constants":803,"./layers":806,"./layout_attributes":807,"mapbox-gl":336}],810:[function(t,e,r){"use strict";e.exports={t:{valType:"number",dflt:0},r:{valType:"number",dflt:0},b:{valType:"number",dflt:0},l:{valType:"number",dflt:0}}},{}],811:[function(t,e,r){"use strict";function n(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(){p.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})}}function i(t,e,r,n){for(var i=t.transforms,a=[t],o=0;o<i.length;o++){var s=i[o],l=b[s.type];l&&l.transform&&(a=l.transform(a,{transform:s,fullTrace:t,fullData:e,layout:r,fullLayout:n,transformIndex:o}))}return a}function a(t){var e,r={left:0,right:0,bottom:0,top:0};if(t)for(e in t)t.hasOwnProperty(e)&&(r.left+=t[e].left||0,r.right+=t[e].right||0,r.bottom+=t[e].bottom||0,r.top+=t[e].top||0);return r}function o(t){for(var e=!1,r=0;r<t.length;r++){t[r]._categories=t[r]._initialCategories.slice(),t[r]._categoriesMap={};for(var n=0;n<t[r]._categories.length;n++)t[r]._categoriesMap[t[r]._categories[n]]=n;"category"===t[r].type&&(e=!0)}return e}var s=t("d3"),l=t("fast-isnumeric"),u=t("../plotly"),c=t("../registry"),h=t("../lib"),f=t("../components/color"),d=t("../constants/numerical").BADNUM,p=e.exports={},m=t("./animation_attributes"),v=t("./frame_attributes"),g=h.relinkPrivateKeys;h.extendFlat(p,c),p.attributes=t("./attributes"),p.attributes.type.values=p.allTypes,p.fontAttrs=t("./font_attributes"),p.layoutAttributes=t("./layout_attributes"),p.fontWeight="normal";var y=p.subplotsRegistry,b=p.transformsRegistry,x=t("../components/errorbars"),_=t("./command");p.executeAPICommand=_.executeAPICommand,p.computeAPICommandBindings=_.computeAPICommandBindings,p.manageCommandObserver=_.manageCommandObserver,p.hasSimpleAPICommandBindings=_.hasSimpleAPICommandBindings,p.findSubplotIds=function(t,e){var r=[];if(!p.subplotsRegistry[e])return r;for(var n=p.subplotsRegistry[e].attr,i=0;i<t.length;i++){var a=t[i];p.traceIs(a,e)&&r.indexOf(a[n])===-1&&r.push(a[n])}return r},p.getSubplotIds=function(t,e){var r=p.subplotsRegistry[e];if(!r)return[];if(!("cartesian"!==e||t._has&&t._has("cartesian")))return[];if(!("gl2d"!==e||t._has&&t._has("gl2d")))return[];if("cartesian"===e||"gl2d"===e)return Object.keys(t._plots||{});for(var n=r.idRegex,i=Object.keys(t),a=[],o=0;o<i.length;o++){var s=i[o];n.test(s)&&a.push(s)}var l=r.idRoot.length;return a.sort(function(t,e){return+(t.substr(l)||1)-+(e.substr(l)||1)}),a},p.getSubplotData=function(t,e,r){if(!p.subplotsRegistry[e])return[];for(var n,i=p.subplotsRegistry[e].attr,a=[],o=0;o<t.length;o++)if(n=t[o],"gl2d"===e&&p.traceIs(n,"gl2d")){var s=u.Axes.subplotMatch,l="x"+r.match(s)[1],c="y"+r.match(s)[2];n[i[0]]===l&&n[i[1]]===c&&a.push(n)}else n[i]===r&&a.push(n);return a},p.getSubplotCalcData=function(t,e,r){if(!p.subplotsRegistry[e])return[];for(var n=p.subplotsRegistry[e].attr,i=[],a=0;a<t.length;a++){var o=t[a];o[0].trace[n]===r&&i.push(o)}return i},p.redrawText=function(t){if(!(t.data&&t.data[0]&&t.data[0].r))return new Promise(function(e){setTimeout(function(){c.getComponentMethod("annotations","draw")(t),c.getComponentMethod("legend","draw")(t),(t.calcdata||[]).forEach(function(t){t[0]&&t[0].t&&t[0].t.cb&&t[0].t.cb()}),e(p.previousPromises(t))},300)})},p.resize=function(t){return new Promise(function(e,r){t&&"none"!==s.select(t).style("display")||r(new Error("Resize must be passed a plot div element.")),t._redrawTimer&&clearTimeout(t._redrawTimer),t._redrawTimer=setTimeout(function(){if(t.layout.width&&t.layout.height)return void e(t);delete t.layout.width,delete t.layout.height;var r=t.changed;t.autoplay=!0,u.relayout(t,{autosize:!0}).then(function(){t.changed=r,e(t)})},100)})},p.previousPromises=function(t){if((t._promises||[]).length)return Promise.all(t._promises).then(function(){t._promises=[]})},p.addLinks=function(t){if(t._context.showLink||t._context.showSources){var e=t._fullLayout,r=e._paper.selectAll("text.js-plot-link-container").data([0]);r.enter().append("text").classed("js-plot-link-container",!0).style({"font-family":'"Open Sans", Arial, sans-serif',"font-size":"12px",fill:f.defaultLine,"pointer-events":"all"}).each(function(){var t=s.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)});var 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"),l=r.select(".js-link-spacer"),u=r.select(".js-sourcelinks");t._context.showSources&&t._context.showSources(t),t._context.showLink&&n(t,o),l.text(o.text()&&u.text()?" - ":"")}},p.sendDataToCloud=function(t){t.emit("plotly_beforeexport");var e=window.PLOTLYENV&&window.PLOTLYENV.BASE_URL||"https://plot.ly",r=s.select(t).append("div").attr("id","hiddenform").style("display","none"),n=r.append("form").attr({action:e+"/external",method:"post",target:"_blank"});return n.append("input").attr({type:"text",name:"data"}).node().value=p.graphJson(t,!1,"keepdata"),n.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1},p.supplyDefaults=function(t){var e,r=t._fullLayout||{},n=t._fullLayout={},i=t.layout||{},a=t._fullData||[],o=t._fullData=[],s=t.data||[];if(t._transitionData||p.createTransitionData(t),r._initialAutoSizeIsDone){var l=r.width,c=r.height;p.supplyLayoutGlobalDefaults(i,n),i.width||(n.width=l),i.height||(n.height=c)}else{p.supplyLayoutGlobalDefaults(i,n);var h=!i.width||!i.height,f=n.autosize,d=t._context&&t._context.autosizable;h&&(f||d)?p.plotAutoSize(t,i,n):h&&p.sanitizeMargins(t),!f&&h&&(i.width=n.width,i.height=n.height)}n._initialAutoSizeIsDone=!0,n._dataLength=s.length,n._globalTransforms=(t._context||{}).globalTransforms,p.supplyDataDefaults(s,o,i,n),n._has=p._hasPlotType.bind(n);var m=n._modules;for(e=0;e<m.length;e++){var v=m[e];v.cleanData&&v.cleanData(o)}if(a.length===s.length)for(e=0;e<o.length;e++)g(o[e],a[e]);p.supplyLayoutModuleDefaults(i,n,o,t._transitionData),n._hasCartesian=n._has("cartesian"),n._hasGeo=n._has("geo"),n._hasGL3D=n._has("gl3d"),n._hasGL2D=n._has("gl2d"),n._hasTernary=n._has("ternary"),n._hasPie=n._has("pie"),p.cleanPlot(o,n,a,r),p.linkSubplots(o,n,a,r),g(n,r),p.doAutoMargin(t);var y=u.Axes.list(t);for(e=0;e<y.length;e++){y[e].setScale()}if((t.calcdata||[]).length===o.length)for(e=0;e<o.length;e++){var b=o[e];(t.calcdata[e][0]||{}).trace=b}},p.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=[])},p._hasPlotType=function(t){for(var e=this._basePlotModules||[],r=0;r<e.length;r++){if(e[r].name===t)return!0}return!1},p.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._paper,u=!!n._infolayer;t:for(i=0;i<r.length;i++){var c=r[i],h=c.uid;for(a=0;a<t.length;a++){var f=t[a];if(h===f.uid)continue t}var d=".hm"+h+",.contour"+h+",.carpet"+h+",#clip"+h+",.trace"+h;l&&n._paper.selectAll(d).remove(),u&&(n._infolayer.selectAll(".cb"+h).remove(),n._infolayer.selectAll("g.rangeslider-container").selectAll(d).remove())}},p.linkSubplots=function(t,e,r,n){for(var i=n._plots||{},a=e._plots={},o={_fullData:t,_fullLayout:e},s=u.Axes.getSubplots(o),l=0;l<s.length;l++){var c,h=s[l],f=i[h];f?(c=a[h]=f,c._scene2d&&c._scene2d.updateRefs(e)):(c=a[h]={},c.id=h),c.xaxis=u.Axes.getFromId(o,h,"x"),c.yaxis=u.Axes.getFromId(o,h,"y")}},p.supplyDataDefaults=function(t,e,r,n){function a(t){e.push(t);var r=t._module;r&&(h.pushUnique(u,r),h.pushUnique(f,t._module.basePlotModule),d++)}var o,s,l,u=n._modules=[],f=n._basePlotModules=[],d=0;n._transformModules=[];var m={},v=[];for(o=0;o<t.length;o++){if(l=t[o],s=p.supplyTraceDefaults(l,d,n,o),s.index=o,s._input=l,s._expandedIndex=d,s.transforms&&s.transforms.length)for(var g=i(s,e,r,n),y=0;y<g.length;y++){var b=g[y],x=p.supplyTraceDefaults(b,d,n,o);b.uid=x.uid=s.uid+y,x.index=o,x._input=l,x._fullInput=s,x._expandedIndex=d,x._expandedInput=b,a(x)}else s._fullInput=s,s._expandedInput=s,a(s);c.traceIs(s,"carpetAxis")&&(m[s.carpet]=s),c.traceIs(s,"carpetDependent")&&v.push(o)}for(o=0;o<v.length;o++)if(s=e[v[o]],s.visible){var _=m[s.carpet];s._carpet=_,_&&_.visible?(s.xaxis=_.xaxis,s.yaxis=_.yaxis):s.visible=!1}},p.supplyAnimationDefaults=function(t){function e(e,r){return h.coerce(t||{},n,m,e,r)}t=t||{};var r,n={};if(e("mode"),e("direction"),e("fromcurrent"),Array.isArray(t.frame))for(n.frame=[],r=0;r<t.frame.length;r++)n.frame[r]=p.supplyAnimationFrameDefaults(t.frame[r]||{});else n.frame=p.supplyAnimationFrameDefaults(t.frame||{});if(Array.isArray(t.transition))for(n.transition=[],r=0;r<t.transition.length;r++)n.transition[r]=p.supplyAnimationTransitionDefaults(t.transition[r]||{});else n.transition=p.supplyAnimationTransitionDefaults(t.transition||{});return n},p.supplyAnimationFrameDefaults=function(t){function e(e,n){return h.coerce(t||{},r,m.frame,e,n)}var r={};return e("duration"),e("redraw"),r},p.supplyAnimationTransitionDefaults=function(t){function e(e,n){return h.coerce(t||{},r,m.transition,e,n)}var r={};return e("duration"),e("easing"),r},p.supplyFrameDefaults=function(t){function e(e,n){return h.coerce(t,r,v,e,n)}var r={};return e("group"),e("name"),e("traces"),e("baseframe"),e("data"),e("layout"),r},p.supplyTraceDefaults=function(t,e,r,n){function i(e,r){return h.coerce(t,o,p.attributes,e,r)}function a(e,r){if(p.traceIs(o,e))return h.coerce(t,o,p.subplotsRegistry[e].attributes,r)}var o={},s=f.defaults[e%f.defaults.length],l=i("visible");i("type"),i("uid"),i("name","trace "+n);for(var u=Object.keys(y),d=0;d<u.length;d++){var m=u[d];if(["cartesian","gl2d"].indexOf(m)===-1){var v=y[m].attr;v&&a(m,v)}}if(l){var g=p.getModule(o);o._module=g,i("hoverinfo",1===r._dataLength?"x+y+z+text":void 0),p.traceIs(o,"showLegend")&&(i("showlegend"),i("legendgroup")),c.getComponentMethod("fx","supplyDefaults")(t,o,s,r),g&&g.supplyDefaults(t,o,s,r),p.traceIs(o,"noOpacity")||i("opacity"),a("cartesian","xaxis"),a("cartesian","yaxis"),a("gl2d","xaxis"),a("gl2d","yaxis"),p.traceIs(o,"notLegendIsolatable")&&(o.visible=!!o.visible),p.supplyTransformDefaults(t,o,r)}return o},p.supplyTransformDefaults=function(t,e,r){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=[],l=0;l<o.length;l++){var u,c=o[l],f=c.type,d=b[f];d||h.warn("Unrecognized transform type "+f+"."),d&&d.supplyDefaults?(u=d.supplyDefaults(c,e,r,t),u.type=f,u._module=d,h.pushUnique(i,d)):u=h.extendFlat({},c),s.push(u)}},p.supplyLayoutGlobalDefaults=function(t,e){function r(r,n){return h.coerce(t,e,p.layoutAttributes,r,n)}var n=h.coerceFont(r,"font");r("title"),h.coerceFont(r,"titlefont",{family:n.family,size:Math.round(1.4*n.size),color:n.color}),r("autosize",!(t.width&&t.height)),r("width"),r("height"),r("margin.l"),r("margin.r"),r("margin.t"),r("margin.b"),r("margin.pad"),r("margin.autoexpand"),t.width&&t.height&&p.sanitizeMargins(e),r("paper_bgcolor"),r("separators"),r("hidesources"),r("smith"),c.getComponentMethod("calendars","handleDefaults")(t,e,"calendar"),c.getComponentMethod("fx","supplyLayoutGlobalDefaults")(t,e,r)},p.plotAutoSize=function(t,e,r){var n,i,o=t._context||{},s=o.frameMargins,u=h.isPlotDiv(t);if(u&&t.emit("plotly_autosize"),o.fillFrame)n=window.innerWidth,i=window.innerHeight,document.body.style.overflow="hidden";else if(l(s)&&s>0){var c=a(t._boundingBoxMargins),f=c.left+c.right,d=c.bottom+c.top,m=1-2*s,v=r._container&&r._container.node?r._container.node().getBoundingClientRect():{width:r.width,height:r.height};n=Math.round(m*(v.width-f)),i=Math.round(m*(v.height-d))}else{var g=u?window.getComputedStyle(t):{};n=parseFloat(g.width)||r.width,i=parseFloat(g.height)||r.height}var y=p.layoutAttributes.width.min,b=p.layoutAttributes.height.min;n<y&&(n=y),i<b&&(i=b);var x=!e.width&&Math.abs(r.width-n)>1,_=!e.height&&Math.abs(r.height-i)>1;(_||x)&&(x&&(r.width=n),_&&(r.height=i)),t._initialAutoSize||(t._initialAutoSize={width:n,height:i}),p.sanitizeMargins(r)},p.supplyLayoutModuleDefaults=function(t,e,r,n){var i,a;u.Axes.supplyLayoutDefaults(t,e,r);var o=e._basePlotModules;for(i=0;i<o.length;i++)a=o[i],"cartesian"!==a.name&&a.supplyLayoutDefaults&&a.supplyLayoutDefaults(t,e,r);var s=e._modules;for(i=0;i<s.length;i++)a=s[i],a.supplyLayoutDefaults&&a.supplyLayoutDefaults(t,e,r);var l=e._transformModules;for(i=0;i<l.length;i++)a=l[i],a.supplyLayoutDefaults&&a.supplyLayoutDefaults(t,e,r,n);var h=Object.keys(c.componentsRegistry);for(i=0;i<h.length;i++)a=c.componentsRegistry[h[i]],a.supplyLayoutDefaults&&a.supplyLayoutDefaults(t,e,r)},p.purge=function(t){var e=t._fullLayout||{};void 0!==e._glcontainer&&e._glcontainer.remove(),void 0!==e._geocontainer&&e._geocontainer.remove(),
66 e._modeBar&&e._modeBar.destroy(),t._transitionData&&(t._transitionData._interruptCallbacks&&(t._transitionData._interruptCallbacks.length=0),t._transitionData._animationRaf&&window.cancelAnimationFrame(t._transitionData._animationRaf)),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.firstscatter,delete t.hmlumcount,delete t.hmpixcount,delete t.numboxes,delete t._hoverTimer,delete t._lastHoverTime,delete t._transitionData,delete t._transitioning,delete t._initialAutoSize,t.removeAllListeners&&t.removeAllListeners()},p.style=function(t){for(var e=t._fullLayout._modules,r=0;r<e.length;r++){var n=e[r];n.style&&n.style(t)}},p.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))}},p.autoMargin=function(t,e,r){var n=t._fullLayout;if(n._pushmargin||(n._pushmargin={}),n.margin.autoexpand!==!1){if(r){var i=void 0===r.pad?12:r.pad;r.l+r.r>.5*n.width&&(r.l=r.r=0),r.b+r.t>.5*n.height&&(r.b=r.t=0),n._pushmargin[e]={l:{val:r.x,size:r.l+i},r:{val:r.x,size:r.r+i},b:{val:r.y,size:r.b+i},t:{val:r.y,size:r.t+i}}}else delete n._pushmargin[e];n._replotting||p.doAutoMargin(t)}},p.doAutoMargin=function(t){var e=t._fullLayout;e._size||(e._size={}),e._pushmargin||(e._pushmargin={});var r=e._size,n=JSON.stringify(r),i=Math.max(e.margin.l||0,0),a=Math.max(e.margin.r||0,0),o=Math.max(e.margin.t||0,0),s=Math.max(e.margin.b||0,0),c=e._pushmargin;if(e.margin.autoexpand!==!1){c.base={l:{val:0,size:i},r:{val:1,size:a},t:{val:1,size:o},b:{val:0,size:s}};for(var h=Object.keys(c),f=0;f<h.length;f++)for(var d=h[f],p=c[d].l||{},m=c[d].b||{},v=p.val,g=p.size,y=m.val,b=m.size,x=0;x<h.length;x++){var _=h[x];if(l(g)&&c[_].r){var w=c[_].r.val,M=c[_].r.size;if(w>v){var k=(g*w+(M-e.width)*v)/(w-v),A=(M*(1-v)+(g-e.width)*(1-w))/(w-v);k>=0&&A>=0&&k+A>i+a&&(i=k,a=A)}}if(l(b)&&c[_].t){var T=c[_].t.val,S=c[_].t.size;if(T>y){var E=(b*T+(S-e.height)*y)/(T-y),L=(S*(1-y)+(b-e.height)*(1-T))/(T-y);E>=0&&L>=0&&E+L>s+o&&(s=E,o=L)}}}}if(r.l=Math.round(i),r.r=Math.round(a),r.t=Math.round(o),r.b=Math.round(s),r.p=Math.round(e.margin.pad),r.w=Math.round(e.width)-r.l-r.r,r.h=Math.round(e.height)-r.t-r.b,!e._replotting&&"{}"!==n&&n!==JSON.stringify(e._size))return u.plot(t)},p.graphJson=function(t,e,r,n,i){function a(t){if("function"==typeof t)return null;if(h.isPlainObject(t)){var e,n,i={};for(e in t)if("function"!=typeof t[e]&&["_","["].indexOf(e.charAt(0))===-1){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&&!h.isPlainObject(t.stream))continue}else if("keepall"!==r&&"string"==typeof(n=t[e+"src"])&&n.indexOf(":")>0)continue;i[e]=a(t[e])}return i}return Array.isArray(t)?t.map(a):h.isJSDate(t)?h.ms2DateTimeLocal(+t):t}(i&&e&&!t._fullData||i&&!e&&!t._fullLayout)&&p.supplyDefaults(t);var o=i?t._fullData:t.data,s=i?t._fullLayout:t.layout,l=(t._transitionData||{})._frames,u={data:(o||[]).map(function(t){var r=a(t);return e&&delete r.fit,r})};return e||(u.layout=a(s)),t.framework&&t.framework.isPolar&&(u=t.framework.getConfig()),l&&(u.frames=a(l)),"object"===n?u:JSON.stringify(u)},p.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],n.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":i=n.value,o[i.name]=i,a.splice(n.index,0,i);break;case"delete":i=a[n.index],delete o[i.name],a.splice(n.index,1)}return Promise.resolve()},p.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()])&&u.indexOf(s.name)===-1;)l.push(s),u.push(s.name);for(var c={};s=l.pop();)if(s.layout&&(c.layout=p.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++)void 0!==(i=n[r])&&null!==i&&(a=c.traces.indexOf(i),a===-1&&(a=c.data.length,c.traces[a]=i),c.data[a]=p.extendTrace(c.data[a],s.data[r]))}return c},p.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)}},p.extendObjectWithContainers=function(t,e,r){var n,i,a,o,s,l,u,c,f=h.extendDeepNoArrays({},e||{}),d=h.expandObjectPaths(f),m={};if(r&&r.length)for(a=0;a<r.length;a++)n=h.nestedProperty(d,r[a]),i=n.get(),void 0===i?h.nestedProperty(m,r[a]).set(null):(n.set(null),h.nestedProperty(m,r[a]).set(i));if(t=h.extendDeepNoArrays(t||{},d),r&&r.length)for(a=0;a<r.length;a++)if(s=h.nestedProperty(m,r[a]),u=s.get()){for(l=h.nestedProperty(t,r[a]),c=l.get(),Array.isArray(c)||(c=[],l.set(c)),o=0;o<u.length;o++){var v=u[o];c[o]=null===v?null:p.extendObjectWithContainers(c[o],v)}l.set(c)}return t},p.dataArrayContainers=["transforms"],p.layoutArrayContainers=c.layoutArrayContainers,p.extendTrace=function(t,e){return p.extendObjectWithContainers(t,e,p.dataArrayContainers)},p.extendLayout=function(t,e){return p.extendObjectWithContainers(t,e,p.layoutArrayContainers)},p.transition=function(t,e,r,n,i,a){function o(){var n;for(n=0;n<y.length;n++){var i=y[n],a=t._fullData[i],o=a._module;o&&(o.animatable&&b.push(i),t.data[y[n]]=p.extendTrace(t.data[y[n]],e[n]))}var s=h.expandObjectPaths(h.extendDeepNoArrays({},r)),l=/^[xy]axis[0-9]*$/;for(var u in s)l.test(u)&&delete s[u].range;return p.extendLayout(t.layout,s),p.supplyDefaults(t),p.doCalcdata(t),x.calc(t),Promise.resolve()}function s(t){var e=Promise.resolve();if(!t)return e;for(;t.length;)e=e.then(t.shift());return e}function l(t){if(t)for(;t.length;)t.shift()}function c(){return t.emit("plotly_transitioning",[]),new Promise(function(e){function n(){return l++,function(){c++,_||c!==l||f(e)}}t._transitioning=!0,a.duration>0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push(function(){_=!0}),i.redraw&&t._transitionData._interruptCallbacks.push(function(){return u.redraw(t)}),t._transitionData._interruptCallbacks.push(function(){t.emit("plotly_transitioninterrupted",[])});var o,s,l=0,c=0,d=t._fullLayout._basePlotModules,p=!1;if(r)for(s=0;s<d.length;s++)if(d[s].transitionAxes){var m=h.expandObjectPaths(r);p=d[s].transitionAxes(t,m,a,n)||p}for(p?(o=h.extendFlat({},a),o.duration=0):o=a,s=0;s<d.length;s++)d[s].plot(t,b,o,n);setTimeout(n())})}function f(e){if(t._transitionData)return l(t._transitionData._interruptCallbacks),Promise.resolve().then(function(){if(i.redraw)return u.redraw(t)}).then(function(){t._transitioning=!1,t._transitioningWithDuration=!1,t.emit("plotly_transitioned",[])}).then(e)}function d(){if(t._transitionData)return t._transitioning=!1,s(t._transitionData._interruptCallbacks)}var m,v,g=Array.isArray(e)?e.length:0,y=n.slice(0,g),b=[],_=!1;for(m=0;m<y.length;m++){v=y[m];var w=t._fullData[v],M=w._module;if(M&&!M.animatable){var k={};for(var A in e[m])k[A]=[e[m][A]]}}var T=[p.previousPromises,d,o,p.rehover,c],S=h.syncOrAsync(T,t);return S&&S.then||(S=Promise.resolve()),S.then(function(){return t})},p.doCalcdata=function(t,e){var r,n,i,a,s=u.Axes.list(t),l=t._fullData,h=t._fullLayout,f=new Array(l.length),p=(t.calcdata||[]).slice(0);for(t.calcdata=f,t.firstscatter=!0,t.numboxes=0,t._hmpixcount=0,t._hmlumcount=0,h._piecolormap={},h._piedefaultcolorcount=0,i=0;i<l.length;i++)Array.isArray(e)&&e.indexOf(i)===-1&&(f[i]=p[i]);var m=o(s),v=!1;for(i=0;i<l.length;i++)if(r=l[i],r.visible===!0&&r.transforms)for(n=r._module,n&&n.calc&&n.calc(t,r),a=0;a<r.transforms.length;a++){var g=r.transforms[a];n=b[g.type],n&&n.calcTransform&&(v=!0,n.calcTransform(t,r,g))}if(v){for(i=0;i<s.length;i++)s[i]._min=[],s[i]._max=[],s[i]._categories=[],s[i]._categoriesMap={};o(s)}for(i=0;i<l.length;i++){var y=[];r=l[i],r.visible===!0&&(n=r._module)&&n.calc&&(y=n.calc(t,r)),Array.isArray(y)&&y[0]||(y=[{x:d,y:d}]),y[0].t||(y[0].t={}),y[0].trace=r,f[i]=y}if(c.getComponentMethod("fx","calc")(t),m){var x=["annotations","shapes","images"];for(i=0;i<x.length;i++)c.getComponentMethod(x[i],"supplyLayoutDefaults")(t.layout,h,l)}},p.rehover=function(t){t._fullLayout._rehover&&t._fullLayout._rehover()},p.generalUpdatePerTraceModule=function(t,e,r){var n,i=t.traceHash,a={};for(n=0;n<e.length;n++){var o=e[n],s=o[0].trace;s.visible&&(a[s.type]=a[s.type]||[],a[s.type].push(o))}var l=Object.keys(i),u=Object.keys(a);for(n=0;n<l.length;n++){var c=l[n];if(u.indexOf(c)===-1){var h=i[c][0];h[0].trace.visible=!1,a[c]=[h]}}for(u=Object.keys(a),n=0;n<u.length;n++){var f=a[u[n]];f[0][0].trace._module.plot(t,function(t){for(var e=[],r=0;r<t.length;r++){var n=t[r];n[0].trace.visible===!0&&e.push(n)}return e}(f),r)}t.traceHash=a}},{"../components/color":590,"../components/errorbars":620,"../constants/numerical":690,"../lib":709,"../plotly":743,"../registry":826,"./animation_attributes":744,"./attributes":746,"./command":771,"./font_attributes":772,"./frame_attributes":773,"./layout_attributes":802,d3:118,"fast-isnumeric":127}],812:[function(t,e,r){"use strict";var n=t("../../traces/scatter/attributes"),i=n.marker;e.exports={r:n.r,t:n.t,marker:{color:i.color,size:i.size,symbol:i.symbol,opacity:i.opacity}}},{"../../traces/scatter/attributes":1008}],813:[function(t,e,r){"use strict";function n(t,e){return a({},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"},visible:{valType:"boolean"}})}var i=t("../cartesian/layout_attributes"),a=t("../../lib/extend").extendFlat,o=a({},i.domain,{});e.exports={radialaxis:n("radial",{range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},domain:o,orientation:{valType:"number"}}),angularaxis:n("angular",{range:{valType:"info_array",items:[{valType:"number",dflt:0},{valType:"number",dflt:360}]},domain:o}),layout:{direction:{valType:"enumerated",values:["clockwise","counterclockwise"]},orientation:{valType:"angle"}}}},{"../../lib/extend":701,"../cartesian/layout_attributes":759}],814:[function(t,e,r){"use strict";(e.exports=t("./micropolar")).manager=t("./micropolar_manager")},{"./micropolar":815,"./micropolar_manager":816}],815:[function(t,e,r){var n=t("d3"),i=t("../../lib"),a=i.extendDeepAll,o=e.exports={version:"0.2.2"};o.Axis=function(){function t(t){r=t||r;var u=l.data,h=l.layout;return("string"==typeof r||r.nodeName)&&(r=n.select(r)),r.datum(u).each(function(t,r){function l(t,e){return s(t)%360+h.orientation}var u=t.slice();c={data:o.util.cloneJson(u),layout:o.util.cloneJson(h)};var f=0;u.forEach(function(t,e){t.color||(t.color=h.defaultColorRange[f],f=(f+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 d=u.filter(function(t,e){var r=t.visible;return void 0===r||r===!0}),p=!1,m=d.map(function(t,e){return p=p||void 0!==t.groupId,t});if(p){var v=n.nest().key(function(t,e){return void 0!==t.groupId?t.groupId:"unstacked"}).entries(m),g=[],y=v.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});d=n.merge(y)}d.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 b=Math.min(h.width-h.margin.left-h.margin.right,h.height-h.margin.top-h.margin.bottom)/2;b=Math.max(10,b);var x,_=[h.margin.left+b,h.margin.top+b];if(p){x=[0,n.max(o.util.sumArrays(o.util.arrayLast(d).r[0],o.util.arrayLast(g)))]}else x=n.extent(o.util.flattenArray(d.map(function(t,e){return t.r})));h.radialAxis.domain!=o.DATAEXTENT&&(x[0]=0),i=n.scale.linear().domain(h.radialAxis.domain!=o.DATAEXTENT&&h.radialAxis.domain?h.radialAxis.domain:x).range([0,b]),c.layout.radialAxis.domain=i.domain();var w,M=o.util.flattenArray(d.map(function(t,e){return t.t})),k="string"==typeof M[0];k&&(M=o.util.deduplicate(M),w=M.slice(),M=n.range(M.length),d=d.map(function(t,e){var r=t;return t.t=[M],p&&(r.yStack=t.yStack),r}));var A=d.filter(function(t,e){return"LinePlot"===t.geometry||"DotPlot"===t.geometry}).length===d.length,T=null===h.needsEndSpacing?k||!A:h.needsEndSpacing,S=h.angularAxis.domain&&h.angularAxis.domain!=o.DATAEXTENT&&!k&&h.angularAxis.domain[0]>=0,E=S?h.angularAxis.domain:n.extent(M),L=Math.abs(M[1]-M[0]);A&&!k&&(L=0);var C=E.slice();T&&k&&(C[1]+=L);var z=h.angularAxis.ticksCount||4;z>8&&(z=z/(z/8)+z%8),h.angularAxis.ticksStep&&(z=(C[1]-C[0])/z);var D=h.angularAxis.ticksStep||(C[1]-C[0])/(z*(h.minorTicks+1));w&&(D=Math.max(Math.round(D),1)),C[2]||(C[2]=D);var I=n.range.apply(this,C);if(I=I.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=T?L:0,void 0===(e=n.select(this).select("svg.chart-root"))||e.empty()){var P=(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"),O=this.appendChild(this.ownerDocument.importNode(P.documentElement,!0));e=n.select(O)}e.select(".guides-group").style({"pointer-events":"none"}),e.select(".angular.axis-group").style({"pointer-events":"none"}),e.select(".radial.axis-group").style({"pointer-events":"none"});var j,F=e.select(".chart-group"),R={fill:"none",stroke:h.tickColor},N={"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){j=e.select(".legend-group").attr({transform:"translate("+[b,h.margin.top]+")"}).style({display:"block"});var B=d.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=void 0===t.visibleInLegend||t.visibleInLegend,r.color="LinePlot"===t.geometry?t.strokeColor:t.color,r});o.Legend().config({data:d.map(function(t,e){return t.name||"Element"+e}),legendConfig:a({},o.Legend.defaultConfig().legendConfig,{container:j,elements:B,reverseOrder:h.legend.reverseOrder})})();var U=j.node().getBBox();b=Math.min(h.width-U.width-h.margin.left-h.margin.right,h.height-h.margin.top-h.margin.bottom)/2,b=Math.max(10,b),_=[h.margin.left+b,h.margin.top+b],i.range([0,b]),c.layout.radialAxis.domain=i.domain(),j.attr("transform","translate("+[_[0]+b,_[1]-b]+")")}else j=e.select(".legend-group").style({display:"none"});e.attr({width:h.width,height:h.height}).style({opacity:h.opacity}),F.attr("transform","translate("+_+")").style({cursor:"crosshair"});var V=[(h.width-(h.margin.left+h.margin.right+2*b+(U?U.width:0)))/2,(h.height-(h.margin.top+h.margin.bottom+2*b))/2];if(V[0]=Math.max(0,V[0]),V[1]=Math.max(0,V[1]),e.select(".outer-group").attr("transform","translate("+V+")"),h.title){var q=e.select("g.title-group text").style(N).text(h.title),H=q.node().getBBox();q.attr({x:_[0]-H.width/2,y:_[1]-b-20})}var G=e.select(".radial.axis-group");if(h.radialAxis.gridLinesVisible){var Y=G.selectAll("circle.grid-circle").data(i.ticks(5));Y.enter().append("circle").attr({class:"grid-circle"}).style(R),Y.attr("r",i),Y.exit().remove()}G.select("circle.outside-circle").attr({r:b}).style(R);var X=e.select("circle.background-circle").attr({r:b}).style({fill:h.backgroundColor,stroke:h.stroke});if(h.radialAxis.visible){var W=n.svg.axis().scale(i).ticks(5).tickSize(5);G.call(W).attr({transform:"rotate("+h.radialAxis.orientation+")"}),G.selectAll(".domain").style(R),G.selectAll("g>text").text(function(t,e){return this.textContent+h.radialAxis.ticksSuffix}).style(N).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,N["font-size"]]+")":"translate("+[0,N["font-size"]]+")"}}),G.selectAll("g>line").style({stroke:"black"})}var Z=e.select(".angular.axis-group").selectAll("g.angular-tick").data(I),J=Z.enter().append("g").classed("angular-tick",!0);Z.attr({transform:function(t,e){return"rotate("+l(t,e)+")"}}).style({display:h.angularAxis.visible?"block":"none"}),Z.exit().remove(),J.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(R),J.selectAll(".minor").style({stroke:h.minorTickColor}),Z.select("line.grid-line").attr({x1:h.tickLength?b-h.tickLength:0,x2:b}).style({display:h.angularAxis.gridLinesVisible?"block":"none"}),J.append("text").classed("axis-text",!0).style(N);var K=Z.select("text.axis-text").attr({x:b+h.labelOffset,dy:".35em",transform:function(t,e){var r=l(t,e),n=b+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(N);h.angularAxis.rewriteTicks&&K.text(function(t,e){return e%(h.minorTicks+1)!=0?"":h.angularAxis.rewriteTicks(this.textContent,e)});var Q=n.max(F.selectAll(".angular-tick text")[0].map(function(t,e){return t.getCTM().e+t.getBBox().width}));j.attr({transform:"translate("+[b+Q,h.margin.top]+")"});var $=e.select("g.geometry-group").selectAll("g").size()>0,tt=e.select("g.geometry-group").selectAll("g.geometry").data(d);if(tt.enter().append("g").attr({class:function(t,e){return"geometry geometry"+e}}),tt.exit().remove(),d[0]||$){var et=[];d.forEach(function(t,e){var r={};r.radialScale=i,r.angularScale=s,r.container=tt.filter(function(t,r){return r==e}),r.geometry=t.geometry,r.orientation=h.orientation,r.direction=h.direction,r.index=e,et.push({data:t,geometryConfig:r})});var rt=n.nest().key(function(t,e){return void 0!==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 a(o[r].defaultConfig(),t)});o[r]().config(n)()})}var it,at,ot=e.select(".guides-group"),st=e.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(!k){var ht=ot.select("line").attr({x1:0,y1:0,y2:0}).style({stroke:"grey","pointer-events":"none"});F.on("mousemove.angular-guide",function(t,e){var r=o.util.getMousePos(X).angle;ht.attr({x2:-b,transform:"rotate("+r+")"}).style({opacity:.5});var n=(r+180+360-h.orientation)%360;it=s.invert(n);var i=o.util.convertToCartesian(b+12,r+180);lt.text(o.util.round(it)).move([i[0]+_[0],i[1]+_[1]])}).on("mouseout.angular-guide",function(t,e){ot.select("line").style({opacity:0})})}var ft=ot.select("circle").style({stroke:"grey",fill:"none"});F.on("mousemove.radial-guide",function(t,e){var r=o.util.getMousePos(X).radius;ft.attr({r:r}).style({opacity:.5}),at=i.invert(o.util.getMousePos(X).radius);var n=o.util.convertToCartesian(r,h.radialAxis.orientation);ut.text(o.util.round(at)).move([n[0]+_[0],n[1]+_[1]])}).on("mouseout.radial-guide",function(t,e){ft.style({opacity:0}),ct.hide(),lt.hide(),ut.hide()}),e.selectAll(".geometry-group .mark").on("mouseover.tooltip",function(t,r){var i=n.select(this),a=i.style("fill"),s="black",l=i.style("opacity")||1;if(i.attr({"data-opacity":l}),"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(t[0]),r:o.util.round(t[1])};k&&(u.t=w[t[0]]);var c="t: "+u.t+", r: "+u.r,h=this.getBoundingClientRect(),f=e.node().getBoundingClientRect(),d=[h.left+h.width/2-V[0]-f.left,h.top+h.height/2-V[1]-f.top];ct.config({color:s}).text(c),ct.move(d)}else a=i.style("stroke"),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")})})}),f}var e,r,i,s,l={data:[],layout:{}},u={},c={},h=n.dispatch("hover"),f={};return f.render=function(e){return t(e),this},f.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]={}),a(l.data[e],o.Axis.defaultConfig().data[0]),a(l.data[e],t)}),a(l.layout,o.Axis.defaultConfig().layout),a(l.layout,e.layout),this},f.getLiveConfig=function(){return c},f.getinputConfig=function(){return u},f.radialScale=function(t){return i},f.angularScale=function(t){return s},f.svg=function(){return e},n.rebind(f,h,"on"),f},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(void 0===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 r===-2},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],e 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(void 0!==t)return t[e]},t);void 0!==a&&(e.reduce(function(t,r,n){if(void 0!==t)return n===e.length-1&&delete t[r],t[r]},t),r.reduce(function(t,e,n){return void 0===t[e]&&(t[e]={}),n===r.length-1&&(t[e]=a),t[e]},t))},o.PolyChart=function(){function t(){var t=e[0].geometryConfig,r=t.container;"string"==typeof r&&(r=n.select(r)),r.datum(e).each(function(e,r){function a(e,r){return{r:t.radialScale(e[1]),t:(t.angularScale(e[0])+t.orientation)*Math.PI/180}}function o(t){return{x:t.r*Math.cos(t.t),y:t.r*Math.sin(t.t)}}var s=!!e[0].data.yStack,l=e.map(function(t,e){return s?n.zip(t.data.t[0],t.data.r[0],t.data.yStack[0]):n.zip(t.data.t[0],t.data.r[0])}),u=t.angularScale,c=t.radialScale.domain()[0],h={};h.bar=function(r,i,a){var o=e[a].data,s=t.radialScale(r[1])-t.radialScale(0),l=t.radialScale(r[2]||0),c=o.barWidth;n.select(this).attr({class:"mark bar",d:"M"+[[s+l,-c/2],[s+l,c/2],[l,c/2],[l,-c/2]].join("L")+"Z",transform:function(e,r){return"rotate("+(t.orientation+u(e[0]))+")"}})},h.dot=function(t,r,i){var s=t[2]?[t[0],t[1]+t[2]]:t,l=n.svg.symbol().size(e[i].data.dotSize).type(e[i].data.dotType)(t,r);n.select(this).attr({class:"mark dot",d:l,transform:function(t,e){var r=o(a(s));return"translate("+[r.x,r.y]+")"}})};var f=n.svg.line.radial().interpolate(e[0].data.lineInterpolation).radius(function(e){return t.radialScale(e[1])}).angle(function(e){return t.angularScale(e[0])*Math.PI/180});h.line=function(r,i,a){var o=r[2]?l[a].map(function(t,e){return[t[0],t[1]+t[2]]}):l[a];if(n.select(this).each(h.dot).style({opacity:function(t,r){return+e[a].data.dotVisible},fill:v.stroke(r,i,a)}).attr({class:"mark dot"}),!(i>0)){var s=n.select(this.parentNode).selectAll("path.line").data([0]);s.enter().insert("path"),s.attr({class:"line",d:f(o),transform:function(e,r){return"rotate("+(t.orientation+90)+")"},"pointer-events":"none"}).style({fill:function(t,e){return v.fill(r,i,a)},"fill-opacity":0,stroke:function(t,e){return v.stroke(r,i,a)},"stroke-width":function(t,e){return v["stroke-width"](r,i,a)},"stroke-dasharray":function(t,e){return v["stroke-dasharray"](r,i,a)},opacity:function(t,e){return v.opacity(r,i,a)},display:function(t,e){return v.display(r,i,a)}})}};var d=t.angularScale.range(),p=Math.abs(d[1]-d[0])/l[0].length*Math.PI/180,m=n.svg.arc().startAngle(function(t){return-p/2}).endAngle(function(t){return p/2}).innerRadius(function(e){return t.radialScale(c+(e[2]||0))}).outerRadius(function(e){return t.radialScale(c+(e[2]||0))+t.radialScale(e[1])});h.arc=function(e,r,i){n.select(this).attr({class:"mark arc",d:m,transform:function(e,r){return"rotate("+(t.orientation+u(e[0])+90)+")"}})};var v={fill:function(t,r,n){return e[n].data.color},stroke:function(t,r,n){return e[n].data.strokeColor},"stroke-width":function(t,r,n){return e[n].data.strokeSize+"px"},"stroke-dasharray":function(t,r,n){return i[e[n].data.strokeDash]},opacity:function(t,r,n){return e[n].data.opacity},display:function(t,r,n){return void 0===e[n].data.visible||e[n].data.visible?"block":"none"}},g=n.select(this).selectAll("g.layer").data(l);g.enter().append("g").attr({class:"layer"});var y=g.selectAll("path.mark").data(function(t,e){return t});y.enter().append("path").attr({class:"mark"}),y.style(v).each(h[t.geometryType]),y.exit().remove(),g.exit().remove()})}var e=[o.PolyChart.defaultConfig()],r=n.dispatch("hover"),i={solid:"none",dash:[5,2],dot:[2,5]};return t.config=function(t){return arguments.length?(t.forEach(function(t,r){e[r]||(e[r]={}),a(e[r],o.PolyChart.defaultConfig()),a(e[r],t)}),this):e},t.getColorScale=function(){},n.rebind(t,r,"on"),t},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(){function t(){var r=e.legendConfig,i=e.data.map(function(t,e){return[].concat(t).map(function(t,n){var i=a({},r.elements[e]);return i.name=t,i.color=[].concat(r.elements[e].color)[n],i})}),o=n.merge(i);o=o.filter(function(t,e){return r.elements[e]&&(r.elements[e].visibleInLegend||void 0===r.elements[e].visibleInLegend)}),r.reverseOrder&&(o=o.reverse());var s=r.container;("string"==typeof s||s.nodeName)&&(s=n.select(s));var l=o.map(function(t,e){return t.color}),u=r.fontSize,c=null==r.isContinuous?"number"==typeof o[0]:r.isContinuous,h=c?r.height:u*o.length,f=s.classed("legend-group",!0),d=f.selectAll("svg").data([0]),p=d.enter().append("svg").attr({width:300,height:h+u,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"});p.append("g").classed("legend-axis",!0),p.append("g").classed("legend-marks",!0);var m=n.range(o.length),v=n.scale[c?"linear":"ordinal"]().domain(m).range(l),g=n.scale[c?"linear":"ordinal"]().domain(m)[c?"range":"rangePoints"]([0,h]),y=function(t,e){var r=3*e;return"line"===t?"M"+[[-e/2,-e/12],[e/2,-e/12],[e/2,e/12],[-e/2,e/12]]+"Z":n.svg.symbolTypes.indexOf(t)!=-1?n.svg.symbol().type(t).size(r)():n.svg.symbol().type("square").size(r)()};if(c){var b=d.select(".legend-marks").append("defs").append("linearGradient").attr({id:"grad1",x1:"0%",y1:"0%",x2:"0%",y2:"100%"}).selectAll("stop").data(l);b.enter().append("stop"),b.attr({offset:function(t,e){return e/(l.length-1)*100+"%"}}).style({"stop-color":function(t,e){return t}}),d.append("rect").classed("legend-mark",!0).attr({height:r.height,width:r.colorBandWidth,fill:"url(#grad1)"})}else{var x=d.select(".legend-marks").selectAll("path.legend-mark").data(o);x.enter().append("path").classed("legend-mark",!0),x.attr({transform:function(t,e){return"translate("+[u/2,g(e)+u/2]+")"},d:function(t,e){var r=t.symbol;return y(r,u)},fill:function(t,e){return v(e)}}),x.exit().remove()}var _=n.svg.axis().scale(g).orient("right"),w=d.select("g.legend-axis").attr({transform:"translate("+[c?r.colorBandWidth:u,u/2]+")"}).call(_);return w.selectAll(".domain").style({fill:"none",stroke:"none"}),w.selectAll("line").style({fill:"none",stroke:c?r.textColor:"none"}),w.selectAll("text").style({
67 fill:r.textColor,"font-size":r.fontSize}).text(function(t,e){return o[e].name}),t}var e=o.Legend.defaultConfig(),r=n.dispatch("hover");return t.config=function(t){return arguments.length?(a(e,t),this):e},n.rebind(t,r,"on"),t},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,i={container:null,hasTick:!1,fontSize:12,color:"white",padding:5},s="tooltip-"+o.tooltipPanel.uid++,l=function(){t=i.container.selectAll("g."+s).data([0]);var n=t.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:i.padding+10,dy:.3*+i.fontSize}),l};return l.text=function(a){var o=n.hsl(i.color).l,s=o>=.5?"#aaa":"white",u=o>=.5?"black":"white",c=a||"";e.style({fill:u,"font-size":i.fontSize+"px"}).text(c);var h=i.padding,f=e.node().getBBox(),d={fill:i.color,stroke:s,"stroke-width":"2px"},p=f.width+2*h+10,m=f.height+2*h;return r.attr({d:"M"+[[10,-m/2],[10,-m/4],[i.hasTick?0:10,0],[10,m/4],[10,m/2],[p,m/2],[p,-m/2]].join("L")+"Z"}).style(d),t.attr({transform:"translate("+[10,-m/2+2*h]+")"}),t.style({display:"block"}),l},l.move=function(e){if(t)return t.attr({transform:"translate("+[e[0],e[1]]+")"}).style({display:"block"}),l},l.hide=function(){if(t)return t.style({display:"none"}),l},l.show=function(){if(t)return t.style({display:"block"}),l},l.config=function(t){return a(i,t),l},l},o.tooltipPanel.uid=1,o.adapter={},o.adapter.plotly=function(){var t={};return t.convert=function(t,e){var r={};if(t.data&&(r.data=t.data.map(function(t,r){var n=a({},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",n.dotVisible===!0?(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 i=o.util.duplicates(r.data.map(function(t,e){return t.geometry}));r.data.forEach(function(t,e){var n=i.indexOf(t.geometry);n!=-1&&(r.data[e].groupId=n)})}if(t.layout){var s=a({},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?(void 0!==s.tickLength&&(s.angularaxis.ticklen=s.tickLength,delete s.tickLength),s.tickColor&&(s.angularaxis.tickcolor=s.tickColor,delete s.tickColor)):(s.angularAxis&&void 0!==s.angularAxis.ticklen&&(s.tickLength=s.angularAxis.ticklen),s.angularAxis&&void 0!==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&&void 0!==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},t}},{"../../lib":709,d3:118}],816:[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){function e(e,i){return i&&(h=i),n.select(n.select(h).node().parentNode).selectAll(".svg-container>*:not(.chart-root)").remove(),r=r?l(r,e):e,a||(a=o.Axis()),c=o.adapter.plotly().convert(r),a.config(c).render(h),t.data=r.data,t.layout=r.layout,u.fillLayout(t),r}var r,i,a,c,h,f=new s;return e.isPolar=!0,e.svg=function(){return a.svg()},e.getConfig=function(){return r},e.getLiveConfig=function(){return o.adapter.plotly().convert(a.getLiveConfig(),!0)},e.getLiveScales=function(){return{t:a.angularScale(),r:a.radialScale()}},e.setUndoPoint=function(){var t=this,e=o.util.cloneJson(r);!function(e,r){f.add({undo:function(){r&&t(r)},redo:function(){t(e)}})}(e,i),i=o.util.cloneJson(e)},e.undo=function(){f.undo()},e.redo=function(){f.redo()},e},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":590,"../../lib":709,"./micropolar":815,"./undo_manager":817,d3:118}],817:[function(t,e,r){"use strict";e.exports=function(){function t(t,e){return t?(i=!0,t[e](),i=!1,this):this}var e,r=[],n=-1,i=!1;return{add:function(t){return i?this:(r.splice(n+1,r.length-n),r.push(t),n=r.length-1,this)},setCallback:function(t){e=t},undo:function(){var i=r[n];return i?(t(i,"undo"),n-=1,e&&e(i.undo),this):this},redo:function(){var i=r[n+1];return i?(t(i,"redo"),n+=1,e&&e(i.redo),this):this},clear:function(){r=[],n=-1},hasUndo:function(){return n!==-1},hasRedo:function(){return n<r.length-1},getCommands:function(){return r},getPreviousCommand:function(){return r[n-1]},getIndex:function(){return n}}}},{}],818:[function(t,e,r){"use strict";var n=t("../lib"),i=t("./plots");e.exports=function(t,e,r,a){function o(t,e){return n.coerce(s,l,c,t,e)}for(var s,l,u=a.type,c=a.attributes,h=a.handleDefaults,f=a.partition||"x",d=i.findSubplotIds(r,u),p=d.length,m=0;m<p;m++){var v=d[m];s=t[v]?t[v]:t[v]={},e[v]=l={},o("domain."+f,[m/p,(m+1)/p]),o("domain."+{x:"y",y:"x"}[f]),a.id=v,h(s,l,o,a)}}},{"../lib":709,"./plots":811}],819:[function(t,e,r){"use strict";var n=t("./ternary"),i=t("../../plots/plots");r.name="ternary",r.attr="subplot",r.idRoot="ternary",r.idRegex=/^ternary([2-9]|[1-9][0-9]+)?$/,r.attrRegex=/^ternary([2-9]|[1-9][0-9]+)?$/,r.attributes=t("./layout/attributes"),r.layoutAttributes=t("./layout/layout_attributes"),r.supplyLayoutDefaults=t("./layout/defaults"),r.plot=function(t){for(var e=t._fullLayout,r=t.calcdata,a=i.getSubplotIds(e,"ternary"),o=0;o<a.length;o++){var s=a[o],l=i.getSubplotCalcData(r,"ternary",s),u=e[s]._subplot;u||(u=new n({id:s,graphDiv:t,container:e._ternarylayer.node()},e),e[s]._subplot=u),u.plot(l,e,t._promises)}},r.clean=function(t,e,r,n){for(var a=i.getSubplotIds(n,"ternary"),o=0;o<a.length;o++){var s=a[o],l=n[s]._subplot;!e[s]&&l&&(l.plotContainer.remove(),l.clipDef.remove())}}},{"../../plots/plots":811,"./layout/attributes":820,"./layout/defaults":823,"./layout/layout_attributes":824,"./ternary":825}],820:[function(t,e,r){"use strict";e.exports={subplot:{valType:"subplotid",dflt:"ternary"}}},{}],821:[function(t,e,r){"use strict";var n=t("../../cartesian/layout_attributes"),i=t("../../../lib/extend").extendFlat;e.exports={title:n.title,titlefont:n.titlefont,color:n.color,tickmode:n.tickmode,nticks:i({},n.nticks,{dflt:6,min:1}),tick0:n.tick0,dtick:n.dtick,tickvals:n.tickvals,ticktext:n.ticktext,ticks:n.ticks,ticklen:n.ticklen,tickwidth:n.tickwidth,tickcolor:n.tickcolor,showticklabels:n.showticklabels,showtickprefix:n.showtickprefix,tickprefix:n.tickprefix,showticksuffix:n.showticksuffix,ticksuffix:n.ticksuffix,showexponent:n.showexponent,exponentformat:n.exponentformat,separatethousands:n.separatethousands,tickfont:n.tickfont,tickangle:n.tickangle,tickformat:n.tickformat,hoverformat:n.hoverformat,showline:i({},n.showline,{dflt:!0}),linecolor:n.linecolor,linewidth:n.linewidth,showgrid:i({},n.showgrid,{dflt:!0}),gridcolor:n.gridcolor,gridwidth:n.gridwidth,min:{valType:"number",dflt:0,min:0}}},{"../../../lib/extend":701,"../../cartesian/layout_attributes":759}],822:[function(t,e,r){"use strict";var n=t("tinycolor2").mix,i=t("../../../lib"),a=t("./axis_attributes"),o=t("../../cartesian/tick_label_defaults"),s=t("../../cartesian/tick_mark_defaults"),l=t("../../cartesian/tick_value_defaults");e.exports=function(t,e,r){function u(r,n){return i.coerce(t,e,a,r,n)}e.type="linear";var c=u("color"),h=c===t.color?c:r.font.color,f=e._name,d=f.charAt(0).toUpperCase(),p="Component "+d,m=u("title",p);e._hovertitle=m===p?m:d,i.coerceFont(u,"titlefont",{family:r.font.family,size:Math.round(1.2*r.font.size),color:h}),u("min"),l(t,e,u,"linear"),o(t,e,u,"linear",{noHover:!1}),s(t,e,u,{outerTicks:!0}),u("showticklabels")&&(i.coerceFont(u,"tickfont",{family:r.font.family,size:r.font.size,color:h}),u("tickangle"),u("tickformat")),u("hoverformat"),u("showline")&&(u("linecolor",c),u("linewidth")),u("showgrid")&&(u("gridcolor",n(c,r.bgColor,60).toRgbString()),u("gridwidth"))}},{"../../../lib":709,"../../cartesian/tick_label_defaults":766,"../../cartesian/tick_mark_defaults":767,"../../cartesian/tick_value_defaults":768,"./axis_attributes":821,tinycolor2:526}],823:[function(t,e,r){"use strict";function n(t,e,r,n){var a=r("bgcolor"),o=r("sum");n.bgColor=i.combine(a,n.paper_bgcolor);for(var u,c,h,f=0;f<l.length;f++)u=l[f],c=t[u]||{},h=e[u]={_name:u,type:"linear"},s(c,h,n);var d=e.aaxis,p=e.baxis,m=e.caxis;d.min+p.min+m.min>=o&&(d.min=0,p.min=0,m.min=0,t.aaxis&&delete t.aaxis.min,t.baxis&&delete t.baxis.min,t.caxis&&delete t.caxis.min)}var i=t("../../../components/color"),a=t("../../subplot_defaults"),o=t("./layout_attributes"),s=t("./axis_defaults"),l=["aaxis","baxis","caxis"];e.exports=function(t,e,r){a(t,e,r,{type:"ternary",attributes:o,handleDefaults:n,font:e.font,paper_bgcolor:e.paper_bgcolor})}},{"../../../components/color":590,"../../subplot_defaults":818,"./axis_defaults":822,"./layout_attributes":824}],824:[function(t,e,r){"use strict";var n=t("../../../components/color/attributes"),i=t("./axis_attributes");e.exports={domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]},y:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]}},bgcolor:{valType:"color",dflt:n.background},sum:{valType:"number",dflt:1,min:0},aaxis:i,baxis:i,caxis:i}},{"../../../components/color/attributes":589,"./axis_attributes":821}],825:[function(t,e,r){"use strict";function n(t,e){this.id=t.id,this.graphDiv=t.graphDiv,this.init(e),this.makeFramework()}function i(t){a.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}var a=t("d3"),o=t("tinycolor2"),s=t("../../plotly"),l=t("../../lib"),u=t("../../components/color"),c=t("../../components/drawing"),h=t("../cartesian/set_convert"),f=t("../../lib/extend").extendFlat,d=t("../plots"),p=t("../cartesian/axes"),m=t("../../components/dragelement"),v=t("../../components/fx"),g=t("../../components/titles"),y=t("../cartesian/select"),b=t("../cartesian/constants");e.exports=n;var x=n.prototype;x.init=function(t){this.container=t._ternarylayer,this.defs=t._defs,this.layoutId=t._uid,this.traceHash={}},x.plot=function(t,e){var r=this,n=e[r.id],i=e._size;r.adjustLayout(n,i),d.generalUpdatePerTraceModule(r,t,n),r.layers.plotbg.select("path").call(u.fill,n.bgcolor)},x.makeFramework=function(){var t=this,e=t.defs.selectAll("g.clips").data([0]);e.enter().append("g").classed("clips",!0);var r="clip"+t.layoutId+t.id;t.clipDef=e.selectAll("#"+r).data([0]),t.clipDef.enter().append("clipPath").attr("id",r).append("path").attr("d","M0,0Z"),t.plotContainer=t.container.selectAll("g."+t.id).data([0]),t.plotContainer.enter().append("g").classed(t.id,!0),t.layers={};var n=["draglayer","plotbg","backplot","grids","frontplot","zoom","aaxis","baxis","caxis","axlines"];t.plotContainer.selectAll("g.toplevel").data(n).enter().append("g").attr("class",function(t){return"toplevel "+t}).each(function(e){var r=a.select(this);t.layers[e]=r,"frontplot"===e?r.append("g").classed("scatterlayer",!0):"backplot"===e?r.append("g").classed("maplayer",!0):"plotbg"===e?r.append("path").attr("d","M0,0Z"):"axlines"===e&&r.selectAll("path").data(["aline","bline","cline"]).enter().append("path").each(function(t){a.select(this).classed(t,!0)})}),t.plotContainer.select(".grids").selectAll("g.grid").data(["agrid","bgrid","cgrid"]).enter().append("g").attr("class",function(t){return"grid "+t}).each(function(e){t.layers[e]=a.select(this)}),t.plotContainer.selectAll(".backplot,.frontplot,.grids").call(c.setClipUrl,r),t.graphDiv._context.staticPlot||t.initInteractions()};var _=Math.sqrt(4/3);x.adjustLayout=function(t,e){var r,n,i,a,o,s,l=this,c=t.domain,d=(c.x[0]+c.x[1])/2,p=(c.y[0]+c.y[1])/2,m=c.x[1]-c.x[0],v=c.y[1]-c.y[0],g=m*e.w,y=v*e.h,b=t.sum,x=t.aaxis.min,w=t.baxis.min,M=t.caxis.min;g>_*y?(a=y,i=a*_):(i=g,a=i/_),o=m*i/g,s=v*a/y,r=e.l+e.w*d-i/2,n=e.t+e.h*(1-p)-a/2,l.x0=r,l.y0=n,l.w=i,l.h=a,l.sum=b,l.xaxis={type:"linear",range:[x+2*M-b,b-x-2*w],domain:[d-o/2,d+o/2],_id:"x"},h(l.xaxis,l.graphDiv._fullLayout),l.xaxis.setScale(),l.yaxis={type:"linear",range:[x,b-w-M],domain:[p-s/2,p+s/2],_id:"y"},h(l.yaxis,l.graphDiv._fullLayout),l.yaxis.setScale();var k=l.yaxis.domain[0],A=l.aaxis=f({},t.aaxis,{visible:!0,range:[x,b-w-M],side:"left",_counterangle:30,tickangle:(+t.aaxis.tickangle||0)-30,domain:[k,k+s*_],_axislayer:l.layers.aaxis,_gridlayer:l.layers.agrid,_pos:0,_id:"y",_length:i,_gridpath:"M0,0l"+a+",-"+i/2});h(A,l.graphDiv._fullLayout),A.setScale();var T=l.baxis=f({},t.baxis,{visible:!0,range:[b-x-M,w],side:"bottom",_counterangle:30,domain:l.xaxis.domain,_axislayer:l.layers.baxis,_gridlayer:l.layers.bgrid,_counteraxis:l.aaxis,_pos:0,_id:"x",_length:i,_gridpath:"M0,0l-"+i/2+",-"+a});h(T,l.graphDiv._fullLayout),T.setScale(),A._counteraxis=T;var S=l.caxis=f({},t.caxis,{visible:!0,range:[b-x-w,M],side:"right",_counterangle:30,tickangle:(+t.caxis.tickangle||0)+30,domain:[k,k+s*_],_axislayer:l.layers.caxis,_gridlayer:l.layers.cgrid,_counteraxis:l.baxis,_pos:0,_id:"y",_length:i,_gridpath:"M0,0l-"+a+","+i/2});h(S,l.graphDiv._fullLayout),S.setScale();var E="M"+r+","+(n+a)+"h"+i+"l-"+i/2+",-"+a+"Z";l.clipDef.select("path").attr("d",E),l.layers.plotbg.select("path").attr("d",E);var L="translate("+r+","+n+")";l.plotContainer.selectAll(".scatterlayer,.maplayer,.zoom").attr("transform",L);var C="translate("+r+","+(n+a)+")";l.layers.baxis.attr("transform",C),l.layers.bgrid.attr("transform",C);var z="translate("+(r+i/2)+","+n+")rotate(30)";l.layers.aaxis.attr("transform",z),l.layers.agrid.attr("transform",z);var D="translate("+(r+i/2)+","+n+")rotate(-30)";l.layers.caxis.attr("transform",D),l.layers.cgrid.attr("transform",D),l.drawAxes(!0),l.plotContainer.selectAll(".crisp").classed("crisp",!1);var I=l.layers.axlines;I.select(".aline").attr("d",A.showline?"M"+r+","+(n+a)+"l"+i/2+",-"+a:"M0,0").call(u.stroke,A.linecolor||"#000").style("stroke-width",(A.linewidth||0)+"px"),I.select(".bline").attr("d",T.showline?"M"+r+","+(n+a)+"h"+i:"M0,0").call(u.stroke,T.linecolor||"#000").style("stroke-width",(T.linewidth||0)+"px"),I.select(".cline").attr("d",S.showline?"M"+(r+i/2)+","+n+"l"+i/2+","+a:"M0,0").call(u.stroke,S.linecolor||"#000").style("stroke-width",(S.linewidth||0)+"px")},x.drawAxes=function(t){var e=this,r=e.graphDiv,n=e.id.substr(7)+"title",i=e.aaxis,a=e.baxis,o=e.caxis;if(p.doTicks(r,i,!0),p.doTicks(r,a,!0),p.doTicks(r,o,!0),t){var s=Math.max(i.showticklabels?i.tickfont.size/2:0,(o.showticklabels?.75*o.tickfont.size:0)+("outside"===o.ticks?.87*o.ticklen:0));g.draw(r,"a"+n,{propContainer:i,propName:e.id+".aaxis.title",dfltName:"Component A",attributes:{x:e.x0+e.w/2,y:e.y0-i.titlefont.size/3-s,"text-anchor":"middle"}});var l=(a.showticklabels?a.tickfont.size:0)+("outside"===a.ticks?a.ticklen:0)+3;g.draw(r,"b"+n,{propContainer:a,propName:e.id+".baxis.title",dfltName:"Component B",attributes:{x:e.x0-l,y:e.y0+e.h+.83*a.titlefont.size+l,"text-anchor":"middle"}}),g.draw(r,"c"+n,{propContainer:o,propName:e.id+".caxis.title",dfltName:"Component C",attributes:{x:e.x0+e.w+l,y:e.y0+e.h+.83*o.titlefont.size+l,"text-anchor":"middle"}})}};var w=b.MINZOOM/2+.87,M="m-0.87,.5h"+w+"v3h-"+(w+5.2)+"l"+(w/2+2.6)+",-"+(.87*w+4.5)+"l2.6,1.5l-"+w/2+","+.87*w+"Z",k="m0.87,.5h-"+w+"v3h"+(w+5.2)+"l-"+(w/2+2.6)+",-"+(.87*w+4.5)+"l-2.6,1.5l"+w/2+","+.87*w+"Z",A="m0,1l"+w/2+","+.87*w+"l2.6,-1.5l-"+(w/2+2.6)+",-"+(.87*w+4.5)+"l-"+(w/2+2.6)+","+(.87*w+4.5)+"l2.6,1.5l"+w/2+",-"+.87*w+"Z",T=!0;x.initInteractions=function(){function t(t,e,r){var n=j.getBoundingClientRect();x=e-n.left,w=r-n.top,S={a:O.aaxis.range[0],b:O.baxis.range[1],c:O.caxis.range[1]},L=S,E=O.aaxis.range[1]-S.a,C=o(O.graphDiv._fullLayout[O.id].bgcolor).getLuminance(),z="M0,"+O.h+"L"+O.w/2+", 0L"+O.w+","+O.h+"Z",D=!1,I=R.append("path").attr("class","zoombox").style({fill:C>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",z),P=R.append("path").attr("class","zoombox-corners").style({fill:u.background,stroke:u.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),p()}function e(t,e){return 1-e/O.h}function r(t,e){return 1-(t+(O.h-e)/Math.sqrt(3))/O.w}function n(t,e){return(t-(O.h-e)/Math.sqrt(3))/O.w}function a(t,i){var a=x+t,o=w+i,s=Math.max(0,Math.min(1,e(x,w),e(a,o))),l=Math.max(0,Math.min(1,r(x,w),r(a,o))),u=Math.max(0,Math.min(1,n(x,w),n(a,o))),c=(s/2+u)*O.w,h=(1-s/2-l)*O.w,f=(c+h)/2,d=h-c,p=(1-s)*O.h,m=p-d/_;d<b.MINZOOM?(L=S,I.attr("d",z),P.attr("d","M0,0Z")):(L={a:S.a+s*E,b:S.b+l*E,c:S.c+u*E},I.attr("d",z+"M"+c+","+p+"H"+h+"L"+f+","+m+"L"+c+","+p+"Z"),P.attr("d","M"+x+","+w+"m0.5,0.5h5v-2h-5v-5h-2v5h-5v2h5v5h2ZM"+c+","+p+M+"M"+h+","+p+k+"M"+f+","+m+A)),D||(I.transition().style("fill",C>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),P.transition().style("opacity",1).duration(200),D=!0)}function c(t,e){if(L===S)return 2===e&&g(),i(F);i(F);var r={};r[O.id+".aaxis.min"]=L.a,r[O.id+".baxis.min"]=L.b,r[O.id+".caxis.min"]=L.c,s.relayout(F,r),T&&F.data&&F._context.showTips&&(l.notifier("Double-click to<br>zoom back out","long"),T=!1)}function h(){S={a:O.aaxis.range[0],b:O.baxis.range[1],c:O.caxis.range[1]},L=S}function f(t,e){var r=t/O.xaxis._m,n=e/O.yaxis._m;L={a:S.a-n,b:S.b+(r+n)/2,c:S.c-(r-n)/2};var i=[L.a,L.b,L.c].sort(),a={a:i.indexOf(L.a),b:i.indexOf(L.b),c:i.indexOf(L.c)};i[0]<0&&(i[1]+i[0]/2<0?(i[2]+=i[0]+i[1],i[0]=i[1]=0):(i[2]+=i[0]/2,i[1]+=i[0]/2,i[0]=0),L={a:i[a.a],b:i[a.b],c:i[a.c]},e=(S.a-L.a)*O.yaxis._m,t=(S.c-L.c-S.b+L.b)*O.xaxis._m);var o="translate("+(O.x0+t)+","+(O.y0+e)+")";O.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",o),O.aaxis.range=[L.a,O.sum-L.b-L.c],O.baxis.range=[O.sum-L.a-L.c,L.b],O.caxis.range=[O.sum-L.a-L.b,L.c],O.drawAxes(!1),O.plotContainer.selectAll(".crisp").classed("crisp",!1)}function d(t,e){if(t){var r={};r[O.id+".aaxis.min"]=L.a,r[O.id+".baxis.min"]=L.b,r[O.id+".caxis.min"]=L.c,s.relayout(F,r)}else 2===e&&g()}function p(){O.plotContainer.selectAll(".select-outline").remove()}function g(){var t={};t[O.id+".aaxis.min"]=0,t[O.id+".baxis.min"]=0,t[O.id+".caxis.min"]=0,F.emit("plotly_doubleclick",null),s.relayout(F,t)}var x,w,S,E,L,C,z,D,I,P,O=this,j=O.layers.plotbg.select("path").node(),F=O.graphDiv,R=O.layers.zoom,N={element:j,gd:F,plotinfo:{plot:R},doubleclick:g,subplot:O.id,prepFn:function(e,r,n){N.xaxes=[O.xaxis],N.yaxes=[O.yaxis];var i=F._fullLayout.dragmode;e.shiftKey&&(i="pan"===i?"zoom":"pan"),N.minDrag="lasso"===i?1:void 0,"zoom"===i?(N.moveFn=a,N.doneFn=c,t(e,r,n)):"pan"===i?(N.moveFn=f,N.doneFn=d,h(),p()):"select"!==i&&"lasso"!==i||y(e,r,n,N,i)}};j.onmousemove=function(t){v.hover(F,t,O.id),F._fullLayout._lasthover=j,F._fullLayout._hoversubplot=O.id},j.onmouseout=function(t){F._dragging||m.unhover(F,t)},j.onclick=function(t){v.click(F,t)},m.init(N)}},{"../../components/color":590,"../../components/dragelement":611,"../../components/drawing":614,"../../components/fx":631,"../../components/titles":679,"../../lib":709,"../../lib/extend":701,"../../plotly":743,"../cartesian/axes":748,"../cartesian/constants":753,"../cartesian/select":764,"../cartesian/set_convert":765,"../plots":811,d3:118,tinycolor2:526}],826:[function(t,e,r){"use strict";function n(t){if(t.layoutAttributes){var e=t.layoutAttributes._arrayAttrRegexps;if(e)for(var n=0;n<e.length;n++)s(r.layoutArrayRegexes,e[n])}}function i(t){return"object"==typeof t&&(t=t.type),t}var a=t("./lib/loggers"),o=t("./lib/noop"),s=t("./lib/push_unique"),l=t("./plots/attributes");r.modules={},r.allCategories={},r.allTypes=[],r.subplotsRegistry={},r.transformsRegistry={},r.componentsRegistry={},r.layoutArrayContainers=[],r.layoutArrayRegexes=[],r.register=function(t,e,n,i){if(r.modules[e])return void a.log("Type "+e+" already registered");for(var o={},s=0;s<n.length;s++)o[n[s]]=!0,r.allCategories[n[s]]=!0;r.modules[e]={_module:t,categories:o},i&&Object.keys(i).length&&(r.modules[e].meta=i),r.allTypes.push(e)},r.registerSubplot=function(t){var e=t.name;if(r.subplotsRegistry[e])return void a.log("Plot type "+e+" already registered.");n(t),r.subplotsRegistry[e]=t},r.registerComponent=function(t){var e=t.name;r.componentsRegistry[e]=t,t.layoutAttributes&&(t.layoutAttributes._isLinkedToArray&&s(r.layoutArrayContainers,e),n(t))},r.getModule=function(t){if(void 0!==t.r)return a.warn("Tried to put a polar trace on an incompatible graph of cartesian data. Ignoring this dataset.",t),!1;var e=r.modules[i(t)];return!!e&&e._module},r.traceIs=function(t,e){if("various"===(t=i(t)))return!1;var n=r.modules[t];return n||(t&&"area"!==t&&a.log("Unrecognized trace type "+t+"."),n=r.modules[l.type.dflt]),!!n.categories[e]},r.getComponentMethod=function(t,e){var n=r.componentsRegistry[t];return n?n[e]||o:o}},{"./lib/loggers":712,"./lib/noop":716,"./lib/push_unique":720,"./plots/attributes":746}],827:[function(t,e,r){"use strict";function n(t){var e;switch(t){case"themes__thumb":e={autosize:!0,width:150,height:150,title:"",showlegend:!1,margin:{l:5,r:5,t:5,b:5,pad:0},annotations:[]};break;case"thumbnail":e={title:"",hidesources:!0,showlegend:!1,borderwidth:0,bordercolor:"",margin:{l:1,r:1,t:1,b:1,pad:0},annotations:[]};break;default:e={}}return e}function i(t){return["xaxis","yaxis","zaxis"].indexOf(t.slice(0,5))>-1}var a=t("../lib"),o=t("../plots/plots"),s=a.extendFlat,l=a.extendDeep;e.exports=function(t,e){t.framework&&t.framework.isPolar&&(t=t.framework.getConfig());var r,a=t.data,u=t.layout,c=l([],a),h=l({},u,n(e.tileClass)),f=t._context||{};if(e.width&&(h.width=e.width),e.height&&(h.height=e.height),"thumbnail"===e.tileClass||"themes__thumb"===e.tileClass){h.annotations=[];var d=Object.keys(h);for(r=0;r<d.length;r++)i(d[r])&&(h[d[r]].title="");for(r=0;r<c.length;r++){var p=c[r];p.showscale=!1,p.marker&&(p.marker.showscale=!1),"pie"===p.type&&(p.textposition="none")}}if(Array.isArray(e.annotations))for(r=0;r<e.annotations.length;r++)h.annotations.push(e.annotations[r]);var m=o.getSubplotIds(h,"gl3d");if(m.length){var v={};for("thumbnail"===e.tileClass&&(v={title:"",showaxeslabels:!1,showticklabels:!1,linetickenable:!1}),r=0;r<m.length;r++){var g=h[m[r]];g.xaxis||(g.xaxis={}),g.yaxis||(g.yaxis={}),g.zaxis||(g.zaxis={}),s(g.xaxis,v),s(g.yaxis,v),s(g.zaxis,v),g._scene=null}}var y=document.createElement("div");e.tileClass&&(y.className=e.tileClass);var b={gd:y,td:y,layout:h,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:f.mapboxAccessToken}};return"transparent"!==e.setBackground&&(b.config.setBackground=e.setBackground||"opaque"),b.gd.defaultLayout=n(e.tileClass),b}},{"../lib":709,"../plots/plots":811}],828:[function(t,e,r){"use strict";function n(t,e){return e=e||{},e.format=e.format||"png",new Promise(function(r,n){t._snapshotInProgress&&n(new Error("Snapshotting already in progress.")),a.isIE()&&"svg"!==e.format&&n(new Error("Sorry IE does not support downloading from canvas. Try {format:'svg'} instead.")),t._snapshotInProgress=!0;var s=i(t,e),l=e.filename||t.fn||"newplot";l+="."+e.format,s.then(function(e){return t._snapshotInProgress=!1,o(e,l)}).then(function(t){r(t)}).catch(function(e){t._snapshotInProgress=!1,n(e)})})}var i=t("../plot_api/to_image"),a=t("../lib"),o=t("./filesaver");e.exports=n},{"../lib":709,"../plot_api/to_image":741,"./filesaver":829}],829:[function(t,e,r){"use strict";var n=function(t,e){var r=document.createElement("a"),n="download"in r,i=/Version\/[\d\.]+.*Safari/.test(navigator.userAgent);return new Promise(function(a,o){"undefined"!=typeof navigator&&/MSIE [1-9]\./.test(navigator.userAgent)&&o(new Error("IE < 10 unsupported")),i&&(document.location.href="data:application/octet-stream"+t.slice(t.search(/[,;]/)),a(e)),e||(e="download"),n&&(r.href=t,r.download=e,document.body.appendChild(r),r.click(),document.body.removeChild(r),a(e)),"undefined"!=typeof navigator&&navigator.msSaveBlob&&(navigator.msSaveBlob(new Blob([t]),e),a(e)),o(new Error("download error"))})};e.exports=n},{}],830:[function(t,e,r){"use strict";r.getDelay=function(t){return t._has&&(t._has("gl3d")||t._has("gl2d"))?500:0},r.getRedrawFunc=function(t){if(!(t.data&&t.data[0]&&t.data[0].r))return function(){(t.calcdata||[]).forEach(function(t){t[0]&&t[0].t&&t[0].t.cb&&t[0].t.cb()})}}},{}],831:[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":827,"./download":828,"./helpers":830,"./svgtoimg":832,"./toimage":833,"./tosvg":834}],832:[function(t,e,r){"use strict";function n(t){var e=t.emitter||new a,r=new Promise(function(n,a){var o=window.Image,s=t.svg,l=t.format||"png";if(i.isIE()&&(s=s.replace(/"/gi,"'"),s=s.replace(/(\('#)(.*)('\))/gi,'("$2")'),s=s.replace(/(\\')/gi,'"'),"svg"!==l)){var u=new Error("Sorry IE does not support downloading from canvas. Try {format:'svg'} instead.");return a(u),t.promise?r:e.emit("error",u)}var c=t.canvas,h=c.getContext("2d"),f=new o,d="data:image/svg+xml,"+encodeURIComponent(s);c.height=t.height||150,c.width=t.width||300,f.onload=function(){var r;switch("svg"!==l&&h.drawImage(f,0,0),l){case"jpeg":r=c.toDataURL("image/jpeg");break;case"png":r=c.toDataURL("image/png");break;case"webp":r=c.toDataURL("image/webp");break;case"svg":r=d;break;default:if(a(new Error("Image format is not jpeg, png or svg")),!t.promise)return e.emit("error","Image format is not jpeg, png or svg")}n(r),t.promise||e.emit("success",r)},f.onerror=function(r){if(a(r),!t.promise)return e.emit("error",r)},f.src=d});return t.promise?r:e}var i=t("../lib"),a=t("events").EventEmitter;e.exports=n},{"../lib":709,events:125}],833:[function(t,e,r){"use strict";function n(t,e){function r(){var t=s.getDelay(f._fullLayout);setTimeout(function(){var t=u(f),r=document.createElement("canvas");r.id=o.randstr(),n=c({format:e.format,width:f._fullLayout.width,height:f._fullLayout.height,canvas:r,emitter:n,svg:t}),n.clean=function(){f&&document.body.removeChild(f)}},t)}var n=new i,h=l(t,{format:"png"}),f=h.gd;f.style.position="absolute",f.style.left="-5000px",document.body.appendChild(f);var d=s.getRedrawFunc(f);return a.plot(f,h.data,h.layout,h.config).then(d).then(r).catch(function(t){n.emit("error",t)}),n}var i=t("events").EventEmitter,a=t("../plotly"),o=t("../lib"),s=t("./helpers"),l=t("./cloneplot"),u=t("./tosvg"),c=t("./svgtoimg");e.exports=n},{"../lib":709,"../plotly":743,"./cloneplot":827,"./helpers":830,"./svgtoimg":832,"./tosvg":834,events:125}],834:[function(t,e,r){"use strict";var n=t("d3"),i=t("../lib/svg_text_utils"),a=t("../components/drawing"),o=t("../components/color"),s=t("../constants/xmlns_namespaces");e.exports=function(t,e){var r,l=t._fullLayout,u=l._paper,c=l._toppaper;u.insert("rect",":first-child").call(a.setRect,0,0,l.width,l.height).call(o.fill,l.paper_bgcolor);var h=l._basePlotModules||[];for(r=0;r<h.length;r++){var f=h[r];f.toSVG&&f.toSVG(t)}if(c){var d=c.node().childNodes,p=Array.prototype.slice.call(d);for(r=0;r<p.length;r++){var m=p[r];m.childNodes.length&&u.node().appendChild(m)}}l._draggers&&l._draggers.remove(),u.node().style.background="",u.selectAll("text").attr("data-unformatted",null).each(function(){var t=n.select(this);if("hidden"===t.style("visibility"))return void t.remove();t.style("visibility","visible");var e=t.style("font-family");e&&e.indexOf('"')!==-1&&t.style("font-family",e.replace(/"/g,"TOBESTRIPPED"))}),"pdf"!==e&&"eps"!==e||u.selectAll("#MathJax_SVG_glyphs path").attr("stroke-width",0),u.node().setAttributeNS(s.xmlns,"xmlns",s.svg),u.node().setAttributeNS(s.xmlns,"xmlns:xlink",s.xlink);var v=(new window.XMLSerializer).serializeToString(u.node());return v=i.html_entity_decode(v),v=i.xml_entity_encode(v),v=v.replace(/("TOBESTRIPPED)|(TOBESTRIPPED")/g,"'")}},{"../components/color":590,"../components/drawing":614,"../constants/xmlns_namespaces":692,"../lib/svg_text_utils":728,d3:118}],835:[function(t,e,r){"use strict";var n=t("../../lib").mergeArray;e.exports=function(t,e){n(e.text,t,"tx"),n(e.hovertext,t,"htx");var r=e.marker;if(r){n(r.opacity,t,"mo"),n(r.color,t,"mc");var i=r.line;i&&(n(i.color,t,"mlc"),n(i.width,t,"mlw"))}}},{"../../lib":709}],836:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../components/colorscale/color_attributes"),a=t("../../components/errorbars/attributes"),o=t("../../components/colorbar/attributes"),s=t("../../plots/font_attributes"),l=t("../../lib/extend").extendFlat,u=t("../../lib/extend").extendDeep,c=u({},s);c.family.arrayOk=!0,c.size.arrayOk=!0,c.color.arrayOk=!0;var h=n.marker,f=h.line,d=l({},f.width,{dflt:0}),p=l({},{width:d},i("marker.line")),m=l({},{line:p},i("marker"),{showscale:h.showscale,colorbar:o});e.exports={x:n.x,x0:n.x0,dx:n.dx,y:n.y,y0:n.y0,dy:n.dy,text:n.text,hovertext:n.hovertext,textposition:{
68 valType:"enumerated",values:["inside","outside","auto","none"],dflt:"none",arrayOk:!0},textfont:l({},c,{}),insidetextfont:l({},c,{}),outsidetextfont:l({},c,{}),orientation:{valType:"enumerated",values:["v","h"]},base:{valType:"any",dflt:null,arrayOk:!0},offset:{valType:"number",dflt:null,arrayOk:!0},width:{valType:"number",dflt:null,min:0,arrayOk:!0},marker:m,r:n.r,t:n.t,error_y:a,error_x:a,_deprecated:{bardir:{valType:"enumerated",values:["v","h"]}}}},{"../../components/colorbar/attributes":591,"../../components/colorscale/color_attributes":597,"../../components/errorbars/attributes":616,"../../lib/extend":701,"../../plots/font_attributes":772,"../scatter/attributes":1008}],837:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../plots/cartesian/axes"),a=t("../../components/colorscale/has_colorscale"),o=t("../../components/colorscale/calc"),s=t("./arrays_to_calcdata");e.exports=function(t,e){var r,l,u,c,h,f=i.getFromId(t,e.xaxis||"x"),d=i.getFromId(t,e.yaxis||"y"),p=e.orientation||(e.x&&!e.y?"h":"v");"h"===p?(r=f,u=f.makeCalcdata(e,"x"),l=d.makeCalcdata(e,"y"),h=e.xcalendar):(r=d,u=d.makeCalcdata(e,"y"),l=f.makeCalcdata(e,"x"),h=e.ycalendar);var m=Math.min(l.length,u.length),v=new Array(m);for(c=0;c<m;c++)v[c]={p:l[c],s:u[c]};var g,y=e.base;if(Array.isArray(y)){for(c=0;c<Math.min(y.length,v.length);c++)g=r.d2c(y[c],0,h),v[c].b=n(g)?g:0;for(;c<v.length;c++)v[c].b=0}else for(g=r.d2c(y,0,h),g=n(g)?g:0,c=0;c<v.length;c++)v[c].b=g;return a(e,"marker")&&o(e,e.marker.color,"marker","c"),a(e,"marker.line")&&o(e,e.marker.line.color,"marker.line","c"),s(v,e),v}},{"../../components/colorscale/calc":596,"../../components/colorscale/has_colorscale":603,"../../plots/cartesian/axes":748,"./arrays_to_calcdata":835,"fast-isnumeric":127}],838:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../components/color"),a=t("../scatter/xy_defaults"),o=t("../bar/style_defaults"),s=t("../../components/errorbars/defaults"),l=t("./attributes");e.exports=function(t,e,r,u){function c(r,i){return n.coerce(t,e,l,r,i)}var h=n.coerceFont;if(!a(t,e,u,c))return void(e.visible=!1);c("orientation",e.x&&!e.y?"h":"v"),c("base"),c("offset"),c("width"),c("text"),c("hovertext");var f=c("textposition"),d=Array.isArray(f)||"auto"===f,p=d||"inside"===f,m=d||"outside"===f;if(p||m){var v=h(c,"textfont",u.font);p&&h(c,"insidetextfont",v),m&&h(c,"outsidetextfont",v)}o(t,e,c,r,u),s(t,e,i.defaultLine,{axis:"y"}),s(t,e,i.defaultLine,{axis:"x",inherit:"y"})}},{"../../components/color":590,"../../components/errorbars/defaults":619,"../../lib":709,"../bar/style_defaults":847,"../scatter/xy_defaults":1030,"./attributes":836}],839:[function(t,e,r){"use strict";var n=t("../../components/fx"),i=t("../../components/errorbars"),a=t("../../components/color");e.exports=function(t,e,r,o){var s,l,u,c,h,f,d,p=t.cd,m=p[0].trace,v=p[0].t,g=t.xa,y=t.ya,b=function(t){return n.inbox(c(t)-s,h(t)-s)};"h"===m.orientation?(s=r,l=function(t){return t.y-t.w/2},u=function(t){return t.y+t.w/2},f=function(t){return n.inbox(t.b-e,t.x-e)+(t.x-e)/(t.x-t.b)},d=b):(s=e,l=function(t){return t.x-t.w/2},u=function(t){return t.x+t.w/2},d=function(t){return n.inbox(t.b-r,t.y-r)+(t.y-r)/(t.y-t.b)},f=b),c="closest"===o?l:function(t){return Math.min(l(t),t.p-v.bargroupwidth/2)},h="closest"===o?u:function(t){return Math.max(u(t),t.p+v.bargroupwidth/2)};var x=n.getDistanceFunction(o,f,d);if(n.getClosest(p,x,t),t.index!==!1){var _=t.index,w=p[_],M=w.mcc||m.marker.color,k=w.mlcc||m.marker.line.color,A=w.mlw||m.marker.line.width;a.opacity(M)?t.color=M:a.opacity(k)&&A&&(t.color=k);var T=m.base?w.b+w.s:w.s;return"h"===m.orientation?(t.x0=t.x1=g.c2p(w.x,!0),t.xLabelVal=T,t.y0=y.c2p(c(w),!0),t.y1=y.c2p(h(w),!0),t.yLabelVal=w.p):(t.y0=t.y1=y.c2p(w.y,!0),t.yLabelVal=T,t.x0=g.c2p(c(w),!0),t.x1=g.c2p(h(w),!0),t.xLabelVal=w.p),w.htx?t.text=w.htx:m.hovertext?t.text=m.hovertext:w.tx?t.text=w.tx:m.text&&(t.text=m.text),i.hoverInfo(w,m,t),[t]}}},{"../../components/color":590,"../../components/errorbars":620,"../../components/fx":631}],840:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.layoutAttributes=t("./layout_attributes"),n.supplyDefaults=t("./defaults"),n.supplyLayoutDefaults=t("./layout_defaults"),n.calc=t("./calc"),n.setPositions=t("./set_positions"),n.colorbar=t("../scatter/colorbar"),n.arraysToCalcdata=t("./arrays_to_calcdata"),n.plot=t("./plot"),n.style=t("./style"),n.hoverPoints=t("./hover"),n.moduleType="trace",n.name="bar",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","bar","oriented","markerColorscale","errorBarsOK","showLegend"],n.meta={},e.exports=n},{"../../plots/cartesian":758,"../scatter/colorbar":1011,"./arrays_to_calcdata":835,"./attributes":836,"./calc":837,"./defaults":838,"./hover":839,"./layout_attributes":841,"./layout_defaults":842,"./plot":843,"./set_positions":844,"./style":846}],841:[function(t,e,r){"use strict";e.exports={barmode:{valType:"enumerated",values:["stack","group","overlay","relative"],dflt:"group"},barnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:""},bargap:{valType:"number",min:0,max:1},bargroupgap:{valType:"number",min:0,max:1,dflt:0}}},{}],842:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../plots/cartesian/axes"),a=t("../../lib"),o=t("./layout_attributes");e.exports=function(t,e,r){function s(r,n){return a.coerce(t,e,o,r,n)}for(var l=!1,u=!1,c=!1,h={},f=0;f<r.length;f++){var d=r[f];if(n.traceIs(d,"bar")){if(l=!0,"overlay"!==t.barmode&&"stack"!==t.barmode){var p=d.xaxis+d.yaxis;h[p]&&(c=!0),h[p]=!0}if(d.visible&&"histogram"===d.type){"category"!==i.getFromId({_fullLayout:e},d["v"===d.orientation?"xaxis":"yaxis"]).type&&(u=!0)}}}if(l){"overlay"!==s("barmode")&&s("barnorm"),s("bargap",u&&!c?0:.2),s("bargroupgap")}}},{"../../lib":709,"../../plots/cartesian/axes":748,"../../registry":826,"./layout_attributes":841}],843:[function(t,e,r){"use strict";function n(t,e,r,n,o,f,d,p){function m(t,e,r){var n=t.append("text").attr("data-notex",1).text(e).attr({class:"bartext",transform:"","data-bb":"","text-anchor":"middle",x:0,y:0}).call(k.font,r);return n.call(w.convertToTspans),n.selectAll("tspan.line").attr({x:0,y:0}),n}var v=r[0].trace,g=v.orientation,y=s(v,n);if(y){var b=l(v,n);if("none"!==b){var x,_,M,A,T=u(v,n,t._fullLayout.font),S=c(v,n,T),E=h(v,n,T),L=t._fullLayout.barmode,C="stack"===L,z="relative"===L,I=C||z,P=r[n],O=!I||P._outmost,j=Math.abs(f-o)-2*D,F=Math.abs(p-d)-2*D;if("outside"===b&&(O||(b="inside")),"auto"===b)if(O){x=m(e,y,S),_=k.bBox(x.node()),M=_.width,A=_.height;var R=M>0&&A>0,N=M<=j&&A<=F,B=M<=F&&A<=j,U="h"===g?j>=M*(F/A):F>=A*(j/M);R&&(N||B||U)?b="inside":(b="outside",x.remove(),x=null)}else b="inside";if(!x&&(x=m(e,y,"outside"===b?E:S),_=k.bBox(x.node()),M=_.width,A=_.height,M<=0||A<=0))return void x.remove();var V;V="outside"===b?a(o,f,d,p,_,g):i(o,f,d,p,_,g),x.attr("transform",V)}}}function i(t,e,r,n,i,a){var s,l,u,c,h,f=i.width,d=i.height,p=(i.left+i.right)/2,m=(i.top+i.bottom)/2,v=Math.abs(e-t),g=Math.abs(n-r);v>2*D&&g>2*D?(h=D,v-=2*h,g-=2*h):h=0;var y,b;return f<=v&&d<=g?(y=!1,b=1):f<=g&&d<=v?(y=!0,b=1):f<d==v<g?(y=!1,b=Math.min(v/f,g/d)):(y=!0,b=Math.min(g/f,v/d)),y&&(y=90),y?(s=b*d,l=b*f):(s=b*f,l=b*d),"h"===a?e<t?(u=e+h+s/2,c=(r+n)/2):(u=e-h-s/2,c=(r+n)/2):n>r?(u=(t+e)/2,c=n-h-l/2):(u=(t+e)/2,c=n+h+l/2),o(p,m,u,c,b,y)}function a(t,e,r,n,i,a){var s,l="h"===a?Math.abs(n-r):Math.abs(e-t);l>2*D&&(s=D,l-=2*s);var u,c,h,f,d="h"===a?Math.min(1,l/i.height):Math.min(1,l/i.width),p=(i.left+i.right)/2,m=(i.top+i.bottom)/2;return u=d*i.width,c=d*i.height,"h"===a?e<t?(h=e-s-u/2,f=(r+n)/2):(h=e+s+u/2,f=(r+n)/2):n>r?(h=(t+e)/2,f=n+s+c/2):(h=(t+e)/2,f=n-s-c/2),o(p,m,h,f,d,!1)}function o(t,e,r,n,i,a){var o,s;return i<1?o="scale("+i+") ":(i=1,o=""),s=a?"rotate("+a+" "+t+" "+e+") ":"","translate("+(r-i*t)+" "+(n-i*e)+")"+o+s}function s(t,e){var r=d(t.text,e);return p(S,r)}function l(t,e){var r=d(t.textposition,e);return m(E,r)}function u(t,e,r){return f(L,t.textfont,e,r)}function c(t,e,r){return f(C,t.insidetextfont,e,r)}function h(t,e,r){return f(z,t.outsidetextfont,e,r)}function f(t,e,r,n){e=e||{};var i=d(e.family,r),a=d(e.size,r),o=d(e.color,r);return{family:p(t.family,i,n.family),size:v(t.size,a,n.size),color:g(t.color,o,n.color)}}function d(t,e){var r;return Array.isArray(t)?e<t.length&&(r=t[e]):r=t,r}function p(t,e,r){if("string"==typeof e){if(e||!t.noBlank)return e}else if("number"==typeof e&&!t.strict)return String(e);return void 0!==r?r:t.dflt}function m(t,e,r){return t.coerceNumber&&(e=+e),t.values.indexOf(e)!==-1?e:void 0!==r?r:t.dflt}function v(t,e,r){if(b(e)){e=+e;var n=t.min,i=t.max;if(!(void 0!==n&&e<n||void 0!==i&&e>i))return e}return void 0!==r?r:t.dflt}function g(t,e,r){return x(e).isValid()?e:void 0!==r?r:t.dflt}var y=t("d3"),b=t("fast-isnumeric"),x=t("tinycolor2"),_=t("../../lib"),w=t("../../lib/svg_text_utils"),M=t("../../components/color"),k=t("../../components/drawing"),A=t("../../components/errorbars"),T=t("./attributes"),S=T.text,E=T.textposition,L=T.textfont,C=T.insidetextfont,z=T.outsidetextfont,D=3;e.exports=function(t,e,r){var i=e.xaxis,a=e.yaxis,o=t._fullLayout,s=e.plot.select(".barlayer").selectAll("g.trace.bars").data(r);s.enter().append("g").attr("class","trace bars"),s.append("g").attr("class","points").each(function(e){var r=e[0].t,s=e[0].trace,l=r.poffset,u=Array.isArray(l);y.select(this).selectAll("g.point").data(_.identity).enter().append("g").classed("point",!0).each(function(r,c){function h(t){return 0===o.bargap&&0===o.bargroupgap?y.round(Math.round(t)-A,2):t}function f(t,e){return Math.abs(t-e)>=2?h(t):t>e?Math.ceil(t):Math.floor(t)}var d,p,m,v,g=r.p+(u?l[c]:l),x=g+r.w,_=r.b,w=_+r.s;if("h"===s.orientation?(m=a.c2p(g,!0),v=a.c2p(x,!0),d=i.c2p(_,!0),p=i.c2p(w,!0)):(d=i.c2p(g,!0),p=i.c2p(x,!0),m=a.c2p(_,!0),v=a.c2p(w,!0)),!(b(d)&&b(p)&&b(m)&&b(v)&&d!==p&&m!==v))return void y.select(this).remove();var k=(r.mlw+1||s.marker.line.width+1||(r.trace?r.trace.marker.line.width:0)+1)-1,A=y.round(k/2%1,2);if(!t._context.staticPlot){var T=M.opacity(r.mc||s.marker.color),S=T<1||k>.01?h:f;d=S(d,p),p=S(p,d),m=S(m,v),v=S(v,m)}var E=y.select(this);E.append("path").attr("d","M"+d+","+m+"V"+v+"H"+p+"V"+m+"Z"),n(t,E,e,c,d,p,m,v)})}),s.call(A.plot,e)}},{"../../components/color":590,"../../components/drawing":614,"../../components/errorbars":620,"../../lib":709,"../../lib/svg_text_utils":728,"./attributes":836,d3:118,"fast-isnumeric":127,tinycolor2:526}],844:[function(t,e,r){"use strict";function n(t,e,r,n){if(n.length){var s,l,u,c,h,f=t._fullLayout.barmode,d="overlay"===f,p="group"===f;if(d)i(t,e,r,n);else if(p){for(s=[],l=[],u=0;u<n.length;u++)c=n[u],h=c[0].trace,void 0===h.offset?l.push(c):s.push(c);l.length&&a(t,e,r,l),s.length&&i(t,e,r,s)}else{for(s=[],l=[],u=0;u<n.length;u++)c=n[u],h=c[0].trace,void 0===h.base?l.push(c):s.push(c);l.length&&o(t,e,r,l),s.length&&i(t,e,r,s)}}}function i(t,e,r,n){for(var i=t._fullLayout.barnorm,a=!i,o=0;o<n.length;o++){var l=n[o],u=new w([l],!1,a);s(t,e,u),i?(m(t,r,u),v(t,r,u)):d(t,r,u)}}function a(t,e,r,n){var i=t._fullLayout,a=i.barnorm,o=!a,s=new w(n,!1,o);l(t,e,s),a?(m(t,r,s),v(t,r,s)):d(t,r,s)}function o(t,e,r,n){var i=t._fullLayout,a=i.barmode,o="stack"===a,l="relative"===a,u=t._fullLayout.barnorm,c=l,h=!(u||o||l),f=new w(n,c,h);s(t,e,f),p(t,r,f);for(var d=0;d<n.length;d++)for(var m=n[d],g=0;g<m.length;g++){var y=m[g];if(y.s!==b){var x=y.b+y.s===f.get(y.p,y.s);x&&(y._outmost=!0)}}u&&v(t,r,f)}function s(t,e,r){var n,i,a,o,s=t._fullLayout,l=s.bargap,f=s.bargroupgap,d=r.minDiff,p=r.traces,m=d*(1-l),v=m,g=v*(1-f),y=-g/2;for(n=0;n<p.length;n++)i=p[n],a=i[0],o=a.t,o.barwidth=g,o.poffset=y,o.bargroupwidth=m;r.binWidth=p[0][0].t.barwidth/100,u(r),c(t,e,r),h(t,e,r)}function l(t,e,r){var n,i,a,o,s=t._fullLayout,l=s.bargap,f=s.bargroupgap,d=r.positions,p=r.distinctPositions,m=r.minDiff,v=r.traces,g=d.length!==p.length,y=v.length,b=m*(1-l),x=g?b/y:b,_=x*(1-f);for(n=0;n<y;n++){i=v[n],a=i[0];var w=g?((2*n+1-y)*x-_)/2:-_/2;o=a.t,o.barwidth=_,o.poffset=w,o.bargroupwidth=b}r.binWidth=v[0][0].t.barwidth/100,u(r),c(t,e,r),h(t,e,r,g)}function u(t){var e,r,n,i,a,o,s=t.traces;for(e=0;e<s.length;e++){r=s[e],n=r[0],i=n.trace,o=n.t;var l,u=i.offset,c=o.poffset;if(Array.isArray(u)){for(l=u.slice(0,r.length),a=0;a<l.length;a++)y(l[a])||(l[a]=c);for(a=l.length;a<r.length;a++)l.push(c);o.poffset=l}else void 0!==u&&(o.poffset=u);var h=i.width,f=o.barwidth;if(Array.isArray(h)){var d=h.slice(0,r.length);for(a=0;a<d.length;a++)y(d[a])||(d[a]=f);for(a=d.length;a<r.length;a++)d.push(f);if(o.barwidth=d,void 0===u){for(l=[],a=0;a<r.length;a++)l.push(c+(f-d[a])/2);o.poffset=l}}else void 0!==h&&(o.barwidth=h,void 0===u&&(o.poffset=c+(f-h)/2))}}function c(t,e,r){for(var n=r.traces,i=g(e),a=0;a<n.length;a++)for(var o=n[a],s=o[0].t,l=s.poffset,u=Array.isArray(l),c=s.barwidth,h=Array.isArray(c),f=0;f<o.length;f++){var d=o[f],p=d.w=h?c[f]:c;d[i]=d.p+(u?l[f]:l)+p/2}}function h(t,e,r,n){var i=r.traces,a=r.distinctPositions,o=a[0],s=r.minDiff,l=s/2;_.minDtick(e,s,o,n);for(var u=Math.min.apply(Math,a)-l,c=Math.max.apply(Math,a)+l,h=0;h<i.length;h++){var f=i[h],d=f[0],p=d.trace;if(void 0!==p.width||void 0!==p.offset)for(var m=d.t,v=m.poffset,g=m.barwidth,y=Array.isArray(v),b=Array.isArray(g),x=0;x<f.length;x++){var w=f[x],M=y?v[x]:v,k=b?g[x]:g,A=w.p,T=A+M,S=T+k;u=Math.min(u,T),c=Math.max(c,S)}}_.expand(e,[u,c],{padded:!1})}function f(t,e){y(t[0])?t[0]=Math.min(t[0],e):t[0]=e,y(t[1])?t[1]=Math.max(t[1],e):t[1]=e}function d(t,e,r){for(var n=r.traces,i=g(e),a=e.l2c(e.c2l(0)),o=[a,a],s=0;s<n.length;s++)for(var l=n[s],u=0;u<l.length;u++){var c=l[u],h=c.b,d=h+c.s;c[i]=d,y(e.c2l(d))&&f(o,d),y(e.c2l(h))&&f(o,h)}_.expand(e,o,{tozero:!0,padded:!0})}function p(t,e,r){var n,i,a,o,s=t._fullLayout,l=s.barnorm,u=g(e),c=r.traces,h=e.l2c(e.c2l(0)),d=[h,h];for(n=0;n<c.length;n++)for(i=c[n],a=0;a<i.length;a++)if(o=i[a],o.s!==b){var p=r.put(o.p,o.b+o.s),m=p+o.b+o.s;o.b=p,o[u]=m,l||(y(e.c2l(m))&&f(d,m),y(e.c2l(p))&&f(d,p))}l||_.expand(e,d,{tozero:!0,padded:!0})}function m(t,e,r){for(var n=r.traces,i=0;i<n.length;i++)for(var a=n[i],o=0;o<a.length;o++){var s=a[o];s.s!==b&&r.put(s.p,s.b+s.s)}}function v(t,e,r){function n(t){y(e.c2l(t))&&(t<l-s||t>u+s||!y(l))&&(h=!0,f(c,t))}for(var i=r.traces,a=g(e),o="fraction"===t._fullLayout.barnorm?1:100,s=o/1e9,l=e.l2c(e.c2l(0)),u="stack"===t._fullLayout.barmode?o:l,c=[l,u],h=!1,d=0;d<i.length;d++)for(var p=i[d],m=0;m<p.length;m++){var v=p[m];if(v.s!==b){var x=Math.abs(o/r.get(v.p,v.s));v.b*=x,v.s*=x;var w=v.b,M=w+v.s;v[a]=M,n(M),n(w)}}_.expand(e,c,{tozero:!0,padded:h})}function g(t){return t._id.charAt(0)}var y=t("fast-isnumeric"),b=t("../../constants/numerical").BADNUM,x=t("../../registry"),_=t("../../plots/cartesian/axes"),w=t("./sieve.js");e.exports=function(t,e){var r,i=e.xaxis,a=e.yaxis,o=t._fullData,s=t.calcdata,l=[],u=[];for(r=0;r<o.length;r++){var c=o[r];c.visible===!0&&x.traceIs(c,"bar")&&c.xaxis===i._id&&c.yaxis===a._id&&("h"===c.orientation?l.push(s[r]):u.push(s[r]))}n(t,i,a,u),n(t,a,i,l)}},{"../../constants/numerical":690,"../../plots/cartesian/axes":748,"../../registry":826,"./sieve.js":845,"fast-isnumeric":127}],845:[function(t,e,r){"use strict";function n(t,e,r){this.traces=t,this.separateNegativeValues=e,this.dontMergeOverlappingData=r;for(var n=[],o=0;o<t.length;o++)for(var s=t[o],l=0;l<s.length;l++){var u=s[l];u.p!==a&&n.push(u.p)}this.positions=n;var c=i.distinctVals(this.positions);this.distinctPositions=c.vals,this.minDiff=c.minDiff,this.binWidth=this.minDiff,this.bins={}}e.exports=n;var i=t("../../lib"),a=t("../../constants/numerical").BADNUM;n.prototype.put=function(t,e){var r=this.getLabel(t,e),n=this.bins[r]||0;return this.bins[r]=n+e,n},n.prototype.get=function(t,e){var r=this.getLabel(t,e);return this.bins[r]||0},n.prototype.getLabel=function(t,e){return(e<0&&this.separateNegativeValues?"v":"^")+(this.dontMergeOverlappingData?t:Math.round(t/this.binWidth))}},{"../../constants/numerical":690,"../../lib":709}],846:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../components/color"),a=t("../../components/drawing"),o=t("../../components/errorbars");e.exports=function(t){var e=n.select(t).selectAll("g.trace.bars"),r=e.size(),s=t._fullLayout;e.style("opacity",function(t){return t[0].trace.opacity}).each(function(t){("stack"===s.barmode&&r>1||0===s.bargap&&0===s.bargroupgap&&!t[0].trace.marker.line.width)&&n.select(this).attr("shape-rendering","crispEdges")}),e.selectAll("g.points").each(function(t){var e=t[0].trace,r=e.marker,o=r.line,s=a.tryColorscale(r,""),l=a.tryColorscale(r,"line");n.select(this).selectAll("path").each(function(t){var e,a,u=(t.mlw+1||o.width+1)-1,c=n.select(this);e="mc"in t?t.mcc=s(t.mc):Array.isArray(r.color)?i.defaultLine:r.color,c.style("stroke-width",u+"px").call(i.fill,e),u&&(a="mlc"in t?t.mlcc=l(t.mlc):Array.isArray(o.color)?i.defaultLine:o.color,c.call(i.stroke,a))})}),e.call(o.style)}},{"../../components/color":590,"../../components/drawing":614,"../../components/errorbars":620,d3:118}],847:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../components/colorscale/has_colorscale"),a=t("../../components/colorscale/defaults");e.exports=function(t,e,r,o,s){r("marker.color",o),i(t,"marker")&&a(t,e,s,r,{prefix:"marker.",cLetter:"c"}),r("marker.line.color",n.defaultLine),i(t,"marker.line")&&a(t,e,s,r,{prefix:"marker.line.",cLetter:"c"}),r("marker.line.width")}},{"../../components/color":590,"../../components/colorscale/defaults":599,"../../components/colorscale/has_colorscale":603}],848:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../components/color/attributes"),a=t("../../lib/extend").extendFlat,o=n.marker,s=o.line;e.exports={y:{valType:"data_array"},x:{valType:"data_array"},x0:{valType:"any"},y0:{valType:"any"},xcalendar:n.xcalendar,ycalendar:n.ycalendar,whiskerwidth:{valType:"number",min:0,max:1,dflt:.5},boxpoints:{valType:"enumerated",values:["all","outliers","suspectedoutliers",!1],dflt:"outliers"},boxmean:{valType:"enumerated",values:[!0,"sd",!1],dflt:!1},jitter:{valType:"number",min:0,max:1},pointpos:{valType:"number",min:-2,max:2},orientation:{valType:"enumerated",values:["v","h"]},marker:{outliercolor:{valType:"color",dflt:"rgba(0, 0, 0, 0)"},symbol:a({},o.symbol,{arrayOk:!1}),opacity:a({},o.opacity,{arrayOk:!1,dflt:1}),size:a({},o.size,{arrayOk:!1}),color:a({},o.color,{arrayOk:!1}),line:{color:a({},s.color,{arrayOk:!1,dflt:i.defaultLine}),width:a({},s.width,{arrayOk:!1,dflt:0}),outliercolor:{valType:"color"},outlierwidth:{valType:"number",min:0,dflt:1}}},line:{color:{valType:"color"},width:{valType:"number",min:0,dflt:2}},fillcolor:n.fillcolor}},{"../../components/color/attributes":589,"../../lib/extend":701,"../scatter/attributes":1008}],849:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../plots/cartesian/axes");e.exports=function(t,e){var r,o,s,l,u,c,h,f,d,p=a.getFromId(t,e.xaxis||"x"),m=a.getFromId(t,e.yaxis||"y"),v=e.orientation,g=[];"h"===v?(r=p,o="x",u=m,c="y"):(r=m,o="y",u=p,c="x"),s=r.makeCalcdata(e,o),a.expand(r,s,{padded:!0}),h=function(t,e,r,a,o){var s;return r in e?h=a.makeCalcdata(e,r):(s=r+"0"in e?e[r+"0"]:"name"in e&&("category"===a.type||n(e.name)&&["linear","log"].indexOf(a.type)!==-1||i.isDateTime(e.name)&&"date"===a.type)?e.name:t.numboxes,s=a.d2c(s,0,e[r+"calendar"]),h=o.map(function(){return s})),h}(t,e,c,u,s);var y=i.distinctVals(h);return f=y.vals,d=y.minDiff/2,l=function(t,e,r,a,o){var s,l,u,c,h=a.length,f=e.length,d=[],p=[];for(s=0;s<h;++s)l=a[s],t[s]={pos:l},p[s]=l-o,d[s]=[];for(p.push(a[h-1]+o),s=0;s<f;++s)c=e[s],n(c)&&(u=i.findBin(r[s],p))>=0&&u<f&&d[u].push(c);return d}(g,s,h,f,d),function(t,e){var r,n,a,o;for(o=0;o<e.length;++o)r=e[o].sort(i.sorterAsc),n=r.length,a=t[o],a.val=r,a.min=r[0],a.max=r[n-1],a.mean=i.mean(r,n),a.sd=i.stdev(r,n,a.mean),a.q1=i.interp(r,.25),a.med=i.interp(r,.5),a.q3=i.interp(r,.75),a.lf=Math.min(a.q1,r[Math.min(i.findBin(2.5*a.q1-1.5*a.q3,r,!0)+1,n-1)]),a.uf=Math.max(a.q3,r[Math.max(i.findBin(2.5*a.q3-1.5*a.q1,r),0)]),a.lo=4*a.q1-3*a.q3,a.uo=4*a.q3-3*a.q1}(g,l),g=g.filter(function(t){return t.val&&t.val.length}),g.length?(g[0].t={boxnum:t.numboxes,dPos:d},t.numboxes++,g):[{t:{emptybox:!0}}]}},{"../../lib":709,"../../plots/cartesian/axes":748,"fast-isnumeric":127}],850:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry"),a=t("../../components/color"),o=t("./attributes");e.exports=function(t,e,r,s){function l(r,i){return n.coerce(t,e,o,r,i)}var u,c=l("y"),h=l("x");if(c&&c.length)u="v",h||l("x0");else{if(!h||!h.length)return void(e.visible=!1);u="h",l("y0")}i.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],s),l("orientation",u),l("line.color",(t.marker||{}).color||r),l("line.width",2),l("fillcolor",a.addOpacity(e.line.color,.5)),l("whiskerwidth"),l("boxmean");var f=n.coerce2(t,e,o,"marker.outliercolor"),d=l("marker.line.outliercolor"),p=f||d?l("boxpoints","suspectedoutliers"):l("boxpoints");p&&(l("jitter","all"===p?.3:0),l("pointpos","all"===p?-1.5:0),l("marker.symbol"),l("marker.opacity"),l("marker.size"),l("marker.color",e.line.color),l("marker.line.color"),l("marker.line.width"),"suspectedoutliers"===p&&(l("marker.line.outliercolor",e.marker.color),l("marker.line.outlierwidth")))}},{"../../components/color":590,"../../lib":709,"../../registry":826,"./attributes":848}],851:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("../../lib"),a=t("../../components/fx"),o=t("../../components/color");e.exports=function(t,e,r,s){var l,u,c,h,f,d,p,m,v,g=t.cd,y=g[0].trace,b=g[0].t,x=t.xa,_=t.ya,w=[];if(h="closest"===s?2.5*b.bdPos:b.bdPos,"h"===y.orientation?(l=function(t){return a.inbox(t.min-e,t.max-e)},u=function(t){var e=t.pos+b.bPos-r;return a.inbox(e-h,e+h)},f="y",d=_,m="x",v=x):(l=function(t){var r=t.pos+b.bPos-e;return a.inbox(r-h,r+h)},u=function(t){return a.inbox(t.min-r,t.max-r)},f="x",d=x,m="y",v=_),c=a.getDistanceFunction(s,l,u),a.getClosest(g,c,t),t.index!==!1){var M=g[t.index],k=y.line.color,A=(y.marker||{}).color;o.opacity(k)&&y.line.width?t.color=k:o.opacity(A)&&y.boxpoints?t.color=A:t.color=y.fillcolor,t[f+"0"]=d.c2p(M.pos+b.bPos-b.bdPos,!0),t[f+"1"]=d.c2p(M.pos+b.bPos+b.bdPos,!0),n.tickText(d,d.c2l(M.pos),"hover").text,t[f+"LabelVal"]=M.pos;var T,S,E={},L=["med","min","q1","q3","max"];y.boxmean&&L.push("mean"),y.boxpoints&&[].push.apply(L,["lf","uf"]);for(var C=0;C<L.length;C++)(T=L[C])in M&&!(M[T]in E)&&(E[M[T]]=!0,p=v.c2p(M[T],!0),S=i.extendFlat({},t),S[m+"0"]=S[m+"1"]=p,S[m+"LabelVal"]=M[T],S.attr=T,"mean"===T&&"sd"in M&&"sd"===y.boxmean&&(S[m+"err"]=M.sd),t.name="",w.push(S));return w}}},{"../../components/color":590,"../../components/fx":631,"../../lib":709,"../../plots/cartesian/axes":748}],852:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.layoutAttributes=t("./layout_attributes"),n.supplyDefaults=t("./defaults"),n.supplyLayoutDefaults=t("./layout_defaults"),n.calc=t("./calc"),n.setPositions=t("./set_positions"),n.plot=t("./plot"),n.style=t("./style"),n.hoverPoints=t("./hover"),n.moduleType="trace",n.name="box",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","symbols","oriented","box","showLegend"],n.meta={},e.exports=n},{"../../plots/cartesian":758,"./attributes":848,"./calc":849,"./defaults":850,"./hover":851,"./layout_attributes":853,"./layout_defaults":854,"./plot":855,"./set_positions":856,"./style":857}],853:[function(t,e,r){"use strict";e.exports={boxmode:{valType:"enumerated",values:["group","overlay"],dflt:"overlay"},boxgap:{valType:"number",min:0,max:1,dflt:.3},boxgroupgap:{valType:"number",min:0,max:1,dflt:.3}}},{}],854:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e,r){function o(r,n){return i.coerce(t,e,a,r,n)}for(var s,l=0;l<r.length;l++)if(n.traceIs(r[l],"box")){s=!0;break}s&&(o("boxmode"),o("boxgap"),o("boxgroupgap"))}},{"../../lib":709,"../../registry":826,"./layout_attributes":853}],855:[function(t,e,r){"use strict";function n(){l=2e9}function i(){var t=l;return l=(69069*l+1)%4294967296,Math.abs(l-t)<429496729?i():l/4294967296}var a=t("d3"),o=t("../../lib"),s=t("../../components/drawing"),l=2e9;e.exports=function(t,e,r){var l,u,c=t._fullLayout,h=e.xaxis,f=e.yaxis;e.plot.select(".boxlayer").selectAll("g.trace.boxes").data(r).enter().append("g").attr("class","trace boxes").each(function(e){var r=e[0].t,d=e[0].trace,p="group"===c.boxmode&&t.numboxes>1,m=r.dPos*(1-c.boxgap)*(1-c.boxgroupgap)/(p?t.numboxes:1),v=p?2*r.dPos*(-.5+(r.boxnum+.5)/t.numboxes)*(1-c.boxgap):0,g=m*d.whiskerwidth;if(d.visible!==!0||r.emptybox)return void a.select(this).remove();"h"===d.orientation?(l=f,u=h):(l=h,u=f),r.bPos=v,r.bdPos=m,n(),a.select(this).selectAll("path.box").data(o.identity).enter().append("path").attr("class","box").each(function(t){var e=l.c2p(t.pos+v,!0),r=l.c2p(t.pos+v-m,!0),n=l.c2p(t.pos+v+m,!0),i=l.c2p(t.pos+v-g,!0),s=l.c2p(t.pos+v+g,!0),c=u.c2p(t.q1,!0),h=u.c2p(t.q3,!0),f=o.constrain(u.c2p(t.med,!0),Math.min(c,h)+1,Math.max(c,h)-1),p=u.c2p(d.boxpoints===!1?t.min:t.lf,!0),y=u.c2p(d.boxpoints===!1?t.max:t.uf,!0);"h"===d.orientation?a.select(this).attr("d","M"+f+","+r+"V"+n+"M"+c+","+r+"V"+n+"H"+h+"V"+r+"ZM"+c+","+e+"H"+p+"M"+h+","+e+"H"+y+(0===d.whiskerwidth?"":"M"+p+","+i+"V"+s+"M"+y+","+i+"V"+s)):a.select(this).attr("d","M"+r+","+f+"H"+n+"M"+r+","+c+"H"+n+"V"+h+"H"+r+"ZM"+e+","+c+"V"+p+"M"+e+","+h+"V"+y+(0===d.whiskerwidth?"":"M"+i+","+p+"H"+s+"M"+i+","+y+"H"+s))}),d.boxpoints&&a.select(this).selectAll("g.points").data(function(t){return t.forEach(function(t){t.t=r,t.trace=d}),t}).enter().append("g").attr("class","points").selectAll("path").data(function(t){var e,r,n,a,s,l,u,c="all"===d.boxpoints?t.val:t.val.filter(function(e){return e<t.lf||e>t.uf}),h=Math.max((t.max-t.min)/10,t.q3-t.q1),f=1e-9*h,p=.01*h,g=[],y=0;if(d.jitter){if(0===h)for(y=1,g=new Array(c.length),e=0;e<c.length;e++)g[e]=1;else for(e=0;e<c.length;e++)r=Math.max(0,e-5),a=c[r],n=Math.min(c.length-1,e+5),s=c[n],"all"!==d.boxpoints&&(c[e]<t.lf?s=Math.min(s,t.lf):a=Math.max(a,t.uf)),l=Math.sqrt(p*(n-r)/(s-a+f))||0,l=o.constrain(Math.abs(l),0,1),g.push(l),y=Math.max(l,y);u=2*d.jitter/y}return c.map(function(e,r){var n,a=d.pointpos;return d.jitter&&(a+=u*g[r]*(i()-.5)),n="h"===d.orientation?{y:t.pos+a*m+v,x:e}:{x:t.pos+a*m+v,y:e},"suspectedoutliers"===d.boxpoints&&e<t.uo&&e>t.lo&&(n.so=!0),n})}).enter().append("path").call(s.translatePoints,h,f),d.boxmean&&a.select(this).selectAll("path.mean").data(o.identity).enter().append("path").attr("class","mean").style("fill","none").each(function(t){var e=l.c2p(t.pos+v,!0),r=l.c2p(t.pos+v-m,!0),n=l.c2p(t.pos+v+m,!0),i=u.c2p(t.mean,!0),o=u.c2p(t.mean-t.sd,!0),s=u.c2p(t.mean+t.sd,!0);"h"===d.orientation?a.select(this).attr("d","M"+i+","+r+"V"+n+("sd"!==d.boxmean?"":"m0,0L"+o+","+e+"L"+i+","+r+"L"+s+","+e+"Z")):a.select(this).attr("d","M"+r+","+i+"H"+n+("sd"!==d.boxmean?"":"m0,0L"+e+","+o+"L"+r+","+i+"L"+e+","+s+"Z"))})})}},{"../../components/drawing":614,"../../lib":709,d3:118}],856:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../plots/cartesian/axes"),a=t("../../lib");e.exports=function(t,e){var r,o,s,l,u=t._fullLayout,c=e.xaxis,h=e.yaxis,f=["v","h"];for(o=0;o<f.length;++o){var d,p,m,v=f[o],g=[],y=[],b=0,x=0;for(r="h"===v?h:c,s=0;s<t.calcdata.length;++s)d=t.calcdata[s],p=d[0].t,m=d[0].trace,m.visible===!0&&n.traceIs(m,"box")&&!p.emptybox&&m.orientation===v&&m.xaxis===c._id&&m.yaxis===h._id&&(g.push(s),m.boxpoints!==!1&&(b=Math.max(b,m.jitter-m.pointpos-1),x=Math.max(x,m.jitter+m.pointpos-1)));for(s=0;s<g.length;s++)for(d=t.calcdata[g[s]],l=0;l<d.length;l++)y.push(d[l].pos);if(y.length){var _=a.distinctVals(y),w=_.minDiff/2;for(y.length===_.vals.length&&(t.numboxes=1),i.minDtick(r,_.minDiff,_.vals[0],!0),o=0;o<g.length;o++){var M=g[o];t.calcdata[M][0].t.dPos=w}var k=(1-u.boxgap)*(1-u.boxgroupgap)*w/t.numboxes;i.expand(r,_.vals,{vpadminus:w+b*k,vpadplus:w+x*k})}}}},{"../../lib":709,"../../plots/cartesian/axes":748,"../../registry":826}],857:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../components/color"),a=t("../../components/drawing");e.exports=function(t){n.select(t).selectAll("g.trace.boxes").style("opacity",function(t){return t[0].trace.opacity}).each(function(t){var e=t[0].trace,r=e.line.width;n.select(this).selectAll("path.box").style("stroke-width",r+"px").call(i.stroke,e.line.color).call(i.fill,e.fillcolor),n.select(this).selectAll("path.mean").style({"stroke-width":r,"stroke-dasharray":2*r+"px,"+r+"px"}).call(i.stroke,e.line.color),n.select(this).selectAll("g.points path").call(a.pointStyle,e)})}},{"../../components/color":590,"../../components/drawing":614,d3:118}],858:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../ohlc/attributes"),a=t("../box/attributes"),o={name:i.increasing.name,showlegend:i.increasing.showlegend,line:{color:n.extendFlat({},a.line.color),width:n.extendFlat({},a.line.width)},fillcolor:n.extendFlat({},a.fillcolor)};e.exports={x:i.x,open:i.open,high:i.high,low:i.low,close:i.close,line:{width:n.extendFlat({},a.line.width,{})},increasing:n.extendDeep({},o,{line:{color:{dflt:i.increasing.line.color.dflt}}}),decreasing:n.extendDeep({},o,{line:{color:{dflt:i.decreasing.line.color.dflt}}}),text:i.text,whiskerwidth:n.extendFlat({},a.whiskerwidth,{dflt:0})}},{"../../lib":709,"../box/attributes":848,"../ohlc/attributes":967}],859:[function(t,e,r){"use strict";function n(t,e,r,n){o(t,e,r,n),r(n+".line.color"),r(n+".line.width",e.line.width),r(n+".fillcolor")}var i=t("../../lib"),a=t("../ohlc/ohlc_defaults"),o=t("../ohlc/direction_defaults"),s=t("../ohlc/helpers"),l=t("./attributes");e.exports=function(t,e,r,o){function u(r,n){return i.coerce(t,e,l,r,n)}if(s.pushDummyTransformOpts(t,e),0===a(t,e,u,o))return void(e.visible=!1);u("line.width"),n(t,e,u,"increasing"),n(t,e,u,"decreasing"),u("text"),u("whiskerwidth")}},{"../../lib":709,"../ohlc/direction_defaults":969,"../ohlc/helpers":970,"../ohlc/ohlc_defaults":972,"./attributes":858}],860:[function(t,e,r){"use strict";var n=t("../../plot_api/register");e.exports={moduleType:"trace",name:"candlestick",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","showLegend","candlestick"],meta:{},attributes:t("./attributes"),supplyDefaults:t("./defaults")},n(t("../box")),n(t("./transform"))},{"../../plot_api/register":738,"../../plots/cartesian":758,"../box":852,"./attributes":858,"./defaults":859,"./transform":861}],861:[function(t,e,r){"use strict";function n(t,e,r){var n={type:"box",boxpoints:!1,visible:t.visible,hoverinfo:t.hoverinfo,opacity:t.opacity,xaxis:t.xaxis,yaxis:t.yaxis,transforms:a.makeTransform(t,e,r)},o=t[r];return o&&i.extendFlat(n,{x:t.x||[0],xcalendar:t.xcalendar,y:[].concat(t.low).concat(t.high),whiskerwidth:t.whiskerwidth,text:t.text,name:o.name,showlegend:o.showlegend,line:o.line,fillcolor:o.fillcolor}),n}var i=t("../../lib"),a=t("../ohlc/helpers");r.moduleType="transform",r.name="candlestick",r.attributes={},r.supplyDefaults=function(t,e,r,n){return a.clearEphemeralTransformOpts(n),a.copyOHLC(t,e),t},r.transform=function(t,e){for(var r=[],i=0;i<t.length;i++){var o=t[i];"candlestick"===o.type?r.push(n(o,e,"increasing"),n(o,e,"decreasing")):r.push(o)}return a.addRangeSlider(r,e.layout),r},r.calcTransform=function(t,e,r){for(var n=r.direction,i=a.getFilterFn(n),o=e.open,s=e.high,l=e.low,u=e.close,c=o.length,h=[],f=[],d=e._fullInput.x?function(t){var r=e.x[t];h.push(r,r,r,r,r,r)}:function(t){h.push(t,t,t,t,t,t)},p=0;p<c;p++)i(o[p],u[p])&&(d(p),function(t,e,r,n){f.push(r,t,n,n,n,e)}(o[p],s[p],l[p],u[p]));e.x=h,e.y=f}},{"../../lib":709,"../ohlc/helpers":970}],862:[function(t,e,r){"use strict";function n(t,e,r,n){["aaxis","baxis"].forEach(function(a){var o=a.charAt(0),s=t[a]||{},l={},u={tickfont:"x",id:o+"axis",letter:o,font:e.font,name:a,data:t[o],calendar:e.calendar,dfltColor:n,bgColor:r.paper_bgcolor,fullLayout:r};i(s,l,u),l._categories=l._categories||[],e[a]=l,t[a]||"-"===s.type||(t[a]={type:s.type})})}var i=t("./axis_defaults");e.exports=function(t,e,r,i,a){i("a")||(i("da"),i("a0")),
69 i("b")||(i("db"),i("b0")),n(t,e,r,a)}},{"./axis_defaults":867}],863:[function(t,e,r){"use strict";function n(t,e){if(!Array.isArray(t)||e>=10)return null;for(var r=1/0,i=-1/0,a=t.length,o=0;o<a;o++){var s=t[o];if(Array.isArray(s)){var l=n(s,e+1);l&&(r=Math.min(l[0],r),i=Math.max(l[1],i))}else r=Math.min(s,r),i=Math.max(s,i)}return[r,i]}e.exports=function(t){return n(t,0)}},{}],864:[function(t,e,r){"use strict";var n=t("../../lib/extend").extendFlat,i=t("../../plots/font_attributes"),a=t("./axis_attributes"),o=t("../../components/color/attributes");e.exports={carpet:{valType:"string"},x:{valType:"data_array"},y:{valType:"data_array"},a:{valType:"data_array"},a0:{valType:"number",dflt:0},da:{valType:"number",dflt:1},b:{valType:"data_array"},b0:{valType:"number",dflt:0},db:{valType:"number",dflt:1},cheaterslope:{valType:"number",dflt:1},aaxis:n({},a),baxis:n({},a),font:{family:n({},i.family,{dflt:'"Open Sans", verdana, arial, sans-serif'}),size:n({},i.size,{dflt:12}),color:n({},i.color,{dflt:o.defaultLine})},color:{valType:"color",dflt:o.defaultLine}}},{"../../components/color/attributes":589,"../../lib/extend":701,"../../plots/font_attributes":772,"./axis_attributes":866}],865:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){var i,a,o,s,l,u,c,h,f,d,p,m,v,g=Array.isArray(r)?"a":"b",y="a"===g?t.aaxis:t.baxis,b=y.smoothing,x="a"===g?t.a2i:t.b2j,_="a"===g?r:n,w="a"===g?n:r,M="a"===g?e.a.length:e.b.length,k="a"===g?e.b.length:e.a.length,A=Math.floor("a"===g?t.b2j(w):t.a2i(w)),T="a"===g?function(e){return t.evalxy([],e,A)}:function(e){return t.evalxy([],A,e)};b&&(o=Math.max(0,Math.min(k-2,A)),s=A-o,a="a"===g?function(e,r){return t.dxydi([],e,o,r,s)}:function(e,r){return t.dxydj([],o,e,s,r)});var S=x(_[0]),E=x(_[1]),L=S<E?1:-1,C=1e-8*(E-S),z=L>0?Math.floor:Math.ceil,D=L>0?Math.ceil:Math.floor,I=L>0?Math.min:Math.max,P=L>0?Math.max:Math.min,O=z(S+C),j=D(E-C);c=T(S);var F=[[c]];for(i=O;i*L<j*L;i+=L)l=[],p=P(S,i),m=I(E,i+L),v=m-p,u=Math.max(0,Math.min(M-2,Math.floor(.5*(p+m)))),h=T(m),b&&(f=a(u,p-u),d=a(u,m-u),l.push([c[0]+f[0]/3*v,c[1]+f[1]/3*v]),l.push([h[0]-d[0]/3*v,h[1]-d[1]/3*v])),l.push(h),F.push(l),c=h;return F}},{}],866:[function(t,e,r){"use strict";var n=t("../../lib/extend").extendFlat,i=t("../../plots/font_attributes"),a=t("../../components/color/attributes");e.exports={color:{valType:"color"},smoothing:{valType:"number",dflt:1,min:0,max:1.3},title:{valType:"string"},titlefont:n({},i,{}),titleoffset:{valType:"number",dflt:10},type:{valType:"enumerated",values:["-","linear","date","category"],dflt:"-"},autorange:{valType:"enumerated",values:[!0,!1,"reversed"],dflt:!0},rangemode:{valType:"enumerated",values:["normal","tozero","nonnegative"],dflt:"normal"},range:{valType:"info_array",items:[{valType:"any"},{valType:"any"}]},fixedrange:{valType:"boolean",dflt:!1},cheatertype:{valType:"enumerated",values:["index","value"],dflt:"value"},tickmode:{valType:"enumerated",values:["linear","array"],dflt:"array"},nticks:{valType:"integer",min:0,dflt:0},tickvals:{valType:"data_array"},ticktext:{valType:"data_array"},showticklabels:{valType:"enumerated",values:["start","end","both","none"],dflt:"start"},tickfont:n({},i,{}),tickangle:{valType:"angle",dflt:"auto"},tickprefix:{valType:"string",dflt:""},showtickprefix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all"},ticksuffix:{valType:"string",dflt:""},showticksuffix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all"},showexponent:{valType:"enumerated",values:["all","first","last","none"],dflt:"all"},exponentformat:{valType:"enumerated",values:["none","e","E","power","SI","B"],dflt:"B"},separatethousands:{valType:"boolean",dflt:!1},tickformat:{valType:"string",dflt:""},categoryorder:{valType:"enumerated",values:["trace","category ascending","category descending","array"],dflt:"trace"},categoryarray:{valType:"data_array"},labelpadding:{valType:"integer",dflt:10},labelprefix:{valType:"string"},labelsuffix:{valType:"string",dflt:""},showline:{valType:"boolean",dflt:!1},linecolor:{valType:"color",dflt:a.defaultLine},linewidth:{valType:"number",min:0,dflt:1},gridcolor:{valType:"color"},gridwidth:{valType:"number",min:0,dflt:1},showgrid:{valType:"boolean",dflt:!0},minorgridcount:{valType:"integer",min:0,dflt:0},minorgridwidth:{valType:"number",min:0,dflt:1},minorgridcolor:{valType:"color",dflt:a.lightLine},startline:{valType:"boolean"},startlinecolor:{valType:"color"},startlinewidth:{valType:"number",dflt:1},endline:{valType:"boolean"},endlinewidth:{valType:"number",dflt:1},endlinecolor:{valType:"color"},tick0:{valType:"number",min:0,dflt:0},dtick:{valType:"number",min:0,dflt:1},arraytick0:{valType:"integer",min:0,dflt:0},arraydtick:{valType:"integer",min:1,dflt:1}}},{"../../components/color/attributes":589,"../../lib/extend":701,"../../plots/font_attributes":772}],867:[function(t,e,r){"use strict";function n(t,e){if("-"===t.type){var r=t._id,n=r.charAt(0),i=n+"calendar",a=t[i];t.type=d(e,a)}}var i=t("./attributes"),a=t("../../components/color").addOpacity,o=t("../../registry"),s=t("../../lib"),l=t("../../plots/cartesian/tick_value_defaults"),u=t("../../plots/cartesian/tick_label_defaults"),c=t("../../plots/cartesian/category_order_defaults"),h=t("../../plots/cartesian/set_convert"),f=t("../../plots/cartesian/ordered_categories"),d=t("../../plots/cartesian/axis_autotype");e.exports=function(t,e,r){function d(r,n){return s.coerce(t,e,g,r,n)}function p(r,n){return s.coerce2(t,e,g,r,n)}var m=r.letter,v=r.font||{},g=i[m+"axis"];r.noHover=!0,r.name&&(e._name=r.name,e._id=r.name);var y=d("type");if("-"===y&&(r.data&&n(e,r.data),"-"===e.type?e.type="linear":y=t.type=e.type),d("smoothing"),d("cheatertype"),d("showticklabels"),d("labelprefix",m+" = "),d("labelsuffix"),d("showtickprefix"),d("showticksuffix"),d("separatethousands"),d("tickformat"),d("exponentformat"),d("showexponent"),d("categoryorder"),d("tickmode"),d("tickvals"),d("ticktext"),d("tick0"),d("dtick"),"array"===e.tickmode&&(d("arraytick0"),d("arraydtick")),d("labelpadding"),e._hovertitle=m,"date"===y){o.getComponentMethod("calendars","handleDefaults")(t,e,"calendar",r.calendar)}h(e,r.fullLayout);var b=d("color",r.dfltColor),x=b===t.color?b:v.color;d("title"),s.coerceFont(d,"titlefont",{family:v.family,size:Math.round(1.2*v.size),color:x}),d("titleoffset"),d("tickangle"),d("autorange",!e.isValidRange(t.range))&&d("rangemode"),d("range"),e.cleanRange(),d("fixedrange"),l(t,e,d,y),u(t,e,d,y,r),c(t,e,d);var _=p("gridcolor",a(b,.3)),w=p("gridwidth"),M=d("showgrid");M||(delete e.gridcolor,delete e.gridwidth);var k=p("startlinecolor",b),A=p("startlinewidth",w);d("startline",e.showgrid||!!k||!!A)||(delete e.startlinecolor,delete e.startlinewidth);var T=p("endlinecolor",b),S=p("endlinewidth",w);return d("endline",e.showgrid||!!T||!!S)||(delete e.endlinecolor,delete e.endlinewidth),M?(d("minorgridcount"),d("minorgridwidth",w),d("minorgridcolor",a(_,.06)),e.minorgridcount||(delete e.minorgridwidth,delete e.minorgridcolor)):(delete e.gridcolor,delete e.gridWidth),e._separators=r.fullLayout.separators,e._initialCategories="category"===y?f(m,e.categoryorder,e.categoryarray,r.data):[],"none"===e.showticklabels&&(delete e.tickfont,delete e.tickangle,delete e.showexponent,delete e.exponentformat,delete e.tickformat,delete e.showticksuffix,delete e.showtickprefix),e.showticksuffix||delete e.ticksuffix,e.showtickprefix||delete e.tickprefix,d("tickmode"),(!e.title||e.title&&0===e.title.length)&&(delete e.titlefont,delete e.titleoffset),e}},{"../../components/color":590,"../../lib":709,"../../plots/cartesian/axis_autotype":749,"../../plots/cartesian/category_order_defaults":752,"../../plots/cartesian/ordered_categories":761,"../../plots/cartesian/set_convert":765,"../../plots/cartesian/tick_label_defaults":766,"../../plots/cartesian/tick_value_defaults":768,"../../registry":826,"./attributes":864}],868:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("./cheater_basis"),a=t("./array_minmax"),o=t("./map_2d_array"),s=t("./calc_gridlines"),l=t("./calc_labels"),u=t("./calc_clippath"),c=t("../heatmap/clean_2d_array"),h=t("./smooth_fill_2d_array");e.exports=function(t,e){var r,f=n.getFromId(t,e.xaxis||"x"),d=n.getFromId(t,e.yaxis||"y"),p=e.aaxis,m=e.baxis,v=e._a=e.a,g=e._b=e.b,y={},b=e.y;if(e._cheater){var x="index"===p.cheatertype?v.length:v,_="index"===m.cheatertype?g.length:g;e.x=r=i(x,_,e.cheaterslope)}else r=e.x;e._x=e.x=r=c(r),e._y=e.y=b=c(b),h(r,v,g),h(b,v,g),e.setScale(),y.xp=e.xp=o(e.xp,r,f.c2p),y.yp=e.yp=o(e.yp,b,d.c2p);var w=a(r),M=a(b),k=.5*(w[1]-w[0]),A=.5*(w[1]+w[0]),T=.5*(M[1]-M[0]),S=.5*(M[1]+M[0]);return w=[A-1.3*k,A+1.3*k],M=[S-1.3*T,S+1.3*T],n.expand(f,w,{padded:!0}),n.expand(d,M,{padded:!0}),s(e,y,"a","b"),s(e,y,"b","a"),l(e,p),l(e,m),y.clipsegments=u(e.xctrl,e.yctrl,p,m),y.x=r,y.y=b,y.a=v,y.b=g,[y]}},{"../../plots/cartesian/axes":748,"../heatmap/clean_2d_array":929,"./array_minmax":863,"./calc_clippath":869,"./calc_gridlines":870,"./calc_labels":871,"./cheater_basis":873,"./map_2d_array":885,"./smooth_fill_2d_array":889}],869:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){var i,a,o,s=[],l=!!r.smoothing,u=!!n.smoothing,c=t[0].length-1,h=t.length-1;for(i=0,a=[],o=[];i<=c;i++)a[i]=t[0][i],o[i]=e[0][i];for(s.push({x:a,y:o,bicubic:l}),i=0,a=[],o=[];i<=h;i++)a[i]=t[i][c],o[i]=e[i][c];for(s.push({x:a,y:o,bicubic:u}),i=c,a=[],o=[];i>=0;i--)a[c-i]=t[h][i],o[c-i]=e[h][i];for(s.push({x:a,y:o,bicubic:l}),i=h,a=[],o=[];i>=0;i--)a[h-i]=t[i][0],o[h-i]=e[i][0];return s.push({x:a,y:o,bicubic:u}),s}},{}],870:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("../../lib/extend").extendFlat;e.exports=function(t,e,r,a){function o(e){var n,i,o,s,l,u,c,h,f,d,p,v,g=[],y=[],b={};if("b"===r)for(i=t.b2j(e),o=Math.floor(Math.max(0,Math.min(P-2,i))),s=i-o,b.length=P,b.crossLength=I,b.xy=function(e){return t.evalxy([],e,i)},b.dxy=function(e,r){return t.dxydi([],e,o,r,s)},n=0;n<I;n++)u=Math.min(I-2,n),c=n-u,h=t.evalxy([],n,i),E.smoothing&&n>0&&(f=t.dxydi([],n-1,o,0,s),g.push(l[0]+f[0]/3),y.push(l[1]+f[1]/3),d=t.dxydi([],n-1,o,1,s),g.push(h[0]-d[0]/3),y.push(h[1]-d[1]/3)),g.push(h[0]),y.push(h[1]),l=h;else for(n=t.a2i(e),u=Math.floor(Math.max(0,Math.min(I-2,n))),c=n-u,b.length=I,b.crossLength=P,b.xy=function(e){return t.evalxy([],n,e)},b.dxy=function(e,r){return t.dxydj([],u,e,c,r)},i=0;i<P;i++)o=Math.min(P-2,i),s=i-o,h=t.evalxy([],n,i),E.smoothing&&i>0&&(p=t.dxydj([],u,i-1,c,0),g.push(l[0]+p[0]/3),y.push(l[1]+p[1]/3),v=t.dxydj([],u,i-1,c,1),g.push(h[0]-v[0]/3),y.push(h[1]-v[1]/3)),g.push(h[0]),y.push(h[1]),l=h;return b.axisLetter=r,b.axis=M,b.crossAxis=E,b.value=e,b.constvar=a,b.index=m,b.x=g,b.y=y,b.smoothing=E.smoothing,b}function s(e){var n,i,o,s,l,u=[],c=[],h={};if(h.length=w.length,h.crossLength=S.length,"b"===r)for(o=Math.max(0,Math.min(P-2,e)),l=Math.min(1,Math.max(0,e-o)),h.xy=function(r){return t.evalxy([],r,e)},h.dxy=function(e,r){return t.dxydi([],e,o,r,l)},n=0;n<z;n++)u[n]=L[e*O][n],c[n]=C[e*O][n];else for(i=Math.max(0,Math.min(I-2,e)),s=Math.min(1,Math.max(0,e-i)),h.xy=function(r){return t.evalxy([],e,r)},h.dxy=function(e,r){return t.dxydj([],i,e,s,r)},n=0;n<D;n++)u[n]=L[n][e*O],c[n]=C[n][e*O];return h.axisLetter=r,h.axis=M,h.crossAxis=E,h.value=w[e],h.constvar=a,h.index=e,h.x=u,h.y=c,h.smoothing=E.smoothing,h}var l,u,c,h,f,d,p,m,v,g,y,b,x,_,w=t[r],M=t[r+"axis"],k=M._gridlines=[],A=M._minorgridlines=[],T=M._boundarylines=[],S=t[a],E=t[a+"axis"];if("array"===M.tickmode)for(M.tickvals=[],l=0;l<w.length;l++)M.tickvals.push(w[l]);var L=t.xctrl,C=t.yctrl,z=L[0].length,D=L.length,I=t.a.length,P=t.b.length;n.calcTicks(M);var O=M.smoothing?3:1;if("array"===M.tickmode){for(h=5e-15,f=[Math.floor((w.length-1-M.arraytick0)/M.arraydtick*(1+h)),Math.ceil(-M.arraytick0/M.arraydtick/(1+h))].sort(function(t,e){return t-e}),d=f[0]-1,p=f[1]+1,m=d;m<p;m++)(u=M.arraytick0+M.arraydtick*m)<0||u>w.length-1||k.push(i(s(u),{color:M.gridcolor,width:M.gridwidth}));for(m=d;m<p;m++)if(c=M.arraytick0+M.arraydtick*m,y=Math.min(c+M.arraydtick,w.length-1),!(c<0||c>w.length-1||y<0||y>w.length-1))for(b=w[c],x=w[y],l=0;l<M.minorgridcount;l++)(_=y-c)<=0||(g=b+(x-b)*(l+1)/(M.minorgridcount+1)*(M.arraydtick/_))<w[0]||g>w[w.length-1]||A.push(i(o(g),{color:M.minorgridcolor,width:M.minorgridwidth}));M.startline&&T.push(i(s(0),{color:M.startlinecolor,width:M.startlinewidth})),M.endline&&T.push(i(s(w.length-1),{color:M.endlinecolor,width:M.endlinewidth}))}else{for(h=5e-15,f=[Math.floor((w[w.length-1]-M.tick0)/M.dtick*(1+h)),Math.ceil((w[0]-M.tick0)/M.dtick/(1+h))].sort(function(t,e){return t-e}),d=f[0],p=f[1],m=d;m<=p;m++)v=M.tick0+M.dtick*m,k.push(i(o(v),{color:M.gridcolor,width:M.gridwidth}));for(m=d-1;m<p+1;m++)for(v=M.tick0+M.dtick*m,l=0;l<M.minorgridcount;l++)(g=v+M.dtick*(l+1)/(M.minorgridcount+1))<w[0]||g>w[w.length-1]||A.push(i(o(g),{color:M.minorgridcolor,width:M.minorgridwidth}));M.startline&&T.push(i(o(w[0]),{color:M.startlinecolor,width:M.startlinewidth})),M.endline&&T.push(i(o(w[w.length-1]),{color:M.endlinecolor,width:M.endlinewidth}))}}},{"../../lib/extend":701,"../../plots/cartesian/axes":748}],871:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("../../lib/extend").extendFlat;e.exports=function(t,e){var r,a,o,s=e._labels=[],l=e._gridlines;for(r=0;r<l.length;r++)o=l[r],["start","both"].indexOf(e.showticklabels)!==-1&&(a=n.tickText(e,o.value),i(a,{prefix:void 0,suffix:void 0,endAnchor:!0,xy:o.xy(0),dxy:o.dxy(0,0),axis:o.axis,length:o.crossAxis.length,font:o.axis.tickfont,isFirst:0===r,isLast:r===l.length-1}),s.push(a)),["end","both"].indexOf(e.showticklabels)!==-1&&(a=n.tickText(e,o.value),i(a,{endAnchor:!1,xy:o.xy(o.crossLength-1),dxy:o.dxy(o.crossLength-2,1),axis:o.axis,length:o.crossAxis.length,font:o.axis.tickfont,isFirst:0===r,isLast:r===l.length-1}),s.push(a))}},{"../../lib/extend":701,"../../plots/cartesian/axes":748}],872:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){var i=t[0]-e[0],a=t[1]-e[1],o=r[0]-e[0],s=r[1]-e[1],l=Math.pow(i*i+a*a,.25),u=Math.pow(o*o+s*s,.25),c=(u*u*i-l*l*o)*n,h=(u*u*a-l*l*s)*n,f=u*(l+u)*3,d=l*(l+u)*3;return[[e[0]+(f&&c/f),e[1]+(f&&h/f)],[e[0]-(d&&c/d),e[1]-(d&&h/d)]]}},{}],873:[function(t,e,r){"use strict";var n=t("../../lib").isArray;e.exports=function(t,e,r){var i,a,o,s,l,u,c=[],h=n(t)?t.length:t,f=n(e)?e.length:e,d=n(t)?t:null,p=n(e)?e:null;d&&(o=(d.length-1)/(d[d.length-1]-d[0])/(h-1)),p&&(s=(p.length-1)/(p[p.length-1]-p[0])/(f-1));var m,v=1/0,g=-1/0;for(a=0;a<f;a++)for(c[a]=[],u=p?(p[a]-p[0])*s:a/(f-1),i=0;i<h;i++)l=d?(d[i]-d[0])*o:i/(h-1),m=l-u*r,v=Math.min(m,v),g=Math.max(m,g),c[a][i]=m;var y=1/(g-v),b=-v*y;for(a=0;a<f;a++)for(i=0;i<h;i++)c[a][i]=y*c[a][i]+b;return c}},{"../../lib":709}],874:[function(t,e,r){"use strict";function n(t,e,r){var n=-.5*r[0]+1.5*e[0],i=-.5*r[1]+1.5*e[1];return[(2*n+t[0])/3,(2*i+t[1])/3]}var i=t("./catmull_rom"),a=t("../../lib").ensureArray;e.exports=function(t,e,r,o,s,l){var u,c,h,f,d,p,m,v,g,y,b=r[0].length,x=r.length,_=s?3*b-2:b,w=l?3*x-2:x;for(t=a(t,w),e=a(e,w),h=0;h<w;h++)t[h]=a(t[h],_),e[h]=a(e[h],_);for(c=0,f=0;c<x;c++,f+=l?3:1)for(d=t[f],p=e[f],m=r[c],v=o[c],u=0,h=0;u<b;u++,h+=s?3:1)d[h]=m[u],p[h]=v[u];if(s)for(c=0,f=0;c<x;c++,f+=l?3:1){for(u=1,h=3;u<b-1;u++,h+=3)g=i([r[c][u-1],o[c][u-1]],[r[c][u],o[c][u]],[r[c][u+1],o[c][u+1]],s),t[f][h-1]=g[0][0],e[f][h-1]=g[0][1],t[f][h+1]=g[1][0],e[f][h+1]=g[1][1];y=n([t[f][0],e[f][0]],[t[f][2],e[f][2]],[t[f][3],e[f][3]]),t[f][1]=y[0],e[f][1]=y[1],y=n([t[f][_-1],e[f][_-1]],[t[f][_-3],e[f][_-3]],[t[f][_-4],e[f][_-4]]),t[f][_-2]=y[0],e[f][_-2]=y[1]}if(l)for(h=0;h<_;h++){for(f=3;f<w-3;f+=3)g=i([t[f-3][h],e[f-3][h]],[t[f][h],e[f][h]],[t[f+3][h],e[f+3][h]],l),t[f-1][h]=g[0][0],e[f-1][h]=g[0][1],t[f+1][h]=g[1][0],e[f+1][h]=g[1][1];y=n([t[0][h],e[0][h]],[t[2][h],e[2][h]],[t[3][h],e[3][h]]),t[1][h]=y[0],e[1][h]=y[1],y=n([t[w-1][h],e[w-1][h]],[t[w-3][h],e[w-3][h]],[t[w-4][h],e[w-4][h]]),t[w-2][h]=y[0],e[w-2][h]=y[1]}if(s&&l)for(f=1;f<w;f+=(f+1)%3==0?2:1){for(h=3;h<_-3;h+=3)g=i([t[f][h-3],e[f][h-3]],[t[f][h],e[f][h]],[t[f][h+3],e[f][h+3]],s),t[f][h-1]=.5*(t[f][h-1]+g[0][0]),e[f][h-1]=.5*(e[f][h-1]+g[0][1]),t[f][h+1]=.5*(t[f][h+1]+g[1][0]),e[f][h+1]=.5*(e[f][h+1]+g[1][1]);y=n([t[f][0],e[f][0]],[t[f][2],e[f][2]],[t[f][3],e[f][3]]),t[f][1]=.5*(t[f][1]+y[0]),e[f][1]=.5*(e[f][1]+y[1]),y=n([t[f][_-1],e[f][_-1]],[t[f][_-3],e[f][_-3]],[t[f][_-4],e[f][_-4]]),t[f][_-2]=.5*(t[f][_-2]+y[0]),e[f][_-2]=.5*(e[f][_-2]+y[1])}return[t,e]}},{"../../lib":709,"./catmull_rom":872}],875:[function(t,e,r){"use strict";e.exports={RELATIVE_CULL_TOLERANCE:1e-6}},{}],876:[function(t,e,r){"use strict";e.exports=function(t,e,r){return e&&r?function(e,r,n,i,a){e||(e=[]);var o,s,l,u,c,h;r*=3,n*=3;var f=i*i,d=1-i,p=d*d,m=d*i*2,v=-3*p,g=3*(p-m),y=3*(m-f),b=3*f,x=a*a,_=x*a,w=1-a,M=w*w,k=M*w;for(h=0;h<t.length;h++)c=t[h],o=v*c[n][r]+g*c[n][r+1]+y*c[n][r+2]+b*c[n][r+3],s=v*c[n+1][r]+g*c[n+1][r+1]+y*c[n+1][r+2]+b*c[n+1][r+3],l=v*c[n+2][r]+g*c[n+2][r+1]+y*c[n+2][r+2]+b*c[n+2][r+3],u=v*c[n+3][r]+g*c[n+3][r+1]+y*c[n+3][r+2]+b*c[n+3][r+3],e[h]=k*o+3*(M*a*s+w*x*l)+_*u;return e}:e?function(e,r,n,i,a){e||(e=[]);var o,s,l,u;r*=3;var c=i*i,h=1-i,f=h*h,d=h*i*2,p=-3*f,m=3*(f-d),v=3*(d-c),g=3*c,y=1-a;for(l=0;l<t.length;l++)u=t[l],o=p*u[n][r]+m*u[n][r+1]+v*u[n][r+2]+g*u[n][r+3],s=p*u[n+1][r]+m*u[n+1][r+1]+v*u[n+1][r+2]+g*u[n+1][r+3],e[l]=y*o+a*s;return e}:r?function(e,r,n,i,a){e||(e=[]);var o,s,l,u,c,h;n*=3;var f=a*a,d=f*a,p=1-a,m=p*p,v=m*p;for(c=0;c<t.length;c++)h=t[c],o=h[n][r+1]-h[n][r],s=h[n+1][r+1]-h[n+1][r],l=h[n+2][r+1]-h[n+2][r],u=h[n+3][r+1]-h[n+3][r],e[c]=v*o+3*(m*a*s+p*f*l)+d*u;return e}:function(e,r,n,i,a){e||(e=[]);var o,s,l,u,c=1-a;for(l=0;l<t.length;l++)u=t[l],o=u[n][r+1]-u[n][r],s=u[n+1][r+1]-u[n+1][r],e[l]=c*o+a*s;return e}}},{}],877:[function(t,e,r){"use strict";e.exports=function(t,e,r){return e&&r?function(e,r,n,i,a){e||(e=[]);var o,s,l,u,c,h;r*=3,n*=3;var f=i*i,d=f*i,p=1-i,m=p*p,v=m*p,g=a*a,y=1-a,b=y*y,x=y*a*2,_=-3*b,w=3*(b-x),M=3*(x-g),k=3*g;for(h=0;h<t.length;h++)c=t[h],o=_*c[n][r]+w*c[n+1][r]+M*c[n+2][r]+k*c[n+3][r],s=_*c[n][r+1]+w*c[n+1][r+1]+M*c[n+2][r+1]+k*c[n+3][r+1],l=_*c[n][r+2]+w*c[n+1][r+2]+M*c[n+2][r+2]+k*c[n+3][r+2],u=_*c[n][r+3]+w*c[n+1][r+3]+M*c[n+2][r+3]+k*c[n+3][r+3],e[h]=v*o+3*(m*i*s+p*f*l)+d*u;return e}:e?function(e,r,n,i,a){e||(e=[]);var o,s,l,u,c,h;r*=3;var f=a*a,d=f*a,p=1-a,m=p*p,v=m*p;for(c=0;c<t.length;c++)h=t[c],o=h[n+1][r]-h[n][r],s=h[n+1][r+1]-h[n][r+1],l=h[n+1][r+2]-h[n][r+2],u=h[n+1][r+3]-h[n][r+3],e[c]=v*o+3*(m*a*s+p*f*l)+d*u;return e}:r?function(e,r,n,i,a){e||(e=[]);var o,s,l,u;n*=3;var c=1-i,h=a*a,f=1-a,d=f*f,p=f*a*2,m=-3*d,v=3*(d-p),g=3*(p-h),y=3*h;for(l=0;l<t.length;l++)u=t[l],o=m*u[n][r]+v*u[n+1][r]+g*u[n+2][r]+y*u[n+3][r],s=m*u[n][r+1]+v*u[n+1][r+1]+g*u[n+2][r+1]+y*u[n+3][r+1],e[l]=c*o+i*s;return e}:function(e,r,n,i,a){e||(e=[]);var o,s,l,u,c=1-i;for(l=0;l<t.length;l++)u=t[l],o=u[n+1][r]-u[n][r],s=u[n+1][r+1]-u[n][r+1],e[l]=c*o+i*s;return e}}},{}],878:[function(t,e,r){"use strict";e.exports=function(t,e,r,n,i){var a=e-2,o=r-2;return n&&i?function(e,r,n){e||(e=[]);var i,s,l,u,c,h,f=Math.max(0,Math.min(Math.floor(r),a)),d=Math.max(0,Math.min(Math.floor(n),o)),p=Math.max(0,Math.min(1,r-f)),m=Math.max(0,Math.min(1,n-d));f*=3,d*=3;var v=p*p,g=v*p,y=1-p,b=y*y,x=b*y,_=m*m,w=_*m,M=1-m,k=M*M,A=k*M;for(h=0;h<t.length;h++)c=t[h],i=x*c[d][f]+3*(b*p*c[d][f+1]+y*v*c[d][f+2])+g*c[d][f+3],s=x*c[d+1][f]+3*(b*p*c[d+1][f+1]+y*v*c[d+1][f+2])+g*c[d+1][f+3],l=x*c[d+2][f]+3*(b*p*c[d+2][f+1]+y*v*c[d+2][f+2])+g*c[d+2][f+3],u=x*c[d+3][f]+3*(b*p*c[d+3][f+1]+y*v*c[d+3][f+2])+g*c[d+3][f+3],e[h]=A*i+3*(k*m*s+M*_*l)+w*u;return e}:n?function(e,r,n){e||(e=[]);var i,s,l,u,c,h,f=Math.max(0,Math.min(Math.floor(r),a)),d=Math.max(0,Math.min(Math.floor(n),o)),p=Math.max(0,Math.min(1,r-f)),m=Math.max(0,Math.min(1,n-d));f*=3;var v=p*p,g=v*p,y=1-p,b=y*y,x=b*y,_=1-m;for(c=0;c<t.length;c++)h=t[c],i=_*h[d][f]+m*h[d+1][f],s=_*h[d][f+1]+m*h[d+1][f+1],l=_*h[d][f+2]+m*h[d+1][f+1],u=_*h[d][f+3]+m*h[d+1][f+1],e[c]=x*i+3*(b*p*s+y*v*l)+g*u;return e}:i?function(e,r,n){e||(e=[]);var i,s,l,u,c,h,f=Math.max(0,Math.min(Math.floor(r),a)),d=Math.max(0,Math.min(Math.floor(n),o)),p=Math.max(0,Math.min(1,r-f)),m=Math.max(0,Math.min(1,n-d));d*=3;var v=m*m,g=v*m,y=1-m,b=y*y,x=b*y,_=1-p;for(c=0;c<t.length;c++)h=t[c],i=_*h[d][f]+p*h[d][f+1],s=_*h[d+1][f]+p*h[d+1][f+1],l=_*h[d+2][f]+p*h[d+2][f+1],u=_*h[d+3][f]+p*h[d+3][f+1],e[c]=x*i+3*(b*m*s+y*v*l)+g*u;return e}:function(e,r,n){e||(e=[]);var i,s,l,u,c=Math.max(0,Math.min(Math.floor(r),a)),h=Math.max(0,Math.min(Math.floor(n),o)),f=Math.max(0,Math.min(1,r-c)),d=Math.max(0,Math.min(1,n-h)),p=1-d,m=1-f;for(l=0;l<t.length;l++)u=t[l],i=m*u[h][c]+f*u[h][c+1],s=m*u[h+1][c]+f*u[h+1][c+1],e[l]=p*i+d*s;return e}}},{}],879:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./xy_defaults"),a=t("./ab_defaults"),o=t("./set_convert"),s=t("./attributes"),l=t("../../components/color/attributes");e.exports=function(t,e,r,u){function c(r,i){return n.coerce(t,e,s,r,i)}var h=c("color",l.defaultLine);if(n.coerceFont(c,"font"),c("carpet"),a(t,e,u,c,h),!e.a||!e.b)return void(e.visible=!1);e.a.length<3&&(e.aaxis.smoothing=0),e.b.length<3&&(e.baxis.smoothing=0);var f=i(t,e,c);return o(e),e._cheater&&c("cheaterslope"),f?void 0:void(e.visible=!1)}},{"../../components/color/attributes":589,"../../lib":709,"./ab_defaults":862,"./attributes":864,"./set_convert":888,"./xy_defaults":890}],880:[function(t,e,r){"use strict";e.exports=function(t){return Array.isArray(t[0])}},{}],881:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.plot=t("./plot"),n.calc=t("./calc"),n.animatable=!0,n.moduleType="trace",n.name="carpet",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","carpet","carpetAxis","notLegendIsolatable"],n.meta={},e.exports=n},{"../../plots/cartesian":758,"./attributes":864,"./calc":868,"./defaults":879,"./plot":887}],882:[function(t,e,r){"use strict";e.exports=function(t,e){for(var r,n=t._fullData.length,i=0;i<n;i++){var a=t._fullData[i];if(a.index!==e.index&&("carpet"===a.type&&(r||(r=a),a.carpet===e.carpet)))return a}return r}},{}],883:[function(t,e,r){"use strict";e.exports=function(t,e,r){if(0===t.length)return"";var n,i=[],a=r?3:1;for(n=0;n<t.length;n+=a)i.push(t[n]+","+e[n]),r&&n<t.length-a&&(i.push("C"),i.push([t[n+1]+","+e[n+1],t[n+2]+","+e[n+2]+" "].join(" ")));return i.join(r?"":"L")}},{}],884:[function(t,e,r){"use strict";e.exports=function(t,e,r){var n;for(Array.isArray(t)?t.length>e.length&&(t=t.slice(0,e.length)):t=[],n=0;n<e.length;n++)t[n]=r(e[n]);return t}},{}],885:[function(t,e,r){"use strict";e.exports=function(t,e,r){var n,i;for(Array.isArray(t)?t.length>e.length&&(t=t.slice(0,e.length)):t=[],n=0;n<e.length;n++)for(Array.isArray(t[n])?t[n].length>e.length&&(t[n]=t[n].slice(0,e.length)):t[n]=[],i=0;i<e[0].length;i++)t[n][i]=r(e[n][i]);return t}},{}],886:[function(t,e,r){"use strict";e.exports=function(t,e,r,n,i,a){var o=i[0]*t.dpdx(e),s=i[1]*t.dpdy(r),l=1,u=1;if(a){var c=Math.sqrt(i[0]*i[0]+i[1]*i[1]),h=Math.sqrt(a[0]*a[0]+a[1]*a[1]),f=(i[0]*a[0]+i[1]*a[1])/c/h;u=Math.max(0,f)}var d=180*Math.atan2(s,o)/Math.PI;return d<-90?(d+=180,l=-l):d>90&&(d-=180,l=-l),{angle:d,flip:l,p:t.c2p(n,e,r),offsetMultplier:u}}},{}],887:[function(t,e,r){"use strict";function n(t,e,r){var n=t.selectAll(e+"."+r).data([0]);return n.enter().append(e).classed(r,!0),n}function i(t,e,r){var i=r[0],u=r[0].trace,c=e.xaxis,f=e.yaxis,d=u.aaxis,p=u.baxis,m=t._fullLayout,v=e.plot.selectAll(".carpetlayer"),g=n(m._defs,"g","clips"),y=n(v,"g","carpet"+u.uid).classed("trace",!0),b=n(y,"g","minorlayer"),x=n(y,"g","majorlayer"),_=n(y,"g","boundarylayer"),w=n(y,"g","labellayer");y.style("opacity",u.opacity),o(c,f,x,d,"a",d._gridlines),o(c,f,x,p,"b",p._gridlines),o(c,f,b,d,"a",d._minorgridlines),o(c,f,b,p,"b",p._minorgridlines),o(c,f,_,d,"a-boundary",d._boundarylines),o(c,f,_,p,"b-boundary",p._boundarylines),l(w,u,i,c,f,s(h.tester,c,f,u,i,w,d._labels,"a-label"),s(h.tester,c,f,u,i,w,p._labels,"b-label")),a(u,i,g,c,f)}function a(t,e,r,i,a){var o,s,l,u;t.clipPathId="clip"+t.uid+"carpet";var c=r.select("#"+t.clipPathId);c.size()||(c=r.append("clipPath").classed("carpetclip",!0));var h=n(c,"path","carpetboundary"),p=e.clipsegments,m=[];for(u=0;u<p.length;u++)o=p[u],s=f([],o.x,i.c2p),l=f([],o.y,a.c2p),m.push(d(s,l,o.bicubic));t.clipPathData="M"+m.join("L")+"Z",c.attr("id",t.clipPathId),h.attr("d",t.clipPathData)}function o(t,e,r,n,i,a){var o="const-"+i+"-lines",s=r.selectAll("."+o).data(a);s.enter().append("path").classed(o,!0).style("vector-effect","non-scaling-stroke"),s.each(function(r){var n=r,i=n.x,a=n.y,o=f([],i,t.c2p),s=f([],a,e.c2p),l="M"+d(o,s,n.smoothing);c.select(this).attr("d",l).style("stroke-width",n.width).style("stroke",n.color).style("fill","none")}),s.exit().remove()}function s(t,e,r,n,i,a,o,s){var l=a.selectAll("text."+s).data(o);l.enter().append("text").classed(s,!0);var u=0;return l.each(function(i){var a;if("auto"===i.axis.tickangle)a=p(n,e,r,i.xy,i.dxy);else{var o=(i.axis.tickangle+180)*Math.PI/180;a=p(n,e,r,i.xy,[Math.cos(o),Math.sin(o)])}var s=(i.endAnchor?-1:1)*a.flip,l=h.measureText(t,i.text,i.font);c.select(this).attr("text-anchor",s>0?"start":"end").text(i.text).attr("transform","translate("+a.p[0]+","+a.p[1]+") rotate("+a.angle+")translate("+i.axis.labelpadding*s+","+.3*l.height+")").call(h.font,i.font.family,i.font.size,i.font.color),u=Math.max(u,l.width+i.axis.labelpadding)}),l.exit().remove(),u}function l(t,e,r,n,i,a,o){var s,l,c,h;s=.5*(e.a[0]+e.a[e.a.length-1]),l=e.b[0],c=e.ab2xy(s,l,!0),h=e.dxyda_rough(s,l),u(t,e,r,c,h,e.aaxis,n,i,a,"a-title"),s=e.a[0],l=.5*(e.b[0]+e.b[e.b.length-1]),c=e.ab2xy(s,l,!0),h=e.dxydb_rough(s,l),u(t,e,r,c,h,e.baxis,n,i,o,"b-title")}function u(t,e,r,n,i,a,o,s,l,u){var f=[];a.title&&f.push(a.title);var d=t.selectAll("text."+u).data(f);d.enter().append("text").classed(u,!0),d.each(function(){var t=p(e,o,s,n,i);["start","both"].indexOf(a.showticklabels)===-1&&(l=0),l+=a.titlefont.size+a.titleoffset,c.select(this).text(a.title||"").attr("transform","translate("+t.p[0]+","+t.p[1]+") rotate("+t.angle+") translate(0,"+l+")").classed("user-select-none",!0).attr("text-anchor","middle").call(h.font,a.titlefont)}),d.exit().remove()}var c=t("d3"),h=t("../../components/drawing"),f=t("./map_1d_array"),d=t("./makepath"),p=t("./orient_text");e.exports=function(t,e,r){for(var n=0;n<r.length;n++)i(t,e,r[n])}},{"../../components/drawing":614,"./makepath":883,"./map_1d_array":884,"./orient_text":886,d3:118}],888:[function(t,e,r){"use strict";var n=t("./constants"),i=t("../../lib/search").findBin,a=t("./compute_control_points"),o=t("./create_spline_evaluator"),s=t("./create_i_derivative_evaluator"),l=t("./create_j_derivative_evaluator");e.exports=function(t){var e=t.a,r=t.b,u=t.a.length,c=t.b.length,h=t.aaxis,f=t.baxis,d=e[0],p=e[u-1],m=r[0],v=r[c-1],g=e[e.length-1]-e[0],y=r[r.length-1]-r[0],b=g*n.RELATIVE_CULL_TOLERANCE,x=y*n.RELATIVE_CULL_TOLERANCE;d-=b,p+=b,m-=x,v+=x,t.isVisible=function(t,e){return t>d&&t<p&&e>m&&e<v},t.isOccluded=function(t,e){return t<d||t>p||e<m||e>v},h.c2p=function(t){return t},f.c2p=function(t){return t},t.setScale=function(){var e=t.x,r=t.y,n=a(t.xctrl,t.yctrl,e,r,h.smoothing,f.smoothing);t.xctrl=n[0],t.yctrl=n[1],t.evalxy=o([t.xctrl,t.yctrl],u,c,h.smoothing,f.smoothing),t.dxydi=s([t.xctrl,t.yctrl],h.smoothing,f.smoothing),t.dxydj=l([t.xctrl,t.yctrl],h.smoothing,f.smoothing)},t.i2a=function(t){var r=Math.max(0,Math.floor(t[0]),u-2),n=t[0]-r;return(1-n)*e[r]+n*e[r+1]},t.j2b=function(t){var e=Math.max(0,Math.floor(t[1]),u-2),n=t[1]-e;return(1-n)*r[e]+n*r[e+1]},t.ij2ab=function(e){return[t.i2a(e[0]),t.j2b(e[1])]},t.a2i=function(t){var r=Math.max(0,Math.min(i(t,e),u-2)),n=e[r],a=e[r+1];return Math.max(0,Math.min(u-1,r+(t-n)/(a-n)))},t.b2j=function(t){var e=Math.max(0,Math.min(i(t,r),c-2)),n=r[e],a=r[e+1];return Math.max(0,Math.min(c-1,e+(t-n)/(a-n)))},t.ab2ij=function(e){return[t.a2i(e[0]),t.b2j(e[1])]},t.i2c=function(e,r){return t.evalxy([],e,r)},t.ab2xy=function(n,i,a){if(!a&&(n<e[0]||n>e[u-1]|i<r[0]||i>r[c-1]))return[!1,!1];var o=t.a2i(n),s=t.b2j(i),l=t.evalxy([],o,s);if(a){var h,f,d,p,m=0,v=0,g=[];n<e[0]?(h=0,f=0,m=(n-e[0])/(e[1]-e[0])):n>e[u-1]?(h=u-2,f=1,m=(n-e[u-1])/(e[u-1]-e[u-2])):(h=Math.max(0,Math.min(u-2,Math.floor(o))),f=o-h),i<r[0]?(d=0,p=0,v=(i-r[0])/(r[1]-r[0])):i>r[c-1]?(d=c-2,p=1,v=(i-r[c-1])/(r[c-1]-r[c-2])):(d=Math.max(0,Math.min(c-2,Math.floor(s))),p=s-d),m&&(t.dxydi(g,h,d,f,p),l[0]+=g[0]*m,l[1]+=g[1]*m),v&&(t.dxydj(g,h,d,f,p),l[0]+=g[0]*v,l[1]+=g[1]*v)}return l},t.c2p=function(t,e,r){return[e.c2p(t[0]),r.c2p(t[1])]},t.p2x=function(t,e,r){return[e.p2c(t[0]),r.p2c(t[1])]},t.dadi=function(t){var r=Math.max(0,Math.min(e.length-2,t));return e[r+1]-e[r]},t.dbdj=function(t){var e=Math.max(0,Math.min(r.length-2,t));return r[e+1]-r[e]},t.dxyda=function(e,r,n,i){var a=t.dxydi(null,e,r,n,i),o=t.dadi(e,n);return[a[0]/o,a[1]/o]},t.dxydb=function(e,r,n,i){var a=t.dxydj(null,e,r,n,i),o=t.dbdj(r,i);return[a[0]/o,a[1]/o]},t.dxyda_rough=function(e,r,n){var i=g*(n||.1),a=t.ab2xy(e+i,r,!0),o=t.ab2xy(e-i,r,!0);return[.5*(a[0]-o[0])/i,.5*(a[1]-o[1])/i]},t.dxydb_rough=function(e,r,n){var i=y*(n||.1),a=t.ab2xy(e,r+i,!0),o=t.ab2xy(e,r-i,!0);return[.5*(a[0]-o[0])/i,.5*(a[1]-o[1])/i]},t.dpdx=function(t){return t._m},t.dpdy=function(t){return t._m}}},{"../../lib/search":723,"./compute_control_points":874,"./constants":875,"./create_i_derivative_evaluator":876,"./create_j_derivative_evaluator":877,"./create_spline_evaluator":878}],889:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e,r){var i,a,o,s=[],l=[],u=t[0].length,c=t.length,h=0;for(i=0;i<u;i++)for(a=0;a<c;a++)void 0===t[a][i]&&(s.push(i),l.push(a),t[a][i]=function(e,r){var n,i=0,a=0;return e>0&&void 0!==(n=t[r][e-1])&&(a++,i+=n),e<u-1&&void 0!==(n=t[r][e+1])&&(a++,i+=n),r>0&&void 0!==(n=t[r-1][e])&&(a++,i+=n),r<c-1&&void 0!==(n=t[r+1][e])&&(a++,i+=n),i/Math.max(1,a)}(i,a)),h=Math.max(h,Math.abs(t[a][i]));if(!s.length)return t;var f,d,p,m,v,g,y,b,x,_,w,M=0,k=0,A=s.length;do{for(M=0,o=0;o<A;o++){i=s[o],a=l[o];var T,S,E,L,C,z,D=0,I=0;0===i?(C=Math.min(u-1,2),E=e[C],L=e[1],T=t[a][C],S=t[a][1],I+=S+(S-T)*(e[0]-L)/(L-E),D++):i===u-1&&(C=Math.max(0,u-3),E=e[C],L=e[u-2],T=t[a][C],S=t[a][u-2],I+=S+(S-T)*(e[u-1]-L)/(L-E),D++),(0===i||i===u-1)&&a>0&&a<c-1&&(f=r[a+1]-r[a],d=r[a]-r[a-1],I+=(d*t[a+1][i]+f*t[a-1][i])/(d+f),D++),0===a?(z=Math.min(c-1,2),E=r[z],L=r[1],T=t[z][i],S=t[1][i],I+=S+(S-T)*(r[0]-L)/(L-E),D++):a===c-1&&(z=Math.max(0,c-3),E=r[z],L=r[c-2],T=t[z][i],S=t[c-2][i],I+=S+(S-T)*(r[c-1]-L)/(L-E),D++),(0===a||a===c-1)&&i>0&&i<u-1&&(f=e[i+1]-e[i],d=e[i]-e[i-1],I+=(d*t[a][i+1]+f*t[a][i-1])/(d+f),D++),D?I/=D:(p=e[i+1]-e[i],m=e[i]-e[i-1],v=r[a+1]-r[a],g=r[a]-r[a-1],y=p*m*(p+m),b=v*g*(v+g),I=(y*(g*t[a+1][i]+v*t[a-1][i])+b*(m*t[a][i+1]+p*t[a][i-1]))/(b*(m+p)+y*(g+v))),x=I-t[a][i],_=x/h,M+=_*_,w=D?0:.85,t[a][i]+=x*(1+w)}M=Math.sqrt(M)}while(k++<100&&M>1e-5);return n.log("Smoother converged to",M,"after",k,"iterations"),t}},{"../../lib":709}],890:[function(t,e,r){"use strict";var n=t("./has_columns"),i=t("../heatmap/convert_column_xyz");e.exports=function(t,e,r){var a=[],o=r("x");o&&!n(o)&&a.push("x"),e._cheater=!o;var s=r("y");if(s&&!n(s)&&a.push("y"),o||s)return a.length&&i(e,e.aaxis,e.baxis,"a","b",a),!0}},{"../heatmap/convert_column_xyz":931,"./has_columns":880}],891:[function(t,e,r){"use strict";var n=t("../scattergeo/attributes"),i=t("../../components/colorscale/attributes"),a=t("../../components/colorbar/attributes"),o=t("../../plots/attributes"),s=t("../../lib/extend").extendFlat,l=n.marker.line;e.exports=s({},{locations:{valType:"data_array"},locationmode:n.locationmode,z:{valType:"data_array"},text:{valType:"data_array"},marker:{line:{color:l.color,width:s({},l.width,{dflt:1})}},hoverinfo:s({},o.hoverinfo,{flags:["location","z","text","name"]})},i,{colorbar:a})},{"../../components/colorbar/attributes":591,"../../components/colorscale/attributes":595,"../../lib/extend":701,"../../plots/attributes":746,"../scattergeo/attributes":1045}],892:[function(t,e,r){"use strict"
70 ;var n=t("../../components/colorscale/calc");e.exports=function(t,e){n(e,e.z,"","z")}},{"../../components/colorscale/calc":596}],893:[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,u=s("locations");if(u&&(l=u.length),!u||!l)return void(e.visible=!1);var c=s("z");if(!Array.isArray(c))return void(e.visible=!1);c.length>l&&(e.z=c.slice(0,l)),s("locationmode"),s("text"),s("marker.line.color"),s("marker.line.width"),i(t,e,o,s,{prefix:"",cLetter:"z"}),s("hoverinfo",1===o._dataLength?"location+z+text":void 0)}},{"../../components/colorscale/defaults":599,"../../lib":709,"./attributes":891}],894:[function(t,e,r){"use strict";e.exports=function(t,e){return t.location=e.location,t.z=e.z,t}},{}],895:[function(t,e,r){"use strict";function n(t,e,r,n){var o=e.hoverinfo,s="all"===o?a.hoverinfo.flags:o.split("+"),l=s.indexOf("name")!==-1,u=s.indexOf("location")!==-1,c=s.indexOf("z")!==-1,h=s.indexOf("text")!==-1,f=!l&&u,d=[];f?t.nameOverride=r.id:(l&&(t.nameOverride=e.name),u&&d.push(r.id)),c&&d.push(function(t){return i.tickText(n,n.c2l(t),"hover").text}(r.z)),h&&d.push(r.tx),t.extraText=d.join("<br>")}var i=t("../../plots/cartesian/axes"),a=t("./attributes");e.exports=function(t){var e=t.cd,r=e[0].trace,i=t.subplot,a=i.choroplethHoverPt;if(a){var o=i.projection(a.properties.ct);return t.x0=t.x1=o[0],t.y0=t.y1=o[1],t.index=a.index,t.location=a.id,t.z=a.z,n(t,r,a,i.mockAxis),[t]}}},{"../../plots/cartesian/axes":748,"./attributes":891}],896:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../heatmap/colorbar"),n.calc=t("./calc"),n.plot=t("./plot"),n.hoverPoints=t("./hover"),n.eventData=t("./event_data"),n.moduleType="trace",n.name="choropleth",n.basePlotModule=t("../../plots/geo"),n.categories=["geo","noOpacity"],n.meta={},e.exports=n},{"../../plots/geo":776,"../heatmap/colorbar":930,"./attributes":891,"./calc":892,"./defaults":893,"./event_data":894,"./hover":895,"./plot":897}],897:[function(t,e,r){"use strict";function n(t,e){for(var r,n=[],i=t.locations,a=i.length,o=u(t,e),s=(t.marker||{}).line||{},l=0;l<a;l++)(r=c(t.locationmode,i[l],o))&&(r.z=t.z[l],void 0!==t.text&&(r.tx=t.text[l]),h(s.color,r,"mlc",l),h(s.width,r,"mlw",l),r.index=l,n.push(r));return n.length>0&&(n[0].trace=t),n}function i(t){t.framework.selectAll("g.trace.choropleth").each(function(t){var e=t[0].trace,r=a.select(this),n=e.marker||{},i=n.line||{},u=l.makeColorScaleFunc(l.extractScale(e.colorscale,e.zmin,e.zmax));r.selectAll("path.choroplethlocation").each(function(t){a.select(this).attr("fill",function(t){return u(t.z)}).call(o.stroke,t.mlc||i.color).call(s.dashLine,"",t.mlw||i.width||0)})})}var a=t("d3"),o=t("../../components/color"),s=t("../../components/drawing"),l=t("../../components/colorscale"),u=t("../../lib/topojson_utils").getTopojsonFeatures,c=t("../../lib/geo_location_utils").locationToFeature,h=t("../../lib/array_to_calc_item"),f=t("../../plots/geo/constants");e.exports=function(t,e,r){function o(t){return t[0].trace.uid}var s,l=t.framework,u=l.select("g.choroplethlayer"),c=l.select("g.baselayer"),h=l.select("g.baselayeroverchoropleth"),d=f.baseLayersOverChoropleth,p=u.selectAll("g.trace.choropleth").data(e,o);p.enter().append("g").attr("class","trace choropleth"),p.exit().remove(),p.each(function(e){var r=e[0].trace,i=n(r,t.topojson),o=a.select(this).selectAll("path.choroplethlocation").data(i);o.enter().append("path").classed("choroplethlocation",!0).on("mouseover",function(e){t.choroplethHoverPt=e}).on("mouseout",function(){t.choroplethHoverPt=null}),o.exit().remove()}),h.selectAll("*").remove();for(var m=0;m<d.length;m++)s=d[m],c.select("g."+s).remove(),t.drawTopo(h,s,r),t.styleLayer(h,s,r);i(t)}},{"../../components/color":590,"../../components/colorscale":604,"../../components/drawing":614,"../../lib/array_to_calc_item":695,"../../lib/geo_location_utils":704,"../../lib/topojson_utils":730,"../../plots/geo/constants":774,d3:118}],898:[function(t,e,r){"use strict";var n=t("../heatmap/attributes"),i=t("../scatter/attributes"),a=t("../../components/colorscale/attributes"),o=t("../../components/colorbar/attributes"),s=t("../../components/drawing/attributes").dash,l=t("../../lib/extend").extendFlat,u=i.line;e.exports=l({},{z:n.z,x:n.x,x0:n.x0,dx:n.dx,y:n.y,y0:n.y0,dy:n.dy,text:n.text,transpose:n.transpose,xtype:n.xtype,ytype:n.ytype,connectgaps:n.connectgaps,autocontour:{valType:"boolean",dflt:!0},ncontours:{valType:"integer",dflt:15,min:1},contours:{start:{valType:"number",dflt:null},end:{valType:"number",dflt:null},size:{valType:"number",dflt:null,min:0},coloring:{valType:"enumerated",values:["fill","heatmap","lines","none"],dflt:"fill"},showlines:{valType:"boolean",dflt:!0}},line:{color:l({},u.color,{}),width:u.width,dash:s,smoothing:l({},u.smoothing,{})}},a,{autocolorscale:l({},a.autocolorscale,{dflt:!1}),zmin:l({},a.zmin,{editType:"docalc"}),zmax:l({},a.zmax,{editType:"docalc"})},{colorbar:o})},{"../../components/colorbar/attributes":591,"../../components/colorscale/attributes":595,"../../components/drawing/attributes":613,"../../lib/extend":701,"../heatmap/attributes":927,"../scatter/attributes":1008}],899:[function(t,e,r){"use strict";function n(t,e,r){var n={type:"linear",range:[t,e]};return i.autoTicks(n,(e-t)/(r||15)),n}var i=t("../../plots/cartesian/axes"),a=t("../../lib").extendFlat,o=t("../heatmap/calc");e.exports=function(t,e){var r=o(t,e),s=e.contours;if(e.autocontour!==!1){var l=n(e.zmin,e.zmax,e.ncontours);s.size=l.dtick,s.start=i.tickFirst(l),l.range.reverse(),s.end=i.tickFirst(l),s.start===e.zmin&&(s.start+=s.size),s.end===e.zmax&&(s.end-=s.size),s.start>s.end&&(s.start=s.end=(s.start+s.end)/2),e._input.contours||(e._input.contours={}),a(e._input.contours,{start:s.start,end:s.end,size:s.size}),e._input.autocontour=!0}else{var u=s.start,c=s.end,h=e._input.contours;if(u>c&&(s.start=h.start=c,c=s.end=h.end=u,u=s.start),!(s.size>0)){var f;f=u===c?1:n(u,c,e.ncontours).dtick,h.size=s.size=f}}return r}},{"../../lib":709,"../../plots/cartesian/axes":748,"../heatmap/calc":928}],900:[function(t,e,r){"use strict";var n=t("../../plots/plots"),i=t("../../components/colorbar/draw"),a=t("./make_color_map"),o=t("./end_plus");e.exports=function(t,e){var r=e[0].trace,s="cb"+r.uid;if(t._fullLayout._infolayer.selectAll("."+s).remove(),!r.showscale)return void n.autoMargin(t,s);var l=i(t,s);e[0].t.cb=l;var u=r.contours,c=r.line,h=u.size||1,f=u.coloring,d=a(r,{isColorbar:!0});"heatmap"===f&&l.filllevels({start:r.zmin,end:r.zmax,size:(r.zmax-r.zmin)/254}),l.fillcolor("fill"===f||"heatmap"===f?d:"").line({color:"lines"===f?d:c.color,width:u.showlines!==!1?c.width:0,dash:c.dash}).levels({start:u.start,end:o(u),size:h}).options(r.colorbar)()}},{"../../components/colorbar/draw":593,"../../plots/plots":811,"./end_plus":904,"./make_color_map":908}],901:[function(t,e,r){"use strict";e.exports.BOTTOMSTART=[1,9,13,104,713],e.exports.TOPSTART=[4,6,7,104,713],e.exports.LEFTSTART=[8,12,14,208,1114],e.exports.RIGHTSTART=[2,3,11,208,1114],e.exports.NEWDELTA=[null,[-1,0],[0,-1],[-1,0],[1,0],null,[0,-1],[-1,0],[0,1],[0,1],null,[0,1],[1,0],[1,0],[0,-1]],e.exports.CHOOSESADDLE={104:[4,1],208:[2,8],713:[7,13],1114:[11,14]},e.exports.SADDLEREMAINDER={1:4,2:8,4:1,7:13,8:2,11:14,13:7,14:11}},{}],902:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes");e.exports=function(t,e,r){var a,o=n.coerce2(t,e,i,"contours.start"),s=n.coerce2(t,e,i,"contours.end"),l=o===!1||s===!1,u=r("contours.size");!(a=l?e.autocontour=!0:r("autocontour",!1))&&u||r("ncontours")}},{"../../lib":709,"./attributes":898}],903:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../heatmap/has_columns"),a=t("../heatmap/xyz_defaults"),o=t("./contours_defaults"),s=t("./style_defaults"),l=t("./attributes");e.exports=function(t,e,r,u){function c(r,i){return n.coerce(t,e,l,r,i)}if(!a(t,e,c,u))return void(e.visible=!1);c("text"),c("connectgaps",i(e)),o(t,e,c),s(t,e,c,u)}},{"../../lib":709,"../heatmap/has_columns":934,"../heatmap/xyz_defaults":942,"./attributes":898,"./contours_defaults":902,"./style_defaults":912}],904:[function(t,e,r){"use strict";e.exports=function(t){return t.end+t.size/1e6}},{}],905:[function(t,e,r){"use strict";function n(t,e,r,n){return Math.abs(t[0]-e[0])<r&&Math.abs(t[1]-e[1])<n}function i(t,e){var r=t[0]-e[0],n=t[1]-e[1];return Math.sqrt(r*r+n*n)}function a(t,e,r,a,c){function h(t){return g[t%g.length]}var f,d=e.join(","),p=d,m=t.crossings[p],v=o(m,r,e),g=[s(t,e,[-v[0],-v[1]])],y=v.join(","),b=t.z.length,x=t.z[0].length;for(f=0;f<1e4;f++){if(m>20?(m=u.CHOOSESADDLE[m][(v[0]||v[1])<0?0:1],t.crossings[p]=u.SADDLEREMAINDER[m]):delete t.crossings[p],!(v=u.NEWDELTA[m])){l.log("Found bad marching index:",m,e,t.level);break}g.push(s(t,e,v)),e[0]+=v[0],e[1]+=v[1],n(g[g.length-1],g[g.length-2],a,c)&&g.pop(),p=e.join(",");var _=v[0]&&(e[0]<0||e[0]>x-2)||v[1]&&(e[1]<0||e[1]>b-2);if(p===d&&v.join(",")===y||r&&_)break;m=t.crossings[p]}1e4===f&&l.log("Infinite loop in contour?");var w,M,k,A,T,S,E,L=n(g[0],g[g.length-1],a,c),C=0,z=.2*t.smoothing,D=[],I=0;for(f=1;f<g.length;f++)E=i(g[f],g[f-1]),C+=E,D.push(E);var P=C/D.length*z;for(f=g.length-2;f>=I;f--)if((w=D[f])<P){for(k=0,M=f-1;M>=I&&w+D[M]<P;M--)w+=D[M];if(L&&f===g.length-2)for(k=0;k<M&&w+D[k]<P;k++)w+=D[k];T=f-M+k+1,S=Math.floor((f+M+k+2)/2),A=L||f!==g.length-2?L||M!==-1?T%2?h(S):[(h(S)[0]+h(S+1)[0])/2,(h(S)[1]+h(S+1)[1])/2]:g[0]:g[g.length-1],g.splice(M+1,f-M+1,A),f=M+1,k&&(I=k),L&&(f===g.length-2?g[k]=g[g.length-1]:0===f&&(g[g.length-1]=g[0]))}if(g.splice(0,I),!(g.length<2))if(L)g.pop(),t.paths.push(g);else{r||l.log("Unclosed interior contour?",t.level,d,g.join("L"));var O=!1;t.edgepaths.forEach(function(e,r){if(!O&&n(e[0],g[g.length-1],a,c)){g.pop(),O=!0;var i=!1;t.edgepaths.forEach(function(e,o){!i&&n(e[e.length-1],g[0],a,c)&&(i=!0,g.splice(0,1),t.edgepaths.splice(r,1),o===r?t.paths.push(g.concat(e)):t.edgepaths[o]=t.edgepaths[o].concat(g,e))}),i||(t.edgepaths[r]=g.concat(e))}}),t.edgepaths.forEach(function(e,r){!O&&n(e[e.length-1],g[0],a,c)&&(g.splice(0,1),t.edgepaths[r]=e.concat(g),O=!0)}),O||t.edgepaths.push(g)}}function o(t,e,r){var n=0,i=0;return t>20&&e?208===t||1114===t?n=0===r[0]?1:-1:i=0===r[1]?1:-1:u.BOTTOMSTART.indexOf(t)!==-1?i=1:u.LEFTSTART.indexOf(t)!==-1?n=1:u.TOPSTART.indexOf(t)!==-1?i=-1:n=-1,[n,i]}function s(t,e,r){var n=e[0]+Math.max(r[0],0),i=e[1]+Math.max(r[1],0),a=t.z[i][n],o=t.xaxis,s=t.yaxis;if(r[1]){var l=(t.level-a)/(t.z[i][n+1]-a);return[o.c2p((1-l)*t.x[n]+l*t.x[n+1],!0),s.c2p(t.y[i],!0)]}var u=(t.level-a)/(t.z[i+1][n]-a);return[o.c2p(t.x[n],!0),s.c2p((1-u)*t.y[i]+u*t.y[i+1],!0)]}var l=t("../../lib"),u=t("./constants");e.exports=function(t,e,r){var n,i,o,s,u;for(e=e||.01,r=r||.01,o=0;o<t.length;o++){for(s=t[o],u=0;u<s.starts.length;u++)i=s.starts[u],a(s,i,"edge",e,r);for(n=0;Object.keys(s.crossings).length&&n<1e4;)n++,i=Object.keys(s.crossings)[0].split(",").map(Number),a(s,i,void 0,e,r);1e4===n&&l.log("Infinite loop in contour?")}}},{"../../lib":709,"./constants":901}],906:[function(t,e,r){"use strict";var n=t("../heatmap/hover");e.exports=function(t,e,r,i){return n(t,e,r,i,!0)}},{"../heatmap/hover":935}],907:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.calc=t("./calc"),n.plot=t("./plot"),n.style=t("./style"),n.colorbar=t("./colorbar"),n.hoverPoints=t("./hover"),n.moduleType="trace",n.name="contour",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","2dMap","contour"],n.meta={},e.exports=n},{"../../plots/cartesian":758,"./attributes":898,"./calc":899,"./colorbar":900,"./defaults":903,"./hover":906,"./plot":910,"./style":911}],908:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../components/colorscale"),a=t("./end_plus");e.exports=function(t){var e=t.contours,r=e.start,o=a(e),s=e.size||1,l=Math.floor((o-r)/s)+1,u="lines"===e.coloring?0:1;isFinite(s)||(s=1,l=1);var c,h,f=t.colorscale,d=f.length,p=new Array(d),m=new Array(d);if("heatmap"===e.coloring){for(t.zauto&&t.autocontour===!1&&(t.zmin=r-s/2,t.zmax=t.zmin+l*s),h=0;h<d;h++)c=f[h],p[h]=c[0]*(t.zmax-t.zmin)+t.zmin,m[h]=c[1];var v=n.extent([t.zmin,t.zmax,e.start,e.start+s*(l-1)]),g=v[t.zmin<t.zmax?0:1],y=v[t.zmin<t.zmax?1:0];g!==t.zmin&&(p.splice(0,0,g),m.splice(0,0,Range[0])),y!==t.zmax&&(p.push(y),m.push(m[m.length-1]))}else for(h=0;h<d;h++)c=f[h],p[h]=(c[0]*(l+u-1)-u/2)*s+r,m[h]=c[1];return i.makeColorScaleFunc({domain:p,range:m},{noNumericCheck:!0})}},{"../../components/colorscale":604,"./end_plus":904,d3:118}],909:[function(t,e,r){"use strict";function n(t,e){var r=(e[0][0]>t?0:1)+(e[0][1]>t?0:2)+(e[1][1]>t?0:4)+(e[1][0]>t?0:8);if(5===r||10===r){return t>(e[0][0]+e[0][1]+e[1][0]+e[1][1])/4?5===r?713:1114:5===r?104:208}return 15===r?0:r}var i=t("./constants");e.exports=function(t){var e,r,a,o,s,l,u,c,h,f=t[0].z,d=f.length,p=f[0].length,m=2===d||2===p;for(r=0;r<d-1;r++)for(o=[],0===r&&(o=o.concat(i.BOTTOMSTART)),r===d-2&&(o=o.concat(i.TOPSTART)),e=0;e<p-1;e++)for(a=o.slice(),0===e&&(a=a.concat(i.LEFTSTART)),e===p-2&&(a=a.concat(i.RIGHTSTART)),s=e+","+r,l=[[f[r][e],f[r][e+1]],[f[r+1][e],f[r+1][e+1]]],h=0;h<t.length;h++)c=t[h],(u=n(c.level,l))&&(c.crossings[s]=u,a.indexOf(u)!==-1&&(c.starts.push([e,r]),m&&a.indexOf(u,a.indexOf(u)+1)!==-1&&c.starts.push([e,r])))}},{"./constants":901}],910:[function(t,e,r){"use strict";function n(t,e,r){var n=r[0].trace,l=r[0].x,h=r[0].y,f=n.contours,d=n.uid,p=e.xaxis,y=e.yaxis,b=t._fullLayout,x="contour"+d,_=i(f,e,r[0]);if(n.visible!==!0)return b._paper.selectAll("."+x+",.hm"+d).remove(),void b._infolayer.selectAll(".cb"+d).remove();"heatmap"===f.coloring?(n.zauto&&n.autocontour===!1&&(n._input.zmin=n.zmin=f.start-f.size/2,n._input.zmax=n.zmax=n.zmin+_.length*f.size),m(t,e,[r])):(b._paper.selectAll(".hm"+d).remove(),b._infolayer.selectAll("g.rangeslider-container").selectAll(".hm"+d).remove()),v(_),g(_);var w=p.c2p(l[0],!0),M=p.c2p(l[l.length-1],!0),k=y.c2p(h[0],!0),A=y.c2p(h[h.length-1],!0),T=[[w,A],[M,A],[M,k],[w,k]],S=a(e,r,x);o(S,T,f),s(S,_,T,f),u(S,_,f),c(S,e,r[0],T)}function i(t,e,r){for(var n=t.size,i=[],a=y(t),o=t.start;o<a;o+=n)if(i.push({level:o,crossings:{},starts:[],edgepaths:[],paths:[],xaxis:e.xaxis,yaxis:e.yaxis,x:r.x,y:r.y,z:r.z,smoothing:r.trace.line.smoothing}),i.length>1e3){d.warn("Too many contours, clipping at 1000",t);break}return i}function a(t,e,r){var n=t.plot.select(".maplayer").selectAll("g.contour."+r).data(e);return n.enter().append("g").classed("contour",!0).classed(r,!0),n.exit().remove(),n}function o(t,e,r){var n=t.selectAll("g.contourbg").data([0]);n.enter().append("g").classed("contourbg",!0);var i=n.selectAll("path").data("fill"===r.coloring?[0]:[]);i.enter().append("path"),i.exit().remove(),i.attr("d","M"+e.join("L")+"Z").style("stroke","none")}function s(t,e,r,n){var i=t.selectAll("g.contourfill").data([0]);i.enter().append("g").classed("contourfill",!0);var a=i.selectAll("path").data("fill"===n.coloring?e:[]);a.enter().append("path"),a.exit().remove(),a.each(function(t){var e=l(t,r);e?f.select(this).attr("d",e).style("stroke","none"):f.select(this).remove()})}function l(t,e){function r(t){return Math.abs(t[0]-e[2][0])<.01}for(var n,i,a,o,s,l,u=Math.min(t.z[0][0],t.z[0][1]),c=t.edgepaths.length||u<=t.level?"":"M"+e.join("L")+"Z",h=0,f=t.edgepaths.map(function(t,e){return e}),m=!0;f.length;){for(l=p.smoothopen(t.edgepaths[h],t.smoothing),c+=m?l:l.replace(/^M/,"L"),f.splice(f.indexOf(h),1),n=t.edgepaths[h][t.edgepaths[h].length-1],o=-1,a=0;a<4;a++){if(!n){d.log("Missing end?",h,t);break}for(!function(t){return Math.abs(t[1]-e[0][1])<.01}(n)||r(n)?!function(t){return Math.abs(t[0]-e[0][0])<.01}(n)?!function(t){return Math.abs(t[1]-e[2][1])<.01}(n)?r(n)&&(i=e[2]):i=e[3]:i=e[0]:i=e[1],s=0;s<t.edgepaths.length;s++){var v=t.edgepaths[s][0];Math.abs(n[0]-i[0])<.01?Math.abs(n[0]-v[0])<.01&&(v[1]-n[1])*(i[1]-v[1])>=0&&(i=v,o=s):Math.abs(n[1]-i[1])<.01?Math.abs(n[1]-v[1])<.01&&(v[0]-n[0])*(i[0]-v[0])>=0&&(i=v,o=s):d.log("endpt to newendpt is not vert. or horz.",n,i,v)}if(n=i,o>=0)break;c+="L"+i}if(o===t.edgepaths.length){d.log("unclosed perimeter path");break}h=o,m=f.indexOf(h)===-1,m&&(h=f[0],c+="Z")}for(h=0;h<t.paths.length;h++)c+=p.smoothclosed(t.paths[h],t.smoothing);return c}function u(t,e,r){var n=e[0].smoothing,i=t.selectAll("g.contourlevel").data(r.showlines===!1?[]:e);i.enter().append("g").classed("contourlevel",!0),i.exit().remove();var a=i.selectAll("path.openline").data(function(t){return t.edgepaths});a.enter().append("path").classed("openline",!0),a.exit().remove(),a.attr("d",function(t){return p.smoothopen(t,n)}).style("stroke-miterlimit",1).style("vector-effect","non-scaling-stroke");var o=i.selectAll("path.closedline").data(function(t){return t.paths});o.enter().append("path").classed("closedline",!0),o.exit().remove(),o.attr("d",function(t){return p.smoothclosed(t,n)}).style("stroke-miterlimit",1).style("vector-effect","non-scaling-stroke")}function c(t,e,r,n){var i="clip"+r.trace.uid,a=e.plot.selectAll("defs").data([0]);a.enter().append("defs");var o=a.selectAll("#"+i).data(r.trace.connectgaps?[]:[0]);if(o.enter().append("clipPath").attr("id",i),o.exit().remove(),r.trace.connectgaps===!1){var s={level:.9,crossings:{},starts:[],edgepaths:[],paths:[],xaxis:e.xaxis,yaxis:e.yaxis,x:r.x,y:r.y,z:h(r),smoothing:0};v([s]),g([s]);var u=l(s,n),c=o.selectAll("path").data([0]);c.enter().append("path"),c.attr("d",u)}else i=null;t.call(p.setClipUrl,i),e.plot.selectAll(".hm"+r.trace.uid).call(p.setClipUrl,i)}function h(t){var e,r,n=t.trace._emptypoints,i=[],a=t.z.length,o=t.z[0].length,s=[];for(e=0;e<o;e++)s.push(1);for(e=0;e<a;e++)i.push(s.slice());for(e=0;e<n.length;e++)r=n[e],i[r[0]][r[1]]=0;return t.zmask=i,i}var f=t("d3"),d=t("../../lib"),p=t("../../components/drawing"),m=t("../heatmap/plot"),v=t("./make_crossings"),g=t("./find_all_paths"),y=t("./end_plus");e.exports=function(t,e,r){for(var i=0;i<r.length;i++)n(t,e,r[i])}},{"../../components/drawing":614,"../../lib":709,"../heatmap/plot":940,"./end_plus":904,"./find_all_paths":905,"./make_crossings":909,d3:118}],911:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../components/drawing"),a=t("../heatmap/style"),o=t("./make_color_map");e.exports=function(t){var e=n.select(t).selectAll("g.contour");e.style("opacity",function(t){return t.trace.opacity}),e.each(function(t){var e=n.select(this),r=t.trace,a=r.contours,s=r.line,l=a.size||1,u=a.start,c=o(r);e.selectAll("g.contourlevel").each(function(t){n.select(this).selectAll("path").call(i.lineGroupStyle,s.width,"lines"===a.coloring?c(t.level):s.color,s.dash)});var h;e.selectAll("g.contourfill path").style("fill",function(t){return void 0===h&&(h=t.level),c(t.level+.5*l)}),void 0===h&&(h=u),e.selectAll("g.contourbg path").style("fill",c(h-.5*l))}),a(t)}},{"../../components/drawing":614,"../heatmap/style":941,"./make_color_map":908,d3:118}],912:[function(t,e,r){"use strict";var n=t("../../components/colorscale/defaults");e.exports=function(t,e,r,i,a,o){var s,l=r("contours.coloring");"fill"===l&&(s=r("contours.showlines")),s!==!1&&("lines"!==l&&r("line.color",a||"#000"),r("line.width",void 0===o?.5:o),r("line.dash")),r("line.smoothing"),"none"!==(e.contours||{}).coloring&&n(t,e,i,r,{prefix:"",cLetter:"z"})}},{"../../components/colorscale/defaults":599}],913:[function(t,e,r){"use strict";var n=t("../heatmap/attributes"),i=t("../scatter/attributes"),a=t("../../components/colorscale/attributes"),o=t("../../components/colorbar/attributes"),s=t("../../lib/extend").extendFlat,l=i.line,u=t("./constants");e.exports=s({},{carpet:{valType:"string"},z:n.z,a:n.x,a0:n.x0,da:n.dx,b:n.y,b0:n.y0,db:n.dy,text:n.text,transpose:n.transpose,atype:n.xtype,btype:n.ytype,mode:{valType:"flaglist",flags:["lines","fill"],extras:["none"]},connectgaps:n.connectgaps,fillcolor:{valType:"color"},autocontour:{valType:"boolean",dflt:!0},ncontours:{valType:"integer",dflt:15,min:1},contours:{type:{valType:"enumerated",values:["levels","constraint"],dflt:"levels"},start:{valType:"number",dflt:null},end:{valType:"number",dflt:null},size:{valType:"number",dflt:null,min:0},coloring:{valType:"enumerated",values:["fill","lines","none"],dflt:"fill"},showlines:{valType:"boolean",dflt:!0},operation:{valType:"enumerated",values:[].concat(u.INEQUALITY_OPS).concat(u.INTERVAL_OPS).concat(u.SET_OPS),dflt:"="},value:{valType:"any",dflt:0}},line:{color:s({},l.color,{}),width:l.width,dash:l.dash,smoothing:s({},l.smoothing,{})}},a,{autocolorscale:s({},a.autocolorscale,{dflt:!1})},{colorbar:o})},{"../../components/colorbar/attributes":591,"../../components/colorscale/attributes":595,"../../lib/extend":701,"../heatmap/attributes":927,"../scatter/attributes":1008,"./constants":916}],914:[function(t,e,r){"use strict";function n(t,e,r){var n={type:"linear",range:[t,e]};return o.autoTicks(n,(e-t)/(r||15)),n}function i(t,e){function r(t){A=e._input.zsmooth=e.zsmooth=!1,a.notifier("cannot fast-zsmooth: "+t)}var n,i,o,s,g,y,b,x,_=e.carpetTrace,w=_.aaxis,M=_.baxis,k=l.traceIs(e,"contour"),A=k?"best":e.zsmooth;if(w._minDtick=0,M._minDtick=0,c(e)&&h(e,w,M,"a","b",["z"]),n=e.a?w.makeCalcdata(e,"a"):[],s=e.b?M.makeCalcdata(e,"b"):[],i=e.a0||0,o=e.da||1,g=e.b0||0,y=e.db||1,b=f(e.z,e.transpose),e._emptypoints=m(b),e._interpz=p(b,e._emptypoints,e._interpz),"fast"===A)if("log"===w.type||"log"===M.type)r("log axis found");else{if(n.length){var T=(n[n.length-1]-n[0])/(n.length-1),S=Math.abs(T/100);for(x=0;x<n.length-1;x++)if(Math.abs(n[x+1]-n[x]-T)>S){r("a scale is not linear");break}}if(s.length&&"fast"===A){var E=(s[s.length-1]-s[0])/(s.length-1),L=Math.abs(E/100);for(x=0;x<s.length-1;x++)if(Math.abs(s[x+1]-s[x]-E)>L){r("b scale is not linear");break}}}var C=d(b),z="scaled"===e.xtype?"":n,D=v(e,z,i,o,C,w),I="scaled"===e.ytype?"":s,P=v(e,I,g,y,b.length,M),O={a:D,b:P,z:b};return"levels"===e.contours.type&&u(e,b,"","z"),[O]}var a=t("../../lib"),o=t("../../plots/cartesian/axes"),s=t("../../lib").extendFlat,l=t("../../registry"),u=t("../../components/colorscale/calc"),c=t("../heatmap/has_columns"),h=t("../heatmap/convert_column_xyz"),f=t("../heatmap/clean_2d_array"),d=t("../heatmap/max_row_length"),p=t("../heatmap/interp2d"),m=t("../heatmap/find_empties"),v=t("../heatmap/make_bound_array"),g=t("./defaults"),y=t("../carpet/lookup_carpetid");e.exports=function(t,e){var r=e.carpetTrace=y(t,e);if(r&&r.visible&&"legendonly"!==r.visible){if(!e.a||!e.b){var a=t.data[r.index],l=t.data[e.index];l.a||(l.a=a.a),l.b||(l.b=a.b),g(l,e,e._defaultColor,t._fullLayout)}var u=i(t,e),c=e.contours;if(e.autocontour===!0){var h=n(e.zmin,e.zmax,e.ncontours);c.size=h.dtick,c.start=o.tickFirst(h),h.range.reverse(),c.end=o.tickFirst(h),c.start===e.zmin&&(c.start+=c.size),c.end===e.zmax&&(c.end-=c.size),c.start>c.end&&(c.start=c.end=(c.start+c.end)/2),e._input.contours=s({},c)}else{var f=c.start,d=c.end,p=e._input.contours;if(f>d&&(c.start=p.start=d,d=c.end=p.end=f,f=c.start),!(c.size>0)){var m;m=f===d?1:n(f,d,e.ncontours).dtick,p.size=c.size=m}}return u}}},{"../../components/colorscale/calc":596,"../../lib":709,"../../plots/cartesian/axes":748,"../../registry":826,"../carpet/lookup_carpetid":882,"../heatmap/clean_2d_array":929,"../heatmap/convert_column_xyz":931,"../heatmap/find_empties":933,"../heatmap/has_columns":934,"../heatmap/interp2d":937,"../heatmap/make_bound_array":938,"../heatmap/max_row_length":939,"./defaults":920}],915:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){var i,a,o,s=n.a.length,l=n.b.length,u=n.z,c=-1/0,h=1/0;for(i=0;i<l;i++)h=Math.min(h,u[i][0]),h=Math.min(h,u[i][s-1]),c=Math.max(c,u[i][0]),c=Math.max(c,u[i][s-1]);for(i=1;i<s-1;i++)h=Math.min(h,u[0][i]),h=Math.min(h,u[l-1][i]),c=Math.max(c,u[0][i]),c=Math.max(c,u[l-1][i]);switch(e){case">":case">=":n.contours.value>c&&(t[0].prefixBoundary=!0);break;case"<":case"<=":n.contours.value<h&&(t[0].prefixBoundary=!0);break;case"[]":case"()":a=Math.min.apply(null,n.contours.value),o=Math.max.apply(null,n.contours.value),o<h&&(t[0].prefixBoundary=!0),a>c&&(t[0].prefixBoundary=!0);break;case"][":case")(":a=Math.min.apply(null,n.contours.value),o=Math.max.apply(null,n.contours.value),a<h&&o>c&&(t[0].prefixBoundary=!0)}}},{}],916:[function(t,e,r){"use strict";e.exports={INEQUALITY_OPS:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"]}},{}],917:[function(t,e,r){"use strict";function n(t,e){function r(t){return s(t)?+t:null}var n,i=Array.isArray(e);return o.INEQUALITY_OPS.indexOf(t)!==-1?n=r(i?e[0]:e):o.INTERVAL_OPS.indexOf(t)!==-1?n=i?[r(e[0]),r(e[1])]:[r(e),r(e)]:o.SET_OPS.indexOf(t)!==-1&&(n=i?e.map(r):[r(e)]),n}function i(t){return function(e){e=n(t,e);var r=Math.min(e[0],e[1]),i=Math.max(e[0],e[1]);return{start:r,end:i,size:i-r}}}function a(t){return function(e){return e=n(t,e),{start:e,end:1/0,size:1/0}}}var o=t("./constants"),s=t("fast-isnumeric");e.exports["[]"]=i("[]"),e.exports["()"]=i("()"),e.exports["[)"]=i("[)"),e.exports["(]"]=i("(]"),e.exports["]["]=i("]["),e.exports[")("]=i(")("),e.exports[")["]=i(")["),e.exports["]("]=i("]("),e.exports[">"]=a(">"),e.exports[">="]=a(">="),e.exports["<"]=a("<"),e.exports["<="]=a("<="),e.exports["="]=a("=")},{"./constants":916,"fast-isnumeric":127}],918:[function(t,e,r){"use strict";var n=t("./constraint_mapping"),i=t("fast-isnumeric");e.exports=function(t,e){var r;["=","<","<=",">",">="].indexOf(e.operation)===-1?(t("contours.value",[0,1]),Array.isArray(e.value)?e.value.length>2?e.value=e.value.slice(2):0===e.length?e.value=[0,1]:e.length<2?(r=parseFloat(e.value[0]),e.value=[r,r+1]):e.value=[parseFloat(e.value[0]),parseFloat(e.value[1])]:i(e.value)&&(r=parseFloat(e.value),e.value=[r,r+1])):(t("contours.value",0),i(e.value)||(Array.isArray(e.value)?e.value=parseFloat(e.value[0]):e.value=0));var a=n[e.operation](e.value);e.start=a.start,e.end=a.end,e.size=a.size}},{"./constraint_mapping":917,"fast-isnumeric":127}],919:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){var r,i,a,o=function(t){return t.reverse()},s=function(t){return t};switch(e){case"][":case")[":case"](":case")(":var l=o;o=s,s=l;case"[]":case"[)":case"(]":case"()":if(2!==t.length)return void n.warn("Contour data invalid for the specified inequality range operation.");for(i=t[0],a=t[1],r=0;r<i.edgepaths.length;r++)i.edgepaths[r]=o(i.edgepaths[r]);for(r=0;r<i.paths.length;r++)i.paths[r]=o(i.paths[r]);for(;a.edgepaths.length;)i.edgepaths.push(s(a.edgepaths.shift()));for(;a.paths.length;)i.paths.push(s(a.paths.shift()));t.pop();break;case">=":case">":if(1!==t.length)return void n.warn("Contour data invalid for the specified inequality operation.");for(i=t[0],r=0;r<i.edgepaths.length;r++)i.edgepaths[r]=o(i.edgepaths[r]);for(r=0;r<i.paths.length;r++)i.paths[r]=o(i.paths[r])}}},{"../../lib":709}],920:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../heatmap/xyz_defaults"),a=t("./attributes"),o=t("../contour/style_defaults"),s=t("../scatter/fillcolor_defaults"),l=t("../../plots/attributes"),u=t("./constraint_value_defaults"),c=t("../../components/color").addOpacity;e.exports=function(t,e,r,h){function f(r,i){return n.coerce(t,e,a,r,i)}if(f("carpet"),t.a&&t.b){var d,p,m,v,g;if(!i(t,e,f,h,"a","b"))return void(e.visible=!1);f("text"),f("contours.type");var y=e.contours;if("constraint"===y.type){f("contours.operation"),u(f,y),n.coerce(t,e,l,"showlegend",!0),f("contours.coloring","="===y.operation?"lines":"fill"),f("contours.showlines",!0),"="===y.operation&&(y.coloring="lines"),s(t,e,r,f);var b=e.fillcolor?c(e.fillcolor,1):r;o(t,e,f,h,b,2),"="===y.operation&&(f("line.color",r),"fill"===y.coloring&&(y.coloring="lines"),"lines"===y.coloring&&delete e.fillcolor),delete e.showscale,delete e.autocontour,delete e.autocolorscale,delete e.colorscale,delete e.ncontours,delete e.colorbar,e.line&&(delete e.line.autocolorscale,delete e.line.colorscale,delete e.line.mincolor,delete e.line.maxcolor)}else n.coerce(t,e,l,"showlegend",!1),p=n.coerce2(t,e,a,"contours.start"),m=n.coerce2(t,e,a,"contours.end"),d=f("contours.size"),f("contours.coloring"),v=p===!1||m===!1,g=v?e.autocontour=!0:f("autocontour",!1),!g&&d||f("ncontours"),o(t,e,f,h),delete e.value,delete e.operation}else e._defaultColor=r}},{"../../components/color":590,"../../lib":709,"../../plots/attributes":746,"../contour/style_defaults":912,"../heatmap/xyz_defaults":942,"../scatter/fillcolor_defaults":1015,"./attributes":913,"./constraint_value_defaults":918}],921:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e,r){for(var i=t.size,a=[],o=r.trace.carpetTrace,s=t.start;s<t.end+i/10;s+=i)if(a.push({level:s,crossings:{},starts:[],edgepaths:[],paths:[],xaxis:o.aaxis,yaxis:o.baxis,x:r.a,y:r.b,z:r.z,smoothing:r.trace.line.smoothing}),a.length>1e3){n.warn("Too many contours, clipping at 1000",t);break}return a}},{"../../lib":709}],922:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../contour/colorbar"),n.calc=t("./calc"),n.plot=t("./plot"),n.style=t("./style"),n.moduleType="trace",n.name="contourcarpet",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","carpet","contour","symbols","showLegend","hasLines","carpetDependent"],n.meta={},e.exports=n},{"../../plots/cartesian":758,"../contour/colorbar":900,"./attributes":913,"./calc":914,"./defaults":920,"./plot":925,"./style":926}],923:[function(t,e,r){"use strict";var n=t("../../components/drawing"),i=t("../carpet/axis_aligned_line"),a=t("../../lib");e.exports=function(t,e,r,o,s,l,u,c){function h(t){return Math.abs(t[1]-r[0][1])<S}function f(t){return Math.abs(t[1]-r[2][1])<S}function d(t){return Math.abs(t[0]-r[0][0])<T}function p(t){return Math.abs(t[0]-r[2][0])<T}function m(t,e){var r,n,a,o,m="";for(h(t)&&!p(t)||f(t)&&!d(t)?(o=s.aaxis,a=i(s,l,[t[0],e[0]],.5*(t[1]+e[1]))):(o=s.baxis,a=i(s,l,.5*(t[0]+e[0]),[t[1],e[1]])),r=1;r<a.length;r++)for(m+=o.smoothing?"C":"L",n=0;n<a[r].length;n++){var v=a[r][n];m+=[u.c2p(v[0]),c.c2p(v[1])]+" "}return m}var v,g,y,b,x,_,w,M="",k=e.edgepaths.map(function(t,e){return e}),A=!0,T=1e-4*Math.abs(r[0][0]-r[2][0]),S=1e-4*Math.abs(r[0][1]-r[2][1]);for(v=0,g=null;k.length;){var E=e.edgepaths[v][0];for(g&&(M+=m(g,E)),w=n.smoothopen(e.edgepaths[v].map(o),e.smoothing),M+=A?w:w.replace(/^M/,"L"),k.splice(k.indexOf(v),1),g=e.edgepaths[v][e.edgepaths[v].length-1],x=-1,b=0;b<4;b++){if(!g){a.log("Missing end?",v,e);break}for(h(g)&&!p(g)?y=r[1]:d(g)?y=r[0]:f(g)?y=r[3]:p(g)&&(y=r[2]),_=0;_<e.edgepaths.length;_++){var L=e.edgepaths[_][0];Math.abs(g[0]-y[0])<T?Math.abs(g[0]-L[0])<T&&(L[1]-g[1])*(y[1]-L[1])>=0&&(y=L,x=_):Math.abs(g[1]-y[1])<S?Math.abs(g[1]-L[1])<S&&(L[0]-g[0])*(y[0]-L[0])>=0&&(y=L,x=_):a.log("endpt to newendpt is not vert. or horz.",g,y,L)}if(x>=0)break;M+=m(g,y),g=y}if(x===e.edgepaths.length){a.log("unclosed perimeter path");break}v=x,A=k.indexOf(v)===-1,A&&(v=k[0],M+=m(g,y)+"Z",g=null)}for(v=0;v<e.paths.length;v++)M+=n.smoothclosed(e.paths[v].map(o),e.smoothing);return M}},{"../../components/drawing":614,"../../lib":709,"../carpet/axis_aligned_line":865}],924:[function(t,e,r){"use strict";e.exports=function(t,e){var r,n,i,a,o,s,l,u,c;for(r=0;r<t.length;r++){for(a=t[r],o=a.pedgepaths=[],s=a.ppaths=[],n=0;n<a.edgepaths.length;n++){for(c=a.edgepaths[n],l=[],i=0;i<c.length;i++)l[i]=e(c[i]);o.push(l)}for(n=0;n<a.paths.length;n++){for(c=a.paths[n],u=[],i=0;i<c.length;i++)u[i]=e(c[i]);s.push(u)}}}},{}],925:[function(t,e,r){"use strict";function n(t,e,r){var n=t.selectAll(e+"."+r).data([0]);return n.enter().append(e).classed(r,!0),n}function i(t,e,r){function n(t){var e=c.ab2xy(t[0],t[1],!0);return[A.c2p(e[0]),T.c2p(e[1])]}var i=r[0].trace,c=i.carpetTrace=x(t,i),d=t.calcdata[c.index][0];if(c.visible&&"legendonly"!==c.visible){var g=r[0].a,w=r[0].b,M=i.contours,k=i.uid,A=e.xaxis,T=e.yaxis,S=t._fullLayout,E="contour"+k,L=y(M,e,r[0]),C="constraint"===i.contours.type;if(i.visible!==!0)return void S._infolayer.selectAll(".cb"+k).remove()
71 ;var z=[[g[0],w[w.length-1]],[g[g.length-1],w[w.length-1]],[g[g.length-1],w[0]],[g[0],w[0]]];p(L);var D=1e-8*(g[g.length-1]-g[0]),I=1e-8*(w[w.length-1]-w[0]);m(L,D,I),"constraint"===i.contours.type&&(v(L,i.contours.operation),_(L,i.contours.operation,z,i)),b(L,n);var P,O,j,F,R=o(e,r,E),N=[];for(F=d.clipsegments.length-1;F>=0;F--)P=d.clipsegments[F],O=h([],P.x,A.c2p),j=h([],P.y,T.c2p),O.reverse(),j.reverse(),N.push(f(O,j,P.bicubic));var B="M"+N.join("L")+"Z";l(R,d.clipsegments,A,T,C,M.coloring),u(i,R,A,T,L,z,n,c,d,M.coloring,B),s(R,L,M),a(R,c)}}function a(t,e){t.attr("clip-path","url(#"+e.clipPathId+")")}function o(t,e,r){var n=t.plot.select(".maplayer").selectAll("g.contour."+r).classed("trace",!0).data(e);return n.enter().append("g").classed("contour",!0).classed(r,!0),n.exit().remove(),n}function s(t,e,r){var n=e[0].smoothing,i=t.selectAll("g.contourlevel").data(r.showlines===!1?[]:e);i.enter().append("g").classed("contourlevel",!0),i.exit().remove();var a=i.selectAll("path.openline").data(function(t){return t.pedgepaths});a.enter().append("path").classed("openline",!0),a.exit().remove(),a.attr("d",function(t){return d.smoothopen(t,n)}).style("vector-effect","non-scaling-stroke");var o=i.selectAll("path.closedline").data(function(t){return t.ppaths});o.enter().append("path").classed("closedline",!0),o.exit().remove(),o.attr("d",function(t){return d.smoothclosed(t,n)}).style("vector-effect","non-scaling-stroke").style("stroke-miterlimit",1)}function l(t,e,r,i,a,o){var s,l,u,c,d=n(t,"g","contourbg"),p=d.selectAll("path").data("fill"!==o||a?[]:[0]);p.enter().append("path"),p.exit().remove();var m=[];for(c=0;c<e.length;c++)s=e[c],l=h([],s.x,r.c2p),u=h([],s.y,i.c2p),m.push(f(l,u,s.bicubic));p.attr("d","M"+m.join("L")+"Z").style("stroke","none")}function u(t,e,r,n,i,a,o,s,l,u,h){var f=e.selectAll("g.contourfill").data([0]);f.enter().append("g").classed("contourfill",!0);var d=f.selectAll("path").data("fill"===u?i:[]);d.enter().append("path"),d.exit().remove(),d.each(function(e){var i=g(t,e,a,o,s,l,r,n);e.prefixBoundary&&(i=h+i),i?c.select(this).attr("d",i).style("stroke","none"):c.select(this).remove()})}var c=t("d3"),h=t("../carpet/map_1d_array"),f=t("../carpet/makepath"),d=t("../../components/drawing"),p=t("../contour/make_crossings"),m=t("../contour/find_all_paths"),v=t("./convert_to_constraints"),g=t("./join_all_paths"),y=t("./empty_pathinfo"),b=t("./map_pathinfo"),x=t("../carpet/lookup_carpetid"),_=t("./close_boundaries");e.exports=function(t,e,r){for(var n=0;n<r.length;n++)i(t,e,r[n])}},{"../../components/drawing":614,"../carpet/lookup_carpetid":882,"../carpet/makepath":883,"../carpet/map_1d_array":884,"../contour/find_all_paths":905,"../contour/make_crossings":909,"./close_boundaries":915,"./convert_to_constraints":919,"./empty_pathinfo":921,"./join_all_paths":923,"./map_pathinfo":924,d3:118}],926:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../components/drawing"),a=t("../heatmap/style"),o=t("../contour/make_color_map");e.exports=function(t){var e=n.select(t).selectAll("g.contour");e.style("opacity",function(t){return t.trace.opacity}),e.each(function(t){var e=n.select(this),r=t.trace,a=r.contours,s=r.line,l=a.size||1,u=a.start;if(isFinite(l)||(l=0),e.selectAll("g.contourlevel").each(function(){n.select(this).selectAll("path").call(i.lineGroupStyle,s.width,s.color,s.dash)}),"levels"===r.contours.type&&"none"!==r.contours.coloring){var c=o(r);e.selectAll("g.contourbg path").style("fill",c(u-l/2)),e.selectAll("g.contourfill path").style("fill",function(t,e){return c(u+(e+.5)*l)})}else e.selectAll("g.contourfill path").style("fill",r.fillcolor)}),a(t)}},{"../../components/drawing":614,"../contour/make_color_map":908,"../heatmap/style":941,d3:118}],927:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../components/colorscale/attributes"),a=t("../../components/colorbar/attributes"),o=t("../../lib/extend").extendFlat;e.exports=o({},{z:{valType:"data_array"},x:n.x,x0:n.x0,dx:n.dx,y:n.y,y0:n.y0,dy:n.dy,text:{valType:"data_array"},transpose:{valType:"boolean",dflt:!1},xtype:{valType:"enumerated",values:["array","scaled"]},ytype:{valType:"enumerated",values:["array","scaled"]},zsmooth:{valType:"enumerated",values:["fast","best",!1],dflt:!1},connectgaps:{valType:"boolean",dflt:!1},xgap:{valType:"number",dflt:0,min:0},ygap:{valType:"number",dflt:0,min:0}},i,{autocolorscale:o({},i.autocolorscale,{dflt:!1})},{colorbar:a})},{"../../components/colorbar/attributes":591,"../../components/colorscale/attributes":595,"../../lib/extend":701,"../scatter/attributes":1008}],928:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("../../plots/cartesian/axes"),o=t("../histogram2d/calc"),s=t("../../components/colorscale/calc"),l=t("./has_columns"),u=t("./convert_column_xyz"),c=t("./max_row_length"),h=t("./clean_2d_array"),f=t("./interp2d"),d=t("./find_empties"),p=t("./make_bound_array");e.exports=function(t,e){function r(t){E=e._input.zsmooth=e.zsmooth=!1,i.notifier("cannot fast-zsmooth: "+t)}var m,v,g,y,b,x,_,w,M=a.getFromId(t,e.xaxis||"x"),k=a.getFromId(t,e.yaxis||"y"),A=n.traceIs(e,"contour"),T=n.traceIs(e,"histogram"),S=n.traceIs(e,"gl2d"),E=A?"best":e.zsmooth;if(M._minDtick=0,k._minDtick=0,T){var L=o(t,e);m=L.x,v=L.x0,g=L.dx,y=L.y,b=L.y0,x=L.dy,_=L.z}else l(e)&&u(e,M,k,"x","y",["z"]),m=e.x?M.makeCalcdata(e,"x"):[],y=e.y?k.makeCalcdata(e,"y"):[],v=e.x0||0,g=e.dx||1,b=e.y0||0,x=e.dy||1,_=h(e.z,e.transpose),(A||e.connectgaps)&&(e._emptypoints=d(_),e._interpz=f(_,e._emptypoints,e._interpz));if("fast"===E)if("log"===M.type||"log"===k.type)r("log axis found");else if(!T){if(m.length){var C=(m[m.length-1]-m[0])/(m.length-1),z=Math.abs(C/100);for(w=0;w<m.length-1;w++)if(Math.abs(m[w+1]-m[w]-C)>z){r("x scale is not linear");break}}if(y.length&&"fast"===E){var D=(y[y.length-1]-y[0])/(y.length-1),I=Math.abs(D/100);for(w=0;w<y.length-1;w++)if(Math.abs(y[w+1]-y[w]-D)>I){r("y scale is not linear");break}}}var P=c(_),O="scaled"===e.xtype?"":m,j=p(e,O,v,g,P,M),F="scaled"===e.ytype?"":y,R=p(e,F,b,x,_.length,k);S||(a.expand(M,j),a.expand(k,R));var N={x:j,y:R,z:_,text:e.text};if(s(e,_,"","z"),A&&e.contours&&"heatmap"===e.contours.coloring){var B={type:"contour"===e.type?"heatmap":"histogram2d",xcalendar:e.xcalendar,ycalendar:e.ycalendar};N.xfill=p(B,O,v,g,P,M),N.yfill=p(B,F,b,x,_.length,k)}return[N]}},{"../../components/colorscale/calc":596,"../../lib":709,"../../plots/cartesian/axes":748,"../../registry":826,"../histogram2d/calc":956,"./clean_2d_array":929,"./convert_column_xyz":931,"./find_empties":933,"./has_columns":934,"./interp2d":937,"./make_bound_array":938,"./max_row_length":939}],929:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.exports=function(t,e){var r,i,a,o,s,l;if(e){for(r=0,s=0;s<t.length;s++)r=Math.max(r,t[s].length);if(0===r)return!1;a=function(t){return t.length},o=function(t,e,r){return t[r][e]}}else r=t.length,a=function(t,e){return t[e].length},o=function(t,e,r){return t[e][r]};var u=new Array(r);for(s=0;s<r;s++)for(i=a(t,s),u[s]=new Array(i),l=0;l<i;l++)u[s][l]=function(t){if(n(t))return+t}(o(t,s,l));return u}},{"fast-isnumeric":127}],930:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../plots/plots"),o=t("../../components/colorscale"),s=t("../../components/colorbar/draw");e.exports=function(t,e){var r=e[0].trace,l="cb"+r.uid,u=r.zmin,c=r.zmax;if(n(u)||(u=i.aggNums(Math.min,null,r.z)),n(c)||(c=i.aggNums(Math.max,null,r.z)),t._fullLayout._infolayer.selectAll("."+l).remove(),!r.showscale)return void a.autoMargin(t,l);var h=e[0].t.cb=s(t,l),f=o.makeColorScaleFunc(o.extractScale(r.colorscale,u,c),{noNumericCheck:!0});h.fillcolor(f).filllevels({start:u,end:c,size:(c-u)/254}).options(r.colorbar)()}},{"../../components/colorbar/draw":593,"../../components/colorscale":604,"../../lib":709,"../../plots/plots":811,"fast-isnumeric":127}],931:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../constants/numerical").BADNUM;e.exports=function(t,e,r,a,o,s){a=a||"x",o=o||"y",s=s||["z"];var l,u,c,h,f,d=t[a].slice(),p=t[o].slice(),m=t.text,v=Math.min(d.length,p.length),g=void 0!==m&&!Array.isArray(m[0]),y=t[a+"calendar"],b=t[o+"calendar"];for(l=0;l<s.length;l++)(c=t[s[l]])&&(v=Math.min(v,c.length));for(v<d.length&&(d=d.slice(0,v)),v<p.length&&(p=p.slice(0,v)),l=0;l<v;l++)d[l]=e.d2c(d[l],0,y),p[l]=r.d2c(p[l],0,b);var x=n.distinctVals(d),_=x.vals,w=n.distinctVals(p),M=w.vals,k=[];for(l=0;l<s.length;l++)k[l]=n.init2dArray(M.length,_.length);var A,T,S;for(g&&(S=n.init2dArray(M.length,_.length)),l=0;l<v;l++)if(d[l]!==i&&p[l]!==i){for(A=n.findBin(d[l]+x.minDiff/2,_),T=n.findBin(p[l]+w.minDiff/2,M),u=0;u<s.length;u++)f=s[u],c=t[f],h=k[u],h[T][A]=c[l];g&&(S[T][A]=m[l])}for(t[a]=_,t[o]=M,u=0;u<s.length;u++)t[s[u]]=k[u];g&&(t.text=S)}},{"../../constants/numerical":690,"../../lib":709}],932:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./has_columns"),a=t("./xyz_defaults"),o=t("../../components/colorscale/defaults"),s=t("./attributes");e.exports=function(t,e,r,l){function u(r,i){return n.coerce(t,e,s,r,i)}if(!a(t,e,u,l))return void(e.visible=!1);u("text"),u("zsmooth")===!1&&(u("xgap"),u("ygap")),u("connectgaps",i(e)&&e.zsmooth!==!1),o(t,e,l,u,{prefix:"",cLetter:"z"})}},{"../../components/colorscale/defaults":599,"../../lib":709,"./attributes":927,"./has_columns":934,"./xyz_defaults":942}],933:[function(t,e,r){"use strict";var n=t("./max_row_length");e.exports=function(t){var e,r,i,a,o,s,l,u,c=[],h={},f=[],d=t[0],p=[],m=[0,0,0],v=n(t);for(r=0;r<t.length;r++)for(e=p,p=d,d=t[r+1]||[],i=0;i<v;i++)void 0===p[i]&&(s=(void 0!==p[i-1]?1:0)+(void 0!==p[i+1]?1:0)+(void 0!==e[i]?1:0)+(void 0!==d[i]?1:0),s?(0===r&&s++,0===i&&s++,r===t.length-1&&s++,i===p.length-1&&s++,s<4&&(h[[r,i]]=[r,i,s]),c.push([r,i,s])):f.push([r,i]));for(;f.length;){for(l={},u=!1,o=f.length-1;o>=0;o--)a=f[o],r=a[0],i=a[1],(s=((h[[r-1,i]]||m)[2]+(h[[r+1,i]]||m)[2]+(h[[r,i-1]]||m)[2]+(h[[r,i+1]]||m)[2])/20)&&(l[a]=[r,i,s],f.splice(o,1),u=!0);if(!u)throw"findEmpties iterated with no new neighbors";for(a in l)h[a]=l[a],c.push(l[a])}return c.sort(function(t,e){return e[2]-t[2]})}},{"./max_row_length":939}],934:[function(t,e,r){"use strict";e.exports=function(t){return!Array.isArray(t.z[0])}},{}],935:[function(t,e,r){"use strict";var n=t("../../components/fx"),i=t("../../lib"),a=n.constants.MAXDIST;e.exports=function(t,e,r,o,s){if(!(t.distance<a)){var l,u,c,h,f=t.cd[0],d=f.trace,p=t.xa,m=t.ya,v=f.x,g=f.y,y=f.z,b=f.zmask,x=v,_=g;if(t.index!==!1){try{c=Math.round(t.index[1]),h=Math.round(t.index[0])}catch(e){return void i.error("Error hovering on heatmap, pointNumber must be [row,col], found:",t.index)}if(c<0||c>=y[0].length||h<0||h>y.length)return}else{if(n.inbox(e-v[0],e-v[v.length-1])>a||n.inbox(r-g[0],r-g[g.length-1])>a)return;if(s){var w;for(x=[2*v[0]-v[1]],w=1;w<v.length;w++)x.push((v[w]+v[w-1])/2);for(x.push([2*v[v.length-1]-v[v.length-2]]),_=[2*g[0]-g[1]],w=1;w<g.length;w++)_.push((g[w]+g[w-1])/2);_.push([2*g[g.length-1]-g[g.length-2]])}c=Math.max(0,Math.min(x.length-2,i.findBin(e,x))),h=Math.max(0,Math.min(_.length-2,i.findBin(r,_)))}var M=p.c2p(v[c]),k=p.c2p(v[c+1]),A=m.c2p(g[h]),T=m.c2p(g[h+1]);s?(k=M,l=v[c],T=A,u=g[h]):(l=(v[c]+v[c+1])/2,u=(g[h]+g[h+1])/2,d.zsmooth&&(M=k=(M+k)/2,A=T=(A+T)/2));var S=y[h][c];b&&!b[h][c]&&(S=void 0);var E;return Array.isArray(f.text)&&Array.isArray(f.text[h])&&(E=f.text[h][c]),[i.extendFlat(t,{index:[h,c],distance:a+10,x0:M,x1:k,y0:A,y1:T,xLabelVal:l,yLabelVal:u,zLabelVal:S,text:E})]}}},{"../../components/fx":631,"../../lib":709}],936:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.calc=t("./calc"),n.plot=t("./plot"),n.colorbar=t("./colorbar"),n.style=t("./style"),n.hoverPoints=t("./hover"),n.moduleType="trace",n.name="heatmap",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","2dMap"],n.meta={},e.exports=n},{"../../plots/cartesian":758,"./attributes":927,"./calc":928,"./colorbar":930,"./defaults":932,"./hover":935,"./plot":940,"./style":941}],937:[function(t,e,r){"use strict";function n(t){return.5-.25*Math.min(1,.5*t)}function i(t,e,r){var n,i,a,s,l,u,c,h,f,d,p,m,v,g=0;for(s=0;s<e.length;s++){for(n=e[s],i=n[0],a=n[1],p=t[i][a],d=0,f=0,l=0;l<4;l++)u=o[l],(c=t[i+u[0]])&&void 0!==(h=c[a+u[1]])&&(0===d?m=v=h:(m=Math.min(m,h),v=Math.max(v,h)),f++,d+=h);if(0===f)throw"iterateInterp2d order is wrong: no defined neighbors";t[i][a]=d/f,void 0===p?f<4&&(g=1):(t[i][a]=(1+r)*t[i][a]-r*p,v>m&&(g=Math.max(g,Math.abs(t[i][a]-p)/(v-m))))}return g}var a=t("../../lib"),o=[[-1,0],[1,0],[0,-1],[0,1]];e.exports=function(t,e,r){var o,s,l=1;if(Array.isArray(r))for(o=0;o<e.length;o++)s=e[o],t[s[0]][s[1]]=r[s[0]][s[1]];else i(t,e);for(o=0;o<e.length&&!(e[o][2]<4);o++);for(e=e.slice(o),o=0;o<100&&l>.01;o++)l=i(t,e,n(l));return l>.01&&a.log("interp2d didn't converge quickly",l),t}},{"../../lib":709}],938:[function(t,e,r){"use strict";var n=t("../../registry");e.exports=function(t,e,r,i,a,o){var s,l,u,c=[],h=n.traceIs(t,"contour"),f=n.traceIs(t,"histogram"),d=n.traceIs(t,"gl2d");if(Array.isArray(e)&&e.length>1&&!f&&"category"!==o.type){var p=e.length;if(!(p<=a))return h?e.slice(0,a):e.slice(0,a+1);if(h||d)c=e.slice(0,a);else if(1===a)c=[e[0]-.5,e[0]+.5];else{for(c=[1.5*e[0]-.5*e[1]],u=1;u<p;u++)c.push(.5*(e[u-1]+e[u]));c.push(1.5*e[p-1]-.5*e[p-2])}if(p<a){var m=c[c.length-1],v=m-c[c.length-2];for(u=p;u<a;u++)m+=v,c.push(m)}}else{l=i||1;var g=t[o._id.charAt(0)+"calendar"];for(s=f||"category"===o.type?o.r2c(r,0,g)||0:Array.isArray(e)&&1===e.length?e[0]:void 0===r?0:o.d2c(r,0,g),u=h||d?0:-.5;u<a;u++)c.push(s+l*u)}return c}},{"../../registry":826}],939:[function(t,e,r){"use strict";e.exports=function(t){for(var e=0,r=0;r<t.length;r++)e=Math.max(e,t[r].length);return e}},{}],940:[function(t,e,r){"use strict";function n(t,e,r){function n(t,e){var r=e.length-2,n=o.constrain(o.findBin(t,e),0,r),i=e[n],a=e[n+1],s=o.constrain(n+(t-i)/(a-i)-.5,0,r),l=Math.round(s),u=Math.abs(s-l);return s&&s!==r&&u?{bin0:l,frac:u,bin1:Math.round(l+u/(s-l))}:{bin0:l,bin1:l,frac:0}}function c(t,e){if(void 0!==t){var r=H(t);return r[0]=Math.round(r[0]),r[1]=Math.round(r[1]),r[2]=Math.round(r[2]),rt+=e,nt+=r[0]*e,it+=r[1]*e,at+=r[2]*e,r}return[0,0,0,0]}function h(t,e,r){t[e]=r[0],t[e+1]=r[1],t[e+2]=r[2],t[e+3]=Math.round(255*r[3])}var f=r[0].trace,d=f.uid,p=e.xaxis,m=e.yaxis,v=t._fullLayout,g="hm"+d;if(v._paper.selectAll(".contour"+d).remove(),v._infolayer.selectAll("g.rangeslider-container").selectAll(".contour"+d).remove(),f.visible!==!0)return v._paper.selectAll("."+g).remove(),void v._infolayer.selectAll(".cb"+d).remove();var y,b,x,_,w,M,k=r[0].z,A=r[0].x,T=r[0].y,S=a.traceIs(f,"contour"),E=S?"best":f.zsmooth,L=k.length,C=u(k),z=!1,D=!1;for(M=0;void 0===y&&M<A.length-1;)y=p.c2p(A[M]),M++;for(M=A.length-1;void 0===b&&M>0;)b=p.c2p(A[M]),M--;for(b<y&&(x=b,b=y,y=x,z=!0),M=0;void 0===_&&M<T.length-1;)_=m.c2p(T[M]),M++;for(M=T.length-1;void 0===w&&M>0;)w=m.c2p(T[M]),M--;if(w<_&&(x=_,_=w,w=x,D=!0),S&&(A=r[0].xfill,T=r[0].yfill),"fast"!==E){var I="best"===E?0:.5;y=Math.max(-I*p._length,y),b=Math.min((1+I)*p._length,b),_=Math.max(-I*m._length,_),w=Math.min((1+I)*m._length,w)}var P=Math.round(b-y),O=Math.round(w-_),j=P<=0||O<=0,F=e.plot.select(".imagelayer").selectAll("g.hm."+g).data(j?[]:[0]);if(F.enter().append("g").classed("hm",!0).classed(g,!0),F.exit().remove(),!j){var R,N;"fast"===E?(R=C,N=L):(R=P,N=O);var B=document.createElement("canvas");B.width=R,B.height=N;var U,V,q=B.getContext("2d"),H=s.makeColorScaleFunc(s.extractScale(f.colorscale,f.zmin,f.zmax),{noNumericCheck:!0,returnArray:!0});"fast"===E?(U=z?function(t){return C-1-t}:o.identity,V=D?function(t){return L-1-t}:o.identity):(U=function(t){return o.constrain(Math.round(p.c2p(A[t])-y),0,P)},V=function(t){return o.constrain(Math.round(m.c2p(T[t])-_),0,O)});var G,Y,X,W,Z,J,K,Q=V(0),$=[Q,Q],tt=z?0:1,et=D?0:1,rt=0,nt=0,it=0,at=0;if(E){var ot,st=0;try{ot=new Uint8Array(P*O*4)}catch(t){ot=new Array(P*O*4)}if("best"===E){var lt,ut,ct,ht=new Array(A.length),ft=new Array(T.length),dt=new Array(P);for(M=0;M<A.length;M++)ht[M]=Math.round(p.c2p(A[M])-y);for(M=0;M<T.length;M++)ft[M]=Math.round(m.c2p(T[M])-_);for(M=0;M<P;M++)dt[M]=n(M,ht);for(X=0;X<O;X++)for(lt=n(X,ft),ut=k[lt.bin0],ct=k[lt.bin1],M=0;M<P;M++,st+=4)K=function(t,e,r,n){var i=t[r.bin0];if(void 0===i)return c(void 0,1);var a,o=t[r.bin1],s=e[r.bin0],l=e[r.bin1],u=o-i||0,h=s-i||0;return a=void 0===o?void 0===l?0:void 0===s?2*(l-i):2*(2*l-s-i)/3:void 0===l?void 0===s?0:2*(2*i-o-s)/3:void 0===s?2*(2*l-o-i)/3:l+i-o-s,c(i+r.frac*u+n.frac*(h+r.frac*a))}(ut,ct,dt[M],lt),h(ot,st,K)}else for(X=0;X<L;X++)for(J=k[X],$=V(X),M=0;M<P;M++)K=c(J[M],1),st=4*($*P+U(M)),h(ot,st,K);var pt=q.createImageData(P,O);try{pt.data.set(ot)}catch(t){var mt=pt.data,vt=mt.length;for(X=0;X<vt;X++)mt[X]=ot[X]}q.putImageData(pt,0,0)}else for(X=0;X<L;X++)if(J=k[X],$.reverse(),$[et]=V(X+1),$[0]!==$[1]&&void 0!==$[0]&&void 0!==$[1])for(W=U(0),Y=[W,W],M=0;M<C;M++)Y.reverse(),Y[tt]=U(M+1),Y[0]!==Y[1]&&void 0!==Y[0]&&void 0!==Y[1]&&(Z=J[M],K=c(Z,(Y[1]-Y[0])*($[1]-$[0])),q.fillStyle="rgba("+K.join(",")+")",G=function(t,e,r,n,i,a,o,s,l){var u={x0:e,x1:r,y0:n,y1:i},c=2*t.xgap/3,h=2*t.ygap/3,f=t.xgap/3,d=t.ygap/3;return s===l-1&&(u.y1=i-h),a===o-1&&(u.x0=e+c),0===s&&(u.y0=n+h),0===a&&(u.x1=r-c),a>0&&a<o-1&&(u.x0=e+f,u.x1=r-f),s>0&&s<l-1&&(u.y0=n+d,u.y1=i-d),u}(f,Y[0],Y[1],$[0],$[1],M,C,X,L),q.fillRect(G.x0,G.y0,G.x1-G.x0,G.y1-G.y0));nt=Math.round(nt/rt),it=Math.round(it/rt),at=Math.round(at/rt);var gt=i("rgb("+nt+","+it+","+at+")");t._hmpixcount=(t._hmpixcount||0)+rt,t._hmlumcount=(t._hmlumcount||0)+rt*gt.getLuminance();var yt=F.selectAll("image").data(r);yt.enter().append("svg:image").attr({xmlns:l.svg,preserveAspectRatio:"none"}),yt.attr({height:O,width:P,x:y,y:_,"xlink:href":B.toDataURL("image/png")}),yt.exit().remove()}}var i=t("tinycolor2"),a=t("../../registry"),o=t("../../lib"),s=t("../../components/colorscale"),l=t("../../constants/xmlns_namespaces"),u=t("./max_row_length");e.exports=function(t,e,r){for(var i=0;i<r.length;i++)n(t,e,r[i])}},{"../../components/colorscale":604,"../../constants/xmlns_namespaces":692,"../../lib":709,"../../registry":826,"./max_row_length":939,tinycolor2:526}],941:[function(t,e,r){"use strict";var n=t("d3");e.exports=function(t){n.select(t).selectAll(".hm image").style("opacity",function(t){return t.trace.opacity})}},{d3:118}],942:[function(t,e,r){"use strict";function n(t,e){var r=e(t);return"scaled"===(r?e(t+"type","array"):"scaled")&&(e(t+"0"),e("d"+t)),r}function i(t){for(var e,r=!0,n=!1,i=!1,o=0;o<t.length;o++){if(e=t[o],!Array.isArray(e)){r=!1;break}e.length>0&&(n=!0);for(var s=0;s<e.length;s++)if(a(e[s])){i=!0;break}}return r&&n&&i}var a=t("fast-isnumeric"),o=t("../../registry"),s=t("./has_columns");e.exports=function(t,e,r,a,l,u){var c=r("z");l=l||"x",u=u||"y";var h,f;if(void 0===c||!c.length)return 0;if(s(t)){if(h=r(l),f=r(u),!h||!f)return 0}else{if(h=n(l,r),f=n(u,r),!i(c))return 0;r("transpose")}return o.getComponentMethod("calendars","handleTraceDefaults")(t,e,[l,u],a),e.z.length}},{"../../registry":826,"./has_columns":934,"fast-isnumeric":127}],943:[function(t,e,r){"use strict";for(var n=t("../heatmap/attributes"),i=t("../../components/colorscale/attributes"),a=t("../../components/colorbar/attributes"),o=t("../../lib/extend").extendFlat,s=["z","x","x0","dx","y","y0","dy","text","transpose","xtype","ytype"],l={},u=0;u<s.length;u++){var c=s[u];l[c]=n[c]}o(l,i,{autocolorscale:o({},i.autocolorscale,{dflt:!1})},{colorbar:a}),e.exports=l},{"../../components/colorbar/attributes":591,"../../components/colorscale/attributes":595,"../../lib/extend":701,"../heatmap/attributes":927}],944:[function(t,e,r){"use strict";function n(t,e){this.scene=t,this.uid=e,this.type="heatmapgl",this.name="",this.hoverinfo="all",this.xData=[],this.yData=[],this.zData=[],this.textLabels=[],this.idToIndex=[],this.bounds=[0,0,0,0],this.options={z:[],x:[],y:[],shape:[0,0],colorLevels:[0],colorValues:[0,0,0,1]},this.heatmap=o(t.glplot,this.options),this.heatmap._trace=this}function i(t){for(var e=t.colorscale,r=t.zmin,n=t.zmax,i=e.length,a=new Array(i),o=new Array(4*i),s=0;s<i;s++){var u=e[s],c=l(u[1]);a[s]=r+u[0]*(n-r);for(var h=0;h<4;h++)o[4*s+h]=c[h]}return{colorLevels:a,colorValues:o}}function a(t,e,r){var i=new n(t,e.uid);return i.update(e,r),i}var o=t("gl-heatmap2d"),s=t("../../plots/cartesian/axes"),l=t("../../lib/str2rgbarray"),u=n.prototype;u.handlePick=function(t){var e=this.options,r=e.shape,n=t.pointId,i=n%r[0],a=Math.floor(n/r[0]),o=n;return{trace:this,dataCoord:t.dataCoord,traceCoord:[e.x[i],e.y[a],e.z[o]],textLabel:this.textLabels[n],name:this.name,pointIndex:[i,a],hoverinfo:this.hoverinfo}},u.update=function(t,e){var r=e[0];this.index=t.index,this.name=t.name,this.hoverinfo=t.hoverinfo;var n=r.z;this.options.z=[].concat.apply([],n);var a=n[0].length,o=n.length;this.options.shape=[a,o],this.options.x=r.x,this.options.y=r.y;var l=i(t);this.options.colorLevels=l.colorLevels,this.options.colorValues=l.colorValues,this.textLabels=[].concat.apply([],t.text),this.heatmap.update(this.options),s.expand(this.scene.xaxis,r.x),s.expand(this.scene.yaxis,r.y)},u.dispose=function(){this.heatmap.dispose()},e.exports=a},{"../../lib/str2rgbarray":727,"../../plots/cartesian/axes":748,"gl-heatmap2d":161}],945:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("../heatmap/defaults"),n.colorbar=t("../heatmap/colorbar"),n.calc=t("../heatmap/calc"),n.plot=t("./convert"),n.moduleType="trace",n.name="heatmapgl",n.basePlotModule=t("../../plots/gl2d"),n.categories=["gl2d","2dMap"],n.meta={},e.exports=n},{"../../plots/gl2d":788,"../heatmap/calc":928,"../heatmap/colorbar":930,"../heatmap/defaults":932,"./attributes":943,"./convert":944}],946:[function(t,e,r){"use strict";function n(t){return{start:{valType:"any",dflt:null},end:{valType:"any",dflt:null},size:{valType:"any",dflt:null}}}var i=t("../bar/attributes");e.exports={x:{valType:"data_array"},y:{valType:"data_array"},text:i.text,orientation:i.orientation,histfunc:{valType:"enumerated",values:["count","sum","avg","min","max"],dflt:"count"},histnorm:{valType:"enumerated",values:["","percent","probability","density","probability density"],dflt:""},cumulative:{enabled:{valType:"boolean",dflt:!1},direction:{valType:"enumerated",values:["increasing","decreasing"],dflt:"increasing"},currentbin:{valType:"enumerated",values:["include","exclude","half"],dflt:"include"}},autobinx:{valType:"boolean",dflt:null},nbinsx:{valType:"integer",min:0,dflt:0},xbins:n("x"),autobiny:{valType:"boolean",dflt:null},nbinsy:{valType:"integer",min:0,dflt:0},ybins:n("y"),marker:i.marker,error_y:i.error_y,error_x:i.error_x,_deprecated:{bardir:i._deprecated.bardir}}},{"../bar/attributes":836}],947:[function(t,e,r){"use strict";e.exports=function(t,e){for(var r=t.length,n=0,i=0;i<r;i++)e[i]?(t[i]/=e[i],n+=t[i]):t[i]=null;return n}},{}],948:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){return r("histnorm"),n.forEach(function(t){r(t+"bins.start"),r(t+"bins.end"),r(t+"bins.size"),r("autobin"+t),r("nbins"+t)}),e}},{}],949:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.exports={count:function(t,e,r){return r[t]++,1},sum:function(t,e,r,i){var a=i[e];return n(a)?(a=Number(a),r[t]+=a,a):0},avg:function(t,e,r,i,a){var o=i[e];return n(o)&&(o=Number(o),r[t]+=o,a[t]++),0},min:function(t,e,r,i){var a=i[e];if(n(a)){if(a=Number(a),!n(r[t]))return r[t]=a,a;if(r[t]>a){var o=a-r[t];return r[t]=a,o}}return 0},max:function(t,e,r,i){var a=i[e];if(n(a)){if(a=Number(a),!n(r[t]))return r[t]=a,a;if(r[t]<a){var o=a-r[t];return r[t]=a,o}}return 0}}},{"fast-isnumeric":127}],950:[function(t,e,r){"use strict";function n(t,e,r){function n(e){s=t[e],t[e]/=2}function i(e){o=t[e],t[e]=s+o/2,s+=o}var a,o,s;if("half"===r)if("increasing"===e)for(n(0),a=1;a<t.length;a++)i(a);else for(n(t.length-1),a=t.length-2;a>=0;a--)i(a);else if("increasing"===e){for(a=1;a<t.length;a++)t[a]+=t[a-1];"exclude"===r&&(t.unshift(0),t.pop())}else{for(a=t.length-2;a>=0;a--)t[a]+=t[a+1];"exclude"===r&&(t.push(0),t.shift())}}var i=t("fast-isnumeric"),a=t("../../lib"),o=t("../../plots/cartesian/axes"),s=t("../bar/arrays_to_calcdata"),l=t("./bin_functions"),u=t("./norm_functions"),c=t("./average"),h=t("./clean_bins");e.exports=function(t,e){if(e.visible===!0){var r,f=[],d=[],p=o.getFromId(t,"h"===e.orientation?e.yaxis||"y":e.xaxis||"x"),m="h"===e.orientation?"y":"x",v={x:"y",y:"x"}[m],g=e[m+"calendar"],y=e.cumulative;h(e,p,m);var b,x=p.makeCalcdata(e,m),_=m+"bins";e["autobin"+m]===!1&&_ in e?b=e[_]:(b=o.autoBin(x,p,e["nbins"+m],!1,g),y.enabled&&"include"!==y.currentbin&&("decreasing"===y.direction?b.start=p.c2r(p.r2c(b.start)-b.size):b.end=p.c2r(p.r2c(b.end)+b.size)),e._input[_]=e[_]=b);var w,M,k,A="string"==typeof b.size,T=A?[]:b,S=[],E=[],L=0,C=e.histnorm,z=e.histfunc,D=C.indexOf("density")!==-1;y.enabled&&D&&(C=C.replace(/ ?density$/,""),D=!1);var I,P="max"===z||"min"===z,O=P?null:0,j=l.count,F=u[C],R=!1,N=function(t){return p.r2c(t,0,g)};for(Array.isArray(e[v])&&"count"!==z&&(I=e[v],R="avg"===z,j=l[z]),r=N(b.start),M=N(b.end)+(r-o.tickIncrement(r,b.size,!1,g))/1e6;r<M&&f.length<5e3;)w=o.tickIncrement(r,b.size,!1,g),f.push((r+w)/2),d.push(O),A&&T.push(r),D&&S.push(1/(w-r)),R&&E.push(0),r=w;A||"date"!==p.type||(T={start:N(T.start),end:N(T.end),size:T.size});var B=d.length;for(r=0;r<x.length;r++)(k=a.findBin(x[r],T))>=0&&k<B&&(L+=j(k,r,d,I,E));R&&(L=c(d,E)),F&&F(d,L,S),y.enabled&&n(d,y.direction,y.currentbin);var U=Math.min(f.length,d.length),V=[],q=0,H=U-1;for(r=0;r<U;r++)if(d[r]){q=r;break}for(r=U-1;r>q;r--)if(d[r]){H=r;break}for(r=q;r<=H;r++)i(f[r])&&i(d[r])&&V.push({p:f[r],s:d[r],b:0});return s(V,e),V}}},{"../../lib":709,"../../plots/cartesian/axes":748,"../bar/arrays_to_calcdata":835,"./average":947,"./bin_functions":949,"./clean_bins":951,"./norm_functions":954,"fast-isnumeric":127}],951:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib").cleanDate,a=t("../../constants/numerical"),o=a.ONEDAY,s=a.BADNUM;e.exports=function(t,e,r){var a=e.type,l=r+"bins",u=t[l];u||(u=t[l]={});var c="date"===a?function(t){return t||0===t?i(t,s,u.calendar):null}:function(t){return n(t)?Number(t):null};u.start=c(u.start),u.end=c(u.end);var h="date"===a?o:1,f=u.size;if(n(f))u.size=f>0?Number(f):h;else if("string"!=typeof f)u.size=h;else{var d=f.charAt(0),p=f.substr(1);p=n(p)?Number(p):0,(p<=0||"date"!==a||"M"!==d||p!==Math.round(p))&&(u.size=h)}var m="autobin"+r;"boolean"!=typeof t[m]&&(t[m]=!((u.start||0===u.start)&&(u.end||0===u.end))),t[m]||delete t["nbins"+r]}},{"../../constants/numerical":690,"../../lib":709,"fast-isnumeric":127}],952:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("../../components/color"),o=t("./bin_defaults"),s=t("../bar/style_defaults"),l=t("../../components/errorbars/defaults"),u=t("./attributes");e.exports=function(t,e,r,c){function h(r,n){return i.coerce(t,e,u,r,n)}var f=h("x"),d=h("y");h("cumulative.enabled")&&(h("cumulative.direction"),h("cumulative.currentbin")),h("text");var p=h("orientation",d&&!f?"h":"v"),m=e["v"===p?"x":"y"];if(!m||!m.length)return void(e.visible=!1);n.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],c),e["h"===p?"x":"y"]&&h("histfunc"),o(t,e,h,"h"===p?["y"]:["x"]),s(t,e,h,r,c),l(t,e,a.defaultLine,{axis:"y"}),l(t,e,a.defaultLine,{axis:"x",inherit:"y"})}},{"../../components/color":590,"../../components/errorbars/defaults":619,"../../lib":709,"../../registry":826,"../bar/style_defaults":847,"./attributes":946,"./bin_defaults":948}],953:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.layoutAttributes=t("../bar/layout_attributes"),n.supplyDefaults=t("./defaults"),n.supplyLayoutDefaults=t("../bar/layout_defaults"),n.calc=t("./calc"),n.setPositions=t("../bar/set_positions"),n.plot=t("../bar/plot"),n.style=t("../bar/style"),n.colorbar=t("../scatter/colorbar"),n.hoverPoints=t("../bar/hover"),n.moduleType="trace",n.name="histogram",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","bar","histogram","oriented","errorBarsOK","showLegend"],n.meta={},e.exports=n},{"../../plots/cartesian":758,"../bar/hover":839,"../bar/layout_attributes":841,"../bar/layout_defaults":842,"../bar/plot":843,"../bar/set_positions":844,"../bar/style":846,"../scatter/colorbar":1011,"./attributes":946,"./calc":950,"./defaults":952}],954:[function(t,e,r){"use strict";e.exports={percent:function(t,e){for(var r=t.length,n=100/e,i=0;i<r;i++)t[i]*=n},probability:function(t,e){for(var r=t.length,n=0;n<r;n++)t[n]/=e},density:function(t,e,r,n){var i=t.length;n=n||1;for(var a=0;a<i;a++)t[a]*=r[a]*n},"probability density":function(t,e,r,n){var i=t.length;n&&(e/=n);for(var a=0;a<i;a++)t[a]*=r[a]/e}}},{}],955:[function(t,e,r){"use strict";var n=t("../histogram/attributes"),i=t("../heatmap/attributes"),a=t("../../components/colorscale/attributes"),o=t("../../components/colorbar/attributes"),s=t("../../lib/extend").extendFlat;e.exports=s({},{x:n.x,y:n.y,z:{valType:"data_array"},marker:{color:{valType:"data_array"}},histnorm:n.histnorm,histfunc:n.histfunc,autobinx:n.autobinx,nbinsx:n.nbinsx,xbins:n.xbins,autobiny:n.autobiny,nbinsy:n.nbinsy,ybins:n.ybins,xgap:i.xgap,ygap:i.ygap,zsmooth:i.zsmooth},a,{autocolorscale:s({},a.autocolorscale,{dflt:!1})},{colorbar:o})},{"../../components/colorbar/attributes":591,"../../components/colorscale/attributes":595,"../../lib/extend":701,"../heatmap/attributes":927,"../histogram/attributes":946}],956:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axes"),a=t("../histogram/bin_functions"),o=t("../histogram/norm_functions"),s=t("../histogram/average"),l=t("../histogram/clean_bins");e.exports=function(t,e){var r,u,c,h,f,d,p=i.getFromId(t,e.xaxis||"x"),m=e.x?p.makeCalcdata(e,"x"):[],v=i.getFromId(t,e.yaxis||"y"),g=e.y?v.makeCalcdata(e,"y"):[],y=e.xcalendar,b=e.ycalendar,x=function(t){return p.r2c(t,0,y)},_=function(t){return v.r2c(t,0,b)},w=function(t){return p.c2r(t,0,y)},M=function(t){return v.c2r(t,0,b)};l(e,p,"x"),l(e,v,"y");var k=Math.min(m.length,g.length);m.length>k&&m.splice(k,m.length-k),g.length>k&&g.splice(k,g.length-k),!e.autobinx&&"xbins"in e||(e.xbins=i.autoBin(m,p,e.nbinsx,"2d",y),"histogram2dcontour"===e.type&&(e.xbins.start=w(i.tickIncrement(x(e.xbins.start),e.xbins.size,!0,y)),e.xbins.end=w(i.tickIncrement(x(e.xbins.end),e.xbins.size,!1,y))),e._input.xbins=e.xbins),!e.autobiny&&"ybins"in e||(e.ybins=i.autoBin(g,v,e.nbinsy,"2d",b),"histogram2dcontour"===e.type&&(e.ybins.start=M(i.tickIncrement(_(e.ybins.start),e.ybins.size,!0,b)),e.ybins.end=M(i.tickIncrement(_(e.ybins.end),e.ybins.size,!1,b))),e._input.ybins=e.ybins),f=[];var A,T,S=[],E=[],L="string"==typeof e.xbins.size,C="string"==typeof e.ybins.size,z=L?[]:e.xbins,D=C?[]:e.ybins,I=0,P=[],O=e.histnorm,j=e.histfunc,F=O.indexOf("density")!==-1,R="max"===j||"min"===j,N=R?null:0,B=a.count,U=o[O],V=!1,q=[],H=[],G="z"in e?e.z:"marker"in e&&Array.isArray(e.marker.color)?e.marker.color:"";G&&"count"!==j&&(V="avg"===j,B=a[j]);var Y=e.xbins,X=x(Y.start),W=x(Y.end)+(X-i.tickIncrement(X,Y.size,!1,y))/1e6;for(d=X;d<W;d=i.tickIncrement(d,Y.size,!1,y))S.push(N),L&&z.push(d),V&&E.push(0);L&&z.push(d);var Z=S.length;r=e.xbins.start;var J=x(r);for(u=(d-J)/Z,r=w(J+u/2),Y=e.ybins,X=_(Y.start),W=_(Y.end)+(X-i.tickIncrement(X,Y.size,!1,b))/1e6,d=X;d<W;d=i.tickIncrement(d,Y.size,!1,b))f.push(S.concat()),C&&D.push(d),V&&P.push(E.concat());C&&D.push(d);var K=f.length;c=e.ybins.start;var Q=_(c);for(h=(d-Q)/K,c=M(Q+h/2),F&&(q=S.map(function(t,e){return L?1/(z[e+1]-z[e]):1/u}),H=f.map(function(t,e){return C?1/(D[e+1]-D[e]):1/h})),L||"date"!==p.type||(z={start:x(z.start),end:x(z.end),size:z.size}),C||"date"!==v.type||(D={start:_(D.start),end:_(D.end),size:D.size}),d=0;d<k;d++)A=n.findBin(m[d],z),T=n.findBin(g[d],D),A>=0&&A<Z&&T>=0&&T<K&&(I+=B(A,d,f[T],G,P[T]));if(V)for(T=0;T<K;T++)I+=s(f[T],P[T]);if(U)for(T=0;T<K;T++)U(f[T],I,q,H[T]);return{x:m,x0:r,dx:u,y:g,y0:c,dy:h,z:f}}},{"../../lib":709,
72 "../../plots/cartesian/axes":748,"../histogram/average":947,"../histogram/bin_functions":949,"../histogram/clean_bins":951,"../histogram/norm_functions":954}],957:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./sample_defaults"),a=t("../../components/colorscale/defaults"),o=t("./attributes");e.exports=function(t,e,r,s){function l(r,i){return n.coerce(t,e,o,r,i)}i(t,e,l,s),l("zsmooth")===!1&&(l("xgap"),l("ygap")),a(t,e,s,l,{prefix:"",cLetter:"z"})}},{"../../components/colorscale/defaults":599,"../../lib":709,"./attributes":955,"./sample_defaults":959}],958:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.calc=t("../heatmap/calc"),n.plot=t("../heatmap/plot"),n.colorbar=t("../heatmap/colorbar"),n.style=t("../heatmap/style"),n.hoverPoints=t("../heatmap/hover"),n.moduleType="trace",n.name="histogram2d",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","2dMap","histogram"],n.meta={},e.exports=n},{"../../plots/cartesian":758,"../heatmap/calc":928,"../heatmap/colorbar":930,"../heatmap/hover":935,"../heatmap/plot":940,"../heatmap/style":941,"./attributes":955,"./defaults":957}],959:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../histogram/bin_defaults");e.exports=function(t,e,r,a){var o=r("x"),s=r("y");if(!(o&&o.length&&s&&s.length))return void(e.visible=!1);n.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],a),(r("z")||r("marker.color"))&&r("histfunc"),i(t,e,r,["x","y"])}},{"../../registry":826,"../histogram/bin_defaults":948}],960:[function(t,e,r){"use strict";var n=t("../histogram2d/attributes"),i=t("../contour/attributes"),a=t("../../components/colorscale/attributes"),o=t("../../components/colorbar/attributes"),s=t("../../lib/extend").extendFlat;e.exports=s({},{x:n.x,y:n.y,z:n.z,marker:n.marker,histnorm:n.histnorm,histfunc:n.histfunc,autobinx:n.autobinx,nbinsx:n.nbinsx,xbins:n.xbins,autobiny:n.autobiny,nbinsy:n.nbinsy,ybins:n.ybins,autocontour:i.autocontour,ncontours:i.ncontours,contours:i.contours,line:i.line},a,{zmin:s({},a.zmin,{editType:"docalc"}),zmax:s({},a.zmax,{editType:"docalc"})},{colorbar:o})},{"../../components/colorbar/attributes":591,"../../components/colorscale/attributes":595,"../../lib/extend":701,"../contour/attributes":898,"../histogram2d/attributes":955}],961:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../histogram2d/sample_defaults"),a=t("../contour/contours_defaults"),o=t("../contour/style_defaults"),s=t("./attributes");e.exports=function(t,e,r,l){function u(r,i){return n.coerce(t,e,s,r,i)}i(t,e,u,l),a(t,e,u),o(t,e,u,l)}},{"../../lib":709,"../contour/contours_defaults":902,"../contour/style_defaults":912,"../histogram2d/sample_defaults":959,"./attributes":960}],962:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.calc=t("../contour/calc"),n.plot=t("../contour/plot"),n.style=t("../contour/style"),n.colorbar=t("../contour/colorbar"),n.hoverPoints=t("../contour/hover"),n.moduleType="trace",n.name="histogram2dcontour",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","2dMap","contour","histogram"],n.meta={},e.exports=n},{"../../plots/cartesian":758,"../contour/calc":899,"../contour/colorbar":900,"../contour/hover":906,"../contour/plot":910,"../contour/style":911,"./attributes":960,"./defaults":961}],963:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),i=t("../../components/colorbar/attributes"),a=t("../surface/attributes"),o=t("../../lib/extend").extendFlat;e.exports={x:{valType:"data_array"},y:{valType:"data_array"},z:{valType:"data_array"},i:{valType:"data_array"},j:{valType:"data_array"},k:{valType:"data_array"},delaunayaxis:{valType:"enumerated",values:["x","y","z"],dflt:"z"},alphahull:{valType:"number",dflt:-1},intensity:{valType:"data_array"},color:{valType:"color"},vertexcolor:{valType:"data_array"},facecolor:{valType:"data_array"},opacity:o({},a.opacity),flatshading:{valType:"boolean",dflt:!1},contour:{show:o({},a.contours.x.show,{}),color:o({},a.contours.x.color),width:o({},a.contours.x.width)},colorscale:n.colorscale,reversescale:n.reversescale,showscale:n.showscale,colorbar:i,lightposition:{x:o({},a.lightposition.x,{dflt:1e5}),y:o({},a.lightposition.y,{dflt:1e5}),z:o({},a.lightposition.z,{dflt:0})},lighting:o({},{vertexnormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-12},facenormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-6}},a.lighting)}},{"../../components/colorbar/attributes":591,"../../components/colorscale/attributes":595,"../../lib/extend":701,"../surface/attributes":1071}],964:[function(t,e,r){"use strict";function n(t,e,r){this.scene=t,this.uid=r,this.mesh=e,this.name="",this.color="#fff",this.data=null,this.showContour=!1}function i(t){return t.map(function(t){var e=t[0],r=u(t[1]),n=r.toRgb();return{index:e,rgb:[n.r,n.g,n.b,1]}})}function a(t){return t.map(d)}function o(t,e,r){for(var n=new Array(t.length),i=0;i<t.length;++i)n[i]=[t[i],e[i],r[i]];return n}function s(t,e){var r=t.glplot.gl,i=l({gl:r}),a=new n(t,i,e.uid);return i._trace=a,a.update(e),t.glplot.add(i),a}var l=t("gl-mesh3d"),u=t("tinycolor2"),c=t("delaunay-triangulate"),h=t("alpha-shape"),f=t("convex-hull"),d=t("../../lib/str2rgbarray"),p=n.prototype;p.handlePick=function(t){if(t.object===this.mesh){var e=t.index=t.data.index;return t.traceCoordinate=[this.data.x[e],this.data.y[e],this.data.z[e]],!0}},p.update=function(t){function e(t,e,r,n){return e.map(function(e){return t.d2l(e,0,n)*r})}var r=this.scene,n=r.fullSceneLayout;this.data=t;var s,l=o(e(n.xaxis,t.x,r.dataScale[0],t.xcalendar),e(n.yaxis,t.y,r.dataScale[1],t.ycalendar),e(n.zaxis,t.z,r.dataScale[2],t.zcalendar));if(t.i&&t.j&&t.k)s=o(t.i,t.j,t.k);else if(0===t.alphahull)s=f(l);else if(t.alphahull>0)s=h(t.alphahull,l);else{var u=["x","y","z"].indexOf(t.delaunayaxis);s=c(l.map(function(t){return[t[(u+1)%3],t[(u+2)%3]]}))}var p={positions:l,cells:s,lightPosition:[t.lightposition.x,t.lightposition.y,t.lightposition.z],ambient:t.lighting.ambient,diffuse:t.lighting.diffuse,specular:t.lighting.specular,roughness:t.lighting.roughness,fresnel:t.lighting.fresnel,vertexNormalsEpsilon:t.lighting.vertexnormalsepsilon,faceNormalsEpsilon:t.lighting.facenormalsepsilon,opacity:t.opacity,contourEnable:t.contour.show,contourColor:d(t.contour.color).slice(0,3),contourWidth:t.contour.width,useFacetNormals:t.flatshading};t.intensity?(this.color="#fff",p.vertexIntensity=t.intensity,p.colormap=i(t.colorscale)):t.vertexcolor?(this.color=t.vertexcolor[0],p.vertexColors=a(t.vertexcolor)):t.facecolor?(this.color=t.facecolor[0],p.cellColors=a(t.facecolor)):(this.color=t.color,p.meshColor=d(t.color)),this.mesh.update(p)},p.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()},e.exports=s},{"../../lib/str2rgbarray":727,"alpha-shape":41,"convex-hull":99,"delaunay-triangulate":119,"gl-mesh3d":200,tinycolor2:526}],965:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("../../components/colorbar/defaults"),o=t("./attributes");e.exports=function(t,e,r,s){function l(r,n){return i.coerce(t,e,o,r,n)}function u(t){var e=t.map(function(t){var e=l(t);return e&&Array.isArray(e)?e:null});return e.every(function(t){return t&&t.length===e[0].length})&&e}var c=u(["x","y","z"]),h=u(["i","j","k"]);if(!c)return void(e.visible=!1);h&&h.forEach(function(t){for(var e=0;e<t.length;++e)t[e]|=0}),n.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y","z"],s),["lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lighting.vertexnormalsepsilon","lighting.facenormalsepsilon","lightposition.x","lightposition.y","lightposition.z","contour.show","contour.color","contour.width","colorscale","reversescale","flatshading","alphahull","delaunayaxis","opacity"].forEach(function(t){l(t)}),"intensity"in t?(l("intensity"),l("showscale",!0)):(e.showscale=!1,"facecolor"in t?l("facecolor"):"vertexcolor"in t?l("vertexcolor"):l("color",r)),e.reversescale&&(e.colorscale=e.colorscale.map(function(t){return[1-t[0],t[1]]}).reverse()),e.showscale&&a(t,e,s)}},{"../../components/colorbar/defaults":592,"../../lib":709,"../../registry":826,"./attributes":963}],966:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../heatmap/colorbar"),n.plot=t("./convert"),n.moduleType="trace",n.name="mesh3d",n.basePlotModule=t("../../plots/gl3d"),n.categories=["gl3d"],n.meta={},e.exports=n},{"../../plots/gl3d":791,"../heatmap/colorbar":930,"./attributes":963,"./convert":964,"./defaults":965}],967:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../scatter/attributes"),a=t("../../components/drawing/attributes").dash,o=i.line,s={name:{valType:"string"},showlegend:{valType:"boolean",dflt:!0},line:{color:o.color,width:o.width,dash:a}};e.exports={x:{valType:"data_array"},open:{valType:"data_array",dflt:[]},high:{valType:"data_array",dflt:[]},low:{valType:"data_array",dflt:[]},close:{valType:"data_array",dflt:[]},line:{width:n.extendFlat({},o.width,{}),dash:n.extendFlat({},a,{})},increasing:n.extendDeep({},s,{line:{color:{dflt:"#3D9970"}}}),decreasing:n.extendDeep({},s,{line:{color:{dflt:"#FF4136"}}}),text:{valType:"string",dflt:"",arrayOk:!0},tickwidth:{valType:"number",min:0,max:.5,dflt:.3}}},{"../../components/drawing/attributes":613,"../../lib":709,"../scatter/attributes":1008}],968:[function(t,e,r){"use strict";function n(t,e,r,n){o(t,e,r,n),r(n+".line.color"),r(n+".line.width",e.line.width),r(n+".line.dash",e.line.dash)}var i=t("../../lib"),a=t("./ohlc_defaults"),o=t("./direction_defaults"),s=t("./attributes"),l=t("./helpers");e.exports=function(t,e,r,o){function u(r,n){return i.coerce(t,e,s,r,n)}if(l.pushDummyTransformOpts(t,e),0===a(t,e,u,o))return void(e.visible=!1);u("line.width"),u("line.dash"),n(t,e,u,"increasing"),n(t,e,u,"decreasing"),u("text"),u("tickwidth")}},{"../../lib":709,"./attributes":967,"./direction_defaults":969,"./helpers":970,"./ohlc_defaults":972}],969:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){r(n+".showlegend"),t.showlegend===!1&&(e[n].showlegend=!1),r(n+".name",e.name+" - "+n)}},{}],970:[function(t,e,r){"use strict";var n=t("../../lib");r.pushDummyTransformOpts=function(t,e){var r={type:e.type,_ephemeral:!0};Array.isArray(t.transforms)?t.transforms.push(r):t.transforms=[r]},r.clearEphemeralTransformOpts=function(t){var e=t.transforms;if(Array.isArray(e)){for(var r=0;r<e.length;r++)e[r]._ephemeral&&e.splice(r,1);0===e.length&&delete t.transforms}},r.copyOHLC=function(t,e){t.open&&(e.open=t.open),t.high&&(e.high=t.high),t.low&&(e.low=t.low),t.close&&(e.close=t.close)},r.makeTransform=function(t,e,r){var i=n.extendFlat([],t.transforms);return i[e.transformIndex]={type:t.type,direction:r,open:t.open,high:t.high,low:t.low,close:t.close},i},r.getFilterFn=function(t){switch(t){case"increasing":return function(t,e){return t<=e};case"decreasing":return function(t,e){return t>e}}},r.addRangeSlider=function(t,e){for(var r=!1,n=0;n<t.length;n++)if(t[n].visible===!0){r=!0;break}r&&(e.xaxis||(e.xaxis={}),e.xaxis.rangeslider||(e.xaxis.rangeslider={}))}},{"../../lib":709}],971:[function(t,e,r){"use strict";var n=t("../../plot_api/register");e.exports={moduleType:"trace",name:"ohlc",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","showLegend"],meta:{},attributes:t("./attributes"),supplyDefaults:t("./defaults")},n(t("../scatter")),n(t("./transform"))},{"../../plot_api/register":738,"../../plots/cartesian":758,"../scatter":1018,"./attributes":967,"./defaults":968,"./transform":973}],972:[function(t,e,r){"use strict";var n=t("../../registry");e.exports=function(t,e,r,i){var a,o=r("x"),s=r("open"),l=r("high"),u=r("low"),c=r("close");return n.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x"],i),a=Math.min(s.length,l.length,u.length,c.length),o&&(a=Math.min(a,o.length))<o.length&&(e.x=o.slice(0,a)),a<s.length&&(e.open=s.slice(0,a)),a<l.length&&(e.high=l.slice(0,a)),a<u.length&&(e.low=u.slice(0,a)),a<c.length&&(e.close=c.slice(0,a)),a}},{"../../registry":826}],973:[function(t,e,r){"use strict";function n(t,e,r){var n={type:"scatter",mode:"lines",connectgaps:!1,visible:t.visible,opacity:t.opacity,xaxis:t.xaxis,yaxis:t.yaxis,hoverinfo:i(t),transforms:s.makeTransform(t,e,r)},a=t[r];return a&&o.extendFlat(n,{x:t.x||[0],xcalendar:t.xcalendar,y:[].concat(t.low).concat(t.high),text:t.text,name:a.name,showlegend:a.showlegend,line:a.line}),n}function i(t){var e=t.hoverinfo;if("all"===e)return"x+text+name";var r=e.split("+"),n=r.indexOf("y"),i=r.indexOf("text");return n!==-1&&(r.splice(n,1),i===-1&&r.push("text")),r.join("+")}function a(t,e,r){var n=r._fullInput,i=n.tickwidth,a=n._minDiff;if(!a){var s=t._fullData,l=[];a=1/0;var u;for(u=0;u<s.length;u++){var c=s[u]._fullInput;if("ohlc"===c.type&&c.visible===!0&&c.xaxis===e._id&&(l.push(c),c.x&&c.x.length>1)){var h=o.simpleMap(c.x,e.d2c,0,r.xcalendar),f=o.distinctVals(h).minDiff;a=Math.min(a,f)}}for(1/0===a&&(a=1),u=0;u<l.length;u++)l[u]._minDiff=a}return a*i}var o=t("../../lib"),s=t("./helpers"),l=t("../../plots/cartesian/axes"),u=t("../../plots/cartesian/axis_ids");r.moduleType="transform",r.name="ohlc",r.attributes={},r.supplyDefaults=function(t,e,r,n){return s.clearEphemeralTransformOpts(n),s.copyOHLC(t,e),t},r.transform=function(t,e){for(var r=[],i=0;i<t.length;i++){var a=t[i];"ohlc"===a.type?r.push(n(a,e,"increasing"),n(a,e,"decreasing")):r.push(a)}return s.addRangeSlider(r,e.layout),r},r.calcTransform=function(t,e,r){var n,i=r.direction,o=s.getFilterFn(i),c=u.getFromTrace(t,e,"x"),h=u.getFromTrace(t,e,"y"),f=a(t,c,e),d=e.open,p=e.high,m=e.low,v=e.close,g=e.text,y=d.length,b=[],x=[],_=[];n=e._fullInput.x?function(t){var r=e.x[t],n=e.xcalendar,i=c.d2c(r,0,n);b.push(c.c2d(i-f,0,n),r,r,r,r,c.c2d(i+f,0,n),null)}:function(t){b.push(t-f,t,t,t,t,t+f,null)};for(var w=function(t,e){return l.tickText(t,t.c2l(e),"hover").text},M=e._fullInput.hoverinfo,k=M.split("+"),A="all"===M,T=A||k.indexOf("y")!==-1,S=A||k.indexOf("text")!==-1,E=Array.isArray(g)?function(t){return g[t]||""}:function(){return g},L=0;L<y;L++)o(d[L],v[L])&&(n(L),function(t,e,r,n){x.push(t,t,e,r,n,n,null)}(d[L],p[L],m[L],v[L]),function(t,e,r,n,i){var a=[];T&&(a.push("Open: "+w(h,e)),a.push("High: "+w(h,r)),a.push("Low: "+w(h,n)),a.push("Close: "+w(h,i))),S&&a.push(E(t));var o=a.join("<br>");_.push(o,o,o,o,o,o,null)}(L,d[L],p[L],m[L],v[L]));e.x=b,e.y=x,e.text=_}},{"../../lib":709,"../../plots/cartesian/axes":748,"../../plots/cartesian/axis_ids":751,"./helpers":970}],974:[function(t,e,r){"use strict";var n=t("../../components/colorscale/color_attributes"),i=t("../../components/colorbar/attributes"),a=t("../../components/colorscale/scales"),o=t("../../plots/cartesian/layout_attributes"),s=t("../../plots/font_attributes"),l=t("../../lib/extend").extendDeep,u=t("../../lib/extend").extendFlat;e.exports={domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]},y:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]}},labelfont:u({},s,{}),tickfont:u({},s,{}),rangefont:u({},s,{}),dimensions:{_isLinkedToArray:"dimension",label:{valType:"string"},tickvals:o.tickvals,ticktext:o.ticktext,tickformat:{valType:"string",dflt:"3s"},visible:{valType:"boolean",dflt:!0},range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},constraintrange:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},values:{valType:"data_array",dflt:[]}},line:u({},l({},n("line"),{colorscale:l({},n("line").colorscale,{dflt:a.Viridis}),autocolorscale:l({},n("line").autocolorscale,{dflt:!1})}),{showscale:{valType:"boolean",dflt:!1},colorbar:i})}},{"../../components/colorbar/attributes":591,"../../components/colorscale/color_attributes":597,"../../components/colorscale/scales":608,"../../lib/extend":701,"../../plots/cartesian/layout_attributes":759,"../../plots/font_attributes":772}],975:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../plots/plots"),a=t("./plot"),o=t("../../constants/xmlns_namespaces"),s=t("./constants");r.name="parcoords",r.attr="type",r.plot=function(t){var e=i.getSubplotCalcData(t.calcdata,"parcoords","parcoords");e.length&&a(t,e)},r.clean=function(t,e,r,n){var i=n._has&&n._has("parcoords"),a=e._has&&e._has("parcoords");i&&!a&&(n._paperdiv.selectAll(".parcoords-line-layers").remove(),n._paperdiv.selectAll(".parcoords-line-layers").remove(),n._paperdiv.selectAll(".parcoords").remove(),n._paperdiv.selectAll(".parcoords").remove(),n._glimages.selectAll("*").remove())},r.toSVG=function(t){function e(e){var n=this,i=n.toDataURL("image/png"),a=r.append("svg:image"),l=t._fullLayout._size,u=t._fullData[e.model.key].domain;a.attr({xmlns:o.svg,"xlink:href":i,x:l.l+l.w*u.x[0]-s.overdrag,y:l.t+l.h*(1-u.y[1]),width:(u.x[1]-u.x[0])*l.w+2*s.overdrag,height:(u.y[1]-u.y[0])*l.h,preserveAspectRatio:"none"})}var r=t._fullLayout._glimages,i=n.selectAll(".svg-container");i.filter(function(t,e){return e===i.size()-1}).selectAll(".parcoords-lines.context, .parcoords-lines.focus").each(e),window.setTimeout(function(){n.selectAll("#filterBarPattern").attr("id","filterBarPattern")},60)}},{"../../constants/xmlns_namespaces":692,"../../plots/plots":811,"./constants":978,"./plot":983,d3:118}],976:[function(t,e,r){"use strict";var n=t("../../components/colorscale/has_colorscale"),i=t("../../components/colorscale/calc"),a=t("../../lib");e.exports=function(t,e){var r=!!e.line.colorscale&&a.isArray(e.line.color),o=r?e.line.color:Array.apply(0,Array(e.dimensions.reduce(function(t,e){return Math.max(t,e.values.length)},0))).map(function(){return.5}),s=r?e.line.colorscale:[[0,e.line.color],[1,e.line.color]];return n(e,"line")&&i(e,e.line.color,"line","c"),[{lineColor:o,cscale:s}]}},{"../../components/colorscale/calc":596,"../../components/colorscale/has_colorscale":603,"../../lib":709}],977:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../plots/plots"),o=t("../../components/colorscale"),s=t("../../components/colorbar/draw");e.exports=function(t,e){var r=e[0].trace,l=r.line,u="cb"+r.uid;if(t._fullLayout._infolayer.selectAll("."+u).remove(),void 0===l||!l.showscale)return void a.autoMargin(t,u);var c=l.color,h=l.cmin,f=l.cmax;n(h)||(h=i.aggNums(Math.min,null,c)),n(f)||(f=i.aggNums(Math.max,null,c));var d=e[0].t.cb=s(t,u),p=o.makeColorScaleFunc(o.extractScale(l.colorscale,h,f),{noNumericCheck:!0});d.fillcolor(p).filllevels({start:h,end:f,size:(f-h)/254}).options(l.colorbar)()}},{"../../components/colorbar/draw":593,"../../components/colorscale":604,"../../lib":709,"../../plots/plots":811,"fast-isnumeric":127}],978:[function(t,e,r){"use strict";e.exports={maxDimensionCount:60,overdrag:45,verticalPadding:2,tickDistance:50,canvasPixelRatio:1,blockLineCount:5e3,scatter:!1,layers:["contextLineLayer","focusLineLayer","pickLineLayer"],axisTitleOffset:28,axisExtentOffset:10,bar:{width:4,capturewidth:10,fillcolor:"magenta",fillopacity:1,strokecolor:"white",strokeopacity:1,strokewidth:1,handleheight:16,handleopacity:1,handleoverlap:0}}},{}],979:[function(t,e,r){"use strict";function n(t,e,r,n,i){i("line.color",r),s(t,"line")&&a.isArray(t.line.color)?(i("line.colorscale"),l(t,e,n,i,{prefix:"line.",cLetter:"c"})):i("line.color",r)}function i(t,e){function r(t,e){return a.coerce(n,i,o.dimensions,t,e)}var n,i,s,l=t.dimensions||[],c=e.dimensions=[],h=1/0;for(l.length>u&&(a.log("parcoords traces support up to "+u+" dimensions at the moment"),l.splice(u)),s=0;s<l.length;s++)if(n=l[s],i={},a.isPlainObject(n)){var f=r("values"),d=r("visible",f.length>0);d&&(r("label"),r("tickvals"),r("ticktext"),r("tickformat"),r("range"),r("constraintrange"),h=Math.min(h,i.values.length)),i._index=s,c.push(i)}if(isFinite(h))for(s=0;s<c.length;s++)i=c[s],i.visible&&i.values.length>h&&(i.values=i.values.slice(0,h));return c}var a=t("../../lib"),o=t("./attributes"),s=t("../../components/colorscale/has_colorscale"),l=t("../../components/colorscale/defaults"),u=t("./constants").maxDimensionCount;e.exports=function(t,e,r,s){function l(r,n){return a.coerce(t,e,o,r,n)}var u=i(t,e);n(t,e,r,s,l),l("domain.x"),l("domain.y"),Array.isArray(u)&&u.length||(e.visible=!1);var c={family:s.font.family,size:Math.round(s.font.size*(10/12)),color:s.font.color};a.coerceFont(l,"labelfont",c),a.coerceFont(l,"tickfont",c),a.coerceFont(l,"rangefont",c)}},{"../../components/colorscale/defaults":599,"../../components/colorscale/has_colorscale":603,"../../lib":709,"./attributes":974,"./constants":978}],980:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.calc=t("./calc"),n.plot=t("./plot"),n.colorbar=t("./colorbar"),n.moduleType="trace",n.name="parcoords",n.basePlotModule=t("./base_plot"),n.categories=["gl","noOpacity"],n.meta={},e.exports=n},{"./attributes":974,"./base_plot":975,"./calc":976,"./colorbar":977,"./defaults":979,"./plot":983}],981:[function(t,e,r){"use strict";function n(t){t.read({x:0,y:0,width:1,height:1,data:x})}function i(t,e,r,n,i){var a=t._gl;a.enable(a.SCISSOR_TEST),a.scissor(e,r,n,i),t.clear({color:[0,0,0,0],depth:1})}function a(t,e,r,a,o,s){function l(n){var c;c=Math.min(a,o-n*a),s.offset=g*n*a,s.count=g*c,0===n&&(window.cancelAnimationFrame(r.currentRafs[u]),delete r.currentRafs[u],i(t,s.scissorX,s.scissorY,s.scissorWidth,s.viewBoxSize[1])),r.clearOnly||(e(s),n*a+c<o&&(r.currentRafs[u]=window.requestAnimationFrame(function(){l(n+1)})),r.drawCompleted=!1)}var u=s.key;r.drawCompleted||(n(t),r.drawCompleted=!0),l(0)}function o(t){return Math.max(m,Math.min(1-m,t))}function s(t,e,r){for(var n=[],i=0;i<256;i++){var a=t(i/255);n.push((e?b:a).concat(r))}return n}function l(t,e){return(t>>>8*e)%256/255}function u(t,e,r,n){for(var i=[],a=0;a<t;a++)for(var s=0;s<v;s++)i.push(s<e?r[s].paddedUnitValues[a]:s===v-1?o(n[a]):s>=v-4?l(a,v-2-s):.5);return i}function c(t,e,r){var n,i,a,o=[];for(i=0;i<t;i++)for(a=0;a<g;a++)for(n=0;n<y;n++)o.push(e[i*v+r*y+n]),r*y+n===v-1&&a%2==0&&(o[o.length-1]*=-1);return o}function h(t,e){var r=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15],n=r.map(function(r){return c(t,e,r)}),i={};return n.forEach(function(t,e){i["p"+e.toString(16)]=t}),i}function f(t,e,r){return t+e<=r}var d=t("regl"),p=t("./constants").verticalPadding,m=1e-6,v=64,g=2,y=4,b=[119,119,119],x=new Uint8Array(4),_=new Uint8Array(4);e.exports=function(t,e,r,n,o,l,c,m,v,g){function y(t){R[0]=t[0],R[1]=t[1]}function b(t,e,i,a,o,s,l,u,c,h,d){var v,g,y,b,x=[t,e],_=p/s,w=[0,1].map(function(){return[0,1,2,3].map(function(){return new Float32Array(16)})}),M=[0,1].map(function(){return[0,1,2,3].map(function(){return new Float32Array(16)})});for(v=0;v<2;v++)for(b=x[v],g=0;g<4;g++)for(y=0;y<16;y++){var k=y+16*g;w[v][g][y]=y+16*g===b?1:0,M[v][g][y]=(!m&&f(y,16*g,D)?A[0===k?0:1+(k-1)%(A.length-1)].filter[v]:v)+(2*v-1)*_}return{key:l,resolution:[r,n],viewBoxPosition:[i+z,a],viewBoxSize:[o,s],i:t,ii:e,dim1A:w[0][0],dim1B:w[0][1],dim1C:w[0][2],dim1D:w[0][3],dim2A:w[1][0],dim2B:w[1][1],dim2C:w[1][2],dim2D:w[1][3],loA:M[0][0],loB:M[0][1],loC:M[0][2],loD:M[0][3],hiA:M[1][0],hiB:M[1][1],hiC:M[1][2],hiD:M[1][3],colorClamp:R,scatter:u||0,scissorX:c===h?0:i+z,scissorWidth:(c===d?r-i+z:o+.5)+(c===h?i+z:0),scissorY:a,scissorHeight:s}}function x(t,o,s){var l,u,c,h=1/0,f=-1/0;for(l=0;l<D;l++)t[l].dim2.canvasX>f&&(f=t[l].dim2.canvasX,c=l),t[l].dim1.canvasX<h&&(h=t[l].dim1.canvasX,u=l);for(0===D&&i(O,0,0,r,n),l=0;l<D;l++){var d=t[l],p=d.dim1,m=p.crossfilterDimensionIndex,v=d.canvasX,y=d.canvasY,x=d.dim2,_=x.crossfilterDimensionIndex,w=d.panelSizeX,M=d.panelSizeY,A=v+w;if(o||!N[m]||N[m][0]!==v||N[m][1]!==A){N[m]=[v,A];var T=b(m,_,v,y,w,M,p.crossfilterDimensionIndex,g||p.scatter?1:0,l,u,c);k.clearOnly=s,a(O,F,k,o?e.blockLineCount:S,S,T)}}}function w(t,e){return O.read({x:t,y:e,width:1,height:1,data:_}),_}function M(t,e,r,n){var i=new Uint8Array(4*r*n);return O.read({x:t,y:e,width:r,height:n,data:i}),i}var k={currentRafs:{},drawCompleted:!0,clearOnly:!1},A=o.slice(),T=A.length,S=A[0]?A[0].values.length:0,E=m,L=v?e.color.map(function(t,r){return r/e.color.length}):e.color,C=Math.max(1/255,Math.pow(1/L.length,1/3)),z=e.canvasOverdrag,D=l.length,I=u(S,T,A,L),P=h(S,I),O=d({canvas:t,attributes:{preserveDrawingBuffer:!0,antialias:!v}}),j=O.texture({shape:[256,1],format:"rgba",type:"uint8",mag:"nearest",min:"nearest",data:s(c,m,Math.round(255*(m?C:1)))}),F=O({profile:!1,blend:{enable:E,func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:1,dstAlpha:1},equation:{rgb:"add",alpha:"add"},color:[0,0,0,0]},depth:{enable:!E,mask:!0,func:"less",range:[0,1]},cull:{enable:!0,face:"back"},scissor:{enable:!0,box:{x:O.prop("scissorX"),y:O.prop("scissorY"),width:O.prop("scissorWidth"),height:O.prop("scissorHeight")}},dither:!1,vert:v?"precision highp float;\n#define GLSLIFY 1\n\nattribute vec4 p0, p1, p2, p3,\n p4, p5, p6, p7,\n p8, p9, pa, pb,\n pc, pd, pe;\n\nattribute vec4 pf;\n\nuniform mat4 dim1A, dim2A, dim1B, dim2B, dim1C, dim2C, dim1D, dim2D,\n loA, hiA, loB, hiB, loC, hiC, loD, hiD;\n\nuniform vec2 resolution,\n viewBoxPosition,\n viewBoxSize;\n\nuniform sampler2D palette;\n\nuniform vec2 colorClamp;\n\nuniform float scatter;\n\nvarying vec4 fragColor;\n\nvec4 zero = vec4(0, 0, 0, 0);\nvec4 unit = vec4(1, 1, 1, 1);\nvec2 xyProjection = vec2(1, 1);\n\nmat4 mclamp(mat4 m, mat4 lo, mat4 hi) {\n return mat4(clamp(m[0], lo[0], hi[0]),\n clamp(m[1], lo[1], hi[1]),\n clamp(m[2], lo[2], hi[2]),\n clamp(m[3], lo[3], hi[3]));\n}\n\nbool mshow(mat4 p, mat4 lo, mat4 hi) {\n return mclamp(p, lo, hi) == p;\n}\n\nfloat val(mat4 p, mat4 v) {\n return dot(matrixCompMult(p, v) * unit, unit);\n}\n\nvoid main() {\n\n float x = 0.5 * sign(pf[3]) + 0.5;\n float prominence = abs(pf[3]);\n float depth = 1.0 - prominence;\n\n mat4 pA = mat4(p0, p1, p2, p3);\n mat4 pB = mat4(p4, p5, p6, p7);\n mat4 pC = mat4(p8, p9, pa, pb);\n mat4 pD = mat4(pc, pd, pe, abs(pf));\n\n float show = float(mshow(pA, loA, hiA) &&\n mshow(pB, loB, hiB) &&\n mshow(pC, loC, hiC) &&\n mshow(pD, loD, hiD));\n\n vec2 yy = show * vec2(val(pA, dim2A) + val(pB, dim2B) + val(pC, dim2C) + val(pD, dim2D),\n val(pA, dim1A) + val(pB, dim1B) + val(pC, dim1C) + val(pD, dim1D));\n\n vec2 dimensionToggle = vec2(x, 1.0 - x);\n\n vec2 scatterToggle = vec2(scatter, 1.0 - scatter);\n\n float y = dot(yy, dimensionToggle);\n mat2 xy = mat2(viewBoxSize * yy + dimensionToggle, viewBoxSize * vec2(x, y));\n\n vec2 viewBoxXY = viewBoxPosition + xy * scatterToggle;\n\n float depthOrHide = depth + 2.0 * (1.0 - show);\n\n gl_Position = vec4(\n xyProjection * (2.0 * viewBoxXY / resolution - 1.0),\n depthOrHide,\n 1.0\n );\n\n // pick coloring\n fragColor = vec4(pf.rgb, 1.0);\n}\n":"precision highp float;\n#define GLSLIFY 1\n\nattribute vec4 p0, p1, p2, p3,\n p4, p5, p6, p7,\n p8, p9, pa, pb,\n pc, pd, pe;\n\nattribute vec4 pf;\n\nuniform mat4 dim1A, dim2A, dim1B, dim2B, dim1C, dim2C, dim1D, dim2D,\n loA, hiA, loB, hiB, loC, hiC, loD, hiD;\n\nuniform vec2 resolution,\n viewBoxPosition,\n viewBoxSize;\n\nuniform sampler2D palette;\n\nuniform vec2 colorClamp;\n\nuniform float scatter;\n\nvarying vec4 fragColor;\n\nvec4 zero = vec4(0, 0, 0, 0);\nvec4 unit = vec4(1, 1, 1, 1);\nvec2 xyProjection = vec2(1, 1);\n\nmat4 mclamp(mat4 m, mat4 lo, mat4 hi) {\n return mat4(clamp(m[0], lo[0], hi[0]),\n clamp(m[1], lo[1], hi[1]),\n clamp(m[2], lo[2], hi[2]),\n clamp(m[3], lo[3], hi[3]));\n}\n\nbool mshow(mat4 p, mat4 lo, mat4 hi) {\n return mclamp(p, lo, hi) == p;\n}\n\nfloat val(mat4 p, mat4 v) {\n return dot(matrixCompMult(p, v) * unit, unit);\n}\n\nvoid main() {\n\n float x = 0.5 * sign(pf[3]) + 0.5;\n float prominence = abs(pf[3]);\n float depth = 1.0 - prominence;\n\n mat4 pA = mat4(p0, p1, p2, p3);\n mat4 pB = mat4(p4, p5, p6, p7);\n mat4 pC = mat4(p8, p9, pa, pb);\n mat4 pD = mat4(pc, pd, pe, abs(pf));\n\n float show = float(mshow(pA, loA, hiA) &&\n mshow(pB, loB, hiB) &&\n mshow(pC, loC, hiC) &&\n mshow(pD, loD, hiD));\n\n vec2 yy = show * vec2(val(pA, dim2A) + val(pB, dim2B) + val(pC, dim2C) + val(pD, dim2D),\n val(pA, dim1A) + val(pB, dim1B) + val(pC, dim1C) + val(pD, dim1D));\n\n vec2 dimensionToggle = vec2(x, 1.0 - x);\n\n vec2 scatterToggle = vec2(scatter, 1.0 - scatter);\n\n float y = dot(yy, dimensionToggle);\n mat2 xy = mat2(viewBoxSize * yy + dimensionToggle, viewBoxSize * vec2(x, y));\n\n vec2 viewBoxXY = viewBoxPosition + xy * scatterToggle;\n\n float depthOrHide = depth + 2.0 * (1.0 - show);\n\n gl_Position = vec4(\n xyProjection * (2.0 * viewBoxXY / resolution - 1.0),\n depthOrHide,\n 1.0\n );\n\n // visible coloring\n float clampedColorIndex = clamp((prominence - colorClamp[0]) / (colorClamp[1] - colorClamp[0]), 0.0, 1.0);\n fragColor = texture2D(palette, vec2((clampedColorIndex * 255.0 + 0.5) / 256.0, 0.5));\n}\n",frag:"precision lowp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nvoid main() {\n gl_FragColor = fragColor;\n}\n",primitive:"lines",lineWidth:1,attributes:P,uniforms:{resolution:O.prop("resolution"),viewBoxPosition:O.prop("viewBoxPosition"),viewBoxSize:O.prop("viewBoxSize"),dim1A:O.prop("dim1A"),dim2A:O.prop("dim2A"),dim1B:O.prop("dim1B"),dim2B:O.prop("dim2B"),dim1C:O.prop("dim1C"),dim2C:O.prop("dim2C"),dim1D:O.prop("dim1D"),dim2D:O.prop("dim2D"),loA:O.prop("loA"),hiA:O.prop("hiA"),loB:O.prop("loB"),hiB:O.prop("hiB"),loC:O.prop("loC"),hiC:O.prop("hiC"),loD:O.prop("loD"),hiD:O.prop("hiD"),palette:j,colorClamp:O.prop("colorClamp"),scatter:O.prop("scatter")},offset:O.prop("offset"),count:O.prop("count")}),R=[0,1],N=[];return{setColorDomain:y,render:x,readPixel:w,readPixels:M,destroy:O.destroy}}},{"./constants":978,regl:491}],982:[function(t,e,r){"use strict";function n(t){return t.key}function i(t){return[t]}function a(t){return!("visible"in t)||t.visible}function o(t){var e=t.range?t.range[0]:_.min(t.values),r=t.range?t.range[1]:_.max(t.values);return!isNaN(e)&&isFinite(e)||(e=0),!isNaN(r)&&isFinite(r)||(r=0),e===r&&(void 0===e?(e=0,r=1):0===e?(e-=1,r+=1):(e*=.9,r*=1.1)),[e,r]}function s(t,e){var r,n,i,a,o;for(r=0,n=t.range(),i=1/0,a=n[0],o;r<n.length;r++){if((o=Math.abs(n[r]-e))>i)return a;i=o,a=n[r]}return n[n.length-1]}function l(t,e,r){var n=o(r);return r.tickvals?_.scale.ordinal().domain(r.tickvals).range(r.tickvals.map(function(t){return(t-n[0])/(n[1]-n[0])}).map(function(r){return t-e+r*(e-(t-e))})):_.scale.linear().domain(n).range([t-e,e])}function u(t,e){return _.scale.linear().range([t-e,e])}function c(t){return _.scale.linear().domain(o(t))}function h(t){var e=o(t);return t.tickvals&&_.scale.ordinal().domain(t.tickvals).range(t.tickvals.map(function(t){return(t-e[0])/(e[1]-e[0])}))}function f(t){var e=t.map(function(t){return t[0]}),r=t.map(function(t){return t[1]}),n=r.map(function(t){return _.rgb(t)}),i=function(t){return function(e){return e[t]}},a="rgb".split("").map(function(t){return _.scale.linear().clamp(!0).domain(e).range(n.map(i(t)))});return function(t){return a.map(function(e){return e(t)})}}function d(t){return t[0]}function p(t,e,r){var n=d(e),i=n.trace,o=n.lineColor,s=n.cscale,l=i.line,u=i.domain,h=i.dimensions,p=t.width,m=i.labelfont,v=i.tickfont,g=i.rangefont,y=x.extendDeep({},l,{color:o.map(c({values:o,range:[l.cmin,l.cmax]})),blockLineCount:b.blockLineCount,canvasOverdrag:b.overdrag*b.canvasPixelRatio}),_=Math.floor(p*(u.x[1]-u.x[0])),w=Math.floor(t.height*(u.y[1]-u.y[0])),M=t.margin||{l:80,r:80,t:100,b:80},k=_,A=w
73 ;return{key:r,colCount:h.filter(a).length,dimensions:h,tickDistance:b.tickDistance,unitToColor:f(s),lines:y,labelFont:m,tickFont:v,rangeFont:g,translateX:u.x[0]*p,translateY:t.height-u.y[1]*t.height,pad:M,canvasWidth:k*b.canvasPixelRatio+2*y.canvasOverdrag,canvasHeight:A*b.canvasPixelRatio,width:k,height:A,canvasPixelRatio:b.canvasPixelRatio}}function m(t){var e=t.width,r=t.height,n=t.dimensions,i=t.canvasPixelRatio,o=function(r){return e*r/Math.max(1,t.colCount-1)},s=b.verticalPadding/(r*i),f=1-2*s,d=function(t){return s+f*t},p={key:t.key,xScale:o,model:t},m={};return p.dimensions=n.filter(a).map(function(e,n){var a=c(e),s=m[e.label];return m[e.label]=(s||0)+1,{key:e.label+(s?"__"+s:""),label:e.label,tickFormat:e.tickformat,tickvals:e.tickvals,ticktext:e.ticktext,ordinal:!!e.tickvals,scatter:b.scatter||e.scatter,xIndex:n,crossfilterDimensionIndex:n,visibleIndex:e._index,height:r,values:e.values,paddedUnitValues:e.values.map(a).map(d),xScale:o,x:o(n),canvasX:o(n)*i,unitScale:u(r,b.verticalPadding),domainScale:l(r,b.verticalPadding,e),ordinalScale:h(e),domainToUnitScale:a,filter:e.constraintrange?e.constraintrange.map(a):[0,1],parent:p,model:t}}),p}function v(t){return b.layers.map(function(e){return{key:e,context:"contextLineLayer"===e,pick:"pickLineLayer"===e,viewModel:t,model:t.model}})}function g(t){t.classed("axisExtentText",!0).attr("text-anchor","middle").style("cursor","default").style("user-select","none")}var y=t("./lines"),b=t("./constants"),x=t("../../lib"),_=t("d3"),w=t("../../components/drawing");e.exports=function(t,e,r,a,o){function l(t){var e=t.selectAll("defs").data(i,n);e.enter().append("defs");var r=e.selectAll("#filterBarPattern").data(i,n);r.enter().append("pattern").attr("id","filterBarPattern").attr("patternUnits","userSpaceOnUse"),r.attr("x",-b.bar.width).attr("width",b.bar.capturewidth).attr("height",function(t){return t.model.height});var a=r.selectAll("rect").data(i,n);a.enter().append("rect").attr("shape-rendering","crispEdges"),a.attr("height",function(t){return t.model.height}).attr("width",b.bar.width).attr("x",b.bar.width/2).attr("fill",b.bar.fillcolor).attr("fill-opacity",b.bar.fillopacity).attr("stroke",b.bar.strokecolor).attr("stroke-opacity",b.bar.strokeopacity).attr("stroke-width",b.bar.strokewidth)}function u(t){return t.dimensions.some(function(t){return 0!==t.filter[0]||1!==t.filter[1]})}function c(t,e){for(var r=e.panels||(e.panels=[]),n=t.each(function(t){return t})[e.key].map(function(t){return t.__data__}),i=n.length-1,a=0;a<1;a++)for(var o=0;o<i;o++){var s=r[o+a*i]||(r[o+a*i]={}),l=n[o],u=n[o+1];s.dim1=l,s.dim2=u,s.canvasX=l.canvasX,s.panelSizeX=u.canvasX-l.canvasX,s.panelSizeY=e.model.canvasHeight/1,s.y=a*s.panelSizeY,s.canvasY=e.model.canvasHeight-s.y-s.panelSizeY}}function h(t,e){for(var r=e.panels||(e.panels=[]),n=t.each(function(t){return t})[e.key].map(function(t){return t.__data__}),i=n.length-1,a=i,o=0;o<i;o++)for(var s=0;s<i;s++){var l=r[s+o*i]||(r[s+o*i]={}),u=n[s],c=n[s+1];l.dim1=n[o+1],l.dim2=c,l.canvasX=u.canvasX,l.panelSizeX=c.canvasX-u.canvasX,l.panelSizeY=e.model.canvasHeight/a,l.y=o*l.panelSizeY,l.canvasY=e.model.canvasHeight-l.y-l.panelSizeY}}function f(t,e){return(b.scatter?h:c)(t,e)}function x(t){return t.ordinal?function(){return""}:_.format(t.tickFormat)}function M(){X=!0,T=!0}function k(t){S=!1;var e=t.parent,r=t.brush.extent(),n=e.dimensions,i=n[t.xIndex].filter,a=X&&r[0]===r[1];a&&(t.brush.clear(),_.select(this).select("rect.extent").attr("y",-100));var o=a?[0,1]:r.slice();if(o[0]!==i[0]||o[1]!==i[1]){n[t.xIndex].filter=o,e.focusLineLayer&&e.focusLineLayer.render(e.panels,!0);var s=u(e);!W&&s?(e.contextLineLayer&&e.contextLineLayer.render(e.panels,!0),W=!0):W&&!s&&(e.contextLineLayer&&e.contextLineLayer.render(e.panels,!0,!0),W=!1)}X=!1}function A(t){var e=t.parent,r=t.brush.extent(),n=r[0]===r[1],i=e.dimensions,a=i[t.xIndex].filter;if(!n&&t.ordinal&&(a[0]=s(t.ordinalScale,a[0]),a[1]=s(t.ordinalScale,a[1]),a[0]===a[1]&&(a[0]=Math.max(0,a[0]-.05),a[1]=Math.min(1,a[1]+.05)),_.select(this).transition().duration(150).call(t.brush.extent(a)),e.focusLineLayer.render(e.panels,!0)),e.pickLineLayer&&e.pickLineLayer.render(e.panels,!0),S=!0,T="ending",o&&o.filterChanged){var l=t.domainToUnitScale.invert,u=a.map(l);o.filterChanged(e.key,t.visibleIndex,u)}}var T=!1,S=!0,E=r.filter(function(t){return d(t).trace.visible}).map(p.bind(0,a)).map(m);t.selectAll(".parcoords-line-layers").remove();var L=t.selectAll(".parcoords-line-layers").data(E,n);L.enter().insert("div","."+e.attr("class").split(" ").join(" .")).classed("parcoords-line-layers",!0).style("box-sizing","content-box"),L.style("transform",function(t){return"translate("+(t.model.translateX-b.overdrag)+"px,"+t.model.translateY+"px)"});var C=L.selectAll(".parcoords-lines").data(v,n),z={renderers:[],dimensions:[]},D=null;C.enter().append("canvas").attr("class",function(t){return"parcoords-lines "+(t.context?"context":t.pick?"pick":"focus")}).style("box-sizing","content-box").style("float","left").style("clear","both").style("left",0).style("overflow","visible").style("position",function(t,e){return"absolute"}).filter(function(t){return t.pick}).on("mousemove",function(t){if(S&&t.lineLayer&&o&&o.hover){var e=_.event,r=this.width,n=this.height,i=_.mouse(this),a=i[0],s=i[1];if(a<0||s<0||a>=r||s>=n)return;var l=t.lineLayer.readPixel(a,n-1-s),u=0!==l[3],c=u?l[2]+256*(l[1]+256*l[0]):null,h={x:a,y:s,clientX:e.clientX,clientY:e.clientY,dataIndex:t.model.key,curveNumber:c};c!==D&&(u?o.hover(h):o.unhover&&o.unhover(h),D=c)}}),C.style("margin",function(t){var e=t.model.pad;return e.t+"px "+e.r+"px "+e.b+"px "+e.l+"px"}).attr("width",function(t){return t.model.canvasWidth}).attr("height",function(t){return t.model.canvasHeight}).style("width",function(t){return t.model.width+2*b.overdrag+"px"}).style("height",function(t){return t.model.height+"px"}).style("opacity",function(t){return t.pick?.01:1}),e.style("background","rgba(255, 255, 255, 0)");var I=e.selectAll(".parcoords").data(E,n);I.exit().remove(),I.enter().append("g").classed("parcoords",!0).attr("overflow","visible").style("box-sizing","content-box").style("position","absolute").style("left",0).style("overflow","visible").style("shape-rendering","crispEdges").style("pointer-events","none").call(l),I.attr("width",function(t){return t.model.width+t.model.pad.l+t.model.pad.r}).attr("height",function(t){return t.model.height+t.model.pad.t+t.model.pad.b}).attr("transform",function(t){return"translate("+t.model.translateX+","+t.model.translateY+")"});var P=I.selectAll(".parcoordsControlView").data(i,n);P.enter().append("g").classed("parcoordsControlView",!0).style("box-sizing","content-box"),P.attr("transform",function(t){return"translate("+t.model.pad.l+","+t.model.pad.t+")"});var O=P.selectAll(".yAxis").data(function(t){return t.dimensions},n);O.enter().append("g").classed("yAxis",!0).each(function(t){z.dimensions.push(t)}),P.each(function(t){f(O,t)}),C.each(function(t){t.lineLayer=y(this,t.model.lines,t.model.canvasWidth,t.model.canvasHeight,t.viewModel.dimensions,t.viewModel.panels,t.model.unitToColor,t.context,t.pick,b.scatter),t.viewModel[t.key]=t.lineLayer,z.renderers.push(function(){t.lineLayer.render(t.viewModel.panels,!0)}),t.lineLayer.render(t.viewModel.panels,!t.context)}),O.attr("transform",function(t){return"translate("+t.xScale(t.xIndex)+", 0)"}),O.call(_.behavior.drag().origin(function(t){return t}).on("drag",function(t){var e=t.parent;S=!1,T||(t.x=Math.max(-b.overdrag,Math.min(t.model.width+b.overdrag,_.event.x)),t.canvasX=t.x*t.model.canvasPixelRatio,O.sort(function(t,e){return t.x-e.x}).each(function(e,r){e.xIndex=r,e.x=t===e?e.x:e.xScale(e.xIndex),e.canvasX=e.x*e.model.canvasPixelRatio}),f(O,e),O.filter(function(e){return 0!==Math.abs(t.xIndex-e.xIndex)}).attr("transform",function(t){return"translate("+t.xScale(t.xIndex)+", 0)"}),_.select(this).attr("transform","translate("+t.x+", 0)"),O.each(function(r,n,i){i===t.parent.key&&(e.dimensions[n]=r)}),e.contextLineLayer&&e.contextLineLayer.render(e.panels,!1,!u(e)),e.focusLineLayer.render&&e.focusLineLayer.render(e.panels))}).on("dragend",function(t){var e=t.parent;if(T)return void("ending"===T&&(T=!1));t.x=t.xScale(t.xIndex),t.canvasX=t.x*t.model.canvasPixelRatio,f(O,e),_.select(this).attr("transform",function(t){return"translate("+t.x+", 0)"}),e.contextLineLayer&&e.contextLineLayer.render(e.panels,!1,!u(e)),e.focusLineLayer&&e.focusLineLayer.render(e.panels),e.pickLineLayer&&e.pickLineLayer.render(e.panels,!0),S=!0,o&&o.axesMoved&&o.axesMoved(e.key,e.dimensions.map(function(t){return t.crossfilterDimensionIndex}))})),O.exit().remove();var j=O.selectAll(".axisOverlays").data(i,n);j.enter().append("g").classed("axisOverlays",!0),j.selectAll(".axis").remove();var F=j.selectAll(".axis").data(i,n);F.enter().append("g").classed("axis",!0),F.each(function(t){var e=t.model.height/t.model.tickDistance,r=t.domainScale,n=r.domain(),i=t.ticktext;_.select(this).call(_.svg.axis().orient("left").tickSize(4).outerTickSize(2).ticks(e,t.tickFormat).tickValues(t.ordinal?n.map(function(t,e){return i&&i[e]||t}):null).tickFormat(t.ordinal?function(t){return t}:null).scale(r)),w.font(F.selectAll("text"),t.model.tickFont)}),F.selectAll(".domain, .tick>line").attr("fill","none").attr("stroke","black").attr("stroke-opacity",.25).attr("stroke-width","1px"),F.selectAll("text").style("text-shadow","1px 1px 1px #fff, -1px -1px 1px #fff, 1px -1px 1px #fff, -1px 1px 1px #fff").style("cursor","default").style("user-select","none");var R=j.selectAll(".axisHeading").data(i,n);R.enter().append("g").classed("axisHeading",!0);var N=R.selectAll(".axisTitle").data(i,n);N.enter().append("text").classed("axisTitle",!0).attr("text-anchor","middle").style("cursor","ew-resize").style("user-select","none").style("pointer-events","auto"),N.attr("transform","translate(0,"+-b.axisTitleOffset+")").text(function(t){return t.label}).each(function(t){w.font(N,t.model.labelFont)});var B=j.selectAll(".axisExtent").data(i,n);B.enter().append("g").classed("axisExtent",!0);var U=B.selectAll(".axisExtentTop").data(i,n);U.enter().append("g").classed("axisExtentTop",!0),U.attr("transform","translate(0,"+-b.axisExtentOffset+")");var V=U.selectAll(".axisExtentTopText").data(i,n);V.enter().append("text").classed("axisExtentTopText",!0).attr("alignment-baseline","after-edge").call(g),V.text(function(t){return x(t)(t.domainScale.domain().slice(-1)[0])}).each(function(t){w.font(V,t.model.rangeFont)});var q=B.selectAll(".axisExtentBottom").data(i,n);q.enter().append("g").classed("axisExtentBottom",!0),q.attr("transform",function(t){return"translate(0,"+(t.model.height+b.axisExtentOffset)+")"});var H=q.selectAll(".axisExtentBottomText").data(i,n);H.enter().append("text").classed("axisExtentBottomText",!0).attr("alignment-baseline","before-edge").call(g),H.text(function(t){return x(t)(t.domainScale.domain()[0])}).each(function(t){w.font(H,t.model.rangeFont)});var G=j.selectAll(".axisBrush").data(i,n),Y=G.enter().append("g").classed("axisBrush",!0);G.each(function(t){t.brush||(t.brush=_.svg.brush().y(t.unitScale).on("brushstart",M).on("brush",k).on("brushend",A),0===t.filter[0]&&1===t.filter[1]||t.brush.extent(t.filter),_.select(this).call(t.brush))}),Y.selectAll("rect").attr("x",-b.bar.capturewidth/2).attr("width",b.bar.capturewidth),Y.selectAll("rect.extent").attr("fill","url(#filterBarPattern)").style("cursor","ns-resize").filter(function(t){return 0===t.filter[0]&&1===t.filter[1]}).attr("y",-100),Y.selectAll(".resize rect").attr("height",b.bar.handleheight).attr("opacity",0).style("visibility","visible"),Y.selectAll(".resize.n rect").style("cursor","n-resize").attr("y",b.bar.handleoverlap-b.bar.handleheight),Y.selectAll(".resize.s rect").style("cursor","s-resize").attr("y",b.bar.handleoverlap);var X=!1,W=!1;return z}},{"../../components/drawing":614,"../../lib":709,"./constants":978,"./lines":981,d3:118}],983:[function(t,e,r){"use strict";var n=t("./parcoords");e.exports=function(t,e){var r=t._fullLayout,i=r._paper,a=r._paperdiv,o={},s={},l=r._size;e.forEach(function(e,r){o[r]=t.data[r].dimensions,s[r]=t.data[r].dimensions.slice()});var u=function(e,r,n){var i=s[e][r],a=i.constraintrange;a&&2===a.length||(a=i.constraintrange=[]),a[0]=n[0],a[1]=n[1],t.emit("plotly_restyle")},c=function(e){t.emit("plotly_hover",e)},h=function(e){t.emit("plotly_unhover",e)},f=function(e,r){function n(t){return!("visible"in t)||t.visible}function i(t,e,r){var n=e.indexOf(r),i=t.indexOf(n);return i===-1&&(i+=e.length),i}var a=function(t){return function(e,n){return i(r,t,e)-i(r,t,n)}}(s[e].filter(n));o[e].sort(a),s[e].filter(function(t){return!n(t)}).sort(function(t){return s[e].indexOf(t)}).forEach(function(t){o[e].splice(o[e].indexOf(t),1),o[e].splice(s[e].indexOf(t),0,t)}),t.emit("plotly_restyle")};n(a,i,e,{width:l.w,height:l.h,margin:{t:l.t,r:l.r,b:l.b,l:l.l}},{filterChanged:u,hover:c,unhover:h,axesMoved:f})}},{"./parcoords":982}],984:[function(t,e,r){"use strict";var n=t("../../components/color/attributes"),i=t("../../plots/font_attributes"),a=t("../../plots/attributes"),o=t("../../lib/extend").extendFlat;e.exports={labels:{valType:"data_array"},label0:{valType:"number",dflt:0},dlabel:{valType:"number",dflt:1},values:{valType:"data_array"},marker:{colors:{valType:"data_array"},line:{color:{valType:"color",dflt:n.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:0,arrayOk:!0}}},text:{valType:"data_array"},hovertext:{valType:"string",dflt:"",arrayOk:!0},scalegroup:{valType:"string",dflt:""},textinfo:{valType:"flaglist",flags:["label","text","value","percent"],extras:["none"]},hoverinfo:o({},a.hoverinfo,{flags:["label","text","value","percent","name"]}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0},textfont:o({},i,{}),insidetextfont:o({},i,{}),outsidetextfont:o({},i,{}),domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]},y:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]}},hole:{valType:"number",min:0,max:1,dflt:0},sort:{valType:"boolean",dflt:!0},direction:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"counterclockwise"},rotation:{valType:"number",min:-360,max:360,dflt:0},pull:{valType:"number",min:0,max:1,dflt:0,arrayOk:!0}}},{"../../components/color/attributes":589,"../../lib/extend":701,"../../plots/attributes":746,"../../plots/font_attributes":772}],985:[function(t,e,r){"use strict";function n(t,e){for(var r=[],n=0;n<t.length;n++){var i=t[n],a=i[0].trace;a._module===e&&a.visible===!0&&r.push(i)}return r}var i=t("../../registry");r.name="pie",r.plot=function(t){var e=i.getModule("pie"),r=n(t.calcdata,e);r.length&&e.plot(t,r)},r.clean=function(t,e,r,n){var i=n._has&&n._has("pie"),a=e._has&&e._has("pie");i&&!a&&n._pielayer.selectAll("g.trace").remove()}},{"../../registry":826}],986:[function(t,e,r){"use strict";function n(t){if(!l){var e=o.defaults;l=e.slice();var r;for(r=0;r<e.length;r++)l.push(a(e[r]).lighten(20).toHexString());for(r=0;r<o.defaults.length;r++)l.push(a(e[r]).darken(20).toHexString())}return l[t%l.length]}var i=t("fast-isnumeric"),a=t("tinycolor2"),o=t("../../components/color"),s=t("./helpers");e.exports=function(t,e){var r,l,u,c,h,f,d=e.values,p=e.labels,m=[],v=t._fullLayout,g=v._piecolormap,y={},b=!1,x=0,_=v.hiddenlabels||[];if(e.dlabel)for(p=new Array(d.length),r=0;r<d.length;r++)p[r]=String(e.label0+r*e.dlabel);for(r=0;r<d.length;r++)l=d[r],i(l)&&((l=+l)<0||(u=p[r],void 0!==u&&""!==u||(u=r),u=String(u),void 0===y[u]&&(y[u]=!0,c=a(e.marker.colors[r]),c.isValid()?(c=o.addOpacity(c,c.getAlpha()),g[u]||(g[u]=c)):g[u]?c=g[u]:(c=!1,b=!0),h=_.indexOf(u)!==-1,h||(x+=l),m.push({v:l,label:u,color:c,i:r,hidden:h}))));if(e.sort&&m.sort(function(t,e){return e.v-t.v}),b)for(r=0;r<m.length;r++)f=m[r],f.color===!1&&(g[f.label]=f.color=n(v._piedefaultcolorcount),v._piedefaultcolorcount++);if(m[0]&&(m[0].vTotal=x),e.textinfo&&"none"!==e.textinfo){var w,M=e.textinfo.indexOf("label")!==-1,k=e.textinfo.indexOf("text")!==-1,A=e.textinfo.indexOf("value")!==-1,T=e.textinfo.indexOf("percent")!==-1,S=v.separators;for(r=0;r<m.length;r++)f=m[r],w=M?[f.label]:[],k&&e.text[f.i]&&w.push(e.text[f.i]),A&&w.push(s.formatPieValue(f.v,S)),T&&w.push(s.formatPiePercent(f.v/x,S)),f.text=w.join("<br>")}return m};var l},{"../../components/color":590,"./helpers":988,"fast-isnumeric":127,tinycolor2:526}],987:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes");e.exports=function(t,e,r,a){function o(r,a){return n.coerce(t,e,i,r,a)}var s=n.coerceFont,l=o("values");if(!Array.isArray(l)||!l.length)return void(e.visible=!1);var u=o("labels");Array.isArray(u)||(o("label0"),o("dlabel")),o("marker.line.width")&&o("marker.line.color");var c=o("marker.colors");Array.isArray(c)||(e.marker.colors=[]),o("scalegroup");var h=o("text"),f=o("textinfo",Array.isArray(h)?"text+percent":"percent");if(o("hovertext"),o("hoverinfo",1===a._dataLength?"label+text+value+percent":void 0),f&&"none"!==f){var d=o("textposition"),p=Array.isArray(d)||"auto"===d,m=p||"inside"===d,v=p||"outside"===d;if(m||v){var g=s(o,"textfont",a.font);m&&s(o,"insidetextfont",g),v&&s(o,"outsidetextfont",g)}}o("domain.x"),o("domain.y"),o("hole"),o("sort"),o("direction"),o("rotation"),o("pull")}},{"../../lib":709,"./attributes":984}],988:[function(t,e,r){"use strict";var n=t("../../lib");r.formatPiePercent=function(t,e){var r=(100*t).toPrecision(3);return r.lastIndexOf(".")!==-1&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)+"%"},r.formatPieValue=function(t,e){var r=t.toPrecision(10);return r.lastIndexOf(".")!==-1&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)}},{"../../lib":709}],989:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.supplyLayoutDefaults=t("./layout_defaults"),n.layoutAttributes=t("./layout_attributes"),n.calc=t("./calc"),n.plot=t("./plot"),n.style=t("./style"),n.styleOne=t("./style_one"),n.moduleType="trace",n.name="pie",n.basePlotModule=t("./base_plot"),n.categories=["pie","showLegend"],n.meta={},e.exports=n},{"./attributes":984,"./base_plot":985,"./calc":986,"./defaults":987,"./layout_attributes":990,"./layout_defaults":991,"./plot":992,"./style":993,"./style_one":994}],990:[function(t,e,r){"use strict";e.exports={hiddenlabels:{valType:"data_array"}}},{}],991:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e){!function(r,a){n.coerce(t,e,i,r,a)}("hiddenlabels")}},{"../../lib":709,"./layout_attributes":990}],992:[function(t,e,r){"use strict";function n(t,e,r){var n=Math.sqrt(t.width*t.width+t.height*t.height),a=t.width/t.height,o=Math.PI*Math.min(e.v/r.vTotal,.5),s=1-r.trace.hole,l=i(e,r),u={scale:l*r.r*2/n,rCenter:1-l,rotate:0};if(u.scale>=1)return u;var c=a+1/(2*Math.tan(o)),h=r.r*Math.min(1/(Math.sqrt(c*c+.5)+c),s/(Math.sqrt(a*a+s/2)+a)),f={scale:2*h/t.height,rCenter:Math.cos(h/r.r)-h*a/r.r,rotate:(180/Math.PI*e.midangle+720)%180-90},d=1/a,p=d+1/(2*Math.tan(o)),m=r.r*Math.min(1/(Math.sqrt(p*p+.5)+p),s/(Math.sqrt(d*d+s/2)+d)),v={scale:2*m/t.width,rCenter:Math.cos(m/r.r)-m/a/r.r,rotate:(180/Math.PI*e.midangle+810)%180-90},g=v.scale>f.scale?v:f;return u.scale<1&&g.scale>u.scale?g:u}function i(t,e){if(t.v===e.vTotal&&!e.trace.hole)return 1;var r=Math.PI*Math.min(t.v/e.vTotal,.5);return Math.min(1/(1+1/Math.sin(r)),(1-e.trace.hole)/2)}function a(t,e){var r=e.pxmid[0],n=e.pxmid[1],i=t.width/2,a=t.height/2;return r<0&&(i*=-1),n<0&&(a*=-1),{scale:1,rCenter:1,rotate:0,x:i+Math.abs(a)*(i>0?1:-1)/2,y:a/(1+r*r/(n*n)),outside:!0}}function o(t,e){function r(t,e){return t.pxmid[1]-e.pxmid[1]}function n(t,e){return e.pxmid[1]-t.pxmid[1]}var i,a,o,s,l,u,c,h,f,d,p,m,v;for(a=0;a<2;a++)for(o=a?r:n,l=a?Math.max:Math.min,c=a?1:-1,i=0;i<2;i++){for(s=i?Math.max:Math.min,u=i?1:-1,h=t[a][i],h.sort(o),f=t[1-a][i],d=f.concat(h),m=[],p=0;p<h.length;p++)void 0!==h[p].yLabelMid&&m.push(h[p]);for(v=!1,p=0;a&&p<f.length;p++)if(void 0!==f[p].yLabelMid){v=f[p];break}for(p=0;p<m.length;p++){var g=p&&m[p-1];v&&!p&&(g=v),function(t,r){r||(r={});var n,i,o,h,f,p,m=r.labelExtraY+(a?r.yLabelMax:r.yLabelMin),v=a?t.yLabelMin:t.yLabelMax,g=a?t.yLabelMax:t.yLabelMin,y=t.cyFinal+l(t.px0[1],t.px1[1]),b=m-v;if(b*c>0&&(t.labelExtraY=b),Array.isArray(e.pull))for(i=0;i<d.length;i++)(o=d[i])===t||(e.pull[t.i]||0)>=e.pull[o.i]||((t.pxmid[1]-o.pxmid[1])*c>0?(h=o.cyFinal+l(o.px0[1],o.px1[1]),(b=h-v-t.labelExtraY)*c>0&&(t.labelExtraY+=b)):(g+t.labelExtraY-y)*c>0&&(n=3*u*Math.abs(i-d.indexOf(t)),f=o.cxFinal+s(o.px0[0],o.px1[0]),(p=f+n-(t.cxFinal+t.pxmid[0])-t.labelExtraX)*u>0&&(t.labelExtraX+=p)))}(m[p],g)}}}function s(t,e){var r,n,i,a,o,s,l,c,h,f,d=[];for(i=0;i<t.length;i++){if(o=t[i][0],s=o.trace,r=e.w*(s.domain.x[1]-s.domain.x[0]),n=e.h*(s.domain.y[1]-s.domain.y[0]),l=s.tiltaxis*Math.PI/180,c=s.pull,Array.isArray(c))for(c=0,a=0;a<s.pull.length;a++)s.pull[a]>c&&(c=s.pull[a]);o.r=Math.min(r/u(s.tilt,Math.sin(l),s.depth),n/u(s.tilt,Math.cos(l),s.depth))/(2+2*c),o.cx=e.l+e.w*(s.domain.x[1]+s.domain.x[0])/2,o.cy=e.t+e.h*(2-s.domain.y[1]-s.domain.y[0])/2,s.scalegroup&&d.indexOf(s.scalegroup)===-1&&d.push(s.scalegroup)}for(a=0;a<d.length;a++){for(f=1/0,h=d[a],i=0;i<t.length;i++)o=t[i][0],o.trace.scalegroup===h&&(f=Math.min(f,o.r*o.r/o.vTotal));for(i=0;i<t.length;i++)o=t[i][0],o.trace.scalegroup===h&&(o.r=Math.sqrt(f*o.vTotal))}}function l(t){function e(t){var e=h.r*Math.sin(t),r=-h.r*Math.cos(t);return d?[e*(1-s*n*n)+r*o*s,e*o*s+r*(1-s*i*i),Math.sin(a)*(r*i-e*n)]:[e,r]}var r,n,i,a,o,s,l,u,c,h=t[0],f=h.trace,d=f.tilt,p=f.rotation*Math.PI/180,m=2*Math.PI/h.vTotal,v="px0",g="px1";if("counterclockwise"===f.direction){for(l=0;l<t.length&&t[l].hidden;l++);if(l===t.length)return;p+=m*t[l].v,m*=-1,v="px1",g="px0"}for(d&&(a=d*Math.PI/180,r=f.tiltaxis*Math.PI/180,o=Math.sin(r)*Math.cos(r),s=1-Math.cos(a),n=Math.sin(r),i=Math.cos(r)),c=e(p),l=0;l<t.length;l++)u=t[l],u.hidden||(u[v]=c,p+=m*u.v/2,u.pxmid=e(p),u.midangle=p,p+=m*u.v/2,c=e(p),u[g]=c,u.largeArc=u.v>h.vTotal/2?1:0)}function u(t,e,r){if(!t)return 1;var n=Math.sin(t*Math.PI/180);return Math.max(.01,r*n*Math.abs(e)+2*Math.sqrt(1-n*n*e*e))}var c=t("d3"),h=t("../../components/fx"),f=t("../../components/color"),d=t("../../components/drawing"),p=t("../../lib/svg_text_utils"),m=t("./helpers");e.exports=function(t,e){var r=t._fullLayout;s(e,r._size);var u=r._pielayer.selectAll("g.trace").data(e);u.enter().append("g").attr({"stroke-linejoin":"round",class:"trace"}),u.exit().remove(),u.order(),u.each(function(e){var s=c.select(this),u=e[0],v=u.trace,g=(v.depth||0)*u.r*Math.sin(0)/2,y=v.tiltaxis||0,b=y*Math.PI/180,x=[g*Math.sin(b),g*Math.cos(b)],_=u.r*Math.cos(0),w=s.selectAll("g.part").data(v.tilt?["top","sides"]:["top"]);w.enter().append("g").attr("class",function(t){return t+" part"}),w.exit().remove(),w.order(),l(e),s.selectAll(".top").each(function(){var s=c.select(this).selectAll("g.slice").data(e);s.enter().append("g").classed("slice",!0),s.exit().remove();var l=[[[],[]],[[],[]]],g=!1;s.each(function(e){function o(n){n.originalEvent=c.event;var a=t._fullLayout,o=t._fullData[v.index],s=o.hoverinfo;if("all"===s&&(s="label+text+value+percent+name"),t._dragging||a.hovermode===!1||"none"===s||"skip"===s||!s)return void h.hover(t,n,"pie");var l=i(e,u),f=w+e.pxmid[0]*(1-l),d=M+e.pxmid[1]*(1-l),p=r.separators,g=[];s.indexOf("label")!==-1&&g.push(e.label),s.indexOf("text")!==-1&&(o.hovertext?g.push(Array.isArray(o.hovertext)?o.hovertext[e.i]:o.hovertext):o.text&&o.text[e.i]&&g.push(o.text[e.i])),s.indexOf("value")!==-1&&g.push(m.formatPieValue(e.v,p)),s.indexOf("percent")!==-1&&g.push(m.formatPiePercent(e.v/u.vTotal,p));var y=o.hoverlabel;h.loneHover({x0:f-l*u.r,x1:f+l*u.r,y:d,text:g.join("<br>"),name:s.indexOf("name")!==-1?o.name:void 0,idealAlign:e.pxmid[0]<0?"left":"right",color:e.hbg||y.bgcolor||e.color,borderColor:e.hbc||y.bordercolor,fontFamily:e.htf||y.font.family,fontSize:e.hts||y.font.size,fontColor:e.htc||y.font.color},{container:a._hoverlayer.node(),outerContainer:a._paper.node()}),h.hover(t,n,"pie"),T=!0}function s(e){e.originalEvent=c.event,t.emit("plotly_unhover",{event:c.event,points:[e]}),T&&(h.loneUnhover(r._hoverlayer.node()),T=!1)}function f(){t._hoverdata=[e],t._hoverdata.trace=u.trace,h.click(t,c.event)}function b(t,r,n,i){return"a"+i*u.r+","+i*_+" "+y+" "+e.largeArc+(n?" 1 ":" 0 ")+i*(r[0]-t[0])+","+i*(r[1]-t[1])}if(e.hidden)return void c.select(this).selectAll("path,g").remove();l[e.pxmid[1]<0?0:1][e.pxmid[0]<0?0:1].push(e);var w=u.cx+x[0],M=u.cy+x[1],k=c.select(this),A=k.selectAll("path.surface").data([e]),T=!1;if(A.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),k.select("path.textline").remove(),k.on("mouseover",o).on("mouseout",s).on("click",f),v.pull){var S=+(Array.isArray(v.pull)?v.pull[e.i]:v.pull)||0;S>0&&(w+=S*e.pxmid[0],M+=S*e.pxmid[1])}e.cxFinal=w,e.cyFinal=M;var E=v.hole;if(e.v===u.vTotal){var L="M"+(w+e.px0[0])+","+(M+e.px0[1])+b(e.px0,e.pxmid,!0,1)+b(e.pxmid,e.px0,!0,1)+"Z";E?A.attr("d","M"+(w+E*e.px0[0])+","+(M+E*e.px0[1])+b(e.px0,e.pxmid,!1,E)+b(e.pxmid,e.px0,!1,E)+"Z"+L):A.attr("d",L)}else{var C=b(e.px0,e.px1,!0,1);if(E){var z=1-E;A.attr("d","M"+(w+E*e.px1[0])+","+(M+E*e.px1[1])+b(e.px1,e.px0,!1,E)+"l"+z*e.px0[0]+","+z*e.px0[1]+C+"Z")}else A.attr("d","M"+w+","+M+"l"+e.px0[0]+","+e.px0[1]+C+"Z")}var D=Array.isArray(v.textposition)?v.textposition[e.i]:v.textposition,I=k.selectAll("g.slicetext").data(e.text&&"none"!==D?[0]:[]);I.enter().append("g").classed("slicetext",!0),I.exit().remove(),I.each(function(){var t=c.select(this).selectAll("text").data([0]);t.enter().append("text").attr("data-notex",1),t.exit().remove(),t.text(e.text).attr({class:"slicetext",transform:"","data-bb":"","text-anchor":"middle",x:0,y:0}).call(d.font,"outside"===D?v.outsidetextfont:v.insidetextfont).call(p.convertToTspans),t.selectAll("tspan.line").attr({x:0,y:0});var r,i=d.bBox(t.node());"outside"===D?r=a(i,e):(r=n(i,e,u),"auto"===D&&r.scale<1&&(t.call(d.font,v.outsidetextfont),v.outsidetextfont.family===v.insidetextfont.family&&v.outsidetextfont.size===v.insidetextfont.size||(t.attr({"data-bb":""}),i=d.bBox(t.node())),r=a(i,e)));var o=w+e.pxmid[0]*r.rCenter+(r.x||0),s=M+e.pxmid[1]*r.rCenter+(r.y||0);r.outside&&(e.yLabelMin=s-i.height/2,e.yLabelMid=s,e.yLabelMax=s+i.height/2,e.labelExtraX=0,e.labelExtraY=0,g=!0),t.attr("transform","translate("+o+","+s+")"+(r.scale<1?"scale("+r.scale+")":"")+(r.rotate?"rotate("+r.rotate+")":"")+"translate("+-(i.left+i.right)/2+","+-(i.top+i.bottom)/2+")")})}),g&&o(l,v),s.each(function(t){if(t.labelExtraX||t.labelExtraY){var e=c.select(this),r=e.select("g.slicetext text");r.attr("transform","translate("+t.labelExtraX+","+t.labelExtraY+")"+r.attr("transform"));var n=t.cxFinal+t.pxmid[0],i=t.cyFinal+t.pxmid[1],a="M"+n+","+i,o=(t.yLabelMax-t.yLabelMin)*(t.pxmid[0]<0?-1:1)/4;if(t.labelExtraX){var s=t.labelExtraX*t.pxmid[1]/t.pxmid[0],l=t.yLabelMid+t.labelExtraY-(t.cyFinal+t.pxmid[1]);Math.abs(s)>Math.abs(l)?a+="l"+l*t.pxmid[0]/t.pxmid[1]+","+l+"H"+(n+t.labelExtraX+o):a+="l"+t.labelExtraX+","+s+"v"+(l-s)+"h"+o}else a+="V"+(t.yLabelMid+t.labelExtraY)+"h"+o;e.append("path").classed("textline",!0).call(f.stroke,v.outsidetextfont.color).attr({"stroke-width":Math.min(2,v.outsidetextfont.size/8),d:a,fill:"none"})}})})}),setTimeout(function(){u.selectAll("tspan").each(function(){var t=c.select(this);t.attr("dy")&&t.attr("dy",t.attr("dy"))})},0)}},{"../../components/color":590,"../../components/drawing":614,"../../components/fx":631,"../../lib/svg_text_utils":728,"./helpers":988,d3:118}],993:[function(t,e,r){"use strict";var n=t("d3"),i=t("./style_one");e.exports=function(t){t._fullLayout._pielayer.selectAll(".trace").each(function(t){var e=t[0],r=e.trace,a=n.select(this);a.style({opacity:r.opacity}),a.selectAll(".top path.surface").each(function(t){n.select(this).call(i,t,r)})})}},{"./style_one":994,d3:118}],994:[function(t,e,r){"use strict";var n=t("../../components/color");e.exports=function(t,e,r){var i=r.marker.line.color;Array.isArray(i)&&(i=i[e.i]||n.defaultLine);var a=r.marker.line.width||0;Array.isArray(a)&&(a=a[e.i]||0),t.style({"stroke-width":a}).call(n.fill,e.color).call(n.stroke,i)}},{"../../components/color":590}],995:[function(t,e,r){"use strict";var n=t("../scattergl/attributes");e.exports={x:n.x,y:n.y,xy:{valType:"data_array"},indices:{valType:"data_array"},xbounds:{valType:"data_array"},ybounds:{valType:"data_array"},text:n.text,marker:{color:{valType:"color",arrayOk:!1},opacity:{valType:"number",min:0,max:1,dflt:1,arrayOk:!1},blend:{valType:"boolean",dflt:null},sizemin:{valType:"number",min:.1,max:2,dflt:.5},sizemax:{valType:"number",min:.1,dflt:20},border:{color:{valType:"color",arrayOk:!1},arearatio:{valType:"number",min:0,max:1,dflt:0}}}}},{"../scattergl/attributes":1052}],996:[function(t,e,r){"use strict";function n(t,e){this.scene=t,this.uid=e,this.type="pointcloud",this.pickXData=[],this.pickYData=[],this.xData=[],this.yData=[],this.textLabels=[],this.color="rgb(0, 0, 0)",this.name="",this.hoverinfo="all",this.idToIndex=new Int32Array(0),this.bounds=[0,0,0,0],this.pointcloudOptions={positions:new Float32Array(0),idToIndex:this.idToIndex,sizemin:.5,sizemax:12,color:[0,0,0,1],areaRatio:1,borderColor:[0,0,0,1]},this.pointcloud=a(t.glplot,this.pointcloudOptions),this.pointcloud._trace=this}function i(t,e){var r=new n(t,e.uid);return r.update(e),r}var a=t("gl-pointcloud2d"),o=t("../../lib/str2rgbarray"),s=t("../scatter/get_trace_color"),l=["xaxis","yaxis"],u=n.prototype;u.handlePick=function(t){var e=this.idToIndex[t.pointId];return{trace:this,dataCoord:t.dataCoord,traceCoord:this.pickXYData?[this.pickXYData[2*e],this.pickXYData[2*e+1]]:[this.pickXData[e],this.pickYData[e]],textLabel:Array.isArray(this.textLabels)?this.textLabels[e]:this.textLabels,color:this.color,name:this.name,pointIndex:e,hoverinfo:this.hoverinfo}},u.update=function(t){this.index=t.index,this.textLabels=t.text,this.name=t.name,this.hoverinfo=t.hoverinfo,this.bounds=[1/0,1/0,-1/0,-1/0],this.updateFast(t),this.color=s(t,{})},u.updateFast=function(t){var e,r,n,i,a,s,l=this.xData=this.pickXData=t.x,u=this.yData=this.pickYData=t.y,c=this.pickXYData=t.xy,h=t.xbounds&&t.ybounds,f=t.indices,d=this.bounds;if(c){if(n=c,e=c.length>>>1,h)d[0]=t.xbounds[0],d[2]=t.xbounds[1],d[1]=t.ybounds[0],d[3]=t.ybounds[1];else for(s=0;s<e;s++)i=n[2*s],a=n[2*s+1],i<d[0]&&(d[0]=i),i>d[2]&&(d[2]=i),a<d[1]&&(d[1]=a),a>d[3]&&(d[3]=a);if(f)r=f;else for(r=new Int32Array(e),s=0;s<e;s++)r[s]=s}else for(e=l.length,n=new Float32Array(2*e),r=new Int32Array(e),s=0;s<e;s++)i=l[s],a=u[s],r[s]=s,n[2*s]=i,n[2*s+1]=a,i<d[0]&&(d[0]=i),i>d[2]&&(d[2]=i),a<d[1]&&(d[1]=a),a>d[3]&&(d[3]=a);this.idToIndex=r,this.pointcloudOptions.idToIndex=r,this.pointcloudOptions.positions=n;var p=o(t.marker.color),m=o(t.marker.border.color),v=t.opacity*t.marker.opacity;p[3]*=v,this.pointcloudOptions.color=p;var g=t.marker.blend;if(null===g){g=l.length<100||u.length<100}this.pointcloudOptions.blend=g,m[3]*=v,this.pointcloudOptions.borderColor=m;var y=t.marker.sizemin,b=Math.max(t.marker.sizemax,t.marker.sizemin);this.pointcloudOptions.sizeMin=y,this.pointcloudOptions.sizeMax=b,this.pointcloudOptions.areaRatio=t.marker.border.arearatio,this.pointcloud.update(this.pointcloudOptions),this.expandAxesFast(d,b/2)},u.expandAxesFast=function(t,e){for(var r,n,i,a=e||.5,o=0;o<2;o++)r=this.scene[l[o]],n=r._min,n||(n=[]),n.push({val:t[o],pad:a}),i=r._max,i||(i=[]),i.push({val:t[o+2],pad:a})},u.dispose=function(){this.pointcloud.dispose()},e.exports=i},{"../../lib/str2rgbarray":727,"../scatter/get_trace_color":1016,"gl-pointcloud2d":225}],997:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes");e.exports=function(t,e,r){function a(r,a){return n.coerce(t,e,i,r,a)}a("x"),a("y"),a("xbounds"),a("ybounds"),t.xy&&t.xy instanceof Float32Array&&(e.xy=t.xy),t.indices&&t.indices instanceof Int32Array&&(e.indices=t.indices),a("text"),a("marker.color",r),a("marker.opacity"),a("marker.blend"),a("marker.sizemin"),
74 a("marker.sizemax"),a("marker.border.color",r),a("marker.border.arearatio")}},{"../../lib":709,"./attributes":995}],998:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.calc=t("../scatter3d/calc"),n.plot=t("./convert"),n.moduleType="trace",n.name="pointcloud",n.basePlotModule=t("../../plots/gl2d"),n.categories=["gl2d","showLegend"],n.meta={},e.exports=n},{"../../plots/gl2d":788,"../scatter3d/calc":1032,"./attributes":995,"./convert":996,"./defaults":997}],999:[function(t,e,r){"use strict";var n=t("../../components/shapes/attributes"),i=t("../../plots/font_attributes"),a=t("../../plots/attributes"),o=t("../../components/color/attributes"),s=t("../../lib/extend").extendFlat;e.exports={hoverinfo:s({},a.hoverinfo,{flags:["label","text","value","percent","name"]}),domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]},y:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]}},orientation:{valType:"enumerated",values:["v","h"],dflt:"h"},valueformat:{valType:"string",dflt:".3s"},valuesuffix:{valType:"string",dflt:""},arrangement:{valType:"enumerated",values:["snap","perpendicular","freeform","fixed"],dflt:"snap"},textfont:i,node:{label:{valType:"data_array",dflt:[]},color:s({},n.fillcolor,{arrayOk:!0}),line:{color:{valType:"color",dflt:o.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:.5,arrayOk:!0}},pad:{valType:"number",arrayOk:!1,min:0,dflt:20},thickness:{valType:"number",arrayOk:!1,min:1,dflt:20}},link:{label:{valType:"data_array",dflt:[]},color:s({},n.fillcolor,{arrayOk:!0}),line:{color:{valType:"color",dflt:o.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:0,arrayOk:!0}},source:{valType:"data_array",dflt:[]},target:{valType:"data_array",dflt:[]},value:{valType:"data_array",dflt:[]}}}},{"../../components/color/attributes":589,"../../components/shapes/attributes":666,"../../lib/extend":701,"../../plots/attributes":746,"../../plots/font_attributes":772}],1e3:[function(t,e,r){"use strict";var n=t("../../plots/plots"),i=t("./plot");r.name="sankey",r.attr="type",r.plot=function(t){var e=n.getSubplotCalcData(t.calcdata,"sankey","sankey");e.length&&i(t,e)},r.clean=function(t,e,r,n){var i=n._has&&n._has("sankey"),a=e._has&&e._has("sankey");i&&!a&&n._paperdiv.selectAll(".sankey").remove()}},{"../../plots/plots":811,"./plot":1005}],1001:[function(t,e,r){"use strict";function n(t,e,r){for(var n=t.map(function(){return[]}),a=0;a<Math.min(e.length,r.length);a++){if(e[a]===r[a])return!0;n[e[a]].push(r[a])}return i(n).components.some(function(t){return t.length>1})}var i=t("strongly-connected-components"),a=t("../../lib");e.exports=function(t,e){return n(e.node.label,e.link.source,e.link.target)&&(a.error("Circularity is present in the Sankey data. Removing all nodes and links."),e.link.label=[],e.link.source=[],e.link.target=[],e.link.value=[],e.link.color=[],e.node.label=[],e.node.color=[]),[{link:e.link,node:e.node}]}},{"../../lib":709,"strongly-connected-components":520}],1002:[function(t,e,r){"use strict";e.exports={nodeTextOffsetHorizontal:4,nodeTextOffsetVertical:3,nodePadAcross:10,sankeyIterations:50,forceIterations:5,forceTicksPerFrame:10,duration:500,ease:"linear"}},{}],1003:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes"),a=t("../../components/color/attributes").defaults,o=t("../../components/color"),s=t("tinycolor2");e.exports=function(t,e,r,l){function u(r,a){return n.coerce(t,e,i,r,a)}u("node.label"),u("node.pad"),u("node.thickness"),u("node.line.color"),u("node.line.width");var c=function(t){return a[t%a.length]};u("node.color",e.node.label.map(function(t,e){return o.addOpacity(c(e),.8)})),u("link.label"),u("link.source"),u("link.target"),u("link.value"),u("link.line.color"),u("link.line.width"),u("link.color",e.link.value.map(function(){return s(l.paper_bgcolor).getLuminance()<.333?"rgba(255, 255, 255, 0.6)":"rgba(0, 0, 0, 0.2)"})),u("hoverinfo",1===l._dataLength?"label+text+value+percent":void 0),u("domain.x"),u("domain.y"),u("orientation"),u("valueformat"),u("valuesuffix"),u("arrangement"),n.coerceFont(u,"textfont",n.extendFlat({},l.font));var h=function(t,r){return e.link.source.indexOf(r)===-1&&e.link.target.indexOf(r)===-1};e.node.label.some(h)&&n.warn("Some of the nodes are neither sources nor targets, they will not be displayed.")}},{"../../components/color":590,"../../components/color/attributes":589,"../../lib":709,"./attributes":999,tinycolor2:526}],1004:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.calc=t("./calc"),n.plot=t("./plot"),n.moduleType="trace",n.name="sankey",n.basePlotModule=t("./base_plot"),n.categories=["noOpacity"],n.meta={},e.exports=n},{"./attributes":999,"./base_plot":1e3,"./calc":1001,"./defaults":1003,"./plot":1005}],1005:[function(t,e,r){"use strict";function n(t){return""!==t}function i(t,e){return t.filter(function(t){return t.key===e.traceId})}function a(t,e){p.select(t).select("path").style("fill-opacity",e),p.select(t).select("rect").style("fill-opacity",e)}function o(t){p.select(t).select("text.name").style("fill","black")}function s(t){return function(e){return t.node.sourceLinks.indexOf(e.link)!==-1||t.node.targetLinks.indexOf(e.link)!==-1}}function l(t){return function(e){return e.node.sourceLinks.indexOf(t.link)!==-1||e.node.targetLinks.indexOf(t.link)!==-1}}function u(t,e,r){e&&r&&i(r,e).selectAll(".sankeyLink").filter(s(e)).call(h.bind(0,e,r,!1))}function c(t,e,r){e&&r&&i(r,e).selectAll(".sankeyLink").filter(s(e)).call(f.bind(0,e,r,!1))}function h(t,e,r,n){var a=n.datum().link.label;n.style("fill-opacity",.4),a&&i(e,t).selectAll(".sankeyLink").filter(function(t){return t.link.label===a}).style("fill-opacity",.4),r&&i(e,t).selectAll(".sankeyNode").filter(l(t)).call(u)}function f(t,e,r,n){var a=n.datum().link.label;n.style("fill-opacity",function(t){return t.tinyColorAlpha}),a&&i(e,t).selectAll(".sankeyLink").filter(function(t){return t.link.label===a}).style("fill-opacity",function(t){return t.tinyColorAlpha}),r&&i(e,t).selectAll(".sankeyNode").filter(l(t)).call(c)}function d(t,e){var r=t.hoverlabel||{},n=y.nestedProperty(r,e).get();return!Array.isArray(n)&&n}var p=t("d3"),m=t("./render"),v=t("../../components/fx"),g=t("../../components/color"),y=t("../../lib");e.exports=function(t,e){var r=t._fullLayout,i=r._paper,s=r._size,l=function(r,n){t._hoverdata=[n.link],t._hoverdata.trace=e.trace,v.click(t,{target:!0})},y=function(e,r,n){p.select(e).call(h.bind(0,r,n,!0)),v.hover(t,r.link,"sankey")},b=function(e,i){var s=t._fullData[i.traceId],l=t.getBoundingClientRect(),u=e.getBoundingClientRect(),c=u.left+u.width/2,h=u.top+u.height/2,f=v.loneHover({x:c-l.left,y:h-l.top,name:p.format(i.valueFormat)(i.link.value)+i.valueSuffix,text:[i.link.label,["Source:",i.link.source.label].join(" "),["Target:",i.link.target.label].join(" ")].filter(n).join("<br>"),color:d(s,"bgcolor")||g.addOpacity(i.tinyColorHue,1),borderColor:d(s,"bordercolor"),fontFamily:d(s,"font.family"),fontSize:d(s,"font.size"),fontColor:d(s,"font.color"),idealAlign:p.event.x<c?"right":"left"},{container:r._hoverlayer.node(),outerContainer:r._paper.node()});a(f,.65),o(f)},x=function(e,n,i){p.select(e).call(f.bind(0,n,i,!0)),t.emit("plotly_unhover",{points:[n.link]}),v.loneUnhover(r._hoverlayer.node())},_=function(r,n,i){t._hoverdata=[n.node],t._hoverdata.trace=e.trace,p.select(r).call(c,n,i),v.click(t,{target:!0})},w=function(e,r,n){p.select(e).call(u,r,n),v.hover(t,r.node,"sankey")},M=function(e,i){var s=t._fullData[i.traceId],l=p.select(e).select(".nodeRect"),u=t.getBoundingClientRect(),c=l.node().getBoundingClientRect(),h=c.left-2-u.left,f=c.right+2-u.left,m=c.top+c.height/4-u.top,g=v.loneHover({x0:h,x1:f,y:m,name:p.format(i.valueFormat)(i.node.value)+i.valueSuffix,text:[i.node.label,["Incoming flow count:",i.node.targetLinks.length].join(" "),["Outgoing flow count:",i.node.sourceLinks.length].join(" ")].filter(n).join("<br>"),color:d(s,"bgcolor")||i.tinyColorHue,borderColor:d(s,"bordercolor"),fontFamily:d(s,"font.family"),fontSize:d(s,"font.size"),fontColor:d(s,"font.color"),idealAlign:"left"},{container:r._hoverlayer.node(),outerContainer:r._paper.node()});a(g,.85),o(g)},k=function(e,n,i){p.select(e).call(c,n,i),t.emit("plotly_unhover",{points:[n.node]}),v.loneUnhover(r._hoverlayer.node())};m(i,e,{width:s.w,height:s.h,margin:{t:s.t,r:s.r,b:s.b,l:s.l}},{linkEvents:{hover:y,follow:b,unhover:x,select:l},nodeEvents:{hover:w,follow:M,unhover:k,select:_}})}},{"../../components/color":590,"../../components/fx":631,"../../lib":709,"./render":1006,d3:118}],1006:[function(t,e,r){"use strict";function n(t){return t.key}function i(t){return[t]}function a(t){return t[0]}function o(t){var e,r=[];for(e=0;e<t.length;e++)t[e].originalX=t[e].x,t[e].originalY=t[e].y,r.indexOf(t[e].x)===-1&&r.push(t[e].x);for(r.sort(function(t,e){return t-e}),e=0;e<t.length;e++)t[e].originalLayerIndex=r.indexOf(t[e].originalX),t[e].originalLayer=t[e].originalLayerIndex/(r.length-1)}function s(t){t.lastDraggedX=t.x,t.lastDraggedY=t.y}function l(t){return function(e){return e.node.originalX===t.node.originalX}}function u(t){for(var e=0;e<t.length;e++)t[e].y=t[e].y+t[e].dy/2}function c(t){for(var e=0;e<t.length;e++)t[e].y=t[e].y-t[e].dy/2}function h(t,e,r){for(var n,i=a(e).trace,o=i.domain,s=i.node,l=i.link,c=i.arrangement,h="h"===i.orientation,f=i.node.pad,d=i.node.thickness,p=i.node.line.color,m=i.node.line.width,v=i.link.line.color,g=i.link.line.width,y=i.valueformat,b=i.valuesuffix,x=i.textfont,_=t.width*(o.x[1]-o.x[0]),w=t.height*(o.y[1]-o.y[0]),M=s.label.map(function(t,e){return{label:t,color:O.isArray(s.color)?s.color[e]:s.color}}),k=l.value.map(function(t,e){return{label:l.label[e],color:O.isArray(l.color)?l.color[e]:l.color,source:l.source[e],target:l.target[e],value:t}}),A=I().size(h?[_,w]:[w,_]).nodeWidth(d).nodePadding(f).nodes(M).links(k).layout(E.sankeyIterations),T=A.nodes(),S=0;S<T.length;S++)n=T[S],n.width=_,n.height=w,n.parallel&&(n.x=(h?_:w)*n.parallel),n.perpendicular&&(n.y=(h?w:_)*n.perpendicular);return u(M),{key:r,guid:Math.floor(1e12*(1+Math.random())),horizontal:h,width:_,height:w,nodePad:f,nodeLineColor:p,nodeLineWidth:m,linkLineColor:v,linkLineWidth:g,valueFormat:y,valueSuffix:b,textFont:x,translateX:o.x[0]*_+t.margin.l,translateY:t.height-o.y[1]*t.height+t.margin.t,dragParallel:h?w:_,dragPerpendicular:h?_:w,nodes:M,links:k,arrangement:c,sankey:A,forceLayouts:{},interactionState:{dragInProgress:!1,hovered:!1}}}function f(t,e,r){var n=C(r.color),i=r.source.label+"|"+r.target.label,a=t[i];return t[i]=(void 0===a?a:0)+1,{key:i+(void 0===a?"":"__"+a),traceId:e.key,link:r,tinyColorHue:z.tinyRGB(n),tinyColorAlpha:n.getAlpha(),linkLineColor:e.linkLineColor,linkLineWidth:e.linkLineWidth,valueFormat:e.valueFormat,valueSuffix:e.valueSuffix,sankey:e.sankey,interactionState:e.interactionState}}function d(t,e,r){var n=C(r.color),i=E.nodePadAcross,a=e.nodePad/2,o=r.dx+.5,s=r.dy-.5,l=o+2*i,u=s+2*a,c=r.label,h=t[c];t[c]=(void 0===h?h:0)+1;var f=c+(void 0===h?"":"__"+h);return{key:f,traceId:e.key,node:r,nodePad:e.nodePad,nodeLineColor:e.nodeLineColor,nodeLineWidth:e.nodeLineWidth,textFont:e.textFont,size:e.horizontal?e.height:e.width,visibleWidth:Math.ceil(e.horizontal?o:s),visibleHeight:Math.ceil(e.horizontal?s:o),zoneX:e.horizontal?-i:-a,zoneY:e.horizontal?-a:-i,zoneWidth:e.horizontal?l:u,zoneHeight:e.horizontal?u:l,labelY:e.horizontal?r.dy/2+1:r.dx/2+1,left:1===r.originalLayer,sizeAcross:e.horizontal?e.width:e.height,forceLayouts:e.forceLayouts,horizontal:e.horizontal,darkBackground:n.getBrightness()<=128,tinyColorHue:z.tinyRGB(n),tinyColorAlpha:n.getAlpha(),valueFormat:e.valueFormat,valueSuffix:e.valueSuffix,sankey:e.sankey,arrangement:e.arrangement,uniqueNodeLabelPathId:[e.guid,e.key,f].join(" "),interactionState:e.interactionState}}function p(t){L.select(t.node().parentElement).style("shape-rendering","crispEdges")}function m(t){t.attr("transform",function(t){return t.horizontal?"translate("+(t.node.x-.5)+", "+(t.node.y-t.node.dy/2+.5)+")":"translate("+(t.node.y-t.node.dy/2-.5)+", "+(t.node.x+.5)+")"})}function v(t){var e=t.sankey.nodes();c(e);var r=t.sankey.link()(t.link);return u(e),r}function g(t){L.select(t.node().parentElement).style("shape-rendering","optimizeSpeed"),t.call(m)}function y(t,e){t.call(g),e.attr("d",v)}function b(t){t.attr("width",function(t){return t.visibleWidth}).attr("height",function(t){return t.visibleHeight})}function x(t){return t.link.dy>1||t.linkLineWidth>0}function _(t){return t.horizontal?"matrix(1,0,0,1,0,0)":"matrix(0,1,1,0,0,0)"}function w(t){return L.svg.line()([[t.horizontal?t.left?-t.sizeAcross:t.visibleWidth+E.nodeTextOffsetHorizontal:E.nodeTextOffsetHorizontal,t.labelY],[t.horizontal?t.left?-E.nodeTextOffsetHorizontal:t.sizeAcross:t.visibleWidth-E.nodeTextOffsetHorizontal,t.labelY]])}function M(t,e,r){t.on(".basic",null).on("mouseover.basic",function(t){t.interactionState.dragInProgress||(r.hover(this,t,e),t.interactionState.hovered=[this,t])}).on("mousemove.basic",function(t){t.interactionState.dragInProgress||(r.follow(this,t),t.interactionState.hovered=[this,t])}).on("mouseout.basic",function(t){t.interactionState.dragInProgress||(r.unhover(this,t,e),t.interactionState.hovered=!1)}).on("click.basic",function(t){t.interactionState.hovered&&(r.unhover(this,t,e),t.interactionState.hovered=!1),t.interactionState.dragInProgress||r.select(this,t,e)})}function k(t,e,r){var n=L.behavior.drag().origin(function(t){return t.horizontal?t.node:{x:t.node.y,y:t.node.x}}).on("dragstart",function(n){if("fixed"!==n.arrangement&&(this.parentNode.appendChild(this),n.interactionState.dragInProgress=n.node,s(n.node),n.interactionState.hovered&&(r.nodeEvents.unhover.apply(0,n.interactionState.hovered),n.interactionState.hovered=!1),"snap"===n.arrangement)){var i=n.traceId+"|"+Math.floor(n.node.originalX);n.forceLayouts[i]?n.forceLayouts[i].alpha(1):A(t,i,n),T(t,e,n,i)}}).on("drag",function(r){if("fixed"!==r.arrangement){var n=r.horizontal?L.event.x:L.event.y,i=r.horizontal?L.event.y:L.event.x;"snap"===r.arrangement?(r.node.x=n,r.node.y=i):("freeform"===r.arrangement&&(r.node.x=n),r.node.y=Math.max(r.node.dy/2,Math.min(r.size-r.node.dy/2,i))),s(r.node),"snap"!==r.arrangement&&(r.sankey.relayout(),y(t.filter(l(r)),e),t.call(p))}}).on("dragend",function(t){t.interactionState.dragInProgress=!1});t.on(".drag",null).call(n)}function A(t,e,r){var n=r.sankey.nodes().filter(function(t){return t.originalX===r.node.originalX});r.forceLayouts[e]=P.forceSimulation(n).alphaDecay(0).force("collide",P.forceCollide().radius(function(t){return t.dy/2+r.nodePad/2}).strength(1).iterations(E.forceIterations)).force("constrain",S(t,e,n,r)).stop()}function T(t,e,r,n){window.requestAnimationFrame(function i(){for(var a=0;a<E.forceTicksPerFrame;a++)r.forceLayouts[n].tick();r.sankey.relayout(),y(t.filter(l(r)),e),r.forceLayouts[n].alpha()>0&&window.requestAnimationFrame(i)})}function S(t,e,r,n){return function(){for(var i=0,a=0;a<r.length;a++){var o=r[a];o===n.interactionState.dragInProgress?(o.x=o.lastDraggedX,o.y=o.lastDraggedY):(o.vx=(o.originalX-o.x)/E.forceTicksPerFrame,o.y=Math.min(n.size-o.dy/2,Math.max(o.dy/2,o.y))),i=Math.max(i,Math.abs(o.vx),Math.abs(o.vy))}!n.interactionState.dragInProgress&&i<.1&&n.forceLayouts[e].alpha()>0&&(n.forceLayouts[e].alpha(0),window.setTimeout(function(){t.call(p)},30))}}var E=t("./constants"),L=t("d3"),C=t("tinycolor2"),z=t("../../components/color"),D=t("../../components/drawing"),I=t("@plotly/d3-sankey").sankey,P=t("d3-force"),O=t("../../lib");e.exports=function(t,e,r,s){var l=t.selectAll(".sankey").data(e.filter(function(t){return a(t).trace.visible}).map(h.bind(null,r)),n);l.exit().remove(),l.enter().append("g").classed("sankey",!0).style("box-sizing","content-box").style("position","absolute").style("left",0).style("shape-rendering","geometricPrecision").style("pointer-events","auto").style("box-sizing","content-box"),l.attr("transform",function(t){return"translate("+t.translateX+","+t.translateY+")"});var u=l.selectAll(".sankeyLinks").data(i,n);u.enter().append("g").classed("sankeyLinks",!0).style("fill","none").style("transform",_),u.transition().ease(E.ease).duration(E.duration).style("transform",_);var c=u.selectAll(".sankeyLink").data(function(t){var e={};return t.sankey.links().filter(function(t){return t.value}).map(f.bind(null,e,t))},n);c.enter().append("path").classed("sankeyLink",!0).attr("d",v).call(M,l,s.linkEvents),c.style("stroke",function(t){return x(t)?z.tinyRGB(C(t.linkLineColor)):t.tinyColorHue}).style("stroke-opacity",function(t){return x(t)?z.opacity(t.linkLineColor):t.tinyColorAlpha}).style("stroke-width",function(t){return x(t)?t.linkLineWidth:1}).style("fill",function(t){return t.tinyColorHue}).style("fill-opacity",function(t){return t.tinyColorAlpha}),c.transition().ease(E.ease).duration(E.duration).attr("d",v),c.exit().transition().ease(E.ease).duration(E.duration).style("opacity",0).remove();var p=l.selectAll(".sankeyNodeSet").data(i,n);p.enter().append("g").style("shape-rendering","geometricPrecision").classed("sankeyNodeSet",!0),p.style("cursor",function(t){switch(t.arrangement){case"fixed":return"default";case"perpendicular":return"ns-resize";default:return"move"}});var g=p.selectAll(".sankeyNode").data(function(t){var e=t.sankey.nodes(),r={};return o(e),e.filter(function(t){return t.value}).map(d.bind(null,r,t))},n);g.enter().append("g").classed("sankeyNode",!0).call(m).call(M,l,s.nodeEvents),g.call(k,c,s),g.transition().ease(E.ease).duration(E.duration).call(m),g.exit().transition().ease(E.ease).duration(E.duration).style("opacity",0).remove();var y=g.selectAll(".nodeRect").data(i);y.enter().append("rect").classed("nodeRect",!0).call(b),y.style("stroke-width",function(t){return t.nodeLineWidth}).style("stroke",function(t){return z.tinyRGB(C(t.nodeLineColor))}).style("stroke-opacity",function(t){return z.opacity(t.nodeLineColor)}).style("fill",function(t){return t.tinyColorHue}).style("fill-opacity",function(t){return t.tinyColorAlpha}),y.transition().ease(E.ease).duration(E.duration).call(b);var A=g.selectAll(".nodeCapture").data(i);A.enter().append("rect").classed("nodeCapture",!0).style("fill-opacity",0),A.attr("x",function(t){return t.zoneX}).attr("y",function(t){return t.zoneY}).attr("width",function(t){return t.zoneWidth}).attr("height",function(t){return t.zoneHeight});var T=g.selectAll(".nodeLabelGuide").data(i);T.enter().append("path").classed("nodeLabelGuide",!0).attr("id",function(t){return t.uniqueNodeLabelPathId}).attr("d",w),T.transition().ease(E.ease).duration(E.duration).attr("d",w);var S=g.selectAll(".nodeLabel").data(i);S.enter().append("text").classed("nodeLabel",!0).style("user-select","none").style("cursor","default").style("fill","black"),S.style("text-shadow",function(t){return t.horizontal?"-1px 1px 1px #fff, 1px 1px 1px #fff, 1px -1px 1px #fff, -1px -1px 1px #fff":"none"}).each(function(t){D.font(S,t.textFont)});var L=S.selectAll(".nodeLabelTextPath").data(i);L.enter().append("textPath").classed("nodeLabelTextPath",!0).attr("alignment-baseline","middle").attr("xlink:href",function(t){return"#"+t.uniqueNodeLabelPathId}),L.text(function(t){return t.horizontal||t.node.dy>5?t.node.label:""}).attr("startOffset",function(t){return t.horizontal&&t.left?"100%":"0%"}).style("text-anchor",function(t){return t.horizontal&&t.left?"end":"start"}).style("fill",function(t){return t.darkBackground&&!t.horizontal?"white":"black"})}},{"../../components/color":590,"../../components/drawing":614,"../../lib":709,"./constants":1002,"@plotly/d3-sankey":36,d3:118,"d3-force":114,tinycolor2:526}],1007:[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.hovertext,t,"htx"),n.mergeArray(e.customdata,t,"data"),n.mergeArray(e.textposition,t,"tp"),e.textfont&&(n.mergeArray(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.mergeArray(i.size,t,"ms"),n.mergeArray(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.mergeArray(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":709}],1008:[function(t,e,r){"use strict";var n=t("../../components/colorscale/color_attributes"),i=t("../../components/errorbars/attributes"),a=t("../../components/colorbar/attributes"),o=t("../../components/drawing/attributes").dash,s=t("../../components/drawing"),l=(t("./constants"),t("../../lib/extend").extendFlat);e.exports={x:{valType:"data_array"},x0:{valType:"any",dflt:0},dx:{valType:"number",dflt:1},y:{valType:"data_array"},y0:{valType:"any",dflt:0},customdata:{valType:"data_array"},dy:{valType:"number",dflt:1},ids:{valType:"data_array"},text:{valType:"string",dflt:"",arrayOk:!0},hovertext:{valType:"string",dflt:"",arrayOk:!0},mode:{valType:"flaglist",flags:["lines","markers","text"],extras:["none"]},hoveron:{valType:"flaglist",flags:["points","fills"]},line:{color:{valType:"color"},width:{valType:"number",min:0,dflt:2},shape:{valType:"enumerated",values:["linear","spline","hv","vh","hvh","vhv"],dflt:"linear"},smoothing:{valType:"number",min:0,max:1.3,dflt:1},dash:o,simplify:{valType:"boolean",dflt:!0}},connectgaps:{valType:"boolean",dflt:!1},fill:{valType:"enumerated",values:["none","tozeroy","tozerox","tonexty","tonextx","toself","tonext"],dflt:"none"},fillcolor:{valType:"color"},marker:l({},{symbol:{valType:"enumerated",values:s.symbolList,dflt:"circle",arrayOk:!0},opacity:{valType:"number",min:0,max:1,arrayOk:!0},size:{valType:"number",min:0,dflt:6,arrayOk:!0},maxdisplayed:{valType:"number",min:0,dflt:0},sizeref:{valType:"number",dflt:1},sizemin:{valType:"number",min:0,dflt:0},sizemode:{valType:"enumerated",values:["diameter","area"],dflt:"diameter"},showscale:{valType:"boolean",dflt:!1},colorbar:a,line:l({},{width:{valType:"number",min:0,arrayOk:!0}},n("marker.line")),gradient:{type:{valType:"enumerated",values:["radial","horizontal","vertical","none"],arrayOk:!0,dflt:"none"},color:{valType:"color",arrayOk:!0}}},n("marker")),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},textfont:{family:{valType:"string",noBlank:!0,strict:!0,arrayOk:!0},size:{valType:"number",min:1,arrayOk:!0},color:{valType:"color",arrayOk:!0}},r:{valType:"data_array"},t:{valType:"data_array"},error_y:i,error_x:i}},{"../../components/colorbar/attributes":591,"../../components/colorscale/color_attributes":597,"../../components/drawing":614,"../../components/drawing/attributes":613,"../../components/errorbars/attributes":616,"../../lib/extend":701,"./constants":1013}],1009:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../plots/cartesian/axes"),a=t("../../constants/numerical").BADNUM,o=t("./subtypes"),s=t("./colorscale_calc"),l=t("./arrays_to_calcdata");e.exports=function(t,e){var r,u,c,h=i.getFromId(t,e.xaxis||"x"),f=i.getFromId(t,e.yaxis||"y"),d=h.makeCalcdata(e,"x"),p=f.makeCalcdata(e,"y"),m=Math.min(d.length,p.length);h._minDtick=0,f._minDtick=0,d.length>m&&d.splice(m,d.length-m),p.length>m&&p.splice(m,p.length-m);var v={padded:!0},g={padded:!0};if(o.hasMarkers(e)){if(r=e.marker,u=r.size,Array.isArray(u)){var y={type:"linear"};i.setConvert(y),u=y.makeCalcdata(e.marker,"size"),u.length>m&&u.splice(m,u.length-m)}var b,x=1.6*(e.marker.sizeref||1);b="area"===e.marker.sizemode?function(t){return Math.max(Math.sqrt((t||0)/x),3)}:function(t){return Math.max((t||0)/x,3)},v.ppad=g.ppad=Array.isArray(u)?u.map(b):b(u)}s(e),!("tozerox"===e.fill||"tonextx"===e.fill&&t.firstscatter)||d[0]===d[m-1]&&p[0]===p[m-1]?e.error_y.visible||["tonexty","tozeroy"].indexOf(e.fill)===-1&&(o.hasMarkers(e)||o.hasText(e))||(v.padded=!1,v.ppad=0):v.tozero=!0,!("tozeroy"===e.fill||"tonexty"===e.fill&&t.firstscatter)||d[0]===d[m-1]&&p[0]===p[m-1]?["tonextx","tozerox"].indexOf(e.fill)!==-1&&(g.padded=!1):g.tozero=!0,i.expand(h,d,v),i.expand(f,p,g);var _=new Array(m);for(c=0;c<m;c++)_[c]=n(d[c])&&n(p[c])?{x:d[c],y:p[c]}:{x:a,y:a},e.ids&&(_[c].id=String(e.ids[c]));return l(_,e),t.firstscatter=!1,_}},{"../../constants/numerical":690,"../../plots/cartesian/axes":748,"./arrays_to_calcdata":1007,"./colorscale_calc":1012,"./subtypes":1028,"fast-isnumeric":127}],1010:[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}}}}}},{}],1011:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../plots/plots"),o=t("../../components/colorscale"),s=t("../../components/colorbar/draw");e.exports=function(t,e){var r=e[0].trace,l=r.marker,u="cb"+r.uid;if(t._fullLayout._infolayer.selectAll("."+u).remove(),void 0===l||!l.showscale)return void a.autoMargin(t,u);var c=l.color,h=l.cmin,f=l.cmax;n(h)||(h=i.aggNums(Math.min,null,c)),n(f)||(f=i.aggNums(Math.max,null,c));var d=e[0].t.cb=s(t,u),p=o.makeColorScaleFunc(o.extractScale(l.colorscale,h,f),{noNumericCheck:!0});d.fillcolor(p).filllevels({start:h,end:f,size:(f-h)/254}).options(l.colorbar)()}},{"../../components/colorbar/draw":593,"../../components/colorscale":604,"../../lib":709,"../../plots/plots":811,"fast-isnumeric":127}],1012:[function(t,e,r){"use strict";var n=t("../../components/colorscale/has_colorscale"),i=t("../../components/colorscale/calc"),a=t("./subtypes");e.exports=function(t){a.hasLines(t)&&n(t,"line")&&i(t,t.line.color,"line","c"),a.hasMarkers(t)&&(n(t,"marker")&&i(t,t.marker.color,"marker","c"),n(t,"marker.line")&&i(t,t.marker.line.color,"marker.line","c"))}},{"../../components/colorscale/calc":596,"../../components/colorscale/has_colorscale":603,"./subtypes":1028}],1013:[function(t,e,r){"use strict";e.exports={PTS_LINESONLY:20}},{}],1014:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes"),a=t("./constants"),o=t("./subtypes"),s=t("./xy_defaults"),l=t("./marker_defaults"),u=t("./line_defaults"),c=t("./line_shape_defaults"),h=t("./text_defaults"),f=t("./fillcolor_defaults"),d=t("../../components/errorbars/defaults");e.exports=function(t,e,r,p){function m(r,a){return n.coerce(t,e,i,r,a)}var v=s(t,e,p,m),g=v<a.PTS_LINESONLY?"lines+markers":"lines";if(!v)return void(e.visible=!1);m("customdata"),m("text"),m("hovertext"),m("mode",g),m("ids"),o.hasLines(e)&&(u(t,e,r,p,m),c(t,e,m),m("connectgaps"),m("line.simplify")),o.hasMarkers(e)&&l(t,e,r,p,m,{gradient:!0}),o.hasText(e)&&h(t,e,p,m);var y=[];(o.hasMarkers(e)||o.hasText(e))&&(m("marker.maxdisplayed"),y.push("points")),m("fill"),"none"!==e.fill&&(f(t,e,r,m),o.hasLines(e)||c(t,e,m)),"tonext"!==e.fill&&"toself"!==e.fill||y.push("fills"),m("hoveron",y.join("+")||"points"),d(t,e,r,{axis:"y"}),d(t,e,r,{axis:"x",inherit:"y"})}},{"../../components/errorbars/defaults":619,"../../lib":709,"./attributes":1008,"./constants":1013,"./fillcolor_defaults":1015,"./line_defaults":1019,"./line_shape_defaults":1021,"./marker_defaults":1024,"./subtypes":1028,"./text_defaults":1029,"./xy_defaults":1030}],1015:[function(t,e,r){"use strict";var n=t("../../components/color");e.exports=function(t,e,r,i){var a=!1;if(e.marker){var o=e.marker.color,s=(e.marker.line||{}).color;o&&!Array.isArray(o)?a=o:s&&!Array.isArray(s)&&(a=s)}i("fillcolor",n.addOpacity((e.line||{}).color||a||r,.5))}},{"../../components/color":590}],1016:[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,r&&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:"",a?n.opacity(a)<.3?n.addOpacity(a,.3):a:(r=(t.line||{}).color,r&&n.opacity(r)&&i.hasLines(t)&&t.line.width?r:t.fillcolor)}},{"../../components/color":590,"./subtypes":1028}],1017:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../components/fx"),a=t("../../components/errorbars"),o=t("./get_trace_color"),s=t("../../components/color"),l=i.constants.MAXDIST;e.exports=function(t,e,r,u){var c=t.cd,h=c[0].trace,f=t.xa,d=t.ya,p=f.c2p(e),m=d.c2p(r),v=[p,m];if(h.hoveron.indexOf("points")!==-1){var g=function(t){var e=Math.max(3,t.mrc||0);return Math.max(Math.abs(f.c2p(t.x)-p)-e,1-3/e)},y=function(t){var e=Math.max(3,t.mrc||0);return Math.max(Math.abs(d.c2p(t.y)-m)-e,1-3/e)},b=function(t){var e=Math.max(3,t.mrc||0),r=f.c2p(t.x)-p,n=d.c2p(t.y)-m;return Math.max(Math.sqrt(r*r+n*n)-e,1-3/e)},x=i.getDistanceFunction(u,g,y,b);if(i.getClosest(c,x,t),t.index!==!1){var _=c[t.index],w=f.c2p(_.x,!0),M=d.c2p(_.y,!0),k=_.mrc||1;return n.extendFlat(t,{color:o(h,_),x0:w-k,x1:w+k,xLabelVal:_.x,y0:M-k,y1:M+k,yLabelVal:_.y}),_.htx?t.text=_.htx:h.hovertext?t.text=h.hovertext:_.tx?t.text=_.tx:h.text&&(t.text=h.text),a.hoverInfo(_,h,t),[t]}}if(h.hoveron.indexOf("fills")!==-1&&h._polygons){var A,T,S,E,L,C,z,D,I,P=h._polygons,O=[],j=!1,F=1/0,R=-1/0,N=1/0,B=-1/0;for(A=0;A<P.length;A++)S=P[A],S.contains(v)&&(j=!j,O.push(S),N=Math.min(N,S.ymin),B=Math.max(B,S.ymax));if(j){N=Math.max(N,0),B=Math.min(B,d._length);var U=(N+B)/2;for(A=0;A<O.length;A++)for(E=O[A].pts,T=1;T<E.length;T++)D=E[T-1][1],I=E[T][1],D>U!=I>=U&&(C=E[T-1][0],z=E[T][0],L=C+(z-C)*(U-D)/(I-D),F=Math.min(F,L),R=Math.max(R,L));F=Math.max(F,0),R=Math.min(R,f._length);var V=s.defaultLine;return s.opacity(h.fillcolor)?V=h.fillcolor:s.opacity((h.line||{}).color)&&(V=h.line.color),n.extendFlat(t,{distance:l+10,x0:F,x1:R,y0:U,y1:U,color:V}),delete t.index,h.text&&!Array.isArray(h.text)?t.text=String(h.text):t.text=h.name,[t]}}}},{"../../components/color":590,"../../components/errorbars":620,"../../components/fx":631,"../../lib":709,"./get_trace_color":1016}],1018:[function(t,e,r){"use strict";var n={},i=t("./subtypes");n.hasLines=i.hasLines,n.hasMarkers=i.hasMarkers,n.hasText=i.hasText,n.isBubble=i.isBubble,n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.cleanData=t("./clean_data"),n.calc=t("./calc"),n.arraysToCalcdata=t("./arrays_to_calcdata"),n.plot=t("./plot"),n.colorbar=t("./colorbar"),n.style=t("./style"),n.hoverPoints=t("./hover"),n.selectPoints=t("./select"),n.animatable=!0,n.moduleType="trace",n.name="scatter",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","symbols","markerColorscale","errorBarsOK","showLegend"],n.meta={},e.exports=n},{"../../plots/cartesian":758,"./arrays_to_calcdata":1007,"./attributes":1008,"./calc":1009,"./clean_data":1010,"./colorbar":1011,"./defaults":1014,"./hover":1017,"./plot":1025,"./select":1026,"./style":1027,"./subtypes":1028}],1019:[function(t,e,r){"use strict";var n=t("../../components/colorscale/has_colorscale"),i=t("../../components/colorscale/defaults");e.exports=function(t,e,r,a,o,s){var l=(t.marker||{}).color;if(o("line.color",r),n(t,"line"))i(t,e,a,o,{prefix:"line.",cLetter:"c"});else{o("line.color",!Array.isArray(l)&&l||r)}o("line.width"),(s||{}).noDash||o("line.dash")}},{"../../components/colorscale/defaults":599,"../../components/colorscale/has_colorscale":603}],1020:[function(t,e,r){"use strict";var n=t("../../constants/numerical").BADNUM;e.exports=function(t,e){function r(e){var r=_.c2p(t[e].x),i=w.c2p(t[e].y);return r!==n&&i!==n&&[r,i]}function i(t){var e=t[0]/_._length,r=t[1]/w._length;return(1+10*Math.max(0,-e,e-1,-r,r-1))*A}var a,o,s,l,u,c,h,f,d,p,m,v,g,y,b,x,_=e.xaxis,w=e.yaxis,M=e.simplify,k=e.connectGaps,A=e.baseTolerance,T=e.linear,S=[],E=.2,L=new Array(t.length),C=0;for(M||(A=E=-1),a=0;a<t.length;a++)if(o=r(a)){for(C=0,L[C++]=o,a++;a<t.length;a++){
75 if(!(l=r(a))){if(k)continue;break}if(T){if(!((h=function(t,e){var r=t[0]-e[0],n=t[1]-e[1];return Math.sqrt(r*r+n*n)}(l,o))<i(l)*E)){for(d=[(l[0]-o[0])/h,(l[1]-o[1])/h],u=o,m=h,v=y=b=0,f=!1,s=l,a++;a<t.length;a++){if(!(c=r(a))){if(k)continue;break}if(p=[c[0]-o[0],c[1]-o[1]],x=p[0]*d[1]-p[1]*d[0],y=Math.min(y,x),(b=Math.max(b,x))-y>i(c))break;s=c,g=p[0]*d[0]+p[1]*d[1],g>m?(m=g,l=c,f=!1):g<v&&(v=g,u=c,f=!0)}if(f?(L[C++]=l,s!==u&&(L[C++]=u)):(u!==o&&(L[C++]=u),s!==l&&(L[C++]=l)),L[C++]=s,a>=t.length||!c)break;L[C++]=c,o=c}}else L[C++]=l}S.push(L.slice(0,C))}return S}},{"../../constants/numerical":690}],1021:[function(t,e,r){"use strict";e.exports=function(t,e,r){"spline"===r("line.shape")&&r("line.smoothing")}},{}],1022:[function(t,e,r){"use strict";e.exports=function(t,e,r){for(var n,i,a=null,o=0;o<r.length;++o)n=r[o],i=n[0].trace,i.visible===!0?(i._nexttrace=null,["tonextx","tonexty","tonext"].indexOf(i.fill)!==-1&&(i._prevtrace=a,a&&(a._nexttrace=i)),a=i):i._prevtrace=i._nexttrace=null}},{}],1023:[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":127}],1024:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../components/colorscale/has_colorscale"),a=t("../../components/colorscale/defaults"),o=t("./subtypes");e.exports=function(t,e,r,s,l,u){var c,h=o.isBubble(t),f=(t.line||{}).color;if(u=u||{},f&&(r=f),l("marker.symbol"),l("marker.opacity",h?.7:1),l("marker.size"),l("marker.color",r),i(t,"marker")&&a(t,e,s,l,{prefix:"marker.",cLetter:"c"}),u.noLine||(c=f&&!Array.isArray(f)&&e.marker.color!==f?f:h?n.background:n.defaultLine,l("marker.line.color",c),i(t,"marker.line")&&a(t,e,s,l,{prefix:"marker.line.",cLetter:"c"}),l("marker.line.width",h?1:0)),h&&(l("marker.sizeref"),l("marker.sizemin"),l("marker.sizemode")),u.gradient){"none"!==l("marker.gradient.type")&&l("marker.gradient.color")}}},{"../../components/color":590,"../../components/colorscale/defaults":599,"../../components/colorscale/has_colorscale":603,"./subtypes":1028}],1025:[function(t,e,r){"use strict";function n(t,e){var r;e.selectAll("g.trace").each(function(t){var e=o.select(this);if(r=t[0].trace,r._nexttrace){if(r._nextFill=e.select(".js-fill.js-tonext"),!r._nextFill.size()){var n=":first-child";e.select(".js-fill.js-tozero").size()&&(n+=" + *"),r._nextFill=e.insert("path",n).attr("class","js-fill js-tonext")}}else e.selectAll(".js-fill.js-tonext").remove(),r._nextFill=null;r.fill&&("tozero"===r.fill.substr(0,6)||"toself"===r.fill||"to"===r.fill.substr(0,2)&&!r._prevtrace)?(r._ownFill=e.select(".js-fill.js-tozero"),r._ownFill.size()||(r._ownFill=e.insert("path",":first-child").attr("class","js-fill js-tozero"))):(e.selectAll(".js-fill.js-tozero").remove(),r._ownFill=null)})}function i(t,e,r,n,i,f,p){function m(t){return M?t.transition():t}function v(t){return t.filter(function(t){return t.vis})}function g(t){return t.id}function y(t){if(t.ids)return g}function b(){return!1}function x(e){var r,n,i,a=e[0].trace,u=o.select(this),h=c.hasMarkers(a),f=c.hasText(a),d=y(a),p=b,g=b;h&&(p=a.marker.maxdisplayed||a._needsCull?v:s.identity),f&&(g=a.marker.maxdisplayed||a._needsCull?v:s.identity),n=u.selectAll("path.point"),r=n.data(p,d);var x=r.enter().append("path").classed("point",!0);x.call(l.pointStyle,a).call(l.translatePoints,k,A,a),M&&x.style("opacity",0).transition().style("opacity",1);var _=h&&l.tryColorscale(a.marker,""),w=h&&l.tryColorscale(a.marker,"line");r.each(function(e){var r=o.select(this),n=m(r);(i=l.translatePoint(e,n,k,A))&&(l.singlePointStyle(e,n,a,_,w,t),a.customdata&&r.classed("plotly-customdata",null!==e.data&&void 0!==e.data))}),M?r.exit().transition().style("opacity",0).remove():r.exit().remove(),n=u.selectAll("g"),r=n.data(g,d),r.enter().append("g").classed("textpoint",!0).append("text"),r.each(function(t){var e=o.select(this),r=m(e.select("text"));(i=l.translatePoint(t,r,k,A))||e.remove()}),r.selectAll("text").call(l.textPointStyle,a).each(function(t){var e=t.xp||k.c2p(t.x),r=t.yp||A.c2p(t.y);o.select(this).selectAll("tspan.line").each(function(){m(o.select(this)).attr({x:e,y:r})})}),r.exit().remove()}var _,w;a(t,e,r,n,i);var M=!!p&&p.duration>0,k=r.xaxis,A=r.yaxis,T=n[0].trace,S=T.line,E=o.select(f);if(E.call(u.plot,r,p),T.visible===!0){m(E).style("opacity",T.opacity);var L,C,z=T.fill.charAt(T.fill.length-1);"x"!==z&&"y"!==z&&(z=""),n[0].node3=E;var D="",I=[],P=T._prevtrace;P&&(D=P._prevRevpath||"",C=P._nextFill,I=P._polygons);var O,j,F,R,N,B,U,V,q,H="",G="",Y=[],X=[],W=s.noop;if(L=T._ownFill,c.hasLines(T)||"none"!==T.fill){for(C&&C.datum(n),["hv","vh","hvh","vhv"].indexOf(S.shape)!==-1?(F=l.steps(S.shape),R=l.steps(S.shape.split("").reverse().join(""))):F=R="spline"===S.shape?function(t){var e=t[t.length-1];return t[0][0]===e[0]&&t[0][1]===e[1]?l.smoothclosed(t.slice(1),S.smoothing):l.smoothopen(t,S.smoothing)}:function(t){return"M"+t.join("L")},N=function(t){return R(t.reverse())},Y=h(n,{xaxis:k,yaxis:A,connectGaps:T.connectgaps,baseTolerance:Math.max(S.width||1,3)/4,linear:"linear"===S.shape,simplify:S.simplify}),q=T._polygons=new Array(Y.length),w=0;w<Y.length;w++)T._polygons[w]=d(Y[w]);Y.length&&(B=Y[0][0],U=Y[Y.length-1],V=U[U.length-1]),X=Y.filter(function(t){return t.length>1}),W=function(t){return function(e){if(O=F(e),j=N(e),H?z?(H+="L"+O.substr(1),G=j+"L"+G.substr(1)):(H+="Z"+O,G=j+"Z"+G):(H=O,G=j),c.hasLines(T)&&e.length>1){var r=o.select(this);if(r.datum(n),t)m(r.style("opacity",0).attr("d",O).call(l.lineGroupStyle)).style("opacity",1);else{var i=m(r);i.attr("d",O),l.singleLineStyle(n,i)}}}}}var Z=E.selectAll(".js-line").data(X);m(Z.exit()).style("opacity",0).remove(),Z.each(W(!1)),Z.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(l.lineGroupStyle).each(W(!0)),Y.length&&(L?B&&V&&(z?("y"===z?B[1]=V[1]=A.c2p(0,!0):"x"===z&&(B[0]=V[0]=k.c2p(0,!0)),m(L).attr("d","M"+V+"L"+B+"L"+H.substr(1))):m(L).attr("d",H+"Z")):"tonext"===T.fill.substr(0,6)&&H&&D&&("tonext"===T.fill?m(C).attr("d",H+"Z"+D+"Z"):m(C).attr("d",H+"L"+D.substr(1)+"Z"),T._polygons=T._polygons.concat(I)),T._prevRevpath=G,T._prevPolygons=q);var J=E.selectAll(".points");_=J.data([n]),J.each(x),_.enter().append("g").classed("points",!0).each(x),_.exit().remove()}}function a(t,e,r,n,i){var a=r.xaxis,l=r.yaxis,u=o.extent(s.simpleMap(a.range,a.r2c)),h=o.extent(s.simpleMap(l.range,l.r2c)),f=n[0].trace;if(c.hasMarkers(f)){var d=f.marker.maxdisplayed;if(0!==d){var p=n.filter(function(t){return t.x>=u[0]&&t.x<=u[1]&&t.y>=h[0]&&t.y<=h[1]}),m=Math.ceil(p.length/d),v=0;i.forEach(function(t,r){var n=t[0].trace;c.hasMarkers(n)&&n.marker.maxdisplayed>0&&r<e&&v++});var g=Math.round(v*m/3+Math.floor(v/3)*m/7.1);n.forEach(function(t){delete t.vis}),p.forEach(function(t,e){0===Math.round((e+g)%m)&&(t.vis=!0)})}}}var o=t("d3"),s=t("../../lib"),l=t("../../components/drawing"),u=t("../../components/errorbars"),c=t("./subtypes"),h=t("./line_points"),f=t("./link_traces"),d=t("../../lib/polygon").tester;e.exports=function(t,e,r,a,s){var l,u,c,h,d,p=e.plot.select("g.scatterlayer"),m=!a,v=!!a&&a.duration>0;for(c=p.selectAll("g.trace"),h=c.data(r,function(t){return t[0].trace.uid}),h.enter().append("g").attr("class",function(t){return"trace scatter trace"+t[0].trace.uid}).style("stroke-miterlimit",2),f(t,e,r),n(t,p),l=0,u={};l<r.length;l++)u[r[l][0].trace.uid]=l;if(p.selectAll("g.trace").sort(function(t,e){return u[t[0].trace.uid]>u[e[0].trace.uid]?1:-1}),v){s&&(d=s());o.transition().duration(a.duration).ease(a.easing).each("end",function(){d&&d()}).each("interrupt",function(){d&&d()}).each(function(){p.selectAll("g.trace").each(function(n,o){i(t,o,e,n,r,this,a)})})}else p.selectAll("g.trace").each(function(n,o){i(t,o,e,n,r,this,a)});m&&h.exit().remove(),p.selectAll("path:not([d])").remove()}},{"../../components/drawing":614,"../../components/errorbars":620,"../../lib":709,"../../lib/polygon":719,"./line_points":1020,"./link_traces":1022,"./subtypes":1028,d3:118}],1026:[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=[],h=s[0].trace,f=h.index,d=h.marker,p=!n.hasMarkers(h)&&!n.hasText(h);if(h.visible===!0&&!p){var m=Array.isArray(d.opacity)?1:d.opacity;if(e===!1)for(r=0;r<s.length;r++)s[r].dim=0;else for(r=0;r<s.length;r++)i=s[r],a=l.c2p(i.x),o=u.c2p(i.y),e.contains([a,o])?(c.push({curveNumber:f,pointNumber:r,x:i.x,y:i.y,id:i.id}),i.dim=0):i.dim=1;return s[0].node3.selectAll("path.point").style("opacity",function(t){return((t.mo+1||m+1)-1)*(t.dim?.2:1)}),s[0].node3.selectAll("text").style("opacity",function(t){return t.dim?.2:1}),c}}},{"./subtypes":1028}],1027:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../components/drawing"),a=t("../../components/errorbars");e.exports=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(t){var e=n.select(this),r=e.selectAll("path.point"),a=t.trace||t[0].trace;r.call(i.pointStyle,a),e.selectAll("text").call(i.textPointStyle,a)}),e.selectAll("g.trace path.js-line").call(i.lineGroupStyle),e.selectAll("g.trace path.js-fill").call(i.fillGroupStyle),e.call(a.style)}},{"../../components/drawing":614,"../../components/errorbars":620,d3:118}],1028:[function(t,e,r){"use strict";var n=t("../../lib");e.exports={hasLines:function(t){return t.visible&&t.mode&&t.mode.indexOf("lines")!==-1},hasMarkers:function(t){return t.visible&&t.mode&&t.mode.indexOf("markers")!==-1},hasText:function(t){return t.visible&&t.mode&&t.mode.indexOf("text")!==-1},isBubble:function(t){return n.isPlainObject(t.marker)&&Array.isArray(t.marker.size)}}},{"../../lib":709}],1029:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e,r,i){i("textposition"),n.coerceFont(i,"textfont",r.font)}},{"../../lib":709}],1030:[function(t,e,r){"use strict";var n=t("../../registry");e.exports=function(t,e,r,i){var a,o=i("x"),s=i("y");if(n.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],r),o)s?(a=Math.min(o.length,s.length),a<o.length&&(e.x=o.slice(0,a)),a<s.length&&(e.y=s.slice(0,a))):(a=o.length,i("y0"),i("dy"));else{if(!s)return 0;a=e.y.length,i("x0"),i("dx")}return a}},{"../../registry":826}],1031:[function(t,e,r){"use strict";function n(t){return{show:{valType:"boolean",dflt:!1},opacity:{valType:"number",min:0,max:1,dflt:1},scale:{valType:"number",min:0,max:10,dflt:2/3}}}var i=t("../scatter/attributes"),a=t("../../components/colorscale/color_attributes"),o=t("../../components/errorbars/attributes"),s=t("../../constants/gl3d_dashes"),l=t("../../constants/gl_markers"),u=t("../../lib/extend").extendFlat,c=i.line,h=i.marker,f=h.line;e.exports={x:{valType:"data_array"},y:{valType:"data_array"},z:{valType:"data_array"},text:u({},i.text,{}),hovertext:u({},i.hovertext,{}),mode:u({},i.mode,{dflt:"lines+markers"}),surfaceaxis:{valType:"enumerated",values:[-1,0,1,2],dflt:-1},surfacecolor:{valType:"color"},projection:{x:n("x"),y:n("y"),z:n("z")},connectgaps:i.connectgaps,line:u({},{width:c.width,dash:{valType:"enumerated",values:Object.keys(s),dflt:"solid"},showscale:{valType:"boolean",dflt:!1}},a("line")),marker:u({},{symbol:{valType:"enumerated",values:Object.keys(l),dflt:"circle",arrayOk:!0},size:u({},h.size,{dflt:8}),sizeref:h.sizeref,sizemin:h.sizemin,sizemode:h.sizemode,opacity:u({},h.opacity,{arrayOk:!1}),showscale:h.showscale,colorbar:h.colorbar,line:u({},{width:u({},f.width,{arrayOk:!1})},a("marker.line"))},a("marker")),textposition:u({},i.textposition,{dflt:"top center"}),textfont:i.textfont,error_x:o,error_y:o,error_z:o}},{"../../components/colorscale/color_attributes":597,"../../components/errorbars/attributes":616,"../../constants/gl3d_dashes":687,"../../constants/gl_markers":688,"../../lib/extend":701,"../scatter/attributes":1008}],1032:[function(t,e,r){"use strict";var n=t("../scatter/arrays_to_calcdata"),i=t("../scatter/colorscale_calc");e.exports=function(t,e){var r=[{x:!1,y:!1,trace:e,t:{}}];return n(r,e),i(e),r}},{"../scatter/arrays_to_calcdata":1007,"../scatter/colorscale_calc":1012}],1033:[function(t,e,r){"use strict";function n(t,e,r){if(!e||!e.visible)return null;for(var n=o(e),i=new Array(t.length),a=0;a<t.length;a++){var s=n(+t[a],a);i[a]=[-s[0]*r,s[1]*r]}return i}function i(t){for(var e=0;e<t.length;e++)if(t[e])return t[e].length;return 0}function a(t,e){var r=[n(t.x,t.error_x,e[0]),n(t.y,t.error_y,e[1]),n(t.z,t.error_z,e[2])],a=i(r);if(0===a)return null;for(var o=new Array(a),s=0;s<a;s++){for(var l=[[0,0,0],[0,0,0]],u=0;u<3;u++)if(r[u])for(var c=0;c<2;c++)l[c][u]=r[u][s][c];o[s]=l}return o}var o=t("../../components/errorbars/compute_error");e.exports=a},{"../../components/errorbars/compute_error":618}],1034:[function(t,e,r){"use strict";function n(t,e){this.scene=t,this.uid=e,this.linePlot=null,this.scatterPlot=null,this.errorBars=null,this.textMarkers=null,this.delaunayMesh=null,this.color=null,this.mode="",this.dataPoints=[],this.axesBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.textLabels=null,this.data=null}function i(t,e,r){var n,i=(r+1)%3,a=(r+2)%3,o=[],s=[];for(n=0;n<t.length;++n){var l=t[n];!isNaN(l[i])&&isFinite(l[i])&&!isNaN(l[a])&&isFinite(l[a])&&(o.push([l[i],l[a]]),s.push(n))}var u=g(o);for(n=0;n<u.length;++n)for(var c=u[n],h=0;h<c.length;++h)c[h]=s[c[h]];return{positions:t,cells:u,meshColor:e}}function a(t){for(var e=[0,0,0],r=[[0,0,0],[0,0,0],[0,0,0]],n=[0,0,0],i=0;i<3;i++){var a=t[i];a&&a.copy_zstyle!==!1&&(a=t[2]),a&&(e[i]=a.width/2,r[i]=b(a.color),n=a.thickness)}return{capSize:e,color:r,lineWidth:n}}function o(t){var e=[0,0];return Array.isArray(t)?[0,-1]:(t.indexOf("bottom")>=0&&(e[1]+=1),t.indexOf("top")>=0&&(e[1]-=1),t.indexOf("left")>=0&&(e[0]-=1),t.indexOf("right")>=0&&(e[0]+=1),e)}function s(t,e){return e(4*t)}function l(t){return M[t]}function u(t,e,r,n,i){var a=null;if(Array.isArray(t)){a=[];for(var o=0;o<e;o++)void 0===t[o]?a[o]=n:a[o]=r(t[o],i)}else a=r(t,y.identity);return a}function c(t,e){var r,n,i,c,h,f,d=[],p=t.fullSceneLayout,m=t.dataScale,v=p.xaxis,g=p.yaxis,w=p.zaxis,M=e.marker,A=e.line,T=e.x||[],S=e.y||[],E=e.z||[],L=T.length,C=e.xcalendar,z=e.ycalendar,D=e.zcalendar;for(n=0;n<L;n++)i=v.d2l(T[n],0,C)*m[0],c=g.d2l(S[n],0,z)*m[1],h=w.d2l(E[n],0,D)*m[2],d[n]=[i,c,h];if(Array.isArray(e.text))f=e.text;else if(void 0!==e.text)for(f=new Array(L),n=0;n<L;n++)f[n]=e.text;if(r={position:d,mode:e.mode,text:f},"line"in e&&(r.lineColor=x(A,1,L),r.lineWidth=A.width,r.lineDashes=A.dash),"marker"in e){var I=_(e);r.scatterColor=x(M,1,L),r.scatterSize=u(M.size,L,s,20,I),r.scatterMarker=u(M.symbol,L,l,"\u25cf"),r.scatterLineWidth=M.line.width,r.scatterLineColor=x(M.line,1,L),r.scatterAngle=0}"textposition"in e&&(r.textOffset=o(e.textposition),r.textColor=x(e.textfont,1,L),r.textSize=u(e.textfont.size,L,y.identity,12),r.textFont=e.textfont.family,r.textAngle=0);var P=["x","y","z"];for(r.project=[!1,!1,!1],r.projectScale=[1,1,1],r.projectOpacity=[1,1,1],n=0;n<3;++n){var O=e.projection[P[n]];(r.project[n]=O.show)&&(r.projectOpacity[n]=O.opacity,r.projectScale[n]=O.scale)}r.errorBounds=k(e,m);var j=a([e.error_x,e.error_y,e.error_z]);return r.errorColor=j.color,r.errorLineWidth=j.lineWidth,r.errorCapSize=j.capSize,r.delaunayAxis=e.surfaceaxis,r.delaunayColor=b(e.surfacecolor),r}function h(t){if(Array.isArray(t)){var e=t[0];return Array.isArray(e)&&(t=e),"rgb("+t.slice(0,3).map(function(t){return Math.round(255*t)})+")"}return null}function f(t,e){var r=new n(t,e.uid);return r.update(e),r}var d=t("gl-line3d"),p=t("gl-scatter3d"),m=t("gl-error3d"),v=t("gl-mesh3d"),g=t("delaunay-triangulate"),y=t("../../lib"),b=t("../../lib/str2rgbarray"),x=t("../../lib/gl_format_color"),_=t("../scatter/make_bubble_size_func"),w=t("../../constants/gl3d_dashes"),M=t("../../constants/gl_markers"),k=t("./calc_errors"),A=n.prototype;A.handlePick=function(t){if(t.object&&(t.object===this.linePlot||t.object===this.delaunayMesh||t.object===this.textMarkers||t.object===this.scatterPlot)){t.object.highlight&&t.object.highlight(null),this.scatterPlot&&(t.object=this.scatterPlot,this.scatterPlot.highlight(t.data)),this.textLabels?void 0!==this.textLabels[t.data.index]?t.textLabel=this.textLabels[t.data.index]:t.textLabel=this.textLabels:t.textLabel="";var e=t.index=t.data.index;return t.traceCoordinate=[this.data.x[e],this.data.y[e],this.data.z[e]],!0}},A.update=function(t){var e,r,n,a,o=this.scene.glplot.gl,s=w.solid;this.data=t;var l=c(this.scene,t);"mode"in l&&(this.mode=l.mode),"lineDashes"in l&&l.lineDashes in w&&(s=w[l.lineDashes]),this.color=h(l.scatterColor)||h(l.lineColor),this.dataPoints=l.position,e={gl:o,position:l.position,color:l.lineColor,lineWidth:l.lineWidth||1,dashes:s[0],dashScale:s[1],opacity:t.opacity,connectGaps:t.connectgaps},this.mode.indexOf("lines")!==-1?this.linePlot?this.linePlot.update(e):(this.linePlot=d(e),this.linePlot._trace=this,this.scene.glplot.add(this.linePlot)):this.linePlot&&(this.scene.glplot.remove(this.linePlot),this.linePlot.dispose(),this.linePlot=null);var u=t.opacity;if(t.marker&&t.marker.opacity&&(u*=t.marker.opacity),r={gl:o,position:l.position,color:l.scatterColor,size:l.scatterSize,glyph:l.scatterMarker,opacity:u,orthographic:!0,lineWidth:l.scatterLineWidth,lineColor:l.scatterLineColor,project:l.project,projectScale:l.projectScale,projectOpacity:l.projectOpacity},this.mode.indexOf("markers")!==-1?this.scatterPlot?this.scatterPlot.update(r):(this.scatterPlot=p(r),this.scatterPlot._trace=this,this.scatterPlot.highlightScale=1,this.scene.glplot.add(this.scatterPlot)):this.scatterPlot&&(this.scene.glplot.remove(this.scatterPlot),this.scatterPlot.dispose(),this.scatterPlot=null),a={gl:o,position:l.position,glyph:l.text,color:l.textColor,size:l.textSize,angle:l.textAngle,alignment:l.textOffset,font:l.textFont,orthographic:!0,lineWidth:0,project:!1,opacity:t.opacity},this.textLabels=t.hovertext||t.text,this.mode.indexOf("text")!==-1?this.textMarkers?this.textMarkers.update(a):(this.textMarkers=p(a),this.textMarkers._trace=this,this.textMarkers.highlightScale=1,this.scene.glplot.add(this.textMarkers)):this.textMarkers&&(this.scene.glplot.remove(this.textMarkers),this.textMarkers.dispose(),this.textMarkers=null),n={gl:o,position:l.position,color:l.errorColor,error:l.errorBounds,lineWidth:l.errorLineWidth,capSize:l.errorCapSize,opacity:t.opacity},this.errorBars?l.errorBounds?this.errorBars.update(n):(this.scene.glplot.remove(this.errorBars),this.errorBars.dispose(),this.errorBars=null):l.errorBounds&&(this.errorBars=m(n),this.errorBars._trace=this,this.scene.glplot.add(this.errorBars)),l.delaunayAxis>=0){var f=i(l.position,l.delaunayColor,l.delaunayAxis);f.opacity=t.opacity,this.delaunayMesh?this.delaunayMesh.update(f):(f.gl=o,this.delaunayMesh=v(f),this.delaunayMesh._trace=this,this.scene.glplot.add(this.delaunayMesh))}else this.delaunayMesh&&(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose(),this.delaunayMesh=null)},A.dispose=function(){this.linePlot&&(this.scene.glplot.remove(this.linePlot),this.linePlot.dispose()),this.scatterPlot&&(this.scene.glplot.remove(this.scatterPlot),this.scatterPlot.dispose()),this.errorBars&&(this.scene.glplot.remove(this.errorBars),this.errorBars.dispose()),this.textMarkers&&(this.scene.glplot.remove(this.textMarkers),this.textMarkers.dispose()),this.delaunayMesh&&(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose())},e.exports=f},{"../../constants/gl3d_dashes":687,"../../constants/gl_markers":688,"../../lib":709,"../../lib/gl_format_color":706,"../../lib/str2rgbarray":727,"../scatter/make_bubble_size_func":1023,"./calc_errors":1033,"delaunay-triangulate":119,"gl-error3d":157,"gl-line3d":167,"gl-mesh3d":200,"gl-scatter3d":246}],1035:[function(t,e,r){"use strict";function n(t,e,r,n){var a=0,o=r("x"),s=r("y"),l=r("z");return i.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y","z"],n),o&&s&&l&&(a=Math.min(o.length,s.length,l.length),a<o.length&&(e.x=o.slice(0,a)),a<s.length&&(e.y=s.slice(0,a)),a<l.length&&(e.z=l.slice(0,a))),a}var i=t("../../registry"),a=t("../../lib"),o=t("../scatter/subtypes"),s=t("../scatter/marker_defaults"),l=t("../scatter/line_defaults"),u=t("../scatter/text_defaults"),c=t("../../components/errorbars/defaults"),h=t("./attributes");e.exports=function(t,e,r,i){function f(r,n){return a.coerce(t,e,h,r,n)}if(!n(t,e,f,i))return void(e.visible=!1);f("text"),f("hovertext"),f("mode"),o.hasLines(e)&&(f("connectgaps"),l(t,e,r,i,f)),o.hasMarkers(e)&&s(t,e,r,i,f),o.hasText(e)&&u(t,e,i,f);var d=(e.line||{}).color,p=(e.marker||{}).color;f("surfaceaxis")>=0&&f("surfacecolor",d||p);for(var m=["x","y","z"],v=0;v<3;++v){var g="projection."+m[v];f(g+".show")&&(f(g+".opacity"),f(g+".scale"))}c(t,e,r,{axis:"z"}),c(t,e,r,{axis:"y",inherit:"z"}),c(t,e,r,{axis:"x",inherit:"z"})}},{"../../components/errorbars/defaults":619,"../../lib":709,"../../registry":826,"../scatter/line_defaults":1019,"../scatter/marker_defaults":1024,"../scatter/subtypes":1028,"../scatter/text_defaults":1029,"./attributes":1031}],1036:[function(t,e,r){"use strict";var n={};n.plot=t("./convert"),n.attributes=t("./attributes"),n.markerSymbols=t("../../constants/gl_markers"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("./calc"),n.moduleType="trace",n.name="scatter3d",n.basePlotModule=t("../../plots/gl3d"),n.categories=["gl3d","symbols","markerColorscale","showLegend"],n.meta={},e.exports=n},{"../../constants/gl_markers":688,"../../plots/gl3d":791,"../scatter/colorbar":1011,"./attributes":1031,"./calc":1032,"./convert":1034,"./defaults":1035}],1037:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../plots/attributes"),a=t("../../components/colorscale/color_attributes"),o=t("../../components/colorbar/attributes"),s=t("../../lib/extend").extendFlat,l=n.marker,u=n.line,c=l.line;e.exports={carpet:{valType:"string"},a:{valType:"data_array"},b:{valType:"data_array"},sum:{valType:"number",dflt:0,min:0},mode:s({},n.mode,{dflt:"markers"}),text:s({},n.text,{}),line:{color:u.color,width:u.width,dash:u.dash,shape:s({},u.shape,{values:["linear","spline"]}),smoothing:u.smoothing},connectgaps:n.connectgaps,fill:s({},n.fill,{values:["none","toself","tonext"]}),fillcolor:n.fillcolor,marker:s({},{symbol:l.symbol,opacity:l.opacity,maxdisplayed:l.maxdisplayed,size:l.size,sizeref:l.sizeref,sizemin:l.sizemin,sizemode:l.sizemode,line:s({},{width:c.width},a("marker".line)),gradient:l.gradient},a("marker"),{showscale:l.showscale,colorbar:o}),textfont:n.textfont,textposition:n.textposition,hoverinfo:s({},i.hoverinfo,{flags:["a","b","c","text","name"]}),hoveron:n.hoveron}},{"../../components/colorbar/attributes":591,"../../components/colorscale/color_attributes":597,"../../lib/extend":701,"../../plots/attributes":746,"../scatter/attributes":1008}],1038:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../plots/cartesian/axes"),a=t("../scatter/subtypes"),o=t("../scatter/colorscale_calc"),s=t("../scatter/arrays_to_calcdata"),l=t("../carpet/lookup_carpetid");e.exports=function(t,e){var r=e.carpetTrace=l(t,e);if(r&&r.visible&&"legendonly"!==r.visible){var u;e.xaxis=r.xaxis,e.yaxis=r.yaxis;var c,h,f=e.a.length,d=new Array(f),p=!1;for(u=0;u<f;u++)if(c=e.a[u],h=e.b[u],n(c)&&n(h)){var m=r.ab2xy(+c,+h,!0),v=r.isVisible(+c,+h);v||(p=!0),d[u]={x:m[0],y:m[1],a:c,b:h,vis:v}}else d[u]={x:!1,y:!1};e._needsCull=p,d[0].carpet=r,d[0].trace=e;var g,y;if(a.hasMarkers(e)&&(g=e.marker,y=g.size,Array.isArray(y))){var b={type:"linear"};i.setConvert(b),y=b.makeCalcdata(e.marker,"size"),y.length>f&&y.splice(f,y.length-f)}return o(e),s(d,e),d}}},{"../../plots/cartesian/axes":748,"../carpet/lookup_carpetid":882,"../scatter/arrays_to_calcdata":1007,"../scatter/colorscale_calc":1012,"../scatter/subtypes":1028,"fast-isnumeric":127}],1039:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../scatter/constants"),a=t("../scatter/subtypes"),o=t("../scatter/marker_defaults"),s=t("../scatter/line_defaults"),l=t("../scatter/line_shape_defaults"),u=t("../scatter/text_defaults"),c=t("../scatter/fillcolor_defaults"),h=t("./attributes");e.exports=function(t,e,r,f){function d(r,i){return n.coerce(t,e,h,r,i)}d("carpet"),e.xaxis="x",e.yaxis="y";var p,m=d("a"),v=d("b");if(!(p=Math.min(m.length,v.length)))return void(e.visible=!1);m&&p<m.length&&(e.a=m.slice(0,p)),v&&p<v.length&&(e.b=v.slice(0,p)),d("sum"),d("text"),d("mode",p<i.PTS_LINESONLY?"lines+markers":"lines"),a.hasLines(e)&&(s(t,e,r,f,d),l(t,e,d),d("connectgaps")),a.hasMarkers(e)&&o(t,e,r,f,d,{gradient:!0}),a.hasText(e)&&u(t,e,f,d);var g=[];(a.hasMarkers(e)||a.hasText(e))&&(d("marker.maxdisplayed"),g.push("points")),d("fill"),"none"!==e.fill&&(c(t,e,r,d),a.hasLines(e)||l(t,e,d)),d("hoverinfo",1===f._dataLength?"a+b+text":void 0),"tonext"!==e.fill&&"toself"!==e.fill||g.push("fills"),d("hoveron",g.join("+")||"points")}},{"../../lib":709,"../scatter/constants":1013,"../scatter/fillcolor_defaults":1015,"../scatter/line_defaults":1019,"../scatter/line_shape_defaults":1021,"../scatter/marker_defaults":1024,"../scatter/subtypes":1028,"../scatter/text_defaults":1029,"./attributes":1037}],1040:[function(t,e,r){"use strict";var n=t("../scatter/hover");e.exports=function(t,e,r,i){function a(t,e){v.push((t.labelprefix&&t.labelprefix.length>0?t.labelprefix:t._hovertitle+": ")+e.toFixed(3)+t.labelsuffix)}var o=n(t,e,r,i);if(o&&o[0].index!==!1){var s=o[0];if(void 0===s.index){var l=1-s.y0/t.ya._length,u=t.xa._length,c=u*l/2,h=u-c;return s.x0=Math.max(Math.min(s.x0,h),c),s.x1=Math.max(Math.min(s.x1,h),c),o}var f=s.cd[s.index];s.a=f.a,s.b=f.b,s.xLabelVal=void 0,s.yLabelVal=void 0;var d=s.trace,p=d._carpet,m=d.hoverinfo.split("+"),v=[];m.indexOf("all")!==-1&&(m=["a","b"]),m.indexOf("a")!==-1&&a(p.aaxis,f.a),m.indexOf("b")!==-1&&a(p.baxis,f.b);var g=p.ab2ij([f.a,f.b]),y=Math.floor(g[0]),b=g[0]-y,x=Math.floor(g[1]),_=g[1]-x,w=p.evalxy([],y,x,b,_);return v.push("y: "+w[1].toFixed(3)),s.extraText=v.join("<br>"),o}}},{"../scatter/hover":1017}],1041:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("./calc"),n.plot=t("./plot"),n.style=t("./style"),n.hoverPoints=t("./hover"),n.selectPoints=t("./select"),n.moduleType="trace",n.name="scattercarpet",n.basePlotModule=t("../../plots/cartesian"),n.categories=["carpet","symbols","markerColorscale","showLegend","carpetDependent"],n.meta={},e.exports=n},{"../../plots/cartesian":758,"../scatter/colorbar":1011,"./attributes":1037,"./calc":1038,"./defaults":1039,"./hover":1040,"./plot":1042,"./select":1043,"./style":1044}],1042:[function(t,e,r){"use strict";var n=t("../scatter/plot"),i=t("../../plots/cartesian/axes");e.exports=function(t,e,r){var a,o,s,l=r[0][0].carpet,u={xaxis:i.getFromId(t,l.xaxis||"x"),yaxis:i.getFromId(t,l.yaxis||"y"),plot:e.plot};for(n(t,u,r),a=0;a<r.length;a++)o=r[a][0].trace,s=u.plot.selectAll("g.trace"+o.uid+" .js-line"),s.attr("clip-path","url(#clip"+l.uid+"carpet)")}},{"../../plots/cartesian/axes":748,"../scatter/plot":1025}],1043:[function(t,e,r){"use strict";var n=t("../scatter/select");e.exports=function(t,e){var r=n(t,e);if(r){var i,a,o,s=t.cd;for(o=0;o<r.length;o++)i=r[o],a=s[i.pointNumber],i.a=a.a,i.b=a.b,i.c=a.c,delete i.x,delete i.y;return r}}},{"../scatter/select":1026}],1044:[function(t,e,r){"use strict";var n=t("../scatter/style");e.exports=function(t){for(var e=t._fullLayout._modules,r=0;r<e.length;r++)if("scatter"===e[r].name)return;n(t)}},{"../scatter/style":1027}],1045:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../plots/attributes"),a=t("../../components/colorscale/color_attributes"),o=t("../../components/drawing/attributes").dash,s=t("../../lib/extend").extendFlat,l=n.marker,u=n.line,c=l.line;e.exports={lon:{valType:"data_array"},lat:{valType:"data_array"},locations:{valType:"data_array"},locationmode:{valType:"enumerated",values:["ISO-3","USA-states","country names"],dflt:"ISO-3"},mode:s({},n.mode,{dflt:"markers"}),text:s({},n.text,{}),hovertext:s({},n.hovertext,{}),textfont:n.textfont,textposition:n.textposition,line:{color:u.color,width:u.width,dash:o},connectgaps:n.connectgaps,marker:s({},{symbol:l.symbol,opacity:l.opacity,size:l.size,sizeref:l.sizeref,sizemin:l.sizemin,sizemode:l.sizemode,showscale:l.showscale,colorbar:l.colorbar,line:s({},{width:c.width},a("marker.line")),gradient:l.gradient},a("marker")),fill:{valType:"enumerated",values:["none","toself"],dflt:"none"},fillcolor:n.fillcolor,hoverinfo:s({},i.hoverinfo,{flags:["lon","lat","location","text","name"]})}},{"../../components/colorscale/color_attributes":597,"../../components/drawing/attributes":613,"../../lib/extend":701,"../../plots/attributes":746,"../scatter/attributes":1008}],1046:[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");e.exports=function(t,e){for(var r=Array.isArray(e.locations),s=r?e.locations.length:e.lon.length,l=new Array(s),u=0;u<s;u++){var c=l[u]={};if(r){var h=e.locations[u];c.loc="string"==typeof h?h:null}else{var f=e.lon[u],d=e.lat[u];n(f)&&n(d)?c.lonlat=[+f,+d]:c.lonlat=[i,i]}}return o(l,e),a(e),l}},{"../../constants/numerical":690,"../scatter/arrays_to_calcdata":1007,"../scatter/colorscale_calc":1012,"fast-isnumeric":127}],1047:[function(t,e,r){"use strict";function n(t,e,r){var n,i,a=0,o=r("locations");return o?(r("locationmode"),a=o.length):(n=r("lon")||[],i=r("lat")||[],a=Math.min(n.length,i.length),a<n.length&&(e.lon=n.slice(0,a)),a<i.length&&(e.lat=i.slice(0,a)),a)}var i=t("../../lib"),a=t("../scatter/subtypes"),o=t("../scatter/marker_defaults"),s=t("../scatter/line_defaults"),l=t("../scatter/text_defaults"),u=t("../scatter/fillcolor_defaults"),c=t("./attributes");e.exports=function(t,e,r,h){function f(r,n){return i.coerce(t,e,c,r,n)}if(!n(t,e,f))return void(e.visible=!1);f("text"),f("hovertext"),f("mode"),a.hasLines(e)&&(s(t,e,r,h,f),f("connectgaps")),a.hasMarkers(e)&&o(t,e,r,h,f,{gradient:!0}),a.hasText(e)&&l(t,e,h,f),f("fill"),"none"!==e.fill&&u(t,e,r,f),f("hoverinfo",1===h._dataLength?"lon+lat+location+text":void 0)}},{"../../lib":709,"../scatter/fillcolor_defaults":1015,"../scatter/line_defaults":1019,"../scatter/marker_defaults":1024,"../scatter/subtypes":1028,"../scatter/text_defaults":1029,"./attributes":1045}],1048:[function(t,e,r){"use strict";e.exports=function(t,e){return t.lon=e.lon,t.lat=e.lat,t.location=e.lon?e.lon:null,t}},{}],1049:[function(t,e,r){"use strict";function n(t,e,r){function n(t){return a.tickText(r,r.c2l(t),"hover").text+"\xb0"}var i=t.hoverinfo,o="all"===i?l.hoverinfo.flags:i.split("+"),s=o.indexOf("location")!==-1&&Array.isArray(t.locations),u=o.indexOf("lon")!==-1,c=o.indexOf("lat")!==-1,h=o.indexOf("text")!==-1,f=[];if(s?f.push(e.loc):u&&c?f.push("("+n(e.lonlat[0])+", "+n(e.lonlat[1])+")"):u?f.push("lon: "+n(e.lonlat[0])):c&&f.push("lat: "+n(e.lonlat[1])),h){var d;e.htx?d=e.htx:t.hovertext?d=t.hovertext:e.tx?d=e.tx:t.text&&(d=t.text),Array.isArray(d)||f.push(d)}return f.join("<br>")}var i=t("../../components/fx"),a=t("../../plots/cartesian/axes"),o=t("../../constants/numerical").BADNUM,s=t("../scatter/get_trace_color"),l=t("./attributes");e.exports=function(t){function e(t){return h.projection(t)}function r(t){var r=t.lonlat;if(r[0]===o)return 1/0;if(h.isLonLatOverEdges(r))return 1/0;var n=e(r),i=u.c2p(),a=c.c2p(),s=Math.abs(i-n[0]),l=Math.abs(a-n[1]),f=Math.max(3,t.mrc||0);return Math.max(Math.sqrt(s*s+l*l)-f,1-3/f)}var a=t.cd,l=a[0].trace,u=t.xa,c=t.ya,h=t.subplot;if(i.getClosest(a,r,t),t.index!==!1){var f=a[t.index],d=f.lonlat,p=e(d),m=f.mrc||1;return t.x0=p[0]-m,t.x1=p[0]+m,t.y0=p[1]-m,t.y1=p[1]+m,t.loc=f.loc,t.lat=d[0],t.lon=d[1],t.color=s(l,f),t.extraText=n(l,f,h.mockAxis),[t]}}},{"../../components/fx":631,"../../constants/numerical":690,"../../plots/cartesian/axes":748,
76 "../scatter/get_trace_color":1016,"./attributes":1045}],1050:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("./calc"),n.plot=t("./plot"),n.hoverPoints=t("./hover"),n.eventData=t("./event_data"),n.moduleType="trace",n.name="scattergeo",n.basePlotModule=t("../../plots/geo"),n.categories=["geo","symbols","markerColorscale","showLegend"],n.meta={},e.exports=n},{"../../plots/geo":776,"../scatter/colorbar":1011,"./attributes":1045,"./calc":1046,"./defaults":1047,"./event_data":1048,"./hover":1049,"./plot":1051}],1051:[function(t,e,r){"use strict";function n(t,e){var r=t[0].trace;if(Array.isArray(r.locations))for(var n=c(r,e),i=r.locationmode,a=0;a<t.length;a++){var o=t[a],s=h(i,o.loc,n);o.lonlat=s?s.properties.ct:[u,u]}}function i(t){var e=t.framework.selectAll("g.trace.scattergeo");e.style("opacity",function(t){return t[0].trace.opacity}),e.each(function(t){var e=t[0].trace,r=a.select(this);r.selectAll("path.point").call(o.pointStyle,e),r.selectAll("text").call(o.textPointStyle,e)}),e.selectAll("path.js-line").style("fill","none").each(function(t){var e=a.select(this),r=t.trace,n=r.line||{};e.call(s.stroke,n.color).call(o.dashLine,n.dash||"",n.width||0),"none"!==r.fill&&e.call(s.fill,r.fillcolor)})}var a=t("d3"),o=t("../../components/drawing"),s=t("../../components/color"),l=t("../../lib"),u=t("../../constants/numerical").BADNUM,c=t("../../lib/topojson_utils").getTopojsonFeatures,h=t("../../lib/geo_location_utils").locationToFeature,f=t("../../lib/geojson_utils"),d=t("../scatter/subtypes");e.exports=function(t,e){function r(t){return t[0].trace.uid}function o(t,e){t.lonlat[0]===u&&a.select(e).remove()}for(var s=0;s<e.length;s++)n(e[s],t.topojson);var c=t.framework.select(".scattergeolayer").selectAll("g.trace.scattergeo").data(e,r);c.enter().append("g").attr("class","trace scattergeo"),c.exit().remove(),c.selectAll("*").remove(),c.each(function(t){var e=a.select(this),r=t[0].trace;if(d.hasLines(r)||"none"!==r.fill){var n=f.calcTraceToLineCoords(t),i="none"!==r.fill?f.makePolygon(n,r):f.makeLine(n,r);e.selectAll("path.js-line").data([i]).enter().append("path").classed("js-line",!0)}d.hasMarkers(r)&&e.selectAll("path.point").data(l.identity).enter().append("path").classed("point",!0).each(function(t){o(t,this)}),d.hasText(r)&&e.selectAll("g").data(l.identity).enter().append("g").append("text").each(function(t){o(t,this)})}),i(t)}},{"../../components/color":590,"../../components/drawing":614,"../../constants/numerical":690,"../../lib":709,"../../lib/geo_location_utils":704,"../../lib/geojson_utils":705,"../../lib/topojson_utils":730,"../scatter/subtypes":1028,d3:118}],1052:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../components/colorscale/color_attributes"),a=t("../../constants/gl2d_dashes"),o=t("../../constants/gl_markers"),s=t("../../lib/extend").extendFlat,l=t("../../lib/extend").extendDeep,u=n.line,c=n.marker,h=c.line;e.exports={x:n.x,x0:n.x0,dx:n.dx,y:n.y,y0:n.y0,dy:n.dy,text:s({},n.text,{}),mode:{valType:"flaglist",flags:["lines","markers"],extras:["none"]},line:{color:u.color,width:u.width,dash:{valType:"enumerated",values:Object.keys(a),dflt:"solid"}},marker:l({},i("marker"),{symbol:{valType:"enumerated",values:Object.keys(o),dflt:"circle",arrayOk:!0},size:c.size,sizeref:c.sizeref,sizemin:c.sizemin,sizemode:c.sizemode,opacity:c.opacity,showscale:c.showscale,colorbar:c.colorbar,line:l({},i("marker.line"),{width:h.width})}),connectgaps:n.connectgaps,fill:s({},n.fill,{values:["none","tozeroy","tozerox"]}),fillcolor:n.fillcolor,error_y:n.error_y,error_x:n.error_x}},{"../../components/colorscale/color_attributes":597,"../../constants/gl2d_dashes":686,"../../constants/gl_markers":688,"../../lib/extend":701,"../scatter/attributes":1008}],1053:[function(t,e,r){"use strict";function n(t,e){this.scene=t,this.uid=e,this.type="scattergl",this.pickXData=[],this.pickYData=[],this.xData=[],this.yData=[],this.textLabels=[],this.color="rgb(0, 0, 0)",this.name="",this.hoverinfo="all",this.connectgaps=!0,this.index=null,this.idToIndex=[],this.bounds=[0,0,0,0],this.isVisible=!1,this.hasLines=!1,this.hasErrorX=!1,this.hasErrorY=!1,this.hasMarkers=!1,this.line=this.initObject(d,{positions:new Float64Array(0),color:[0,0,0,1],width:1,fill:[!1,!1,!1,!1],fillColor:[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],dashes:[1]},0),this.errorX=this.initObject(p,{positions:new Float64Array(0),errors:new Float64Array(0),lineWidth:1,capSize:0,color:[0,0,0,1]},1),this.errorY=this.initObject(p,{positions:new Float64Array(0),errors:new Float64Array(0),lineWidth:1,capSize:0,color:[0,0,0,1]},2);var r={positions:new Float64Array(0),sizes:[],colors:[],glyphs:[],borderWidths:[],borderColors:[],size:12,color:[0,0,0,1],borderSize:1,borderColor:[0,0,0,1]};this.scatter=this.initObject(h,r,3),this.fancyScatter=this.initObject(f,r,4)}function i(t,e,r){return Array.isArray(e)||(e=[e]),a(t,e,r)}function a(t,e,r){for(var n=new Array(r),i=e[0],a=0;a<r;++a)n[a]=t(a>=e.length?i:e[a]);return n}function o(t,e,r){return l(z(t,r),C(e,r),r)}function s(t,e,r,n){var i=w(t,e,n);return i=Array.isArray(i[0])?i:a(v.identity,[i],n),l(i,C(r,n),n)}function l(t,e,r){for(var n=new Array(4*r),i=0;i<r;++i){for(var a=0;a<3;++a)n[4*i+a]=t[i][a];n[4*i+3]=t[i][3]*e[i]}return n}function u(t){for(var e,r=t.length,n=Math.max(1,(r-1)/Math.min(Math.max(r,1),1e3)),i=0;i<r;i+=n)if(e=t[Math.floor(i)],!(m(e)||e instanceof Date))return!1;return!0}function c(t,e){var r=new n(t,e.uid);return r.update(e),r}var h=t("gl-scatter2d"),f=t("gl-scatter2d-sdf"),d=t("gl-line2d"),p=t("gl-error2d"),m=t("fast-isnumeric"),v=t("../../lib"),g=t("../../plots/cartesian/axes"),y=t("../../plots/cartesian/axis_autotype"),b=t("../../components/errorbars"),x=t("../../lib/str2rgbarray"),_=t("../../lib/typed_array_truncate"),w=t("../../lib/gl_format_color"),M=t("../scatter/subtypes"),k=t("../scatter/make_bubble_size_func"),A=t("../scatter/get_trace_color"),T=t("../../constants/gl_markers"),S=t("../../constants/gl2d_dashes"),E=["xaxis","yaxis"],L=n.prototype;L.initObject=function(t,e,r){function n(){u||(u=t(s,e),u._trace=o,u._index=r),u.update(e)}function i(){u&&u.update(l)}function a(){u&&u.dispose()}var o=this,s=o.scene.glplot,l=v.extendFlat({},e),u=null;return{options:e,update:n,clear:i,dispose:a}},L.handlePick=function(t){var e=t.pointId;(t.object!==this.line||this.connectgaps)&&(e=this.idToIndex[t.pointId]);var r=this.pickXData[e];return{trace:this,dataCoord:t.dataCoord,traceCoord:[m(r)||!v.isDateTime(r)?r:v.dateTime2ms(r),this.pickYData[e]],textLabel:Array.isArray(this.textLabels)?this.textLabels[e]:this.textLabels,color:Array.isArray(this.color)?this.color[e]:this.color,name:this.name,pointIndex:e,hoverinfo:this.hoverinfo}},L.isFancy=function(t){if("linear"!==this.scene.xaxis.type&&"date"!==this.scene.xaxis.type)return!0;if("linear"!==this.scene.yaxis.type)return!0;if(!t.x||!t.y)return!0;if(this.hasMarkers){var e=t.marker||{};if(Array.isArray(e.symbol)||"circle"!==e.symbol||Array.isArray(e.size)||Array.isArray(e.color)||Array.isArray(e.line.width)||Array.isArray(e.line.color)||Array.isArray(e.opacity))return!0}return!(!this.hasLines||this.connectgaps)||(!!this.hasErrorX||!!this.hasErrorY)};var C=i.bind(null,function(t){return+t}),z=i.bind(null,x),D=i.bind(null,function(t){return T[t]||"\u25cf"});L.update=function(t){t.visible!==!0?(this.isVisible=!1,this.hasLines=!1,this.hasErrorX=!1,this.hasErrorY=!1,this.hasMarkers=!1):(this.isVisible=!0,this.hasLines=M.hasLines(t),this.hasErrorX=t.error_x.visible===!0,this.hasErrorY=t.error_y.visible===!0,this.hasMarkers=M.hasMarkers(t)),this.textLabels=t.text,this.name=t.name,this.hoverinfo=t.hoverinfo,this.bounds=[1/0,1/0,-1/0,-1/0],this.connectgaps=!!t.connectgaps,this.isVisible?this.isFancy(t)?this.updateFancy(t):this.updateFast(t):(this.line.clear(),this.errorX.clear(),this.errorY.clear(),this.scatter.clear(),this.fancyScatter.clear()),this.scene.glplot.objects.sort(function(t,e){return t._index-e._index}),this.index=t.index,this.color=A(t,{})},L.updateFast=function(t){var e,r,n=this.xData=this.pickXData=t.x,i=this.yData=this.pickYData=t.y,a=n.length,o=new Array(a),s=new Float64Array(2*a),l=this.bounds,c=0,h=0,f=t.xcalendar,d=u(n),p=!d&&"date"===y(n,f);if(d||p)for(var g=0;g<a;++g)e=n[g],r=i[g],m(r)&&(d||(e=v.dateTime2ms(e,f)),o[c++]=g,s[h++]=e,s[h++]=r,l[0]=Math.min(l[0],e),l[1]=Math.min(l[1],r),l[2]=Math.max(l[2],e),l[3]=Math.max(l[3],r));s=_(s,h),this.idToIndex=o,this.updateLines(t,s),this.updateError("X",t),this.updateError("Y",t);var b;if(this.hasMarkers){this.scatter.options.positions=s;var w=x(t.marker.color),M=x(t.marker.line.color),k=t.opacity*t.marker.opacity;w[3]*=k,this.scatter.options.color=w,M[3]*=k,this.scatter.options.borderColor=M,b=t.marker.size,this.scatter.options.size=b,this.scatter.options.borderSize=t.marker.line.width,this.scatter.update()}else this.scatter.clear();this.fancyScatter.clear(),this.expandAxesFast(l,b)},L.updateFancy=function(t){var e=this.scene,r=e.xaxis,n=e.yaxis,a=this.bounds,o=this.pickXData=r.makeCalcdata(t,"x").slice(),l=this.pickYData=n.makeCalcdata(t,"y").slice();this.xData=o.slice(),this.yData=l.slice();var u,c,h,f,d,p,m,v,g=b.calcFromTrace(t,e.fullLayout),y=o.length,x=new Array(y),w=new Float64Array(2*y),M=new Float64Array(4*y),A=new Float64Array(4*y),T=0,S=0,E=0,L=0,z="log"===r.type?r.d2l:function(t){return t},I="log"===n.type?n.d2l:function(t){return t};for(u=0;u<y;++u)this.xData[u]=h=z(o[u]),this.yData[u]=f=I(l[u]),isNaN(h)||isNaN(f)||(x[T++]=u,w[S++]=h,w[S++]=f,d=M[E++]=h-g[u].xs||0,p=M[E++]=g[u].xh-h||0,M[E++]=0,M[E++]=0,A[L++]=0,A[L++]=0,m=A[L++]=f-g[u].ys||0,v=A[L++]=g[u].yh-f||0,a[0]=Math.min(a[0],h-d),a[1]=Math.min(a[1],f-m),a[2]=Math.max(a[2],h+p),a[3]=Math.max(a[3],f+v));w=_(w,S),this.idToIndex=x,this.updateLines(t,w),this.updateError("X",t,w,M),this.updateError("Y",t,w,A);var P;if(this.hasMarkers){this.scatter.options.positions=w,this.scatter.options.sizes=new Array(T),this.scatter.options.glyphs=new Array(T),this.scatter.options.borderWidths=new Array(T),this.scatter.options.colors=new Array(4*T),this.scatter.options.borderColors=new Array(4*T);var O,j=k(t),F=t.marker,R=F.opacity,N=t.opacity,B=s(F,R,N,y),U=D(F.symbol,y),V=C(F.line.width,y),q=s(F.line,R,N,y);for(P=i(j,F.size,y),u=0;u<T;++u)for(O=x[u],this.scatter.options.sizes[u]=4*P[O],this.scatter.options.glyphs[u]=U[O],this.scatter.options.borderWidths[u]=.5*V[O],c=0;c<4;++c)this.scatter.options.colors[4*u+c]=B[4*O+c],this.scatter.options.borderColors[4*u+c]=q[4*O+c];this.fancyScatter.update()}else this.fancyScatter.clear();this.scatter.clear(),this.expandAxesFancy(o,l,P)},L.updateLines=function(t,e){var r;if(this.hasLines){var n=e;if(!t.connectgaps){var i=0,a=this.xData,s=this.yData;for(n=new Float64Array(2*a.length),r=0;r<a.length;++r)n[i++]=a[r],n[i++]=s[r]}this.line.options.positions=n;var l=o(t.line.color,t.opacity,1),u=Math.round(.5*this.line.options.width),c=(S[t.line.dash]||[1]).slice();for(r=0;r<c.length;++r)c[r]*=u;switch(t.fill){case"tozeroy":this.line.options.fill=[!1,!0,!1,!1];break;case"tozerox":this.line.options.fill=[!0,!1,!1,!1];break;default:this.line.options.fill=[!1,!1,!1,!1]}var h=x(t.fillcolor);this.line.options.color=l,this.line.options.width=2*t.line.width,this.line.options.dashes=c,this.line.options.fillColor=[h,h,h,h],this.line.update()}else this.line.clear()},L.updateError=function(t,e,r,n){var i=this["error"+t],a=e["error_"+t.toLowerCase()];"x"===t.toLowerCase()&&a.copy_ystyle&&(a=e.error_y),this["hasError"+t]?(i.options.positions=r,i.options.errors=n,i.options.capSize=a.width,i.options.lineWidth=a.thickness/2,i.options.color=o(a.color,1,1),i.update()):i.clear()},L.expandAxesFast=function(t,e){for(var r,n,i,a=e||10,o=0;o<2;o++)r=this.scene[E[o]],n=r._min,n||(n=[]),n.push({val:t[o],pad:a}),i=r._max,i||(i=[]),i.push({val:t[o+2],pad:a})},L.expandAxesFancy=function(t,e,r){var n=this.scene,i={padded:!0,ppad:r};g.expand(n.xaxis,t,i),g.expand(n.yaxis,e,i)},L.dispose=function(){this.line.dispose(),this.errorX.dispose(),this.errorY.dispose(),this.scatter.dispose(),this.fancyScatter.dispose()},e.exports=c},{"../../components/errorbars":620,"../../constants/gl2d_dashes":686,"../../constants/gl_markers":688,"../../lib":709,"../../lib/gl_format_color":706,"../../lib/str2rgbarray":727,"../../lib/typed_array_truncate":731,"../../plots/cartesian/axes":748,"../../plots/cartesian/axis_autotype":749,"../scatter/get_trace_color":1016,"../scatter/make_bubble_size_func":1023,"../scatter/subtypes":1028,"fast-isnumeric":127,"gl-error2d":155,"gl-line2d":165,"gl-scatter2d":243,"gl-scatter2d-sdf":238}],1054:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../scatter/constants"),a=t("../scatter/subtypes"),o=t("../scatter/xy_defaults"),s=t("../scatter/marker_defaults"),l=t("../scatter/line_defaults"),u=t("../scatter/fillcolor_defaults"),c=t("../../components/errorbars/defaults"),h=t("./attributes");e.exports=function(t,e,r,f){function d(r,i){return n.coerce(t,e,h,r,i)}var p=o(t,e,f,d);if(!p)return void(e.visible=!1);d("text"),d("mode",p<i.PTS_LINESONLY?"lines+markers":"lines"),a.hasLines(e)&&(d("connectgaps"),l(t,e,r,f,d)),a.hasMarkers(e)&&s(t,e,r,f,d),d("fill"),"none"!==e.fill&&u(t,e,r,d),c(t,e,r,{axis:"y"}),c(t,e,r,{axis:"x",inherit:"y"})}},{"../../components/errorbars/defaults":619,"../../lib":709,"../scatter/constants":1013,"../scatter/fillcolor_defaults":1015,"../scatter/line_defaults":1019,"../scatter/marker_defaults":1024,"../scatter/subtypes":1028,"../scatter/xy_defaults":1030,"./attributes":1052}],1055:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("../scatter3d/calc"),n.plot=t("./convert"),n.moduleType="trace",n.name="scattergl",n.basePlotModule=t("../../plots/gl2d"),n.categories=["gl2d","symbols","errorBarsOK","markerColorscale","showLegend"],n.meta={},e.exports=n},{"../../plots/gl2d":788,"../scatter/colorbar":1011,"../scatter3d/calc":1032,"./attributes":1052,"./convert":1053,"./defaults":1054}],1056:[function(t,e,r){"use strict";var n=t("../scattergeo/attributes"),i=t("../scatter/attributes"),a=t("../../plots/mapbox/layout_attributes"),o=t("../../plots/attributes"),s=t("../../components/colorbar/attributes"),l=t("../../lib/extend").extendFlat,u=n.line,c=n.marker;e.exports={lon:n.lon,lat:n.lat,mode:l({},i.mode,{dflt:"markers"}),text:l({},i.text,{}),hovertext:l({},i.hovertext,{}),line:{color:u.color,width:u.width},connectgaps:i.connectgaps,marker:{symbol:{valType:"string",dflt:"circle",arrayOk:!0},opacity:l({},c.opacity,{arrayOk:!1}),size:c.size,sizeref:c.sizeref,sizemin:c.sizemin,sizemode:c.sizemode,color:c.color,colorscale:c.colorscale,cauto:c.cauto,cmax:c.cmax,cmin:c.cmin,autocolorscale:c.autocolorscale,reversescale:c.reversescale,showscale:c.showscale,colorbar:s},fill:n.fill,fillcolor:i.fillcolor,textfont:a.layers.symbol.textfont,textposition:a.layers.symbol.textposition,hoverinfo:l({},o.hoverinfo,{flags:["lon","lat","text","name"]})}},{"../../components/colorbar/attributes":591,"../../lib/extend":701,"../../plots/attributes":746,"../../plots/mapbox/layout_attributes":807,"../scatter/attributes":1008,"../scattergeo/attributes":1045}],1057:[function(t,e,r){"use strict";function n(){return{geojson:d.makeBlank(),layout:{visibility:"none"},paint:{}}}function i(t,e){function r(t,r,n,i){void 0===e[r][n]&&(e[r][n]=i),t[r]=e[r][n]}var n,i=t[0].trace,a=i.marker;p.hasColorscale(i,"marker")?n=p.makeColorScaleFunc(p.extractScale(a.colorscale,a.cmin,a.cmax)):Array.isArray(a.color)&&(n=h.identity);var o;v.isBubble(i)?o=m(i):Array.isArray(a.size)&&(o=h.identity);for(var s=[],l=0;l<t.length;l++){var u=t[l],f=u.lonlat;if(!c(f)){var d={};if(n){var g=u.mcc=n(u.mc);r(d,y,g,l)}o&&r(d,b,o(u.ms),l),s.push({type:"Feature",geometry:{type:"Point",coordinates:f},properties:d})}}return{type:"FeatureCollection",features:s}}function a(t){for(var e=t[0].trace,r=e.marker||{},n=r.symbol,i=e.text,a="circle"!==n?l(n):u,o=v.hasText(e)?l(i):u,s=[],h=0;h<t.length;h++){var f=t[h];c(f.lonlat)||s.push({type:"Feature",geometry:{type:"Point",coordinates:f.lonlat},properties:{symbol:a(f.mx),text:o(f.tx)}})}return{type:"FeatureCollection",features:s}}function o(t,e){var r,n=t.marker;if(Array.isArray(n.color)){for(var i=Object.keys(e[y]),a=[],o=0;o<i.length;o++){var s=i[o];a.push([e[y][s],s])}r={property:y,stops:a}}else r=n.color;return r}function s(t,e){var r,n=t.marker;if(Array.isArray(n.size)){for(var i=Object.keys(e[b]),a=[],o=0;o<i.length;o++){var s=i[o];a.push([e[b][s],+s])}a.sort(function(t,e){return t[0]-e[0]}),r={property:b,stops:a}}else r=n.size/2;return r}function l(t){return Array.isArray(t)?function(t){return t}:t?function(){return t}:u}function u(){return""}function c(t){return t[0]===f}var h=t("../../lib"),f=t("../../constants/numerical").BADNUM,d=t("../../lib/geojson_utils"),p=t("../../components/colorscale"),m=t("../scatter/make_bubble_size_func"),v=t("../scatter/subtypes"),g=t("../../plots/mapbox/convert_text_opts"),y="circle-color",b="circle-radius";e.exports=function(t){var e=t[0].trace,r=e.visible===!0,l="none"!==e.fill,u=v.hasLines(e),c=v.hasMarkers(e),f=v.hasText(e),p=c&&"circle"===e.marker.symbol,m=c&&"circle"!==e.marker.symbol,x=n(),_=n(),w=n(),M=n(),k={fill:x,line:_,circle:w,symbol:M};if(!r)return k;var A;if((l||u)&&(A=d.calcTraceToLineCoords(t)),l&&(x.geojson=d.makePolygon(A),x.layout.visibility="visible",h.extendFlat(x.paint,{"fill-color":e.fillcolor})),u&&(_.geojson=d.makeLine(A),_.layout.visibility="visible",h.extendFlat(_.paint,{"line-width":e.line.width,"line-color":e.line.color,"line-opacity":e.opacity})),p){var T={};T[y]={},T[b]={},w.geojson=i(t,T),w.layout.visibility="visible",h.extendFlat(w.paint,{"circle-opacity":e.opacity*e.marker.opacity,"circle-color":o(e,T),"circle-radius":s(e,T)})}if((m||f)&&(M.geojson=a(t),h.extendFlat(M.layout,{visibility:"visible","icon-image":"{symbol}-15","text-field":"{text}"}),m&&(h.extendFlat(M.layout,{"icon-size":e.marker.size/10}),h.extendFlat(M.paint,{"icon-opacity":e.opacity*e.marker.opacity,"icon-color":e.marker.color})),f)){var S=(e.marker||{}).size,E=g(e.textposition,S);h.extendFlat(M.layout,{"text-size":e.textfont.size,"text-anchor":E.anchor,"text-offset":E.offset}),h.extendFlat(M.paint,{"text-color":e.textfont.color,"text-opacity":e.opacity})}return k}},{"../../components/colorscale":604,"../../constants/numerical":690,"../../lib":709,"../../lib/geojson_utils":705,"../../plots/mapbox/convert_text_opts":804,"../scatter/make_bubble_size_func":1023,"../scatter/subtypes":1028}],1058:[function(t,e,r){"use strict";function n(t,e,r){var n=r("lon")||[],i=r("lat")||[],a=Math.min(n.length,i.length);return a<n.length&&(e.lon=n.slice(0,a)),a<i.length&&(e.lat=i.slice(0,a)),a}var i=t("../../lib"),a=t("../scatter/subtypes"),o=t("../scatter/marker_defaults"),s=t("../scatter/line_defaults"),l=t("../scatter/text_defaults"),u=t("../scatter/fillcolor_defaults"),c=t("./attributes");e.exports=function(t,e,r,h){function f(r,n){return i.coerce(t,e,c,r,n)}if(!n(t,e,f))return void(e.visible=!1);if(f("text"),f("hovertext"),f("mode"),a.hasLines(e)&&(s(t,e,r,h,f,{noDash:!0}),f("connectgaps")),a.hasMarkers(e)){o(t,e,r,h,f,{noLine:!0});var d=e.marker;d.line={width:0},"circle"!==d.symbol&&(Array.isArray(d.size)&&(d.size=d.size[0]),Array.isArray(d.color)&&(d.color=d.color[0]))}a.hasText(e)&&l(t,e,h,f),f("fill"),"none"!==e.fill&&u(t,e,r,f),f("hoverinfo",1===h._dataLength?"lon+lat+text":void 0)}},{"../../lib":709,"../scatter/fillcolor_defaults":1015,"../scatter/line_defaults":1019,"../scatter/marker_defaults":1024,"../scatter/subtypes":1028,"../scatter/text_defaults":1029,"./attributes":1056}],1059:[function(t,e,r){"use strict";e.exports=function(t,e){return t.lon=e.lon,t.lat=e.lat,t}},{}],1060:[function(t,e,r){"use strict";function n(t,e){function r(t){return t+"\xb0"}var n=t.hoverinfo.split("+"),i=n.indexOf("all")!==-1,a=n.indexOf("lon")!==-1,o=n.indexOf("lat")!==-1,s=e.lonlat,l=[];if(i||a&&o?l.push("("+r(s[0])+", "+r(s[1])+")"):a?l.push("lon: "+r(s[0])):o&&l.push("lat: "+r(s[1])),i||n.indexOf("text")!==-1){var u;e.htx?u=e.htx:t.hovertext?u=t.hovertext:e.tx?u=e.tx:t.text&&(u=t.text),Array.isArray(u)||l.push(u)}return l.join("<br>")}var i=t("../../components/fx"),a=t("../scatter/get_trace_color"),o=t("../../constants/numerical").BADNUM;e.exports=function(t,e,r){function s(t){var e=t.lonlat;if(e[0]===o)return 1/0;var n=Math.abs(c.c2p(e)-c.c2p([p,e[1]])),i=Math.abs(h.c2p(e)-h.c2p([e[0],r])),a=Math.max(3,t.mrc||0);return Math.max(Math.sqrt(n*n+i*i)-a,1-3/a)}var l=t.cd,u=l[0].trace,c=t.xa,h=t.ya,f=e>=0?Math.floor((e+180)/360):Math.ceil((e-180)/360),d=360*f,p=e-d;if(i.getClosest(l,s,t),t.index!==!1){var m=l[t.index],v=m.lonlat,g=[v[0]+d,v[1]],y=c.c2p(g),b=h.c2p(g),x=m.mrc||1;return t.x0=y-x,t.x1=y+x,t.y0=b-x,t.y1=b+x,t.color=a(u,m),t.extraText=n(u,m),[t]}}},{"../../components/fx":631,"../../constants/numerical":690,"../scatter/get_trace_color":1016}],1061:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("../scattergeo/calc"),n.hoverPoints=t("./hover"),n.eventData=t("./event_data"),n.plot=t("./plot"),n.moduleType="trace",n.name="scattermapbox",n.basePlotModule=t("../../plots/mapbox"),n.categories=["mapbox","gl","symbols","markerColorscale","showLegend"],n.meta={},e.exports=n},{"../../plots/mapbox":805,"../scatter/colorbar":1011,"../scattergeo/calc":1046,"./attributes":1056,"./defaults":1058,"./event_data":1059,"./hover":1060,"./plot":1062}],1062:[function(t,e,r){"use strict";function n(t,e){this.mapbox=t,this.map=t.map,this.uid=e,this.idSourceFill=e+"-source-fill",this.idSourceLine=e+"-source-line",this.idSourceCircle=e+"-source-circle",this.idSourceSymbol=e+"-source-symbol",this.idLayerFill=e+"-layer-fill",this.idLayerLine=e+"-layer-line",this.idLayerCircle=e+"-layer-circle",this.idLayerSymbol=e+"-layer-symbol",this.mapbox.initSource(this.idSourceFill),this.mapbox.initSource(this.idSourceLine),this.mapbox.initSource(this.idSourceCircle),this.mapbox.initSource(this.idSourceSymbol),this.map.addLayer({id:this.idLayerFill,source:this.idSourceFill,type:"fill"}),this.map.addLayer({id:this.idLayerLine,source:this.idSourceLine,type:"line"}),this.map.addLayer({id:this.idLayerCircle,source:this.idSourceCircle,type:"circle"}),this.map.addLayer({id:this.idLayerSymbol,source:this.idSourceSymbol,type:"symbol"})}function i(t){return"visible"===t.layout.visibility}var a=t("./convert"),o=n.prototype;o.update=function(t){var e=this.mapbox,r=a(t);e.setOptions(this.idLayerFill,"setLayoutProperty",r.fill.layout),e.setOptions(this.idLayerLine,"setLayoutProperty",r.line.layout),e.setOptions(this.idLayerCircle,"setLayoutProperty",r.circle.layout),e.setOptions(this.idLayerSymbol,"setLayoutProperty",r.symbol.layout),i(r.fill)&&(e.setSourceData(this.idSourceFill,r.fill.geojson),e.setOptions(this.idLayerFill,"setPaintProperty",r.fill.paint)),i(r.line)&&(e.setSourceData(this.idSourceLine,r.line.geojson),e.setOptions(this.idLayerLine,"setPaintProperty",r.line.paint)),i(r.circle)&&(e.setSourceData(this.idSourceCircle,r.circle.geojson),e.setOptions(this.idLayerCircle,"setPaintProperty",r.circle.paint)),i(r.symbol)&&(e.setSourceData(this.idSourceSymbol,r.symbol.geojson),e.setOptions(this.idLayerSymbol,"setPaintProperty",r.symbol.paint))},o.dispose=function(){var t=this.map;t.removeLayer(this.idLayerFill),t.removeLayer(this.idLayerLine),t.removeLayer(this.idLayerCircle),t.removeLayer(this.idLayerSymbol),t.removeSource(this.idSourceFill),t.removeSource(this.idSourceLine),t.removeSource(this.idSourceCircle),t.removeSource(this.idSourceSymbol)},e.exports=function(t,e){var r=e[0].trace,i=new n(t,r.uid);return i.update(e),i}},{"./convert":1057}],1063:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../plots/attributes"),a=t("../../components/colorscale/color_attributes"),o=t("../../components/colorbar/attributes"),s=t("../../components/drawing/attributes").dash,l=t("../../lib/extend").extendFlat,u=n.marker,c=n.line,h=u.line;e.exports={a:{valType:"data_array"},b:{valType:"data_array"},c:{valType:"data_array"},sum:{valType:"number",dflt:0,min:0},mode:l({},n.mode,{dflt:"markers"}),text:l({},n.text,{}),hovertext:l({},n.hovertext,{}),line:{color:c.color,width:c.width,dash:s,shape:l({},c.shape,{values:["linear","spline"]}),smoothing:c.smoothing},connectgaps:n.connectgaps,fill:l({},n.fill,{values:["none","toself","tonext"]}),fillcolor:n.fillcolor,marker:l({},{symbol:u.symbol,opacity:u.opacity,maxdisplayed:u.maxdisplayed,size:u.size,sizeref:u.sizeref,sizemin:u.sizemin,sizemode:u.sizemode,line:l({},{width:h.width},a("marker".line)),gradient:u.gradient},a("marker"),{showscale:u.showscale,colorbar:o}),textfont:n.textfont,textposition:n.textposition,hoverinfo:l({},i.hoverinfo,{flags:["a","b","c","text","name"]}),hoveron:n.hoveron}},{"../../components/colorbar/attributes":591,"../../components/colorscale/color_attributes":597,"../../components/drawing/attributes":613,"../../lib/extend":701,"../../plots/attributes":746,"../scatter/attributes":1008}],1064:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../plots/cartesian/axes"),a=t("../scatter/subtypes"),o=t("../scatter/colorscale_calc"),s=t("../scatter/arrays_to_calcdata"),l=["a","b","c"],u={a:["b","c"],b:["a","c"],c:["a","b"]};e.exports=function(t,e){var r,c,h,f,d,p,m=t._fullLayout[e.subplot],v=m.sum,g=e.sum||v;for(r=0;r<l.length;r++)if(h=l[r],!e[h]){for(d=e[u[h][0]],p=e[u[h][1]],f=new Array(d.length),c=0;c<d.length;c++)f[c]=g-d[c]-p[c];e[h]=f}var y,b,x,_,w,M,k=e.a.length,A=new Array(k);for(r=0;r<k;r++)y=e.a[r],b=e.b[r],x=e.c[r],n(y)&&n(b)&&n(x)?(y=+y,b=+b,x=+x,_=v/(y+b+x),1!==_&&(y*=_,b*=_,x*=_),M=y,w=x-b,A[r]={x:w,y:M,a:y,b:b,c:x}):A[r]={x:!1,y:!1};var T,S;if(a.hasMarkers(e)&&(T=e.marker,S=T.size,Array.isArray(S))){var E={type:"linear"};i.setConvert(E),S=E.makeCalcdata(e.marker,"size"),S.length>k&&S.splice(k,S.length-k)}return o(e),s(A,e),A}},{"../../plots/cartesian/axes":748,"../scatter/arrays_to_calcdata":1007,"../scatter/colorscale_calc":1012,"../scatter/subtypes":1028,"fast-isnumeric":127}],1065:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../scatter/constants"),a=t("../scatter/subtypes"),o=t("../scatter/marker_defaults"),s=t("../scatter/line_defaults"),l=t("../scatter/line_shape_defaults"),u=t("../scatter/text_defaults"),c=t("../scatter/fillcolor_defaults"),h=t("./attributes");e.exports=function(t,e,r,f){function d(r,i){return n.coerce(t,e,h,r,i)}var p,m=d("a"),v=d("b"),g=d("c");if(m?(p=m.length,v?(p=Math.min(p,v.length),g&&(p=Math.min(p,g.length))):p=g?Math.min(p,g.length):0):v&&g&&(p=Math.min(v.length,g.length)),!p)return void(e.visible=!1);m&&p<m.length&&(e.a=m.slice(0,p)),v&&p<v.length&&(e.b=v.slice(0,p)),g&&p<g.length&&(e.c=g.slice(0,p)),d("sum"),d("text"),d("hovertext"),d("mode",p<i.PTS_LINESONLY?"lines+markers":"lines"),a.hasLines(e)&&(s(t,e,r,f,d),l(t,e,d),d("connectgaps")),a.hasMarkers(e)&&o(t,e,r,f,d,{gradient:!0}),a.hasText(e)&&u(t,e,f,d);var y=[];(a.hasMarkers(e)||a.hasText(e))&&(d("marker.maxdisplayed"),y.push("points")),d("fill"),"none"!==e.fill&&(c(t,e,r,d),a.hasLines(e)||l(t,e,d)),d("hoverinfo",1===f._dataLength?"a+b+c+text":void 0),"tonext"!==e.fill&&"toself"!==e.fill||y.push("fills"),d("hoveron",y.join("+")||"points")}},{"../../lib":709,"../scatter/constants":1013,"../scatter/fillcolor_defaults":1015,"../scatter/line_defaults":1019,"../scatter/line_shape_defaults":1021,"../scatter/marker_defaults":1024,"../scatter/subtypes":1028,"../scatter/text_defaults":1029,"./attributes":1063}],1066:[function(t,e,r){"use strict";var n=t("../scatter/hover"),i=t("../../plots/cartesian/axes");e.exports=function(t,e,r,a){function o(t,e){g.push(t._hovertitle+": "+i.tickText(t,e,"hover").text)}var s=n(t,e,r,a);if(s&&s[0].index!==!1){var l=s[0];if(void 0===l.index){var u=1-l.y0/t.ya._length,c=t.xa._length,h=c*u/2,f=c-h;return l.x0=Math.max(Math.min(l.x0,f),h),l.x1=Math.max(Math.min(l.x1,f),h),s}var d=l.cd[l.index];l.a=d.a,l.b=d.b,l.c=d.c,l.xLabelVal=void 0,l.yLabelVal=void 0;var p=l.trace,m=p._ternary,v=p.hoverinfo.split("+"),g=[];return v.indexOf("all")!==-1&&(v=["a","b","c"]),v.indexOf("a")!==-1&&o(m.aaxis,d.a),v.indexOf("b")!==-1&&o(m.baxis,d.b),v.indexOf("c")!==-1&&o(m.caxis,d.c),l.extraText=g.join("<br>"),s}}},{"../../plots/cartesian/axes":748,"../scatter/hover":1017}],1067:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("./calc"),n.plot=t("./plot"),n.style=t("./style"),n.hoverPoints=t("./hover"),n.selectPoints=t("./select"),n.moduleType="trace",n.name="scatterternary",n.basePlotModule=t("../../plots/ternary"),n.categories=["ternary","symbols","markerColorscale","showLegend"],n.meta={},e.exports=n},{"../../plots/ternary":819,"../scatter/colorbar":1011,"./attributes":1063,"./calc":1064,"./defaults":1065,"./hover":1066,"./plot":1068,"./select":1069,"./style":1070}],1068:[function(t,e,r){"use strict";var n=t("../scatter/plot");e.exports=function(t,e){var r=t.plotContainer;r.select(".scatterlayer").selectAll("*").remove();for(var i={xaxis:t.xaxis,yaxis:t.yaxis,plot:r},a=0;a<e.length;a++)e[a][0].trace._ternary=t;n(t.graphDiv,i,e)}},{"../scatter/plot":1025}],1069:[function(t,e,r){arguments[4][1043][0].apply(r,arguments)},{"../scatter/select":1026,dup:1043}],1070:[function(t,e,r){arguments[4][1044][0].apply(r,arguments)},{"../scatter/style":1027,dup:1044}],1071:[function(t,e,r){"use strict";function n(t){return{valType:"boolean",dflt:!1}}function i(t){return{show:{valType:"boolean",dflt:!1},project:{x:n("x"),y:n("y"),z:n("z")},color:{valType:"color",dflt:a.defaultLine},usecolormap:{valType:"boolean",dflt:!1},width:{valType:"number",min:1,max:16,dflt:2},highlight:{valType:"boolean",dflt:!0},highlightcolor:{valType:"color",dflt:a.defaultLine},highlightwidth:{valType:"number",min:1,max:16,dflt:2}}}var a=t("../../components/color"),o=t("../../components/colorscale/attributes"),s=t("../../components/colorbar/attributes"),l=t("../../lib/extend").extendFlat;e.exports={z:{valType:"data_array"},x:{valType:"data_array"},y:{valType:"data_array"},text:{valType:"data_array"},surfacecolor:{valType:"data_array"},cauto:o.zauto,cmin:o.zmin,cmax:o.zmax,colorscale:o.colorscale,autocolorscale:l({},o.autocolorscale,{dflt:!1}),reversescale:o.reversescale,showscale:o.showscale,colorbar:s,contours:{x:i("x"),y:i("y"),z:i("z")},hidesurface:{valType:"boolean",dflt:!1},lightposition:{x:{valType:"number",min:-1e5,max:1e5,dflt:10},y:{valType:"number",min:-1e5,max:1e5,dflt:1e4},z:{valType:"number",min:-1e5,max:1e5,dflt:0}},lighting:{ambient:{valType:"number",min:0,max:1,dflt:.8},diffuse:{valType:"number",min:0,max:1,dflt:.8},specular:{valType:"number",min:0,max:2,dflt:.05},roughness:{valType:"number",min:0,max:1,dflt:.5},fresnel:{valType:"number",min:0,max:5,dflt:.2}},opacity:{valType:"number",min:0,max:1,dflt:1},_deprecated:{zauto:l({},o.zauto,{}),zmin:l({},o.zmin,{}),zmax:l({},o.zmax,{})}}},{"../../components/color":590,"../../components/colorbar/attributes":591,"../../components/colorscale/attributes":595,"../../lib/extend":701}],1072:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc");e.exports=function(t,e){e.surfacecolor?n(e,e.surfacecolor,"","c"):n(e,e.z,"","c")}},{"../../components/colorscale/calc":596}],1073:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../plots/plots"),o=t("../../components/colorscale"),s=t("../../components/colorbar/draw");e.exports=function(t,e){var r=e[0].trace,l="cb"+r.uid,u=r.cmin,c=r.cmax,h=r.surfacecolor||r.z;if(n(u)||(u=i.aggNums(Math.min,null,h)),n(c)||(c=i.aggNums(Math.max,null,h)),t._fullLayout._infolayer.selectAll("."+l).remove(),!r.showscale)return void a.autoMargin(t,l);var f=e[0].t.cb=s(t,l),d=o.makeColorScaleFunc(o.extractScale(r.colorscale,u,c),{noNumericCheck:!0});f.fillcolor(d).filllevels({start:u,end:c,size:(c-u)/254}).options(r.colorbar)()}},{"../../components/colorbar/draw":593,
77 "../../components/colorscale":604,"../../lib":709,"../../plots/plots":811,"fast-isnumeric":127}],1074:[function(t,e,r){"use strict";function n(t,e,r){this.scene=t,this.uid=r,this.surface=e,this.data=null,this.showContour=[!1,!1,!1],this.dataScale=1}function i(t,e){return void 0===e&&(e=1),t.map(function(t){var r=t[0],n=p(t[1]),i=n.toRgb();return{index:r,rgb:[i.r,i.g,i.b,e]}})}function a(t){var e=t[0].rgb,r=t[t.length-1].rgb;return e[0]===r[0]&&e[1]===r[1]&&e[2]===r[2]&&e[3]===r[3]}function o(t){var e=t.shape,r=[e[0]+2,e[1]+2],n=c(new Float32Array(r[0]*r[1]),r);return d.assign(n.lo(1,1).hi(e[0],e[1]),t),d.assign(n.lo(1).hi(e[0],1),t.hi(e[0],1)),d.assign(n.lo(1,r[1]-1).hi(e[0],1),t.lo(0,e[1]-1).hi(e[0],1)),d.assign(n.lo(0,1).hi(1,e[1]),t.hi(1)),d.assign(n.lo(r[0]-1,1).hi(1,e[1]),t.lo(e[0]-1)),n.set(0,0,t.get(0,0)),n.set(0,r[1]-1,t.get(0,e[1]-1)),n.set(r[0]-1,0,t.get(e[0]-1,0)),n.set(r[0]-1,r[1]-1,t.get(e[0]-1,e[1]-1)),n}function s(t){var e=Math.max(t[0].shape[0],t[0].shape[1]);if(e<v){for(var r=v/e,n=[0|Math.floor(t[0].shape[0]*r+1),0|Math.floor(t[0].shape[1]*r+1)],i=n[0]*n[1],a=0;a<t.length;++a){var s=o(t[a]),l=c(new Float32Array(i),n);h(l,s,[r,0,0,0,r,0,0,0,1]),t[a]=l}return r}return 1}function l(t,e){var r=t.glplot.gl,i=u({gl:r}),a=new n(t,i,e.uid);return i._trace=a,a.update(e),t.glplot.add(i),a}var u=t("gl-surface3d"),c=t("ndarray"),h=t("ndarray-homography"),f=t("ndarray-fill"),d=t("ndarray-ops"),p=t("tinycolor2"),m=t("../../lib/str2rgbarray"),v=128,g=n.prototype;g.handlePick=function(t){if(t.object===this.surface){var e=t.index=[Math.min(0|Math.round(t.data.index[0]/this.dataScale-1),this.data.z[0].length-1),Math.min(0|Math.round(t.data.index[1]/this.dataScale-1),this.data.z.length-1)],r=[0,0,0];Array.isArray(this.data.x[0])?r[0]=this.data.x[e[1]][e[0]]:r[0]=this.data.x[e[0]],Array.isArray(this.data.y[0])?r[1]=this.data.y[e[1]][e[0]]:r[1]=this.data.y[e[1]],r[2]=this.data.z[e[1]][e[0]],t.traceCoordinate=r;var n=this.scene.fullSceneLayout;t.dataCoordinate=[n.xaxis.d2l(r[0],0,this.data.xcalendar)*this.scene.dataScale[0],n.yaxis.d2l(r[1],0,this.data.ycalendar)*this.scene.dataScale[1],n.zaxis.d2l(r[2],0,this.data.zcalendar)*this.scene.dataScale[2]];var i=this.data.text;return i&&i[e[1]]&&void 0!==i[e[1]][e[0]]?t.textLabel=i[e[1]][e[0]]:t.textLabel="",t.data.dataCoordinate=t.dataCoordinate.slice(),this.surface.highlight(t.data),this.scene.glplot.spikes.position=t.dataCoordinate,!0}},g.setContourLevels=function(){for(var t=[[],[],[]],e=!1,r=0;r<3;++r)this.showContour[r]&&(e=!0,t[r]=this.scene.contourLevels[r]);e&&this.surface.update({levels:t})},g.update=function(t){var e,r=this.scene,n=r.fullSceneLayout,o=this.surface,l=t.opacity,u=i(t.colorscale,l),h=t.z,d=t.x,p=t.y,v=n.xaxis,g=n.yaxis,y=n.zaxis,b=r.dataScale,x=h[0].length,_=h.length,w=[c(new Float32Array(x*_),[x,_]),c(new Float32Array(x*_),[x,_]),c(new Float32Array(x*_),[x,_])],M=w[0],k=w[1],A=r.contourLevels;this.data=t;var T=t.xcalendar,S=t.ycalendar,E=t.zcalendar;f(w[2],function(t,e){return y.d2l(h[e][t],0,E)*b[2]}),Array.isArray(d[0])?f(M,function(t,e){return v.d2l(d[e][t],0,T)*b[0]}):f(M,function(t){return v.d2l(d[t],0,T)*b[0]}),Array.isArray(p[0])?f(k,function(t,e){return g.d2l(p[e][t],0,S)*b[1]}):f(k,function(t,e){return g.d2l(p[e],0,S)*b[1]});var L={colormap:u,levels:[[],[],[]],showContour:[!0,!0,!0],showSurface:!t.hidesurface,contourProject:[[!1,!1,!1],[!1,!1,!1],[!1,!1,!1]],contourWidth:[1,1,1],contourColor:[[1,1,1,1],[1,1,1,1],[1,1,1,1]],contourTint:[1,1,1],dynamicColor:[[1,1,1,1],[1,1,1,1],[1,1,1,1]],dynamicWidth:[1,1,1],dynamicTint:[1,1,1],opacity:t.opacity};if(L.intensityBounds=[t.cmin,t.cmax],t.surfacecolor){var C=c(new Float32Array(x*_),[x,_]);f(C,function(e,r){return t.surfacecolor[r][e]}),w.push(C)}else L.intensityBounds[0]*=b[2],L.intensityBounds[1]*=b[2];this.dataScale=s(w),t.surfacecolor&&(L.intensity=w.pop());var z=[!0,!0,!0],D=["x","y","z"];for(e=0;e<3;++e){var I=t.contours[D[e]];z[e]=I.highlight,L.showContour[e]=I.show||I.highlight,L.showContour[e]&&(L.contourProject[e]=[I.project.x,I.project.y,I.project.z],I.show?(this.showContour[e]=!0,L.levels[e]=A[e],o.highlightColor[e]=L.contourColor[e]=m(I.color),I.usecolormap?o.highlightTint[e]=L.contourTint[e]=0:o.highlightTint[e]=L.contourTint[e]=1,L.contourWidth[e]=I.width):this.showContour[e]=!1,I.highlight&&(L.dynamicColor[e]=m(I.highlightcolor),L.dynamicWidth[e]=I.highlightwidth))}a(u)&&(L.vertexColor=!0),L.coords=w,o.update(L),o.visible=t.visible,o.enableDynamic=z,o.snapToData=!0,"lighting"in t&&(o.ambientLight=t.lighting.ambient,o.diffuseLight=t.lighting.diffuse,o.specularLight=t.lighting.specular,o.roughness=t.lighting.roughness,o.fresnel=t.lighting.fresnel),"lightposition"in t&&(o.lightPosition=[t.lightposition.x,t.lightposition.y,t.lightposition.z]),l&&l<1&&(o.supportsTransparency=!0)},g.dispose=function(){this.scene.glplot.remove(this.surface),this.surface.dispose()},e.exports=l},{"../../lib/str2rgbarray":727,"gl-surface3d":261,ndarray:460,"ndarray-fill":450,"ndarray-homography":452,"ndarray-ops":454,tinycolor2:526}],1075:[function(t,e,r){"use strict";function n(t,e,r){e in t&&!(r in t)&&(t[r]=t[e])}var i=t("../../registry"),a=t("../../lib"),o=t("../../components/colorscale/defaults"),s=t("./attributes");e.exports=function(t,e,r,l){function u(r,n){return a.coerce(t,e,s,r,n)}var c,h,f=u("z");if(!f)return void(e.visible=!1);var d=f[0].length,p=f.length;if(u("x"),u("y"),i.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y","z"],l),!Array.isArray(e.x))for(e.x=[],c=0;c<d;++c)e.x[c]=c;if(u("text"),!Array.isArray(e.y))for(e.y=[],c=0;c<p;++c)e.y[c]=c;["lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lightposition.x","lightposition.y","lightposition.z","hidesurface","opacity"].forEach(function(t){u(t)});var m=u("surfacecolor");u("colorscale");var v=["x","y","z"];for(c=0;c<3;++c){var g="contours."+v[c],y=u(g+".show"),b=u(g+".highlight");if(y||b)for(h=0;h<3;++h)u(g+".project."+v[h]);y&&(u(g+".color"),u(g+".width"),u(g+".usecolormap")),b&&(u(g+".highlightcolor"),u(g+".highlightwidth"))}m||(n(t,"zmin","cmin"),n(t,"zmax","cmax"),n(t,"zauto","cauto")),o(t,e,l,u,{prefix:"",cLetter:"c"})}},{"../../components/colorscale/defaults":599,"../../lib":709,"../../registry":826,"./attributes":1071}],1076:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("./colorbar"),n.calc=t("./calc"),n.plot=t("./convert"),n.moduleType="trace",n.name="surface",n.basePlotModule=t("../../plots/gl3d"),n.categories=["gl3d","2dMap","noOpacity"],n.meta={},e.exports=n},{"../../plots/gl3d":791,"./attributes":1071,"./calc":1072,"./colorbar":1073,"./convert":1074,"./defaults":1075}],1077:[function(t,e,r){"use strict";function n(t,e,r){function n(t){return t.indexOf(a)!==-1}var i,a=t.operation,o=t.value,s=Array.isArray(o),h=function(r){return e(r,0,t.valuecalendar)},f=function(t){return e(t,0,r)};switch(n(l)?i=h(s?o[0]:o):n(u)?i=s?[h(o[0]),h(o[1])]:[h(o),h(o)]:n(c)&&(i=s?o.map(h):[h(o)]),a){case"=":return function(t){return f(t)===i};case"!=":return function(t){return f(t)!==i};case"<":return function(t){return f(t)<i};case"<=":return function(t){return f(t)<=i};case">":return function(t){return f(t)>i};case">=":return function(t){return f(t)>=i};case"[]":return function(t){var e=f(t);return e>=i[0]&&e<=i[1]};case"()":return function(t){var e=f(t);return e>i[0]&&e<i[1]};case"[)":return function(t){var e=f(t);return e>=i[0]&&e<i[1]};case"(]":return function(t){var e=f(t);return e>i[0]&&e<=i[1]};case"][":return function(t){var e=f(t);return e<=i[0]||e>=i[1]};case")(":return function(t){var e=f(t);return e<i[0]||e>i[1]};case"](":return function(t){var e=f(t);return e<=i[0]||e>i[1]};case")[":return function(t){var e=f(t);return e<i[0]||e>=i[1]};case"{}":return function(t){return i.indexOf(f(t))!==-1};case"}{":return function(t){return i.indexOf(f(t))===-1}}}var i=t("../lib"),a=t("../registry"),o=t("../plot_api/plot_schema"),s=t("../plots/cartesian/axes"),l=["=","!=","<",">=",">","<="],u=["[]","()","[)","(]","][",")(","](",")["],c=["{}","}{"];r.moduleType="transform",r.name="filter",r.attributes={enabled:{valType:"boolean",dflt:!0},target:{valType:"string",strict:!0,noBlank:!0,arrayOk:!0,dflt:"x"},operation:{valType:"enumerated",values:[].concat(l).concat(u).concat(c),dflt:"="},value:{valType:"any",dflt:0},preservegaps:{valType:"boolean",dflt:!1}},r.supplyDefaults=function(t){function e(e,a){return i.coerce(t,n,r.attributes,e,a)}var n={};if(e("enabled")){e("preservegaps"),e("operation"),e("value"),e("target");var o=a.getComponentMethod("calendars","handleDefaults");o(t,n,"valuecalendar",null),o(t,n,"targetcalendar",null)}return n},r.calcTransform=function(t,e,r){function a(t,r){for(var n=0;n<g.length;n++){t(i.nestedProperty(e,g[n]),r)}}if(r.enabled){var l=i.getTargetArray(e,r);if(l){var u=r.target,c=l.length,h=r.targetcalendar;if("string"==typeof u){var f=i.nestedProperty(e,u+"calendar").get();f&&(h=f)}var d,p,m=s.getDataToCoordFunc(t,e,u,l),v=n(r,m,h),g=o.findArrayAttributes(e),y={};r.preservegaps?(d=function(t){y[t.astr]=i.extendDeep([],t.get()),t.set(new Array(c))},p=function(t,e){var r=y[t.astr][e];t.get()[e]=r}):(d=function(t){y[t.astr]=i.extendDeep([],t.get()),t.set([])},p=function(t,e){var r=y[t.astr][e];t.get().push(r)}),a(d);for(var b=0;b<c;b++){v(l[b])&&a(p,b)}}}}},{"../lib":709,"../plot_api/plot_schema":737,"../plots/cartesian/axes":748,"../registry":826}],1078:[function(t,e,r){"use strict";function n(t,e){o.nestedProperty(t,e).set([])}function i(t,e,r,n){o.nestedProperty(t,n).set(o.nestedProperty(t,n).get().concat([o.nestedProperty(e,n).get()[r]]))}function a(t,e){var r=e.transform,a=t.transforms[e.transformIndex].groups;if(!Array.isArray(a)||0===a.length)return t;for(var l=o.filterUnique(a),u=new Array(l.length),c=a.length,h=s.findArrayAttributes(t),f=r.style||{},d=0;d<l.length;d++){var p=l[d],m=u[d]=o.extendDeepNoArrays({},t);h.forEach(n.bind(null,m));for(var v=0;v<c;v++)a[v]===p&&h.forEach(i.bind(0,m,t,v));m.name=p,m=o.extendDeepNoArrays(m,f[p]||{})}return u}var o=t("../lib"),s=t("../plot_api/plot_schema");r.moduleType="transform",r.name="groupby",r.attributes={enabled:{valType:"boolean",dflt:!0},groups:{valType:"data_array",dflt:[]},style:{valType:"any",dflt:{}}},r.supplyDefaults=function(t){function e(e,i){return o.coerce(t,n,r.attributes,e,i)}var n={};return e("enabled")?(e("groups"),e("style"),n):n},r.transform=function(t,e){for(var r=[],n=0;n<t.length;n++)r=r.concat(a(t[n],e));return r}},{"../lib":709,"../plot_api/plot_schema":737}],1079:[function(t,e,r){"use strict";function n(t,e,r){for(var n=e.length,a=new Array(n),o=e.slice().sort(i(t,r)),s=0;s<n;s++)for(var l=e[s],u=0;u<n;u++){var c=o[u];if(l===c){a[u]=s,o[u]=null;break}}return a}function i(t,e){switch(t.order){case"ascending":return function(t,r){return e(t)-e(r)};case"descending":return function(t,r){return e(r)-e(t)}}}var a=t("../lib"),o=t("../plot_api/plot_schema"),s=t("../plots/cartesian/axes");r.moduleType="transform",r.name="sort",r.attributes={enabled:{valType:"boolean",dflt:!0},target:{valType:"string",strict:!0,noBlank:!0,arrayOk:!0,dflt:"x"},order:{valType:"enumerated",values:["ascending","descending"],dflt:"ascending"}},r.supplyDefaults=function(t){function e(e,i){return a.coerce(t,n,r.attributes,e,i)}var n={};return e("enabled")&&(e("target"),e("order")),n},r.calcTransform=function(t,e,r){if(r.enabled){var i=a.getTargetArray(e,r);if(i)for(var l=r.target,u=i.length,c=o.findArrayAttributes(e),h=s.getDataToCoordFunc(t,e,l,i),f=n(r,i,h),d=0;d<c.length;d++){for(var p=a.nestedProperty(e,c[d]),m=p.get(),v=new Array(u),g=0;g<u;g++)v[g]=m[f[g]];p.set(v)}}}},{"../lib":709,"../plot_api/plot_schema":737,"../plots/cartesian/axes":748}]},{},[19])(19)});